Update move logic after rebase
This commit is contained in:
parent
5d43842e3c
commit
950b3f577b
1 changed files with 11 additions and 2 deletions
|
@ -698,7 +698,10 @@ class Mod(Cog):
|
||||||
|
|
||||||
!move {channel to move to} {number of messages}"""
|
!move {channel to move to} {number of messages}"""
|
||||||
# get a list of the messages
|
# get a list of the messages
|
||||||
fetchedMessages = await ctx.channel.history(limit=limit + 1).flatten()
|
fetchedMessages = []
|
||||||
|
|
||||||
|
async for message in ctx.channel.history(limit=limit + 1):
|
||||||
|
fetchedMessages.append(message)
|
||||||
|
|
||||||
# delete all of those messages from the channel
|
# delete all of those messages from the channel
|
||||||
for i in fetchedMessages:
|
for i in fetchedMessages:
|
||||||
|
@ -718,9 +721,15 @@ class Mod(Cog):
|
||||||
else:
|
else:
|
||||||
# Create embed message object and set content to original
|
# Create embed message object and set content to original
|
||||||
embedMessage = discord.Embed(description=messages.content)
|
embedMessage = discord.Embed(description=messages.content)
|
||||||
|
|
||||||
|
avatar_url = None
|
||||||
|
|
||||||
|
if messages.author.avatar is not None:
|
||||||
|
avatar_url = messages.author.avatar.url
|
||||||
|
|
||||||
# set the embed message author to original author
|
# set the embed message author to original author
|
||||||
embedMessage.set_author(
|
embedMessage.set_author(
|
||||||
name=messages.author, icon_url=messages.author.avatar_url
|
name=messages.author, icon_url=avatar_url
|
||||||
)
|
)
|
||||||
# if message has attachments add them
|
# if message has attachments add them
|
||||||
if messages.attachments:
|
if messages.attachments:
|
||||||
|
|
Loading…
Reference in a new issue