admin管理员组

文章数量:1315835

I'm currently working on a discord bot mand that replies with an embed message the code looks like this. (yes im following a tutorial)

const Discord = require('discord.js');

module.exports.run = async (bot, message, args) => {

    const embed = new Discord.MessageEmbed()
        .setTitle('**Library Wisp | SR - L Nightmare**')
        .setURL('')
        .setThumbnail('.png')
        .setColor('#E2B007')
        .addFields(
            { name: ':skillstory: **Blessed Armor (II)**', value: '\n SP:0 \n Prep. Time: 20s \n Duration 0s \n Effect: Greatly Increases Physial and Magical Defense for all surviving allies.'},
            { name: ':skillcolloseum: **Blessed Armor (II)**', value: '\n SP:0 \n Prep. Time: 60s \n Duration 0s \n Effect: Greatly Increases Physial and Magical Defense for all surviving front-allies.'},
            { name: '**Stats**', value: '**LEVEL** | lv 1 | lv 60 | lv 65 | lv 70 | lv 75 | lv 80 | \n **PATK** | 319 | 968 | 1023 | 1078 | 1133 | 1188 | \n **PDEF** | 323 | 972 | 1027 | 1082 | 1137 | 1192 |'},
        )

    message.channel.send(embed);
}

module.exports.config = {
    name: "lwisp",
    description: "",
    usage: "lwisp",
    accessableby: "Members",
    aliases: []
}

in within the fields I would like to have an emote displayed, I thought by using the emote and the job would be done but I am wrong, it is a custom emote and what I am trying to achieve is something like this

I'm currently working on a discord bot mand that replies with an embed message the code looks like this. (yes im following a tutorial)

const Discord = require('discord.js');

module.exports.run = async (bot, message, args) => {

    const embed = new Discord.MessageEmbed()
        .setTitle('**Library Wisp | SR - L Nightmare**')
        .setURL('https://sinoalice.game-db.tw/nightmares/ライブラリウィスプ')
        .setThumbnail('https://i.imgur./sANYH9P.png')
        .setColor('#E2B007')
        .addFields(
            { name: ':skillstory: **Blessed Armor (II)**', value: '\n SP:0 \n Prep. Time: 20s \n Duration 0s \n Effect: Greatly Increases Physial and Magical Defense for all surviving allies.'},
            { name: ':skillcolloseum: **Blessed Armor (II)**', value: '\n SP:0 \n Prep. Time: 60s \n Duration 0s \n Effect: Greatly Increases Physial and Magical Defense for all surviving front-allies.'},
            { name: '**Stats**', value: '**LEVEL** | lv 1 | lv 60 | lv 65 | lv 70 | lv 75 | lv 80 | \n **PATK** | 319 | 968 | 1023 | 1078 | 1133 | 1188 | \n **PDEF** | 323 | 972 | 1027 | 1082 | 1137 | 1192 |'},
        )

    message.channel.send(embed);
}

module.exports.config = {
    name: "lwisp",
    description: "",
    usage: "lwisp",
    accessableby: "Members",
    aliases: []
}

in within the fields I would like to have an emote displayed, I thought by using the emote and the job would be done but I am wrong, it is a custom emote and what I am trying to achieve is something like this

Share Improve this question edited Jul 11, 2020 at 8:57 Mohsen Alyafei 5,5773 gold badges35 silver badges54 bronze badges asked Jul 11, 2020 at 2:44 mahmoud alfawalmahmoud alfawal 251 gold badge1 silver badge4 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

First of all, wele to StackOverflow !
In order to get your emotes on an embed you'll have to follow this few steps :

  1. Go to your server where the emote is, type it in the chat box, like you would normally do to send it, and but a backslash (\) on front of it. After sending this, you should see something like this : <:EmoteName:420150420046660911>

  2. Then, make sure that your bot is in the same server as where the emote is.

  3. Now, if you copy-paste the full emote text you got earlier in one of your embed's fields, you should now be able to see your emotes inside of it !

  4. (Optional) If your emote is animated, you'll have to add an a on front of your :EmoteName:, wiich would make the result look like this : <a:EmoteName:420150420046660911>

I hope that I was prehensible enough, and that my explainations will help you to fix your issue ! :3

本文标签: javascriptDiscord bot embedding custom emote jsStack Overflow