#Send a message in a certain channel outside a slash command

1 messages · Page 1 of 1 (latest)

placid tartan
#

Hey, is it possible to send a message in a certain channel with the bot = discord.Bot()

i want to send a message when my code crashes thats running, i was hoping there was a bot.send_message(), so i can send messages outside of slash commands

#

Send a message in a certain channel outside a slash command

wraith carbon
#

You need to get the channel and then send the message to it

#

you can use

channel = bot.get_channel(channelid)
await channel.send("Message")```
placid tartan
#

ahh thanks!

#

is there any way to do it based on the channel name?

#

so for example general

wraith carbon
placid tartan
#

thanks! thats exactly what i need

wraith carbon
#

Great, you're welcome 😄

#

.tag close

atomic tideBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @royal barn.

Backup bot: </solved:1109625445990793246> (or .solved) with @atomic tide.