无法访问返回值

时间:2019-06-15 16:37:54

标签: javascript typescript

我无法将返回的transactionHash放入全局变量。

我坚持认为这是一个范围可变的问题,不能继续采用其他策略。

    return ['?'].includes(reaction.emoji.name) && user.id === message.author.id;
};

message.awaitReactions(filter, { max: 1})
    .then(collected => {
        const reaction = collected.first();

        if (reaction.emoji.name === '?') {
      sentMessage.delete(1000)
        } else {
            message.reply('you reacted with a thumbs down.');
        }
    })
    .catch(collected => {
        console.log(`After a minute, only ${collected.size} out of 4 reacted.`);
        message.reply('you reacted with neither a thumbs up, nor a thumbs down.');```

我的期望是我将把transactionHash返回到变量事务,然后可以在其他地方访问它,但是我返回的是“未定义”

0 个答案:

没有答案
相关问题