discord.py

    0热度

    1回答

    from discord.ext.commands import Bot import secrets from time import sleep discordBot = Bot(command_prefix = ".") listStrings = ['add a reaction', 'adnd'] @discordBot.event async def on_read

    2热度

    3回答

    我试图用discord.py编写一个简单的机器人提一个用户,所以我开始与乐趣命令,如刚刚拿到API的窍门 import discord import asyncio client = discord.Client() @client.event async def on_message(message): # we do not want the bot to reply t

    1热度

    2回答

    这可能是一个愚蠢的问题,但我真的需要这个想法。我正在研究我的机器人和DM频道之间的界面。我目前的代码是: if input.startswith('.direct'): content = re.sub(r'^\W*\w+\W*', '', message.content) await client.send_message(discord.PrivateChannel(Use

    1热度

    1回答

    我知道这是非常糟糕的,但它的工作原理,这是我目前的知识完成这项工作的唯一途径。所以我在实践中寻找一种“更好”的方式来写这个。 基本上它显示了3个插槽的图像,这3个插槽使用SLOT_PATTERN中列出的随机图像更改图像。图像使用edit_message编辑之前的3个插槽图像,将其替换为给定列表中的随机图像。 import discord, asyncio, time, random clien

    0热度

    1回答

    所以这样做是什么时候,只要有人键入命令!test进入聊天室频道,它会打印出适当的下面的字符串到聊天频道。不过,我想将在同一时间只能使用一次的命令,所以我要锁定的命令,直到它完成: import discord, asyncio, time client = discord.Client() @client.event async def on_message(message):

    0热度

    1回答

    所以我有这样的事情: import discord, asyncio client = discord.Client() @client.event async def on_message(message): if message.content.lower().startswith("!test"): await client.delete_message(me

    0热度

    1回答

    当我尝试: await client.create_role(message.server, name='testrole', color=discord.Colour("FF0000")) 我得到这个错误: discord.errors.NotFound: NOT FOUND (status code: 404): Unknown Message 有谁知道我怎样才能得到关于此错误的更多信

    -1热度

    1回答

    我试图让用户激活test,它会在聊天室中显示一个测试菜单,并且如果同一用户发送任何消息的反应,它会删除测试菜单: import discord, asyncio client = discord.Client() @client.event async def on_message(message): if message.content.lower().startswith(

    2热度

    1回答

    我目前正在做一个不和谐的机器人,其中的一个命令涉及从SQL表中拉数据,为此我使用了与Pyodbc几乎完全相同的AioOdbc模块,唯一真正的区别是它不会在异步功能中阻塞。 以这种格式输出。 [('Item1',),('Item2',)] 我怎样才能让它输出一些更好看的东西?可能类似于 Item1, Item2 任何帮助表示赞赏!

    0热度

    2回答

    我需要获取用户的下午通道才能看到我的机器人以前发送给该用户的消息。我已经从标准通道的命令消息中获得了其用户对象。 这是我到目前为止已经试过: @client.event async def in_msg(msg): user = msg.author privateChannel = client.get_channel(user.id) # not working