File tree Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Original file line number Diff line number Diff line change 1
- import { SlashCommandBuilder , ChatInputCommandInteraction } from "discord.js" ;
1
+ import {
2
+ SlashCommandBuilder ,
3
+ ChatInputCommandInteraction ,
4
+ MessageFlags ,
5
+ } from "discord.js" ;
2
6
import { ValidatorService } from "../services/validator-service.js" ;
3
7
import { ChainInfoService } from "../services/chaininfo-service.js" ;
4
8
@@ -40,11 +44,11 @@ export default {
40
44
if ( ! address . match ( / ^ 0 x [ a - f A - F 0 - 9 ] { 40 } $ / ) ) {
41
45
return interaction . reply ( {
42
46
content : "Please provide a valid Ethereum address." ,
43
- ephemeral : true ,
47
+ flags : MessageFlags . Ephemeral ,
44
48
} ) ;
45
49
}
46
50
47
- await interaction . deferReply ( ) ;
51
+ await interaction . deferReply ( { flags : MessageFlags . Ephemeral } ) ;
48
52
49
53
if ( interaction . options . getSubcommand ( ) === "add" ) {
50
54
try {
Original file line number Diff line number Diff line change @@ -39,20 +39,14 @@ client.once("ready", () => {
39
39
client . on ( "interactionCreate" , async ( interaction : Interaction ) => {
40
40
if ( ! interaction . isChatInputCommand ( ) ) return ;
41
41
42
- // Determine which channel to use based on environment
43
- const targetChannelId =
44
- ENVIRONMENT === "production" ? PRODUCTION_CHANNEL_ID : DEV_CHANNEL_ID ;
45
-
46
- // Check if the command is in the correct channel
47
- if ( interaction . channelId !== targetChannelId ) {
48
- const channelName =
49
- ENVIRONMENT === "production"
50
- ? PRODUCTION_CHANNEL_NAME
51
- : DEV_CHANNEL_NAME ;
52
- return interaction . reply ( {
53
- content : `This command can only be used in the ${ channelName } channel.` ,
54
- flags : MessageFlags . Ephemeral ,
55
- } ) ;
42
+ if (
43
+ ENVIRONMENT === "development" &&
44
+ interaction . channelId === PRODUCTION_CHANNEL_ID
45
+ ) {
46
+ console . log (
47
+ "Can't use this command in production if ENVIRONMENT is set to development"
48
+ ) ;
49
+ return ;
56
50
}
57
51
58
52
const command = client . commands . get ( interaction . commandName ) ;
You can’t perform that action at this time.
0 commit comments