From 40d07a50ace4a0532123a806e78545570ba34a32 Mon Sep 17 00:00:00 2001 From: Milkeyyy <59532514+Milkeyyy@users.noreply.github.com> Date: Mon, 13 Mar 2023 12:54:56 +0900 Subject: [PATCH] Update main.py --- src/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 6a2706e..2b99bfc 100644 --- a/src/main.py +++ b/src/main.py @@ -230,8 +230,11 @@ async def updateserverstatus(): db[str(guild.id)] = default_guilddata_item else: # テキストチャンネルの名前にステータスインジケーターを設定 - if ch_name[0] in statusindicator.List: ch_name = ch_name[1:] - if db[str(guild.id)]["server_status_message"]["status_indicator"] == True: await msg.channel.edit(name=serverstatus.indicator + ch_name) + try: + if ch_name[0] in statusindicator.List: ch_name = ch_name[1:] + if db[str(guild.id)]["server_status_message"]["status_indicator"] == True: await msg.channel.edit(name=serverstatus.indicator + ch_name) + except Exception as e: + logging.error(f"ギルド {guild.name} のステータスインジケーターの更新に失敗: {e}") await msg.edit(embeds=await generateserverstatusembed(loc)) except Exception as e: