Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

@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.)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading