如何获取服务器所有者的用户名和Discord标记-Python [英] How to get the username and Discord tag of the owner of server - Python

查看:171
本文介绍了如何获取服务器所有者的用户名和Discord标记-Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在discord.py库中寻找一种方法来返回已部署机器人的服务器的所有者。现在我只是对其进行了硬编码(即

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')

),但是当所有者更改名称时,我必须更改它,这似乎很麻烦。我研究了discord.py的权限系统,但似乎没有执行此操作的功能。

), 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?

推荐答案

您正在寻找 Guild.owner

You're looking for Guild.owner

await message.channel.send(str(message.guild.owner))

这篇关于如何获取服务器所有者的用户名和Discord标记-Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆