How to get the username and Discord tag of the own

2020-05-09 09:27发布

I'm looking for a method in the discord.py library to return the owner of the server the bot has been deployed in. Right now I just have it hard coded (i.e.

if message.content == '!owner': 
    await message.channel.send('ownername#1234')

), but when the owner changes their name I have to change it, and it seems like a hassle for nothing. I've looked into the permissions system of discord.py but it doesn't seem to have something that does this. Is there anything that does this?

1条回答
兄弟一词,经得起流年.
2楼-- · 2020-05-09 10:22

You're looking for Guild.owner

await message.channel.send(str(message.guild.owner))
查看更多
登录 后发表回答