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" ;
26import { ValidatorService } from "../services/validator-service.js" ;
37import { ChainInfoService } from "../services/chaininfo-service.js" ;
48
@@ -40,11 +44,11 @@ export default {
4044 if ( ! address . match ( / ^ 0 x [ a - f A - F 0 - 9 ] { 40 } $ / ) ) {
4145 return interaction . reply ( {
4246 content : "Please provide a valid Ethereum address." ,
43- ephemeral : true ,
47+ flags : MessageFlags . Ephemeral ,
4448 } ) ;
4549 }
4650
47- await interaction . deferReply ( ) ;
51+ await interaction . deferReply ( { flags : MessageFlags . Ephemeral } ) ;
4852
4953 if ( interaction . options . getSubcommand ( ) === "add" ) {
5054 try {
Original file line number Diff line number Diff line change @@ -39,20 +39,14 @@ client.once("ready", () => {
3939client . on ( "interactionCreate" , async ( interaction : Interaction ) => {
4040 if ( ! interaction . isChatInputCommand ( ) ) return ;
4141
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 ;
5650 }
5751
5852 const command = client . commands . get ( interaction . commandName ) ;
You can’t perform that action at this time.
0 commit comments