From 9f25caf4eb9e17893373cfc9eb56b5bdfbb5e068 Mon Sep 17 00:00:00 2001 From: The-Foxon Date: Sat, 15 Jul 2023 04:29:59 +1200 Subject: [PATCH] f --- src/commands/Link.ts | 2 +- src/commands/UserMessage.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/Link.ts b/src/commands/Link.ts index d0a1726..63a2185 100644 --- a/src/commands/Link.ts +++ b/src/commands/Link.ts @@ -29,7 +29,7 @@ export default { try { if (!!codeConfirmation && !!userG) { - if (userCode === codeConfirmation && !id) { + if (userCode === codeConfirmation) { global.config.users.set(interaction.user.id, userG) global.config.authCodes.set(interaction.user.id, "-") await interaction.followUp(`Аккаунт успешно привязан`) diff --git a/src/commands/UserMessage.ts b/src/commands/UserMessage.ts index f0b0695..bf50942 100644 --- a/src/commands/UserMessage.ts +++ b/src/commands/UserMessage.ts @@ -20,7 +20,7 @@ export default { await interaction.deferReply({ ephemeral: true }) try { - if (user !== undefined) { + if (user !== undefined && !!message) { if (!global.config.usersInGame.filter(u => u.SlgId === user.SlgId && u.SteamId === user.SteamId).length) { await interaction.followUp(`Ошибка отправки сообщения, повторите привязку аккаунта или повторите через 20 секунд`); return @@ -29,7 +29,7 @@ export default { await interaction.followUp(`Ошибка отправки сообщения`); return } - const uInfo = global.config.usersInGame.filter(u => u.SlgId === user.SlgId || u.SteamId === user.SteamId)[0] + const uInfo = global.config.usersInGame.filter(u => u.SlgId === user.SlgId && u.SteamId === user.SteamId)[0] global.config.users.set(interaction.user.id, uInfo)