Skip to content

Commit

Permalink
Merge pull request #66 from ajstewart/release-v0.1.3
Browse files Browse the repository at this point in the history
Release v0.1.3
  • Loading branch information
ajstewart authored Sep 21, 2021
2 parents 0ade3ce + b2abcdf commit eaf3ddd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.3'

intents = discord.Intents.default()
intents.members = True
Expand Down
28 changes: 18 additions & 10 deletions cogs/time_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')

Expand Down

0 comments on commit eaf3ddd

Please sign in to comment.