mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-09 04:38:55 -05:00
Add on_red_before_identify dispatch (#4647)
* add before_identify_hook with `on_identify` dispatch * move before_identify_hook closer to other "hooks" * add `red_` prefix to avoid potential conflict * on_red_before_identify Co-authored-by: Fixator10 <fixator10@users.noreply.github.com>
This commit is contained in:
parent
41e980c517
commit
315b3e5c98
@ -384,6 +384,12 @@ class RedBase(
|
||||
self._red_before_invoke_objs.add(coro)
|
||||
return coro
|
||||
|
||||
async def before_identify_hook(self, shard_id, *, initial=False):
|
||||
"""A hook that is called before IDENTIFYing a session.
|
||||
Same as in discord.py, but also dispatches "on_red_identify" bot event."""
|
||||
self.dispatch("red_before_identify", shard_id, initial)
|
||||
return await super().before_identify_hook(shard_id, initial=initial)
|
||||
|
||||
@property
|
||||
def cog_mgr(self) -> NoReturn:
|
||||
raise AttributeError("Please don't mess with the cog manager internals.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user