Ask coding questions

← Back to all posts
discord bot input
Kylethedoge (1)

i'm trying to make my discord bot so that I can input something into my repl console and then make it appear in a specific discord channel/server, but the problem is that if I use input on repl, then i cannot use await message.channel.send(i'm using python)

Comments
hotnewtop
InvisibleOne (3227)
message = input("Message to send: ")

channel_id = 636399538650742795
channel = bot.get_channel(channel_id) # or client.get_channel if you are not using bot

await channel.send(message)
InvisibleOne (3227)

did you replace the value for channel_id with the id of the channel you want it to send to?

Kylethedoge (1)

@InvisibleOne , i just realised that it DOES actualy work, it's just that it took some time to load, i was being impatient, thanks for the help!

InvisibleOne (3227)

Ok, let me know if you need more help. I really enjoy working on discord bots. @Kylethedoge