【发布时间】:2021-11-02 16:58:05
【问题描述】:
我正在尝试让我的 discord 机器人向用户发送加入公会的链接,但我无法确定将其发送给谁。由于他们不在公会中,因此您无法向他们发送消息。
if (!args[0]) return message.reply("Who would you like to invite? For example: funny#6942");
message.channel.createInvite({
unique: true,
maxUses: 1,
maxAge: 8 * 60 * 1000
})
.then(invite => {
var invited = args[0];
message.invited.send("https://discord.gg/" + invite.code);
//dm person with the invite code
});
我对 Discord 的 JavaScript API 还是有点陌生。
【问题讨论】:
标签: javascript discord.js