Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
JedHazaymeh committed Feb 1, 2024
1 parent ba92717 commit 154c390
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Entrypoint script to load extensions and start the client."""
import hikari
from hikari import Activity, ActivityType

from src.bot import bot

if __name__ == '__main__':
bot.run(activity=hikari.Activity(name='Webgroup issues', type=hikari.ActivityType.WATCHING))
bot.run(activity=Activity(name='Webgroup issues', type=ActivityType.WATCHING))
4 changes: 3 additions & 1 deletion src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ async def error_handler(ctx: arc.GatewayContext, exc: Exception) -> None:
else:
message = 'If this persists, create an issue at <https://webgroup-issues.redbrick.dcu.ie/>.'

await ctx.respond(f':x: Blockbot encountered an unhandled exception. {message}')
await ctx.respond(f' Blockbot encountered an unhandled exception. {message}')
logging.error(exc)

raise exc
4 changes: 2 additions & 2 deletions src/extensions/user_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ async def role_error_handler(ctx: arc.GatewayContext, exc: Exception) -> None:

if isinstance(exc, hikari.ForbiddenError):
return await ctx.respond(
f':x: Blockbot is not permitted to self-service the {role_mention(role)} role.',
f' Blockbot is not permitted to self-service the {role_mention(role)} role.',
flags=hikari.MessageFlag.EPHEMERAL
)

if isinstance(exc, hikari.NotFoundError):
return await ctx.respond(
f":x: Blockbot can't find that role.",
f" Blockbot can't find that role.",
flags=hikari.MessageFlag.EPHEMERAL
)

Expand Down

0 comments on commit 154c390

Please sign in to comment.