0
votes

I am very curious because I have seen other bots do this, the food bot command would be: "!Order" and then it would send another embed to a different server and a specific channel. How do I code that?

2

2 Answers

1
votes

You can get a guild and then get a channel from the guild.

client.guilds.get(<guild id>).channels.get(<channel id>).send(<message>)

Notice this requires the bot to be in both guilds

0
votes

Saddy's answer is not wrong but it only works on discord.js v11.

To use the same function on v12 you need to add "cache".

bot.guilds.cache.get('<GUILDID>').channels.cache.get('<MESSAGEID>').send('<MESSAGE>');

I recommend you to read this short article to know all the changes from v11 to v12.

https://v12.discordjs.guide/additional-info/changes-in-v12.html

Also, there is already a v13 version coming out, be aware!