From a8dd4a826f66a9e118f7956922ec4e2c34b42ba6 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 23 Feb 2019 04:26:03 -0500 Subject: [PATCH] Document listener changes in the migrating docs. --- docs/migrating.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/migrating.rst b/docs/migrating.rst index 9fc8d72a0..bf468f51b 100644 --- a/docs/migrating.rst +++ b/docs/migrating.rst @@ -956,6 +956,8 @@ Cogs are now required to have a base class, :class:`~.commands.Cog` for future p * :meth:`.Cog.cog_before_invoke` and :meth:`.Cog.cog_after_invoke` - A special method that registers a cog before and after invoke hook. More information can be found in :ref:`migrating_1_0_before_after_hook`. +Those that were using listeners, such as ``on_message`` inside a cog will now have to explicitly mark them as such using the :meth:`.commands.Cog.listener` decorator. + Along with that, cogs have gained the ability to have custom names through specifying it in the class definition line. More options can be found in the metaclass that facilitates all this, :class:`.commands.CogMeta`. An example cog with every special method registered and a custom name is as follows: @@ -987,6 +989,10 @@ An example cog with every special method registered and a custom name is as foll async def cog_after_invoke(self, ctx): print('cog local after: {0.command.qualified_name}'.format(ctx)) + @commands.Cog.listener() + async def on_message(self, message): + pass + .. _migrating_1_0_before_after_hook: