From de8412e4eb5bc8501c25c95e72df7ead9f62db55 Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Sun, 25 Aug 2024 23:35:02 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AF=E3=83=B3=E3=82=BF=E3=82=A4=E3=83=A0?= =?UTF-8?q?=E3=83=91=E3=82=B9=E3=83=AF=E3=83=BC=E3=83=89=E3=81=AE=E9=95=B7?= =?UTF-8?q?=E3=81=95=E3=82=92=E6=B1=BA=E5=AE=9A(8=E6=96=87=E5=AD=97)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dislocker.py b/dislocker.py index 782b287..3309753 100644 --- a/dislocker.py +++ b/dislocker.py @@ -666,7 +666,6 @@ class Bot(discord.Client): pass elif isinstance(message.channel, discord.DMChannel): - if message.author.id == dislocker.server_config["bot"]["admin_user_id"]: msg_split = message.content.split() if msg_split[0] == "/pcreg": @@ -677,14 +676,17 @@ class Bot(discord.Client): await message.channel.send(f"# :dizzy_face: 既にワンタイムパスワードは発行されています。\n# パスワード | {onetime}") else: - onetime = str(self.password_generate()) + onetime = str(self.password_generate(8)) onetime_config = { "onetime": str(onetime) } with open(dislocker.onetime_config_path, "w") as w: json.dump(onetime_config, w, indent=4) await message.channel.send(f"# :dizzy_face: PC登録時のワンタイムパスワードを発行します。\n# パスワード | {onetime}") - + else: + await message.channel.send("# :warning: DMでの応答は、現在無効化されています。") + else: + await message.channel.send("# :warning: DMでの応答は、現在無効化されています。") """ if msg_split[0] == "/password" or msg_split[0] == "/start": @@ -727,7 +729,7 @@ class Bot(discord.Client): await message.channel.send(f":white_check_mark: PC番号 {stop["pc_number"]} の使用が終了されました。") await self.get_channel(dislocker.server_config["bot"]["log_channel_id"]).send(f':negative_squared_cross_mark: {stop["name"]} さんがPC {stop["pc_number"]} の使用を終了しました。') """ - await message.channel.send("# :warning: DMでの応答は、現在無効化されています。") + elif message.channel.id == dislocker.server_config["bot"]["config_channel_id"]: msg_split = message.content.split()