From 2868b1afe29223cf88fdd46f10514fa489e0d616 Mon Sep 17 00:00:00 2001 From: Nick Jungmann Date: Sun, 20 Nov 2022 23:27:22 +0100 Subject: [PATCH] Added messaging to mass-move #20 --- kdb-bot/src/bot/config | 2 +- kdb-bot/src/bot/translation/de.json | 4 ++++ kdb-bot/src/modules/base/command/mass_move_command.py | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/kdb-bot/src/bot/config b/kdb-bot/src/bot/config index 57dd85de79..e7e9d85f7d 160000 --- a/kdb-bot/src/bot/config +++ b/kdb-bot/src/bot/config @@ -1 +1 @@ -Subproject commit 57dd85de79d51893e5f5e5bd7f7d6065ba923f21 +Subproject commit e7e9d85f7d0054ba95ae1ff87d91b4e218ef510f diff --git a/kdb-bot/src/bot/translation/de.json b/kdb-bot/src/bot/translation/de.json index 3ab63d0b75..8005bb1244 100644 --- a/kdb-bot/src/bot/translation/de.json +++ b/kdb-bot/src/bot/translation/de.json @@ -151,6 +151,10 @@ }, "footer": "" }, + "mass_move": { + "moved": "Alle Personen aus {} wurden nach {} verschoben.", + "channel_from_error": "Du musst dich in einem Voicechannel befinden oder die Option \"channel_from\" mit angeben." + }, "presence": { "changed": "Presence wurde geƤndert.", "removed": "Presence wurde entfernt.", diff --git a/kdb-bot/src/modules/base/command/mass_move_command.py b/kdb-bot/src/modules/base/command/mass_move_command.py index a7490bac99..ccf9f9d783 100644 --- a/kdb-bot/src/modules/base/command/mass_move_command.py +++ b/kdb-bot/src/modules/base/command/mass_move_command.py @@ -35,8 +35,8 @@ class MassMoveCommand(DiscordCommandABC): channel_from: discord.VoiceChannel = None): self._logger.debug(__name__, f'Received command mass-move {ctx}') - if channel_from is None and ctx.author.voice.channel is None: - ##Hier den User benachrichtigen, dass er nicht in einem Channel sitzt. + if channel_from is None and ctx.author.voice is None: + await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.mass_move.channel_from_error')) return if channel_from is None: @@ -45,4 +45,6 @@ class MassMoveCommand(DiscordCommandABC): moves = [member.move_to(channel_to) for member in channel_from.members] await asyncio.gather(*moves) + await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.mass_move.moved', channel_from.name, channel_to.name)) + self._logger.trace(__name__, f'Finished mass-move command')