4. 准备一个嵌入对象,并添加图片到该嵌入对象中: embed = discord.Embed(title="Your Title", description="Your Description") embed.set_image(url="https://example.com/path/to/your/image.jpg") 5. 最后,使用send()方法将带有嵌入式图片的消息发送到指定的频道: await channel.send(embed=embed) 6. ...
要发送带有多链接的嵌入消息,可以使用Discord.js库中的MessageEmbed类。MessageEmbed类允许我们创建和定制嵌入消息,包括添加多个链接。 下面是一个示例代码,展示了如何使用Discord.js发送带有多链接的嵌入消息: 代码语言:txt 复制 const Discord = require('discord.js'); const client = new Discord.Client(); clie...
message.reply({ embeds: [embed] }) .then((msg) => { setTimeout(() => msg.delete(), 3000) }) 当用户在机器人之前删除消息时,机器人崩溃,我得到这个错误: C:\Users\\Documents\GitHub\omex\node_modules\discord.js\src\rest\RequestHandler.js:298 throw new DiscordAPIError(data, res.s...
await ctx.send(embed=country_embed) 然后,当您编辑它时,您可以获取消息并访问 message.embeds,这是一个列表。由于消息中只有一个嵌入,因此我们通过索引 0 来获取该嵌入。 message = await channel.fetch_message(message_id) country_embed = message.embeds[0] 现在,我们得到了需要编辑的字段。 Message.em...
await message.channel.send(embed=embed) return query = "INSERT INTO `login` (`l_id`, `l_user`, `l_discord`, `l_pass`, `l_hwid`, `l_banned`) VALUES (NULL, %s, %s, NULL, '', NULL);" cursor.execute(query, [message.content,message.author.id, ]) ...
示例1: send_embed ▲点赞 6▼ # 需要导入模块: import discord [as 别名]# 或者: from discord importFile[as 别名]defsend_embed( ctx: Context, message_txt: str, colour: int = Colours.soft_red, footer: str = None, img_url: str = None, ...
For (G)DMs with other users, it will include the `ATTACH_FILES | EMBED_LINKS | MENTION_EVERYONE`, and for DMs with the app's bot user it will also contain `USE_EXTERNAL_EMOJIS` for the bot’s DM - New `interaction_metadata` on [Messages](#DOCS_RESOURCES_CHANNEL/message-object) ...
/* base-info-sub-command.ts */ import {Handler, SubCommand} from '@discord-nestjs/core'; import { CommandInteraction, InteractionReplyOptions, MessageEmbed, } from 'discord.js'; @SubCommand({name: 'base-info', description: 'Base info'}) export class BaseInfoSubCommand { @Handler() onBase...
2.To send an automated welcome message, enable the toggle besideSend a message when a user joins the server. 3.It should show you a text box where you can enter the message. Note that you can use variables such as [user], [server], [memberCount], etc. in the message. The bot wil...
For this example we'll select Send channel message. Once you've chosen your action, click Continue. Next, connect your action app to Zapier, if you haven't already, then click Continue. The next step is setting up your action by filling in the action step fields. You'll need to ...