#Give role slash command
1 messages · Page 1 of 1 (latest)
from disnake.ext import commands
command_sync_flags = commands.CommandSyncFlags.default()
command_sync_flags.sync_commands_debug = True
bot = commands.Bot(command_prefix=".", help_command=None, intents=disnake.Intents.all(), test_guilds=[910812824773730315], command_sync_flags=command_sync_flags)
@bot.event
async def on_ready():
print(f"Bot {bot.user} is ready to work!")
@bot.slash_command(description="Verifycation member'")
async def verify(ctx):
this is my code
-d disnake.Member.add_roles
await add_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Gives the member a number of [`Role`](https://docs.disnake.dev/page/api.html#disnake.Role "disnake.Role")s.
You must have [`manage_roles`](https://docs.disnake.dev/page/api.html#disnake.Permissions.manage_roles "disnake.Permissions.manage_roles") permission to use this, and the added [`Role`](https://docs.disnake.dev/page/api.html#disnake.Role "disnake.Role")s must appear lower in the list of roles than the highest role of the member.