Ask coding questions

← Back to all posts
Create role?
j0egee (0)

How would the bot create a role on the server when a command is said??

Comments
hotnewtop
j0egee (0)

@client.event
async def on_message(message):
if message.author == client.user:
return

if message.content.startswith('&Mod'):
	await client.create.role(author.server, name="Mod")

@Coder100 this didn't work

Coder100 (17018)

well yeah you put it in the if statement

async def on_message(message):
	if message.author == client.user:
		return

	if message.content.startswith('&Mod'):
		await client.create_role(author.server, name="Mod")

what do you expect lol please actually read my comment
@j0egee