首页 > TAG信息列表 > discord-py

更改discord.py中的昵称会引发错误

每当尝试更改昵称时,我都会使用discord.py设置一个discord机器人,每当我尝试抛出错误时 我已经尝试了很多事情,但是每次抛出一个错误,说客户没有属性change_nickname时,我就看过了,这是我看到的唯一可以做到的事情. client = discord.Client() await client.change_nickname( mes

python-Discord.py Bot的权限系统

我正在使用discord.py和asyncio制作discord机器人.该机器人具有类似kick和ban的命令,这些命令显然不适合普通用户使用. 我想创建一个简单的系统,该系统将使用ctx.message.author来检测用户角色具有的权限,以获取发送命令的用户. 我不希望该漫游器检测到特定的角色名称,因为这些名称

我如何使用discord.py列出不和谐服务器中的所有成员?

嗨,大家好,我正在写一个不和谐的机器人,当我尝试使用on_message事件中的!members命令从服务器中拉出所有成员时,遇到了此错误: elif message.content.startswith('!members'): x = server.Server.members for member in x: print(member) 我希望此命令将所有成员拉

python-角色特定命令

角色特定命令是的,它的工作终于得到了它. 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

带有异步def的Python [无效语法]

我正在尝试使用Python编写不和谐的bot,我遇到了这个机器人. import discord import asyncio import random client = discord.Client() inEmail = input("Email:") inPassword = input("Passwd:") async def background_loop(): await client.wait_until_ready() whi

如何使用python discord bot cog读取所有已发送的消息? on_message似乎不起作用

我已经正确设置了齿轮(我知道,因为我有一个单独的齿轮来处理所有命令,所以on_message不会弄乱它们),但是on_message却什么也没做. 我已经尝试将其包含到另一个齿轮中,但是我仍然没有收到任何错误,只是不起作用.我也尝试过使用@ bot.event的不同形式,但是所有这些都会导致错误.最后,

python – discord.py机器人得到冷却时间剩余的命令

我正在研究一个基于python的discord bot,它具有以下命令 @client.command(name="Mine", description="Mine daily.", brief="Mine daily.", aliases=['mine', 'm'], pass_context=True) @

youtube-dl完成下载后运行异步函数(python)

我一直在使用discord.py重写为python编写音乐机器人.它通过youtube-dl下载视频并在语音聊天中播放.我一直在努力扩展音乐,最近意识到我完全忽视了一些东西. youtube-dl的progress hooks选项是同步的,而discord.py是异步的. youtube-dl在下载视频时产生子进程,而不是在当前线程上运

python – 如何只允许管理员执行命令

我正在写下面的命令 @bot.command(pass_context=True) async def admins_only_command(ctx, *, args): '''do stuff 我怎样才能将此命令限制为仅限管理员?我试着查看ctx.author.roles.role,它说@everyone.如何检查给定用户是否是管理员?解决方法:有两种方法:使用has_any_role的

Discord python on role grant event

因此,我一直试图让机器人在会员获得授权角色时宣布,我知道这段代码根本没有意义,但这就是为什么我问:我怎么能这样做? @bot.event async def on_member_update(before, after): if str(after.roles) == 'android': fmt = "{0.mention} your role request has been accep

python – 为什么多个on_message事件不起作用?

为什么我不能有多个on_message事件? import discord client = discord.Client() @client.event async def on_ready(): print('in on_ready') @client.event async def on_message(message): print("in on_message #1") @client.event async def on_mes

如何安装discord.py重写?

我运行了python3 -m pip install -U discord.py,但它只安装了discord.py v0.16.x.如何安装新的discord.py rewrite v1.0? 我使用pip uninstall discord.py卸载旧的discord.py并重新运行pip以安装discord.py,只是为了再次获得版本v0.16.x而不是新的v1.0版本.解决方法:尝试使用 pip i