Send Discord Channel Message
Send Discord Channel Messageblocks are used to send messages in Discord channels either through a Discord bot or a Discord user account (depending on what inputs we pass to our
Send Discord Channel Messageblocks have four inputs: a Discord connection (which must be established with a
Discord Connectorblock), a Discord guild (server) ID, a Discord channel ID, and the message to be sent.
The guild ID and channel ID for any Discord channel can be found in the Discord App by right-clicking on either the guild (server) or channel, and then click "Copy ID".
In the example below, we send a message every 10 minutes about the price of Polygon to a specific Discord channel using a
Send Discord Channel Messageblock:
The example above is driven by the
Timerblock, which fires every 600 seconds, triggering the
Get CoinGecko Coinblock to retrieve the price of Polygon from CoinGecko. The price is then packed into a short message using a
Replace String In Stringblock and finally sent to the
Send Discord Channel Messageblock. This causes our Discord bot, identified by the token we give to the
Discord Connectorblock, to output the message about Polygon's price in the channel and server specified by the ID strings we have supplied to the
Send Discord Channel Messageblock.
Send Discord Channel Messageblocks also output a piece of data called "MessageId", which is an identifier for the message that was sent. We could use this as input to blocks that require a message ID, like
On Reaction Added Messageand
On Reaction Removed Messageblocks, which could be used to track certain kinds of emoji reactions to our message.