2
votes

I'm trying to make a command for my discord bot that sends a message on a channel the sender puts the ID of. For example: f.say (id) hello world, which would send hello world to the channel of that ID. My command handler right now is if (command === `say`) { already with args integrated.

1

1 Answers

0
votes

NOTE: if the args includes the command 'say' in it then add 1 to both args.

client.channels.cache.get(args[0]).send(args[1]);

with this the syntax will be (if the prefix is '!' and command is 'say'): !say id message