Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何仅在发送消息后发送消息。删除()超时_Javascript_Node.js_Discord_Discord.js - Fatal编程技术网

Javascript 如何仅在发送消息后发送消息。删除()超时

Javascript 如何仅在发送消息后发送消息。删除()超时,javascript,node.js,discord,discord.js,Javascript,Node.js,Discord,Discord.js,我想发送message.channel.send('send me after timeout')仅在消息之后。删除()超时 可以这样做: message.channel.send(嵌入) 。然后(message=>message.delete({timeout:4000})。然后(m=>m.channel.send(“超时后发送我”))。catch(O_O=>{}); const Discord = require('discord.js'); module.exports = {

我想发送
message.channel.send('send me after timeout')仅在消息之后。删除()超时


可以这样做:

message.channel.send(嵌入)
。然后(message=>message.delete({timeout:4000})。然后(m=>m.channel.send(“超时后发送我”))。catch(O_O=>{});
const Discord = require('discord.js');

module.exports = {
    name: 'coin',
    description: 'Toss Coin!',
    aliases: 'toss',
    execute(message, args) {
        message.delete().catch(O_o => {});

        const embed = new Discord.MessageEmbed()

        .setTitle(`${message.author.username}`)
        .setColor('#6d00c1')
        .setImage('https://i.pinimg.com/originals/8f/06/04/8f0604aedc34d33d2f41113c312a588d.gif');
        
        message.channel.send(embed)
        .then(message => { message.delete({ timeout: 4000 })}).catch(O_o => {});

        message.channel.send('Send me after timeout');
    },
};