role specific command yes its working finally got it.
from discord.ext import commands
bot = commands.Bot('?')
@bot.command(pass_context=True)
@commands.has_any_role("Admin", "Moderator")
async def hello(ctx):
await bot.say("Hello {}".format(ctx.message.author.mention))
You can use the discord.ext.commands
extension, which offers a has_any_role
decorator.
from discord.ext import commands
bot = commands.Bot('?')
@bot.command(pass_context=True)
@commands.has_any_role("Admin", "Moderator")
async def hello(ctx):
await bot.say("Hello {}".format(ctx.message.author.mention))