Answer the question
In order to leave comments, you need to log in
Discord.py how to change server icon with bot command?
I have a code that changes the server name:
@bot.command()
async def rename(ctx):
await ctx.message.delete()
guild = ctx.message.guild
await guild.edit(name='Testing', icon='Тут должна быть ссылка на изображение')
But when I insert a link to an image in the corresponding field, the code returns an error:Answer the question
In order to leave comments, you need to log in
with open('image.jpg', 'rb') as f:
icon = f.read()
await bot.edit_guild(ctx.message.guild, icon=icon)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question