Home > front end >  I want to write a bot for my discord channel to send users "hi" message, who writes hello
I want to write a bot for my discord channel to send users "hi" message, who writes hello

Time:07-11

@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" message, who writes hello. But there is a problem, only I(Which is self bot) can receive "hi!" message. When I write "hello" from another account, Bot not answers it. (Note: I am using selfbot, not a normal bot.)

CodePudding user response:

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.

  • Related