1
votes

I'm trying to make a verification system that will work for my Discord Server Network. Here's what I want the bot to do after you type '.agree':

  1. Check so that you sent the message in a channel with the name 'verify_here'.
  2. If you sent it in that channel, add the "Member" role.
  3. Send message '{message.author}, thank you!'
  4. Delete both messages after 3 seconds.

Here's my code:

@client.event
async def on_message(message):
    verify_channel = client.get_channel(868120833858621470)
    verify_role = get(member.guild.roles, id='871383440694587462')
    if message.content == '.agree' in verify_channel:
        await member.add_roles(message.author, verify_role)
        await message.send(f'{message.author}, thanks!')

The weird part is that I don't get any error messages. It just doesn't work. Nothing is happening. The bot added no role, and the bot sent no message. I've tried searching for help, but there are so few guides on making a verification system for Python Discord Bots. I've also tried different ways of laying out the code, but none has worked.

Note: I will use this Bot and verification system for my whole Discord Server Network meaning I want the bot to check the channel name and not the channel id.

How can I make this work?

1

1 Answers

0
votes

use if message.content == '.agree' and message.channel == verify_channel: instead of if message.content == '.agree' in verify_channel: and use await message.channel.send(f'{message.author}, thanks!') instead of await message.send(f'{message.author}, thanks!')

Hope this makes sense :)