Compare commits
2 Commits
NightSlash
...
paris-ci/i
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cddfc3272b | ||
|
|
cdb7c50880 |
6
.github/ISSUE_TEMPLATE/config.yml
vendored
6
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: true
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Ask a question
|
- name: Ask a question
|
||||||
about: Ask questions and discuss with other users of the library.
|
about: Ask questions and discuss with other users of the library.
|
||||||
url: https://github.com/Rapptz/discord.py/discussions
|
url: https://github.com/iDevision/enhanced-discord.py/issues/new
|
||||||
- name: Discord Server
|
- name: Discord Server
|
||||||
about: Use our official Discord server to ask for help and questions as well.
|
about: Use our official Discord server to ask for help and questions as well.
|
||||||
url: https://discord.gg/r3sSKJJ
|
url: https://discord.gg/TvqYBrGXEm
|
||||||
|
|||||||
@@ -241,58 +241,6 @@ class Client:
|
|||||||
|
|
||||||
# internals
|
# internals
|
||||||
|
|
||||||
def get_message(self, id):
|
|
||||||
"""Get a message from cache if the message is still in cache.
|
|
||||||
.. versionadded:: 1.6.0.7
|
|
||||||
Parameters
|
|
||||||
-----------
|
|
||||||
id: :class:`int`
|
|
||||||
The message ID to look for.
|
|
||||||
Returns
|
|
||||||
--------
|
|
||||||
Optional[:class:`.Message`]
|
|
||||||
The message asked for."""
|
|
||||||
return utils.get(self.cached_messages, id=id)
|
|
||||||
|
|
||||||
@property
|
|
||||||
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")
|
|
||||||
if not col:
|
|
||||||
return None
|
|
||||||
return Colour(int(col, 16))
|
|
||||||
|
|
||||||
def set_embed_color(self, color):
|
|
||||||
"""Set a new default embed color.
|
|
||||||
This will raise a TypeError if an improper format was passed.
|
|
||||||
.. versionadded:: 1.5.0.1
|
|
||||||
Parameters
|
|
||||||
-----------
|
|
||||||
color: Union[:class:`.Colour`, :class:`int`]
|
|
||||||
The new color you want to set as default embed color.
|
|
||||||
Pass either an instance of discord.Color or a valid
|
|
||||||
0x****** HEX value.
|
|
||||||
Returns
|
|
||||||
--------
|
|
||||||
:class:`.Colour`
|
|
||||||
The new color that has been set as default embed color.
|
|
||||||
"""
|
|
||||||
if isinstance(color, (Color, Colour)):
|
|
||||||
os.environ['DEFAULT_EMBED_COLOR'] = str(hex(color))
|
|
||||||
return color
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
HEX = re.compile(r'^(#)[A-Fa-f0-9]{6}$')
|
|
||||||
col = Color(color)
|
|
||||||
if HEX.match(str(col)):
|
|
||||||
os.environ['DEFAULT_EMBED_COLOR'] = str(hex(col))
|
|
||||||
return col
|
|
||||||
else:
|
|
||||||
raise TypeError('The hex value passed could not be converted to a color')
|
|
||||||
except:
|
|
||||||
raise TypeError('embed_color must be an instance of discord.Colour or a valid 0x****** hex value.')
|
|
||||||
|
|
||||||
def _get_websocket(self, guild_id: Optional[int] = None, *, shard_id: Optional[int] = None) -> DiscordWebSocket:
|
def _get_websocket(self, guild_id: Optional[int] = None, *, shard_id: Optional[int] = None) -> DiscordWebSocket:
|
||||||
return self.ws
|
return self.ws
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user