'Can multiple listeners be used in a cog?
Problem
I wanted to use multiple listener in a cog file in discord.py but it wont work. Only the last listener in the code gets called. How to solve it?
Code
class test(commands.Cog):
@commands.Cog.listener()
async def on_message(self, message):
# code of this function
@commands.Cog.listener()
async def on_message(self, message):
# code of this function
def setup(bot):
bot.add_cog(test(bot))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
