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. ...
client.on('ready', () => { console.log(`Logged in as ${client.user.tag}`); }); client.on('message', message => { if (message.content === '!sendEmbed') { const embed = new Discord.MessageEmbed() .setTitle('Example Embed') .setDescription('This is an example embed ...
MessageEmbed类允许我们创建和定制嵌入消息,包括添加多个链接。 下面是一个示例代码,展示了如何使用Discord.js发送带有多链接的嵌入消息: 代码语言:txt 复制 const Discord = require('discord.js'); const client = new Discord.Client(); client.on('ready', () => { console.log(`Logged in as ${client...
discord.Embed 构建一个嵌入,然后为每个国家/地区添加一个新字段。例如: country_embed = discord.Embed(title="Available Nations") for country in countries: country_embed.add_field(name=country, value="N/A") # we can edit the N/A later with our list of members .send() 有一个 embed kwar...
embed =awaitself.create_user_embed(ctx, user)awaitctx.send(embed=embed) 开发者ID:python-discord,项目名称:bot,代码行数:20,代码来源:information.py 示例7: basic_user_infraction_counts ▲点赞 6▼ # 需要导入模块: import discord [as 别名]# 或者: from discord importMember[as 别名]defbasic_user...
示例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, ...
embed.set_footer(text=f"Duration: {time} {time_type}") await user.send(embed=embed) else: query = 'SELECT exp.e_id,exp.e_exp FROM exp,login,soft WHERE exp.l_id = login.l_id AND exp.s_id = soft.s_id AND login.l_discord = %s AND soft.s_name = %s' ...
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) ...
embed.add_field(name="Top bakers:", value=names, inline=False) await ctx.send(embed=embed) 这是JSON 文件:(我已替换了实际的用户 ID) {"USERID": 3, "USERID": 2} 这是几次获得积分后会发生的情况: {"USERID": 1} "USERID": 2} ...
_field(name="$cat", value="Gives a cute cat gif to lighten up the mood.", inline=False) embed.add_field(name="$info", value="Gives a little info about the bot", inline=False) embed.add_field(name="$help", value="Gives this message", inline=False) await ctx.send(embed=embed)...