Integrated permission related error handling in both the Discord Async Bot and the API.
This PR resolves #61
Discord Bot Permission Error Handling
If the bot is unable to send an embedded message the bot will attempt to send a plain text message. If the plain text message fails, the bot will then attempt to notify the guild owner and the user who issued the command via direct message (calling user).
Minor YouTube Fixes
Fixed decode issue in 'youtube_channel_id.py'
Added Exception handling in 'youtube_management.py'
discord_post.py Permission Error Check
Added check for response status code of 403 or if the return message contains "Missing Permissions", in the event this happens an alert will be sent to the guild owner notifying them of the permissions issue.
discord_management.py Various Functions to Interact with Discord API
get_guild_data(): returns the an object from the Discord API containing details about the given Discord Guild ID.
find_parent_guild(): returns the Discord Guild ID that the given Discord Channel ID belongs to.
direct_message_channel_id(): Finds or Creates a direct message channel between the bot and the given user ID. Returns the channel ID.
send_direct_message(): Expects a user_id and message string, will use the direct_message_channel_id() function to send a direct message to the given user ID. Returns True or False indicating the success or failure.
alert_guild_owner_permissions(): This function is used to alert a guild owner of a permissions related issue. I.E. The bot is unable to send messages.
Integrated permission related error handling in both the Discord Async Bot and the API.
This PR resolves #61
Discord Bot Permission Error Handling
If the bot is unable to send an embedded message the bot will attempt to send a plain text message. If the plain text message fails, the bot will then attempt to notify the guild owner and the user who issued the command via direct message (calling user).
Minor YouTube Fixes
discord_post.py Permission Error Check
discord_management.py Various Functions to Interact with Discord API
direct_message_channel_id()
function to send a direct message to the given user ID. Returns True or False indicating the success or failure.