Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
ZechCodes committed Jan 31, 2024
2 parents 277e6a1 + 9445a28 commit fe68dd6
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions beginner/cogs/spam.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,15 @@ async def attachment_filter(self, message: Message):
)

if allowed:
embed.title = f"{message.author.display_name} Successfully Uploaded Some Code"
embed.title = (
f"{message.author.display_name} Successfully Uploaded Some Code"
)
embed.description = user_message
embed.colour = GREEN
files = {}
for attachment in allowed:
content = (await attachment.read()).decode()
if len(content) < 1000:
file_type = os.path.splitext(attachment.filename)[1].casefold()
embed.add_field(
name=f"Attachment: {self.escape_markdown(attachment.filename)}",
value=(
f"```{self.file_types.get(file_type, '')}\n{content}\n```"
if content
else "*FILE IS EMPTY*"
),
inline=False,
)
else:
files[attachment.filename] = content
files[attachment.filename] = content

if files:
gist = self.upload_files(files)
Expand Down

0 comments on commit fe68dd6

Please sign in to comment.