Add file docstrings to every .py file, improved exception docstrings, helper func typehint

This commit is contained in:
Xevion
2021-01-24 23:30:09 -06:00
parent 58884a43ff
commit c9fad55ade
10 changed files with 73 additions and 11 deletions

View File

@@ -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}'