mirror of
https://github.com/Xevion/unbelievaselfbot.git
synced 2025-12-08 18:09:12 -06:00
Add file docstrings to every .py file, improved exception docstrings, helper func typehint
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
"""
|
||||
helpers.py
|
||||
|
||||
Stores helper functions to assist the developer with common or complex operations in a separate file.
|
||||
Miscellaneous random (perhaps development-only) functions will be found here.
|
||||
"""
|
||||
|
||||
from pprint import pprint
|
||||
from typing import Union
|
||||
|
||||
@@ -9,6 +16,6 @@ def print_embed(embed: discord.Embed) -> None:
|
||||
pprint((embed.title, embed.description, embed.footer, embed.color, embed.fields, embed.author, embed.timestamp))
|
||||
|
||||
|
||||
def embed_author_matches(embed: discord.Embed, user: Union[discord.User, discord.ClientUser]):
|
||||
def embed_author_matches(embed: discord.Embed, user: Union[discord.User, discord.ClientUser]) -> bool:
|
||||
"""Returns if the Unbelievabot Embed relates to the given user."""
|
||||
return embed.author != discord.embeds.EmptyEmbed and embed.author.name == f'{user.name}#{user.discriminator}'
|
||||
|
||||
Reference in New Issue
Block a user