Merge pull request #7 from bobloy/master

[All Cogs] Fixed to work for most up to date Red V3 (#64)
pull/65/head
Ianardo DiCaprio 6 years ago committed by GitHub
commit 720ceb0280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -88,9 +88,8 @@ class AudioTrivia(Trivia):
if session is not None:
await ctx.send("There is already an ongoing trivia session in this channel.")
return
status = await self.audio.config.status()
notify = await self.audio.config.notify()
notify = await self.audio.config.guild(ctx.guild).notify()
if status:
await ctx.send(

@ -80,7 +80,7 @@ class Chatter(Cog):
send_time = None
try:
async for message in channel.history(limit=None, reverse=True, after=after):
async for message in channel.history(limit=None, after=after):
# if message.author.bot: # Skip bot messages
# continue
if new_message(message, send_time, out[i]):
@ -180,6 +180,7 @@ class Chatter(Cog):
else:
await ctx.send("Error occurred :(")
@commands.Cog.listener()
async def on_message(self, message: discord.Message):
"""
Credit to https://github.com/Twentysix26/26-Cogs/blob/master/cleverbot/cleverbot.py

@ -76,6 +76,7 @@ class Dad(Cog):
await self.config.guild(ctx.guild).cooldown.set(cooldown)
await ctx.send("Dad joke cooldown is now set to {}".format(cooldown))
@commands.Cog.listener()
async def on_message(self, message: discord.Message):
guild: discord.Guild = message.guild
if guild is None:

@ -89,6 +89,7 @@ class ExclusiveRole(Cog):
to_remove = [discord.utils.get(member.guild.roles, id=id) for id in to_remove]
await member.remove_roles(*to_remove, reason="Exclusive roles")
@commands.Cog.listener()
async def on_member_update(self, before: discord.Member, after: discord.Member):
if before.roles == after.roles:
return

@ -4,6 +4,6 @@ from redbot.core import data_manager
def setup(bot):
n = Hangman(bot)
data_manager.load_bundled_data(n, __file__)
data_manager.bundled_data_path(n)
bot.add_cog(n)
bot.add_listener(n.on_react, "on_reaction_add")

@ -276,6 +276,7 @@ class Hangman(Cog):
await self._reprintgame(message)
@commands.Cog.listener()
async def on_react(self, reaction, user):
""" Thanks to flapjack reactpoll for guidelines
https://github.com/flapjax/FlapJack-Cogs/blob/master/reactpoll/reactpoll.py"""

@ -34,6 +34,7 @@ class Leaver(Cog):
await self.config.guild(guild).channel.set(ctx.channel.id)
await ctx.send("Channel set to " + ctx.channel.name)
@commands.Cog.listener()
async def on_member_remove(self, member: discord.Member):
guild = member.guild
channel = await self.config.guild(guild).channel()

@ -5,6 +5,6 @@ from .planttycoon import PlantTycoon
async def setup(bot):
tycoon = PlantTycoon(bot)
data_manager.load_bundled_data(tycoon, __file__)
data_manager.bundled_data_path(tycoon)
await tycoon._load_plants_products() # I can access protected members if I want, linter!!
bot.add_cog(tycoon)

@ -248,6 +248,7 @@ class ReactRestrict(Cog):
await ctx.send("Reaction removed.")
@commands.Cog.listener()
async def on_raw_reaction_add(
self, emoji: discord.PartialEmoji, message_id: int, channel_id: int, user_id: int
):

@ -5,5 +5,5 @@ from .recyclingplant import RecyclingPlant
def setup(bot):
plant = RecyclingPlant(bot)
data_manager.load_bundled_data(plant, __file__)
data_manager.bundled_data_path(plant)
bot.add_cog(plant)

@ -78,6 +78,7 @@ class StealEmoji(Cog):
await ctx.send("This server has been added as an emoji bank")
@commands.Cog.listener()
async def on_reaction_add(self, reaction: discord.Reaction, user: discord.User):
"""Event handler for reaction watching"""
if not reaction.custom_emoji:

Loading…
Cancel
Save