Answer the question
In order to leave comments, you need to log in
How to solve bot permissions issue in discord py?
I decided to write a bot that changes the user's text from normal to bold in a discord group. The bot changes the text only for those users who have a certain role. The code works pretty well, but I ran into a bot rights issue . When creating the bot , I specified administrator rights, and also tried to create a role with administrator rights on the discord server itself, but all in vain . Below I have given the bot code, of course, without specifying imports and a token due to security. PS I did the test on my twink account
client = discord.Client()
list_roles = ['King', 'КОР ОЛЬ'] # список названий ролей
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client)) # подключение бота
@client.event
async def on_message(message):
if message.author == client.user:
return
for role in list_roles: # проверяем наличие роли пользователя в списке
if get(message.author.roles, name=role):
await message.edit(content='**' + str(message) + '**') # изменяем текст с формы message на **message**
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question