set_embed_color, embed_color and get_message added #23

Open
NightSlasher35 wants to merge 1 commits from NightSlasher35/patch-4 into 2.0
NightSlasher35 commented 2021-08-28 23:56:51 +00:00 (Migrated from github.com)

Summary

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)
## Summary <!-- What is this pull request for? Does it fix any issues? --> ## Checklist <!-- Put an x inside [ ] to check it, like so: [x] --> - [ ] If code changes were made then they have been tested. - [ ] I have updated the documentation to reflect the changes. - [ ] This PR fixes an issue. - [ ] This PR adds something new (e.g. new method or parameters). - [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed) - [ ] This PR is **not** a code change (e.g. documentation, README, ...)
Gnome-py (Migrated from github.com) reviewed 2021-08-29 00:04:14 +00:00
@ -244,0 +258,4 @@
def embed_color(self):
"""Optional[:class:`.Colour`]: The default embed colour that is
being used for all embed if no colour is passed."""
col = os.getenv("DEFAULT_EMBED_COLOR")
Gnome-py (Migrated from github.com) commented 2021-08-29 00:01:46 +00:00

No, never use env vars like this, instead store this under discord.Embed.default_colour

No, never use env vars like this, instead store this under `discord.Embed.default_colour`
@ -244,0 +280,4 @@
"""
if isinstance(color, (Color, Colour)):
os.environ['DEFAULT_EMBED_COLOR'] = str(hex(color))
return color
Gnome-py (Migrated from github.com) commented 2021-08-29 00:02:21 +00:00

Same here, do not use env vars

Same here, do not use env vars
@ -244,0 +283,4 @@
return color
else:
try:
HEX = re.compile(r'^(#)[A-Fa-f0-9]{6}$')
Gnome-py (Migrated from github.com) commented 2021-08-29 00:04:03 +00:00

Why are you compiling this regex per invoke, store global.

Why are you compiling this regex per invoke, store global.
WhoTheOOF commented 2021-08-29 04:08:20 +00:00 (Migrated from github.com)

Going to go with Gnome here, fix these and you should be good.

Going to go with Gnome here, fix these and you **should** be good.
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin NightSlasher35/patch-4:NightSlasher35/patch-4
git checkout NightSlasher35/patch-4
Sign in to join this conversation.
No description provided.