Skip to content
Advertisement

discord.py self-bot replies only to itself

@bot.event
async def on_message(message):
    channel = bot.get_channel(931570478915657790)
    if message.content == "hello":
        await channel.send("hi!")

I’m new at programming. I want to write a bot for my Discord channel to send users “hi” messages who send “hello”. But there is a problem, only I (the self bot) can receive the “hi!” message. When I write “hello” from another account, the bot doesn’t answer it. Note: I am using a self-bot, not a normal bot.

Advertisement

Answer

discord.py does not support selfbots very well, instead run these commands:

pip uninstall discord.py
pip install discord.py-self

discord.py-self is a copy of discord.py which gives more functionality to selfbots. However, selfbots are technically against the discord terms of service, so use at your own risk. Your code should work the exact same.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement