Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions discordbot/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def basic(self, **params):
color = params.pop("color", Colors.get_default(self.bot))
if isinstance(color, Colors): color = color.value
e = embeds.build_embed(title=params.pop("title", ""), description=params.pop("message", params.pop("description", "")),
color=params.pop("color", Colors.get_default(self.bot)), **params)
color=color, **params)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do this? The original will grab the color parameter passed, and if not passed use the default color. Yours will grab the color, and if it doesn't exist it can cause error or use discord's default as opposed to bot's default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesnt pop remove the element from the list? you already did it once at the top, doing it again will always return Colors.get_default(self.bot)

return await self.say(**params, embed=e)

async def success(self, **params):
Expand All @@ -48,7 +48,7 @@ async def success(self, **params):

async def failure(self, **params):
title = params.pop("title", "")
message = params.pop("message", "Success")
message = params.pop("message", "Failure")
return await self.basic(title=title, message=message, color=Colors.failure, **params)

async def toggle(self, **params):
Expand All @@ -63,4 +63,4 @@ async def toggle(self, **params):
if success:
return await self.success(title=title, message=message, **params)
else:
return await self.failure(title=title, message=message, **params)
return await self.failure(title=title, message=message, **params)