在上述示例中,我们创建了一个Discord客户端,并在收到消息时检查是否为指定的命令!editEmbed。如果是该命令,我们获取消息中的第一个嵌入,并修改其标题和描述。然后,我们使用message.edit()方法来更新消息中的嵌入内容。 这只是一个简单的示例,你可以根据自己的需求进行更复杂的嵌入编辑操作。同时,腾讯云并没有提供与D...
MessageEmbed() //For discord v11 Change to new Discord.RichEmbed() .setDescription(`${msg.createdTimestamp - message.createdTimestamp}`) msg.edit(embed) }) 另外,除了做 msg.createTimeStamp - message.createdTimestamp 你也可以做 bot.ping.toFixed(2) 原文由 Cipher 发布,翻译遵循 CC BY-SA...
首先建立个斜杠命令,并搞个叫做 embed 的 embed: const { EmbedBuilder, SlashCommandBuilder } = require('discord.js'); const wait = require('node:timers/promises').setTimeout; module.exports = { data: new SlashCommandBuilder() .setName('embededit') .setDescription('Replies with embed!'), ...
在discord.js中重置嵌入数据可以通过以下步骤实现: 1. 首先,确保你已经引入了discord.js库,并创建了一个Discord客户端。 2. 在需要重置嵌入数据的地方,获取到你想要重置的...
我们删掉上面的代码,将上面 “直接用 JSON 对描述的 embed” 重新用 “new EmbedBuilder()” 来构建。 // This EmbedBuilder() has to be inside a command or listenerconstexampleEmbed=newEmbedBuilder().setColor(0xC1F8C0).setTitle('标题标题').setURL('https://discord.js.org/').setAuthor({name...
const{ActionRowBuilder,EmbedBuilder,StringSelectMenuBuilder,SlashCommandBuilder}=require('discord.js');constwait=require('node:timers/promises').setTimeout;module.exports={data:newSlashCommandBuilder().setName('multiselect').setDescription('Replies with a multi-select menu!'),asyncexecute(interaction)...
{ const embed1 = new Discord.RichEmbed() .setDescription(':8ball: 8ball') .setColor('RANDOM') .addField(args.join(" "), 'Não') message.channel.send(embed1); } else if (rnd === 2) { const embed2 = new Discord.RichEmbed() .setDescription(':8ball: 8ball') .setColor('...
Install Node JS Create a Discord bot Follow these bot instructions Future Plans: We plan to implement Uptime Kuma Incidents report in a Discord Embed. Currently, it's not possible because Uptime Kuma doesn't share this data in its metrics API. Feel free to fork or reuse this code! Fo...
"github.com/nestjs-discord/utility-bot/config" ) func NewSession() (*discordgo.Session, error) { Expand Down 10 changes: 5 additions & 5 deletions 10 internal/discord/handler/automod/alert.go Show comments View file Edit file Delete file This file contains bidirectional Unicode text th...
content.startsWith('!reply')) { let embed = new discord.MessageEmbed() .setDescription(`Reply to ${message.author}`); message.lineReply(embed); //Line (Inline) Reply with mention //or message.lineReplyNoMention(embed); //Line (Inline) Reply without mention } Preview Edit (Async ...