blarb
DIAdiscord.js - Imagine an app
•Created by blarb on 1/6/2024 in #djs-questions
Using InteractionCreate want to add multiple emoji/unicode images to text v14.14.x
My bot is taking in a value and returns back multiple lines of text. For each line if text I'd like to include an image/icon/emoji representing the line. Here is the base of the code. Can you include inline images with this type of interaction?
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('mods')
.setDescription('Provides information about the user.')
.addStringOption(option =>
option.setName('toon')
.setDescription('The toon you want or list to show them all')
.setRequired(false)
),
async execute(interaction) {
const toon = interaction.options.getString('toon');
let toonId = 0;
try {
toonId = parseInt(toon, 10);
} catch (exceptionVar) {
await interaction.reply('Invalid input. MUST be a number');
}
let output = 'Some random text to add but want to include images or unicode:' + '\n';
output += '<:image1> Title One' + '\n';
output += '<:image2> Title Two' + '\n';
output += '<:image3> Title Three' + '\n';
await interaction.reply(output);
},
};
5 replies