嘿,我使用脚本从一个服务器发布到另一个嵌入,但我需要改变颜色从转发嵌入(输出)在这一部分的代码,你也改变了页脚,所以我假设我必须在那里设置嵌入颜色。我已经尝试过很多方法,比如:
embed=discord.Embed(color=0xd10a07)
if message.channel.id in channels_forward_embed:
dest_channel_id = channels_forward_embed[message.channel.id]
if message.embeds:
embed
我给我的机器人添加了一个选项,可以在一段时间后改变角色的颜色。但是,过了一段时间,这个选项就不起作用了。我怎样才能让这个选项一直有效? from asyncio.tasks import create_task
import discord
from discord import client
from discord.ext import commands
import asyncio
from discord.utils import get
import os
from keep_alive import keep_alive
bot = commands.Bot(command_p
我想要做的是,当机器人启动时,抓取好友列表,并对其中的每个人进行DM。我不能使用ctx,因为on_ready不支持它。到目前为止我的代码如下:
@bot.event
async def on_ready(msg):
for x in bot.user.friends:
e = x.id
await x.send('hi')
因此,目前我试图编写一个计算器,但我遇到了障碍。嗯,我看了Glowstik关于如何制作计算器不和谐机器人的教程,但他的代码似乎不再工作了。那么,有没有人能建议我对代码做些修改,让机器人工作呢?提前谢谢。代码如下: import discord
import os
from discord.ext import commands, tasks
from online import keep_alive
from discord_slash import SlashCommand
from itertools import cycle
from discord_components import
我是编程新手。我试图让我的discord机器人打开命令提示符,以确认它可以运行,但我得到了这个错误:
File "C:\Users\---\AppData\Local\Programs\Python\Python38-32\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\---\AppData\Local\Programs\Python\Python38-32\lib\asyncio\proactor_events.py", lin
我正在工作的命令,以DM特定的用户嵌入,这是我的项目中的帮助菜单。我成功地发送了正常的消息,但我不知道如何在DM中发送嵌入,我读到它需要另一种类型的嵌入。 module.exports = {
name: 'costietare',
description: "This is a help command.",
async execute(client, message, args, Discord) {
message.delete({timeout: 10});
let d
我制作了超级简单的票证系统,但它不起作用:c。这是我的代码:
@client.event
async def on_reaction_add(reaction, user):
if 'React with to create a ticket' in reaction.message.embeds and reaction.emoji == '':
role = discord.utils.get(user.guild.roles, name="@everyone")
chan = await user.
我正在编辑消息:
chat = client.get_channel(1007301750895677491)
msg = client.fetch_message(1007556250134917170)
await msg.edit(content=discord.File('week_result.png'))
但我错了:
Task exception was never retrieved
future: <Task finished name='Task-14' coro=<week_vipe() done, defined at main
我正在创建一个彩虹嵌入命令,但我真的不知道它应该如何工作。也许您可以查看并帮助我创建命令:D
下面是代码
@bot.commands()
async def rainbowembed(ctx, *, message):
embed = discordEmbed(description=message)
ctx.send(embed=embed)
for i in range(5):
# On this point i dont know what to do...
# I want to switch the color of the e
所以,我找到了这个问题I want to make a multi-page help command using discord.py,但答案让我产生了怀疑。我尝试了一个类似的代码来尝试这个东西,但在循环进行期间,我实际上不能使用任何其他命令。我应该怎么做才能让所有的命令在循环进行时都能工作? import discord
import datetime
from datetime import timedelta
import pytz
from discord.ext import commands
client = discord.Client()
client = comman