From 2cf91e705e711ad0f6f94d0fa5f9f3249ba23430 Mon Sep 17 00:00:00 2001 From: Adam Stewart Date: Thu, 16 Sep 2021 01:43:15 +0100 Subject: [PATCH 1/3] Bump version --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 0c2f0a0..214f26b 100755 --- a/bot.py +++ b/bot.py @@ -17,7 +17,7 @@ # GRAB THE API TOKEN FROM THE .ENV FILE. DISCORD_TOKEN = os.getenv('DISCORD_TOKEN') -version = '0.1.2' +version = '0.1.2dev' intents = discord.Intents.default() intents.members = True From cc1a60def4326c8e0e865188d00d1daf4bebc12c Mon Sep 17 00:00:00 2001 From: Adam Stewart Date: Tue, 21 Sep 2021 22:32:36 +0100 Subject: [PATCH 2/3] Added a catch for time channel permission errors --- cogs/time_channel.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/cogs/time_channel.py b/cogs/time_channel.py index b32b483..66165f7 100644 --- a/cogs/time_channel.py +++ b/cogs/time_channel.py @@ -89,16 +89,24 @@ async def time_channels_manager(self): now = get_current_time(tz=tz) for i in guilds['time_channel']: - time_channel_id = int(i) - time_channel = self.bot.get_channel(time_channel_id) - - new_name = now.strftime("%I:%M %p %Z") - new_name = get_hour_emoji(new_name[:5]) + " " + new_name - - await time_channel.edit(name=new_name) - - logger.info( - f'Updated time channel in {time_channel.guild.name}') + try: + time_channel_id = int(i) + time_channel = self.bot.get_channel(time_channel_id) + + new_name = now.strftime("%I:%M %p %Z") + new_name = get_hour_emoji(new_name[:5]) + " " + new_name + + await time_channel.edit(name=new_name) + + logger.info( + f'Updated time channel in {time_channel.guild.name}') + except Exception as e: + logger.error( + 'Updating the time channel for ' + f'{time_channel.guild.name} failed.' + ' Are the permissions correct?' + ) + logger.error(f'Error: {e}') else: logger.warning('No time channels set skipping loop.') From b2abcdff3f3aeeadeed59b0e9637518484b0e34a Mon Sep 17 00:00:00 2001 From: Adam Stewart Date: Tue, 21 Sep 2021 22:43:39 +0100 Subject: [PATCH 3/3] Bumped release version --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 214f26b..c0ae6bc 100755 --- a/bot.py +++ b/bot.py @@ -17,7 +17,7 @@ # GRAB THE API TOKEN FROM THE .ENV FILE. DISCORD_TOKEN = os.getenv('DISCORD_TOKEN') -version = '0.1.2dev' +version = '0.1.3' intents = discord.Intents.default() intents.members = True