L
L
Lukas Tumas2020-07-30 09:52:40
Python
Lukas Tumas, 2020-07-30 09:52:40

How to issue a role with async def?

How to make a role issue in async def?
self.function(*self.args, **self.kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-07-30
@Alexandre888

async def addrole(ctx):
    member = ctx.message.author
    role = get(member.server.roles, name="role_name")
    await bot.add_roles(member, role)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question