如何从我的不和谐 js 机器人的预设 gif 中嵌入随机 gif?

时间:2021-06-10 20:56:05

标签: javascript node.js discord discord.js

我正在为我的服务器开发一个自定义的 Discord 机器人,我想要一些有趣的命令。一种是禁令命令的变体,在响应禁令时,它还将包含一个 gif。我只是不确定如何实现我正在寻找的东西,更不用说在我现有的代码中了。

我已经包含了我的全部禁令命令。我希望它发生的位置是在 banConfirmationEmbed 中。

有人可以帮我吗?

module.exports = {
name: 'bigban',
description: "An extra fun ban command!",
execute(message, args, Discord){
    const args = mesage.content.split(' ').slice(1);

    const user = message.mentions.users.first();
    const banReason =args.slice(1).join;

    if (!user) {
        try {
            if (!message.guild.members.get(args.slice(0,1).join(' '))) throw new Error('I\'m sorry, I could not get a Discord user with this userID.');
            user = message.guild.members.get(args.slice(0, 1).join(' '));
            user = user.user;
        } catch (error) {
            return message.reply('I\'m sorry, I could not get a Discord user with this userID.');
        }
    }
    if (user === message.author) return message.channel.send('Congratulations, you\'ve tried to big ban yourself.');
    if (!reason) return message.reply('Dude, you have to tell me why this moron deserves a big ban.');
    if (!message.guild.member(user).bannable) return message.reply('You cannot big ban this user, as you are not dank enough.');

    await message.guild.ban(user)

    const Discord = require('discord.js');
    const banConfirmationEmbed = new Discord.RichEmbed()
    .setColor(0x7c22c0)
    .setDescription('? ${usertag} got phocin BIG banned.');
    message.channel.send({
        embed: banConfirmationEmbed
    });

    const modlogChannelID = '852638799694659614';
    if (modlogChannelID.lenght !== 0) {}
        if (!clientInformation.channels.get(modlogChannelID )) return undefined;

        const banConfirmationEmbedModLog = new Discord.RichEmbed()
        .setAuthor('Banned by **${msg.author.username}#${msg.author.discriminator}**', msg.author.displayAvatarURL)
        .setThumbnail(user.displayAvatarURL)
        .setColor(0x7c22c0)
        .setTimestamp()
        .setDescription('**Action**: Ban'
            + '**User: ${user.username}#{user.discriminator} (${user.id})'
            + '**Reason**: ${reason}');
        clientInformation.channels.get(modlogChannelID).send({
            embed: banConfirmationEmbedModLog
        });
        }
}

0 个答案:

没有答案