在discord.js上实现在嵌入消息中显示图片,可以使用Discord.js的Embed类和MessageEmbed对象。Embed类用于创建富文本消息,而MessageEmbed对象则用于定义嵌入消息的属性。 下面是一个示例代码,展示如何使用discord.js在嵌入消息中显示图片: 代码语言:txt 复制 const Discord = require('discord.js'); const client ...
这就是我所拥有的: if (!message.content.startsWith(prefix) || message.author.bot) return; if (message.content.startsWith(prefix + 'pfp')) { message.channel.send('Here is <@'+ message.author.id+ ">'s pfp :)") const avatarEmbed = new Discord.MessageEmbed() .setColor('#446580') ....
message.channel.send(embed); 在上述代码中,我们首先导入了MessageEmbed类,然后创建了一个嵌入对象,并使用setTitle、setDescription、setImage和setURL等方法设置嵌入的各个属性。最后,使用message.channel.send方法发送消息,并将嵌入对象作为参数传递进去。 删除已发送的嵌入消息可以使用discord.js库中的delete方法。以下是...
我们删掉上面的代码,将上面 “直接用 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:...
an array of discord embed objects embeds.messages(): object[] divides the embeds into message objects, based on discord's restrictions (max 6000 chars / 10 embeds) renderOptions: object commands: an object of commands, commands can be functions or values with a.toStringmethod ...
Step 4: The bot then copies the link's embed and is added to its json database Step 5: The bot displays the discord link to the user To-Do (Improvements) Return an additional value with the link split at "external/" Replace GET with POST to prevent problems with long URLS Improve th...
一个中转服务,可以接入到任意第三方平台微信、飞书、QQ等/Obtain the midjourney AI image generation results from the Discord server. It is a transfer service that can be connected to any third-party platform, such as WeChat, Feishu, QQ, etc....
Live Demo (NextJS) Sample code Notes TypeScript module augments Avatar shortcuts Profile shortcuts Theming Components notes DiscordMessages component DiscordMention component DiscordEmbed component EmbedFields component EmbedField component Screenshots Dark Mode Light Mode ContributorsDescription...
Add a description, image, and links to the botsfordiscord topic page so that developers can more easily learn about it. Curate this topic Add this topic to your repo To associate your repository with the botsfordiscord topic, visit your repo's landing page and select "manage topics."...
导入discord.js库:首先,确保已安装discord.js库并将其导入到你的项目中。 代码语言:txt 复制 const Discord = require('discord.js'); const client = new Discord.Client(); 创建嵌入消息:使用Discord.MessageEmbed类创建一个嵌入消息对象,并设置其各种属性。 代码语言:txt 复制 const embed = new Discord.Mess...