[All Cogs] Fixed to work for most up to date Red V3 (#64)
* Update ccrole.py * listener * Update audiotrivia.py * Update audiotrivia.py * Update audiotrivia.py * Update chat.py * Update dad.py * Update exclusiverole.py * Update leaver.py * Update reactrestrict.py * Update stealemoji.py * Update lseen.py * Update __init__.py * Update qrinvite.py * Update qrinvite.py * Depreaction * Depreaction warning * Listener * Update chat.py
This commit is contained in:
parent
aa25cb1f3c
commit
704b1c611b
@ -88,9 +88,8 @@ class AudioTrivia(Trivia):
|
|||||||
if session is not None:
|
if session is not None:
|
||||||
await ctx.send("There is already an ongoing trivia session in this channel.")
|
await ctx.send("There is already an ongoing trivia session in this channel.")
|
||||||
return
|
return
|
||||||
|
|
||||||
status = await self.audio.config.status()
|
status = await self.audio.config.status()
|
||||||
notify = await self.audio.config.notify()
|
notify = await self.audio.config.guild(ctx.guild).notify()
|
||||||
|
|
||||||
if status:
|
if status:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
|
@ -80,7 +80,7 @@ class Chatter(Cog):
|
|||||||
send_time = None
|
send_time = None
|
||||||
try:
|
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
|
# if message.author.bot: # Skip bot messages
|
||||||
# continue
|
# continue
|
||||||
if new_message(message, send_time, out[i]):
|
if new_message(message, send_time, out[i]):
|
||||||
@ -180,6 +180,7 @@ class Chatter(Cog):
|
|||||||
else:
|
else:
|
||||||
await ctx.send("Error occurred :(")
|
await ctx.send("Error occurred :(")
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
async def on_message(self, message: discord.Message):
|
async def on_message(self, message: discord.Message):
|
||||||
"""
|
"""
|
||||||
Credit to https://github.com/Twentysix26/26-Cogs/blob/master/cleverbot/cleverbot.py
|
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 self.config.guild(ctx.guild).cooldown.set(cooldown)
|
||||||
await ctx.send("Dad joke cooldown is now set to {}".format(cooldown))
|
await ctx.send("Dad joke cooldown is now set to {}".format(cooldown))
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
async def on_message(self, message: discord.Message):
|
async def on_message(self, message: discord.Message):
|
||||||
guild: discord.Guild = message.guild
|
guild: discord.Guild = message.guild
|
||||||
if guild is None:
|
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]
|
to_remove = [discord.utils.get(member.guild.roles, id=id) for id in to_remove]
|
||||||
await member.remove_roles(*to_remove, reason="Exclusive roles")
|
await member.remove_roles(*to_remove, reason="Exclusive roles")
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
async def on_member_update(self, before: discord.Member, after: discord.Member):
|
async def on_member_update(self, before: discord.Member, after: discord.Member):
|
||||||
if before.roles == after.roles:
|
if before.roles == after.roles:
|
||||||
return
|
return
|
||||||
|
@ -4,6 +4,6 @@ from redbot.core import data_manager
|
|||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
n = Hangman(bot)
|
n = Hangman(bot)
|
||||||
data_manager.load_bundled_data(n, __file__)
|
data_manager.bundled_data_path(n)
|
||||||
bot.add_cog(n)
|
bot.add_cog(n)
|
||||||
bot.add_listener(n.on_react, "on_reaction_add")
|
bot.add_listener(n.on_react, "on_reaction_add")
|
||||||
|
@ -276,6 +276,7 @@ class Hangman(Cog):
|
|||||||
|
|
||||||
await self._reprintgame(message)
|
await self._reprintgame(message)
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
async def on_react(self, reaction, user):
|
async def on_react(self, reaction, user):
|
||||||
""" Thanks to flapjack reactpoll for guidelines
|
""" Thanks to flapjack reactpoll for guidelines
|
||||||
https://github.com/flapjax/FlapJack-Cogs/blob/master/reactpoll/reactpoll.py"""
|
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 self.config.guild(guild).channel.set(ctx.channel.id)
|
||||||
await ctx.send("Channel set to " + ctx.channel.name)
|
await ctx.send("Channel set to " + ctx.channel.name)
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
async def on_member_remove(self, member: discord.Member):
|
async def on_member_remove(self, member: discord.Member):
|
||||||
guild = member.guild
|
guild = member.guild
|
||||||
channel = await self.config.guild(guild).channel()
|
channel = await self.config.guild(guild).channel()
|
||||||
|
@ -74,6 +74,7 @@ class LastSeen(Cog):
|
|||||||
embed = discord.Embed(timestamp=last_seen)
|
embed = discord.Embed(timestamp=last_seen)
|
||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
async def on_member_update(self, before: discord.Member, after: discord.Member):
|
async def on_member_update(self, before: discord.Member, after: discord.Member):
|
||||||
if before.status != self.offline_status and after.status == self.offline_status:
|
if before.status != self.offline_status and after.status == self.offline_status:
|
||||||
if not await self.config.guild(before.guild).enabled():
|
if not await self.config.guild(before.guild).enabled():
|
||||||
|
@ -5,6 +5,6 @@ from .planttycoon import PlantTycoon
|
|||||||
|
|
||||||
async def setup(bot):
|
async def setup(bot):
|
||||||
tycoon = PlantTycoon(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!!
|
await tycoon._load_plants_products() # I can access protected members if I want, linter!!
|
||||||
bot.add_cog(tycoon)
|
bot.add_cog(tycoon)
|
||||||
|
@ -60,7 +60,7 @@ class QRInvite(Cog):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
extension = pathlib.Path(image_url).parts[-1].replace(".", "?").split("?")[1]
|
eextention = pathlib.Path(image_url).parts[-1].replace(".", "?").split("?")[1]
|
||||||
|
|
||||||
path: pathlib.Path = cog_data_path(self)
|
path: pathlib.Path = cog_data_path(self)
|
||||||
image_path = path / (ctx.guild.icon + "." + extension)
|
image_path = path / (ctx.guild.icon + "." + extension)
|
||||||
|
@ -248,6 +248,7 @@ class ReactRestrict(Cog):
|
|||||||
|
|
||||||
await ctx.send("Reaction removed.")
|
await ctx.send("Reaction removed.")
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
async def on_raw_reaction_add(
|
async def on_raw_reaction_add(
|
||||||
self, emoji: discord.PartialEmoji, message_id: int, channel_id: int, user_id: int
|
self, emoji: discord.PartialEmoji, message_id: int, channel_id: int, user_id: int
|
||||||
):
|
):
|
||||||
|
@ -5,5 +5,5 @@ from .recyclingplant import RecyclingPlant
|
|||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
plant = RecyclingPlant(bot)
|
plant = RecyclingPlant(bot)
|
||||||
data_manager.load_bundled_data(plant, __file__)
|
data_manager.bundled_data_path(plant)
|
||||||
bot.add_cog(plant)
|
bot.add_cog(plant)
|
||||||
|
@ -78,6 +78,7 @@ class StealEmoji(Cog):
|
|||||||
|
|
||||||
await ctx.send("This server has been added as an emoji bank")
|
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):
|
async def on_reaction_add(self, reaction: discord.Reaction, user: discord.User):
|
||||||
"""Event handler for reaction watching"""
|
"""Event handler for reaction watching"""
|
||||||
if not reaction.custom_emoji:
|
if not reaction.custom_emoji:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user