diff --git a/config/locales/de.json b/config/locales/de.json index 574002d5..344b0828 100644 --- a/config/locales/de.json +++ b/config/locales/de.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` ist nicht zum Match angetreten.", "reject": ":x: `{invited}` hat das Match abgelehnt.", "unknown-user": "Du kannst diesen User nicht herausfordern.", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Akzeptieren", "decline": "Ablehnen" diff --git a/config/locales/en.json b/config/locales/en.json index 3d0ca2fd..5525460d 100644 --- a/config/locales/en.json +++ b/config/locales/en.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` did not rise up to the challenge.", "reject": ":x: `{invited}` has rejected the duel.", "unknown-user": "you cannot challenge that user.", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Accept", "decline": "Decline" diff --git a/config/locales/es.json b/config/locales/es.json index 5d6921d2..3357ea0b 100644 --- a/config/locales/es.json +++ b/config/locales/es.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` no se puso a la altura del desafío.", "reject": ":x: `{invited}` ha rechazado el duelo.", "unknown-user": "no pudiste desafiar a ese usuario.", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Aceptar", "decline": "Rechazar" diff --git a/config/locales/fr.json b/config/locales/fr.json index c24365c2..90e864bf 100644 --- a/config/locales/fr.json +++ b/config/locales/fr.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` n'a pas répondu à la demande dans les temps.", "reject": ":x: `{invited}` a rejeté votre proposition de duel.", "unknown-user": "vous ne pouvez pas défier ce membre.", + "no-bot": "vous ne pouvez pas défier un robot.", "button": { "accept": "Accepter", "decline": "Décliner" diff --git a/config/locales/it.json b/config/locales/it.json index ae87fc44..37223270 100644 --- a/config/locales/it.json +++ b/config/locales/it.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` non ha risposto.", "reject": ":x: `{invited}` non ha accettato.", "unknown-user": "non puoi sfidare questo utente.", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Accettare", "decline": "Rifiutare" diff --git a/config/locales/nl.json b/config/locales/nl.json index a7e65a27..b28d20a7 100644 --- a/config/locales/nl.json +++ b/config/locales/nl.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` heeft te laat gereageerd!", "reject": ":x: `{invited}` heeft het spel geweigerd!", "unknown-user": "Je kan dit lid niet uitdagen!", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Accepteren", "decline": "Refuse" diff --git a/config/locales/pl.json b/config/locales/pl.json index 8de10818..bb936bc1 100644 --- a/config/locales/pl.json +++ b/config/locales/pl.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` nie odpowiedział na zaproszenie do pojedynku.", "reject": ":x: `{invited}` odrzucił zaproszenie do pojedynku.", "unknown-user": "nie możesz wyzwać na pojedynek tego użytkownika.", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Akceptuj", "decline": "Odmawiający" diff --git a/config/locales/pt-br.json b/config/locales/pt-br.json index 1ab05911..175870a7 100644 --- a/config/locales/pt-br.json +++ b/config/locales/pt-br.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` não apareceu para o duelo.", "reject": ":x: `{invited}` rejeitou o duelo.", "unknown-user": "você não pode desafiar este usuário.", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Accept", "decline": "Decline" diff --git a/config/locales/ru.json b/config/locales/ru.json index 505098f9..30651971 100644 --- a/config/locales/ru.json +++ b/config/locales/ru.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` Не ответил на Ваше предложение.", "reject": ":x: `{invited}` Отклонил вызов на игру.", "unknown-user": "Вы не можете вызвать данного игрока **{username}**. Пожалуйста линканите другого пользователя.", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Принять", "decline": "отказывать" diff --git a/config/locales/vi.json b/config/locales/vi.json index 3545594c..bad7880e 100644 --- a/config/locales/vi.json +++ b/config/locales/vi.json @@ -10,6 +10,7 @@ "expire": ":x: `{invited}` đã không phản hồi gì về lời mời của bạn", "reject": ":x: `{invited}` đã từ chối lời mời của bạn.", "unknown-user": "Bạn không thể thách đấu **{username}**. Hãy mention một người khác.", + "no-bot": "you cannot challenge bots.", "button": { "accept": "Accept", "decline": "Decline" diff --git a/src/bot/command/GameCommand.ts b/src/bot/command/GameCommand.ts index 225d053b..5b5cec23 100644 --- a/src/bot/command/GameCommand.ts +++ b/src/bot/command/GameCommand.ts @@ -86,7 +86,6 @@ export default class GameCommand { * or requesting a duel between two members. * * @param tunnel game messaging tunnel - * @param channel * @param inviter discord.js inviter member instance * @param invited discord.js invited member instance, can be undefined to play against AI */ @@ -96,14 +95,17 @@ export default class GameCommand { invited?: GuildMember ): Promise { if (invited) { - if ( - !invited.user.bot && - inviter.user.id !== invited.user.id && - invited.permissionsIn(tunnel.channel).has('VIEW_CHANNEL') - ) { - await this.manager.requestDuel(tunnel, invited); + if (!invited.user.bot) { + if ( + inviter.user.id !== invited.user.id && + invited.permissionsIn(tunnel.channel).has('VIEW_CHANNEL') + ) { + await this.manager.requestDuel(tunnel, invited); + } else { + await tunnel.replyWith({ content: localize.__('duel.unknown-user') }, true); + } } else { - await tunnel.replyWith({ content: localize.__('duel.unknown-user') }, true); + await tunnel.replyWith({ content: localize.__('duel.no-bot') }, true); } } else { await this.manager.createGame(tunnel);