#Verify command not working

1 messages · Page 1 of 1 (latest)

clever swallow
#
@client.command()
async def verify(ctx):
    member = ctx.author
    # Get the verify role ID
    verify_role_id = get_verify_role_id(ctx.guild.id)
    role = discord.utils.get(ctx.guild.roles, id=verify_role_id)
    # Check if the verify role has been set
    if role is None:
        await ctx.send("No verify role has been set.")
        return
    # Add the role to the member
    await member.edit(roles=role)
    await ctx.send(f"{ctx.author.mention} has been verified!")

this is my code but for some reason the role is not adding to the user. the role has been insert in the db tho

dreamy portal
#

Also, use guild.get_role(id) instead utils.get

#

.rtfm member.add_roles

safe foxBOT
dreamy portal
clever swallow
last turtle
#

What is client?
client=commands.Bot ?

clever swallow
#

yes

#

it stil doesnt work

#

no erros

wheat depot
#

.idw

safe foxBOT
#

Saying it doesn't work or asking what's wrong with this code is not helpful for yourself or others.
Describe what you expect and/or tried (with your code), and what isn't going right.
Please provide any errors you get for optimal assistance.

last turtle
#

.rtfm member.add_role

safe foxBOT
dreamy portal
dreamy portal
wheat depot
#

you only need a discord.abc.Snowflake

#

so discord.Object(id) would suffice

dreamy portal
#

@clever swallow i already gave you the solution it you did not even respond and kept asking for help

clever swallow
#

nvm i fixed it

#

bot didnt have perms to add role and my console wasnt updating

#

.close

safe foxBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @tranquil osprey.