Skip to content

Commit

Permalink
feat(cogs.meme): edit meme url, add meme msg id
Browse files Browse the repository at this point in the history
  • Loading branch information
samsunghappytree123 committed Mar 19, 2023
1 parent ccf4ff4 commit 2192624
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cogs/meme.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ async def meme_upload_file(
filename = f"{str(ctx.author.id)}-{(datetime.datetime.utcnow() + datetime.timedelta(hours=9)).strftime('%Y%m%d-%H%M%S')}.{url.split('.')[-1]}"

try:
img_msg = await self.bot.get_channel(852811274886447114).send(
content=f"{ctx.author.mention}({ctx.author.id})",
img_msg = await self.bot.get_channel(config.BOT.MEME_CHANNEL).send(
content=f"{ctx.author.mention} (`{ctx.author.id}`)",
file=await file.to_file(),
allowed_mentions=discord.AllowedMentions.none(),
)
Expand Down Expand Up @@ -507,7 +507,7 @@ def check(inter):
)

if interaction_check.data["custom_id"] == "yes_button":
await MEME_DATABASE.insert(title=title, url=url, uploader_id=ctx.author.id)
await MEME_DATABASE.insert(title=title, url=img_msg.attachments[0].url, messageID=img_msg.id, uploader_id=ctx.author.id)
return await ctx.edit(
content=f"{ctx.author.mention}, 짤 등록이 완료되었어요!",
embed=None,
Expand Down Expand Up @@ -556,8 +556,8 @@ async def meme_upload_link(
await f.write(await resp.read())

try:
img_msg = await self.bot.get_channel(852811274886447114).send(
content=f"{ctx.author.mention}({ctx.author.id})",
img_msg = await self.bot.get_channel(config.BOT.MEME_CHANNEL).send(
content=f"{ctx.author.mention} (`{ctx.author.id}`)",
file=discord.File(filename),
allowed_mentions=discord.AllowedMentions.none(),
)
Expand Down Expand Up @@ -607,7 +607,7 @@ def check(inter):
)

if interaction_check.data["custom_id"] == "yes_button":
await MEME_DATABASE.insert(title=title, url=url, uploader_id=ctx.author.id)
await MEME_DATABASE.insert(title=title, url=img_msg.attachments[0].url, messageID=img_msg.id, uploader_id=ctx.author.id)
return await ctx.edit(
content=f"{ctx.author.mention}, 짤 등록이 완료되었어요!",
embed=None,
Expand Down

0 comments on commit 2192624

Please sign in to comment.