Skip to content

Commit

Permalink
fix rename of bettermeme
Browse files Browse the repository at this point in the history
  • Loading branch information
solumath authored and peterdragun committed Apr 6, 2024
1 parent 99223a2 commit 3e95cae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions cogs/bettermeme/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, bot: commands.Bot):
self.repost_lock = asyncio.Lock()

@cached_property
def repost_channel(self):
def bettermeme_channel(self):
return self.bot.get_channel(self.config.bettermeme_room)

async def handle_reaction(self, ctx: ReactionContext):
Expand Down Expand Up @@ -96,12 +96,11 @@ async def on_raw_reaction_remove(self, payload: disnake.RawReactionActionEvent):

async def __repost_message(self, ctx: ReactionContext, reactions: list[disnake.Reaction]):
# Invalid ID
if self.repost_channel is None:
if self.bettermeme_channel is None:
return
async with self.repost_lock:
if MemeRepostDB.find_repost_by_original_message_id(ctx.message.id) is not None:
return

# Generate string with all reactions on post at the time
title_string = ""
for reaction in reactions:
Expand Down Expand Up @@ -180,7 +179,7 @@ async def __repost_message(self, ctx: ReactionContext, reactions: list[disnake.R
repost_message_id = -1
secondary_message_id = None
if len(embed) < 6000:
repost_message = await self.repost_channel.send(embed=embed, file=main_image)
repost_message = await self.bettermeme_channel.send(embed=embed, file=main_image)
repost_message_id = repost_message.id

if len(other_attachments) > 0:
Expand All @@ -192,7 +191,7 @@ async def __repost_message(self, ctx: ReactionContext, reactions: list[disnake.R
urls_list = [file for file in other_attachments if isinstance(file, str)]
urls = "\n".join(urls_list) if urls_list else None

secondary_message = await self.repost_channel.send(urls, files=files)
secondary_message = await self.bettermeme_channel.send(urls, files=files)
secondary_message_id = secondary_message.id

MemeRepostDB.create_repost(
Expand Down
2 changes: 1 addition & 1 deletion cogs/reactions/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def on_raw_reaction_add(self, payload: disnake.RawReactionActionEvent):
if (
ctx.channel.id == self.config.meme_room or ctx.channel.id == self.config.bettermeme_room
) and ctx.message.author.id != ctx.member.id:
cogs.append(self.bot.get_cog("MemeRepost"))
cogs.append(self.bot.get_cog("BetterMeme"))

if ctx.emoji == "🔇":
cogs.append(self.bot.get_cog("TimeoutWars"))
Expand Down

0 comments on commit 3e95cae

Please sign in to comment.