-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
internalTooling and non-user-facing improvementsTooling and non-user-facing improvements
Description
Issue is written assuming #340 is merged
The usage pattern of hooks is one where a factory (create_edit_hook
) builds the listener logic of on_message_edit
:
discord-bot/app/components/github_integration/comments/integration.py
Lines 117 to 124 in e0f4421
@commands.Cog.listener() | |
async def on_message_edit(self, before: dc.Message, after: dc.Message) -> None: | |
return await create_edit_hook( | |
linker=self.comment_linker, | |
message_processor=self.comment_processor, | |
interactor=self.reply_with_comments, | |
view_type=CommentActions, | |
)(before, after) |
However, this is funky looking logic. Besides the fact that it is highly repetitive. This section of code is very ripe for some type of refactor. Perhaps could be improved by making an abstract cog class that you plug in your various controlling functions.
Talks about this were made on the discord + #340 (comment)
Metadata
Metadata
Assignees
Labels
internalTooling and non-user-facing improvementsTooling and non-user-facing improvements