Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reopening this PR for merging TwitchCog into develop #156

Merged
merged 56 commits into from
Aug 23, 2021
Merged

Conversation

Fluxticks
Copy link
Collaborator

No description provided.

Fluxticks added 30 commits June 20, 2021 19:16
…o supports sending a twitch url as the channel
Fluxticks and others added 21 commits June 26, 2021 13:16
# Conflicts:
#	secrets.template
#	src/esportsbot/bot.py
#	src/esportsbot/lib/discordUtil.py
#	src/esportsbot/user_strings.toml
…ow is tied to a specific webhook instead of the server as a whole.

- This change was made with the Esports Hub in mind where different games may not care about other games' streams.
commit 277df81
Author: Fluxticks <[email protected]>
Date:   Thu Aug 19 17:46:18 2021 +0100

    Revert "Implemented posting Twitch Live notifications to Discord Channels  (#140)" (#155)

    This reverts commit 0ddeeb8.

commit 0ddeeb8
Author: Fluxticks <[email protected]>
Date:   Thu Aug 19 16:18:17 2021 +0100

    Implemented posting Twitch Live notifications to Discord Channels  (#140)

    * Implemented verification for POST requests to ensure the message is from Twitch

    * Added basic logging to TwitchListener

    * Added TwitchApp class to handle any data the Request handler needs to keep between requests

    * Added docstring to existing methods

    * Implemented send_webhook so that notifications get sent to their respective channels.

    * updated requirements.txt

    * updated generate_schema.py

    * updated gitignore

    * Implemented the TwitchCog with hook creation and account adding

    * Added removetwitch and listtwitch commands

    * Added remove twitch hook command

    * Added docstrings to command methods

    * Changed CALLBACK_URL to use env var

    * addtwitch channel now accepts a string for the custom message and also supports sending a twitch url as the channel

    * Added user facing strings

    * Added command to set custom message

    * Added command to get custom message

    * Applied YAPF formatter

    * Added check to not allow webhook names to be the webhook prefix

    * Moved all commands to be subcommand of `twitch`

    * Changed module name to reflect new module name in bot start

    * Ensured consistency of use of the word channel over account when refering to a Twitch channel

    * Added help and usage strings to commands

    * Fixed an bug that caused an error when given a Twitch channel that doesn't exists

    * Made channel names in user strings be inline code blocks for easier reading

    * Fixed missing turning list into a dict for channel info

    * Added new string for channels that are not tracked but are real channels

    * Added check for empty environment variables

    * Updated some logging lines

    * Applied YAPF formatter

    * Fixed typos

    * Added module docstring

    * Notifications now include the custom 'go live' message

    * Added preview command to see what a notification for a channel will look like

    * Applied YAPF formatting

    * Deleted TwitchIntegrationCog

    * Implemented new DB accessor

    * Moved load_discord_hooks to discordUtil

    * Made reusable functions for loading/saving bearer tokens

    * Updated load_tracked_channels docstring to be more consistent.

    * Fixed some booleans to be simpler

    * Moved more functions to discordUtil for shared access

    * Made global twitch api strings

    * Fixed an issue where PyCharm doesn't recognise application as the correct class

    * Added filter to for to avoid needing to check for membership

    * Exposed port 443

    * Fixed an issue where if the twitch temp file did not exist it would fail to start

    * Fixed an issue caused by changing of program starting dir

    * Changed createhook command to require a name and channel as parameters

    * Updated how notifications are posted for channels so that a channel now is tied to a specific webhook instead of the server as a whole.

    - This change was made with the Esports Hub in mind where different games may not care about other games' streams.

    * Updated README to include the changes to Webhooks and the tracking of channels

commit fa9c188
Author: Laura Demkowicz-Duffy <[email protected]>
Date:   Thu Aug 19 15:17:49 2021 +0000

    Move from `send_to_log_channel` to `client.adminLog` (#153)

    * Add adminLog usage to voice master cog

    * Explicit guildID passing

    * Correct adminLog invocation

    * Add to log, admin and default role cogs, move changes learned from those back to voicemaster

    * Remove send_to_log_channel function

commit 6f09ad3
Author: Laura Demkowicz-Duffy <[email protected]>
Date:   Sun Aug 8 00:37:17 2021 +0000

    Env var cleanup (#152)

    * Have docker postgres get configuration from secrets file

    * Fix secrets file git handling
@Fluxticks
Copy link
Collaborator Author

This is the same as what was before, but with latest develop merged in and the user_strings.toml updated to stop it from removing strings in other cogs.

@Laura7089 Laura7089 added the enhancement New feature or request label Aug 23, 2021
@Laura7089 Laura7089 merged commit cbf5baf into develop Aug 23, 2021
@Fluxticks Fluxticks deleted the feat/TwitchCog branch August 31, 2021 18:41
Fluxticks added a commit that referenced this pull request Sep 15, 2021
* Add yapf style file (#74)

* Add yapf style file with 'sensible' defaults

* Move styling to setup.cfg and add sections for other tools

* Add git attributes file for line ending normalisation

* Add mypy configuration

* Remove error context from mypy

* Add dict entry option to styling

* Fix styling since merge funkiness removed the last one (#119)

* Add yapf style file with 'sensible' defaults

* Move styling to setup.cfg and add sections for other tools

* Add git attributes file for line ending normalisation

* Add mypy configuration

* Remove error context from mypy

* Add dict entry option to styling

* Run formatter

* send an empty message with new signin channels for event categories

* pass event role mention to success string format

* send empty string in reaction role menu creator

* fix targetMember check in pingme role creation menu voting

* only check targetMember in inline menus if one is set

* add debug printing for reactionClosesMenu

* more debug printing

* stop overwriting emoji with None

* Add EsportsBot.multiWaitFor. Decrement vote counts on vote removal. Account for message deletion.

* correct pingme command signatures

* show member counts in pingme_list

* fix command prefix not being fetched from env vars

* help string for pingme command category

* remove command names from usage strings

* add docs for pingme commands and polls to the project readme

* remove args from pingme remove-role-emoji docs

* Fixed bugs relating to MusicCog (#133)

* Minimum versions in README (#91)

* Set docker image version tags

* Add minimum versions as badges to README

* Reformat README badges

* Add user strings to voice master cog (#84)

Co-authored-by: Ryth-cs <[email protected]>

* Add strIsUserMention and strIsChannelMention functions (#81)

* Add strIsUserMention and strIsChannelMention functions

* Use regexes for isXMention functions

* Migration to SQLAlchemy for DB communication (#137)

* Revert "Migration to SQLAlchemy for DB communication (#137)" (#138)

This reverts commit 567204a.

* Migration to SQLAlchemy for DB communication (#139)

* README Standardisation (#135)

* Update .gitignore

* updated README

* created template secrets file

* Added COMMAND_PREFIX and UNKNOWN_COMMAND_EMOJI variables with default values

* Moved template secrets file out of src to root

* Added Twitch Credential instructions

* Changed Ensure to Be Sure in set up instructions

* Specified Python version in non-docker instructions

* Fixed Unknown Command emoji default and README errors

* Default emoji is now the correct string

* README now instructs env file to be called .env instead of secrets.env as secrets.env is not auto-detected by dotenv

* Updated gitignore to exclude all env files

* Updated referenced path to user_strings.toml

* Added new DB vars to template

* Altered to create DB on startup if it doesn't exist (#142)

* Fix user_strings.toml path to not reference top-level directory (#143)

* Fix user_strings.toml path to not reference top-level directory

* Amend README to use directories and environment file correctly

* Revert "Amend README to use directories and environment file correctly"

This reverts commit 914afb9.

* Undo all auto-formatting

* Add explicit path loading to load_dotenv

* Added help strings to commands that lacked them (#147)

* Add dependency on PG for PGAdmin, alphabetically order docker-compose attrs, use apt-get in dockerfile (#141)

* Implemented posting Twitter Status updates to Discord Channels (#94)

* Implemented TwitterCog using Tweepy and Discord Webhooks

* Changed command names to be more specific to Twitter

* Removed check for quoted retweets

* Added command to get list of currently tracked twitter accounts

* Updated README

* Updated README

* Update requirements.txt

* Removed snscrape dependancy as it was used for the Twitter integration but is no longer needed.

* Fix/proper cog modularity (#148)

* Minor code cleanup

* Moved event code for DefaultRoleCog.py inside of cog

* Moved event code for VoicemasterCog.py inside of cog

* Moved event code for MusicCog.py inside of cog

* Fixed missing parenthesis on decorators

* Implemented newer ReactableMenus for EventCategoriesCog

* Updated README to reflect updated functionality

* Implemented load_dict method

* Applied YAPF formatting

* Fixed bugs regarding permissions for the channels created for the event

* Removed development code

* Created command group for events

* Updated README to reflect new command group

* Fixed usage strings for EventCategoriesCog commands

* Changed how emojis and descriptions are generated in reaction menus

* Added a confirmation menu when deleting an event with EventCategoriesCog

* Implemented __dict__ for ReactableMenu to ensure it is serializable without having to call to_dict()

* Included poll end time in its to_dict() function and fixed some bugs regarding emojis

* Refactored PingablesCog to PingableRolesCog and implemented create-role command with new reaction menus

* Removed minimum poll length requirement from PingableRolesCog

* Implemented __dict__ method for MultiEmoji

* Implemented updating pingable settings with commands

* Added basic logging to main functions

* Removed some TODOs

* Removed old client events from bot.py

* Added the ability to convert roles to and from pingable ones

* Added role ping cooldown edit command so roles can have individual cooldowns

* Moved settings commands to new subcommand

* Added command to update the reactable emoji for a pingable role

* Added command to enable/disable pingable roles and their reaction menus

* Completed TODOs

* Updated README and aligned command help info with the updated README

* Fixed an issue where arguments in angled brackets were not appearing in README

* Cleaned up old code from client.py and ran YAPF style formatter

* Fixed a bug when the user would not receive confirmation that the role had been deleted

* Moved monthly ping report to PingableRolesCog

* Fixed an issue where animated emojis would not be loaded correctly from DB

* Created new cog for managing role reaction messages

* Updated README to reflect new implementation

* Restored missing on_guild_join event handler

* Created VotingCog.py to implement user polls with new reaction menus

* Implemented new DB interface for TwitterCog

* Removed relative imports

* Applied YAPF formatting

* Updated secrets template to include env vars for new cogs

* Updated bot.py launch to add cogs based on new env vars

* Added ability for developers to load, unload, reload cogs with commands

* Fixed a bug where all commands would be deleted by MusicCog on_message function

* Moved MusicCog commands to their own sub group

* Moved TwitterCog commands to their own sub group

* Added backup for allowing admins to manage loaded cogs when no dev IDs are given

* Removed old reaction menu implementations

* Stop the AdminCog from being unloaded

* Added docstring to EventCategoriesCog

* Added docstring to PingableRolesCog

* Fixed a bug that allowed users to set the poll emoji to the threshold emoji

* Fixed a bug that allowed users to set the poll emoji to the threshold emoji

* Added docstring to VotingCog

* Squashed commit of the following:

commit 987ba78
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 16:41:24 2021 +0200

    Updated README to reflect new command usages

commit 4086d76
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 15:53:31 2021 +0200

    Added command to unlink a channel from being a music channel

commit 4c7243a
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 14:21:27 2021 +0200

    Added volume to the preview embed

commit 6103f8a
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 14:15:09 2021 +0200

    Added doc-strings to all functions

commit 5ca41cb
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 13:11:40 2021 +0200

    Bot will now leave empty voice channels

commit 14dcabf
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 13:03:53 2021 +0200

    Applied YAPF formatting

commit 90f519c
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 13:03:15 2021 +0200

    Fixed awaiting non-async method in skip song command

commit be927ac
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 13:02:25 2021 +0200

    Fixed a bug that caused volume level to not be saved between songs

commit ad54045
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 12:56:13 2021 +0200

    Fixed a bug that caused songs to not be moved if there were only 2 songs and a song was being moved back in the queue

commit 9b36721
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 12:33:49 2021 +0200

    Added move song command

commit 274d347
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:53:43 2021 +0200

    Added get queue command

commit 362dee0
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:43:59 2021 +0200

    Added confirmation message for remove song command

commit b08a845
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:43:27 2021 +0200

    Fixed a bug where the bot would not start playing if it was not already in a channel with the play song command

commit 9290fdd
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:33:18 2021 +0200

    Fixed an issue that caused a non-critical error when kicking the bot

commit d3b575c
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:31:36 2021 +0200

    Added remove song command

commit c0b1606
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:12:27 2021 +0200

    Added pause song command

commit 803134e
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:08:40 2021 +0200

    Added resume song command

commit cc0ff12
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:52:03 2021 +0200

    Added clear queue command

commit 42ebade
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:51:30 2021 +0200

    Added checking for bot activity to commands

commit d817eef
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:42:16 2021 +0200

    Added shuffle command

commit 3124086
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:38:17 2021 +0200

    Added volume command

commit cffd781
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:37:41 2021 +0200

    Added skip command

commit 7e7762f
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:05:57 2021 +0200

    Tweaked how string query thumbnails and titles were determined

commit e0b7339
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 09:59:20 2021 +0200

    Added try/except to on_message_handle to ensure the music channel does not get clogged when there is an error

commit bd54225
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 09:40:38 2021 +0200

    Fixed a bug where the last song in the queue would be played instead of the first

commit 044dfef
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 09:40:03 2021 +0200

    Implemented basic playback features and queuing features

commit 0ab8da2
Author: Fluxticks <[email protected]>
Date:   Mon Jul 26 17:40:20 2021 +0200

    Implemented base functionality for setting up music channels and bot voice state changes

* Standardised ready and loaded logging messages

* Fixed an issue when the current guild was not in Guild_info table when trying to set/get/remove the logging channel

* Changed dictionary accessor method to fully utilise flexibility of defaultdict

* Fixed an issue when using defaultrole commands when the guild did not exist in the Guild_info DB table

* EventCategoriesCog can now use the defaultrole of the server

* Fixed an error caused when the user was not in any voice channel

* Fixed an error caused when the bot did not have move members permission in a guild

* Fixed an error caused when a guild did not exist in the Pingable_settings table

* Added response message when default settings applied with command

* Fixed an issue where a poll end time would be reset when loaded from DB and when polls end, reacted users get the given pingable role

* Turned checking of guild membership in pingable settings DB table into function

* Fixed an issue when a pingable role was deleted while the bot was down

* Fixed an issue where the bot was using an old instance of the message causing reactions to not be removed/added correctly

* Fixed incorrect key for formatting user string

* Fixed string typos

* Fixed incorrect conversion from TextChannel to str

* Fixed an issue where new music channels weren't added to the Cog dictionary

* Ensured the preview and queue messages are updated when the bot leaves

* Fixed wrong index sent as confirmation music

* Made list queue command list entire queue instead of the truncated song list

* Added `quiet` option to youtube_dl opts to stop unwanted output

* Added `nowarning` option to youtube_dl opts to stop unwanted output

* Bot will self deafen upon joining the channel

* Removed DEV IDS from template

* Env var cleanup (#152)

* Have docker postgres get configuration from secrets file

* Fix secrets file git handling

* Move from `send_to_log_channel` to `client.adminLog` (#153)

* Add adminLog usage to voice master cog

* Explicit guildID passing

* Correct adminLog invocation

* Add to log, admin and default role cogs, move changes learned from those back to voicemaster

* Remove send_to_log_channel function

* Implemented posting Twitch Live notifications to Discord Channels  (#140)

* Implemented verification for POST requests to ensure the message is from Twitch

* Added basic logging to TwitchListener

* Added TwitchApp class to handle any data the Request handler needs to keep between requests

* Added docstring to existing methods

* Implemented send_webhook so that notifications get sent to their respective channels.

* updated requirements.txt

* updated generate_schema.py

* updated gitignore

* Implemented the TwitchCog with hook creation and account adding

* Added removetwitch and listtwitch commands

* Added remove twitch hook command

* Added docstrings to command methods

* Changed CALLBACK_URL to use env var

* addtwitch channel now accepts a string for the custom message and also supports sending a twitch url as the channel

* Added user facing strings

* Added command to set custom message

* Added command to get custom message

* Applied YAPF formatter

* Added check to not allow webhook names to be the webhook prefix

* Moved all commands to be subcommand of `twitch`

* Changed module name to reflect new module name in bot start

* Ensured consistency of use of the word channel over account when refering to a Twitch channel

* Added help and usage strings to commands

* Fixed an bug that caused an error when given a Twitch channel that doesn't exists

* Made channel names in user strings be inline code blocks for easier reading

* Fixed missing turning list into a dict for channel info

* Added new string for channels that are not tracked but are real channels

* Added check for empty environment variables

* Updated some logging lines

* Applied YAPF formatter

* Fixed typos

* Added module docstring

* Notifications now include the custom 'go live' message

* Added preview command to see what a notification for a channel will look like

* Applied YAPF formatting

* Deleted TwitchIntegrationCog

* Implemented new DB accessor

* Moved load_discord_hooks to discordUtil

* Made reusable functions for loading/saving bearer tokens

* Updated load_tracked_channels docstring to be more consistent.

* Fixed some booleans to be simpler

* Moved more functions to discordUtil for shared access

* Made global twitch api strings

* Fixed an issue where PyCharm doesn't recognise application as the correct class

* Added filter to for to avoid needing to check for membership

* Exposed port 443

* Fixed an issue where if the twitch temp file did not exist it would fail to start

* Fixed an issue caused by changing of program starting dir

* Changed createhook command to require a name and channel as parameters

* Updated how notifications are posted for channels so that a channel now is tied to a specific webhook instead of the server as a whole.

- This change was made with the Esports Hub in mind where different games may not care about other games' streams.

* Updated README to include the changes to Webhooks and the tracking of channels

* Revert "Implemented posting Twitch Live notifications to Discord Channels  (#140)" (#155)

This reverts commit 0ddeeb8.

* Altered logging to use the user_strings file (#166)

* Fix incorrect error causing quotes catching to fail silently (#167)

* Reopening this PR for merging TwitchCog into develop (#156)

* Implemented verification for POST requests to ensure the message is from Twitch

* Added basic logging to TwitchListener

* Added TwitchApp class to handle any data the Request handler needs to keep between requests

* Added docstring to existing methods

* Implemented send_webhook so that notifications get sent to their respective channels.

* updated requirements.txt

* updated generate_schema.py

* updated gitignore

* Implemented the TwitchCog with hook creation and account adding

* Added removetwitch and listtwitch commands

* Added remove twitch hook command

* Added docstrings to command methods

* Changed CALLBACK_URL to use env var

* addtwitch channel now accepts a string for the custom message and also supports sending a twitch url as the channel

* Added user facing strings

* Added command to set custom message

* Added command to get custom message

* Applied YAPF formatter

* Added check to not allow webhook names to be the webhook prefix

* Moved all commands to be subcommand of `twitch`

* Changed module name to reflect new module name in bot start

* Ensured consistency of use of the word channel over account when refering to a Twitch channel

* Added help and usage strings to commands

* Fixed an bug that caused an error when given a Twitch channel that doesn't exists

* Made channel names in user strings be inline code blocks for easier reading

* Fixed missing turning list into a dict for channel info

* Added new string for channels that are not tracked but are real channels

* Added check for empty environment variables

* Updated some logging lines

* Applied YAPF formatter

* Fixed typos

* Added module docstring

* Notifications now include the custom 'go live' message

* Added preview command to see what a notification for a channel will look like

* Applied YAPF formatting

* Deleted TwitchIntegrationCog

* Implemented new DB accessor

* Moved load_discord_hooks to discordUtil

* Made reusable functions for loading/saving bearer tokens

* Updated load_tracked_channels docstring to be more consistent.

* Fixed some booleans to be simpler

* Moved more functions to discordUtil for shared access

* Made global twitch api strings

* Fixed an issue where PyCharm doesn't recognise application as the correct class

* Added filter to for to avoid needing to check for membership

* Exposed port 443

* Fixed an issue where if the twitch temp file did not exist it would fail to start

* Fixed an issue caused by changing of program starting dir

* Changed createhook command to require a name and channel as parameters

* Updated how notifications are posted for channels so that a channel now is tied to a specific webhook instead of the server as a whole.

- This change was made with the Esports Hub in mind where different games may not care about other games' streams.

* Updated README to include the changes to Webhooks and the tracking of channels

* Squashed commit of the following:

commit 277df81
Author: Fluxticks <[email protected]>
Date:   Thu Aug 19 17:46:18 2021 +0100

    Revert "Implemented posting Twitch Live notifications to Discord Channels  (#140)" (#155)

    This reverts commit 0ddeeb8.

commit 0ddeeb8
Author: Fluxticks <[email protected]>
Date:   Thu Aug 19 16:18:17 2021 +0100

    Implemented posting Twitch Live notifications to Discord Channels  (#140)

    * Implemented verification for POST requests to ensure the message is from Twitch

    * Added basic logging to TwitchListener

    * Added TwitchApp class to handle any data the Request handler needs to keep between requests

    * Added docstring to existing methods

    * Implemented send_webhook so that notifications get sent to their respective channels.

    * updated requirements.txt

    * updated generate_schema.py

    * updated gitignore

    * Implemented the TwitchCog with hook creation and account adding

    * Added removetwitch and listtwitch commands

    * Added remove twitch hook command

    * Added docstrings to command methods

    * Changed CALLBACK_URL to use env var

    * addtwitch channel now accepts a string for the custom message and also supports sending a twitch url as the channel

    * Added user facing strings

    * Added command to set custom message

    * Added command to get custom message

    * Applied YAPF formatter

    * Added check to not allow webhook names to be the webhook prefix

    * Moved all commands to be subcommand of `twitch`

    * Changed module name to reflect new module name in bot start

    * Ensured consistency of use of the word channel over account when refering to a Twitch channel

    * Added help and usage strings to commands

    * Fixed an bug that caused an error when given a Twitch channel that doesn't exists

    * Made channel names in user strings be inline code blocks for easier reading

    * Fixed missing turning list into a dict for channel info

    * Added new string for channels that are not tracked but are real channels

    * Added check for empty environment variables

    * Updated some logging lines

    * Applied YAPF formatter

    * Fixed typos

    * Added module docstring

    * Notifications now include the custom 'go live' message

    * Added preview command to see what a notification for a channel will look like

    * Applied YAPF formatting

    * Deleted TwitchIntegrationCog

    * Implemented new DB accessor

    * Moved load_discord_hooks to discordUtil

    * Made reusable functions for loading/saving bearer tokens

    * Updated load_tracked_channels docstring to be more consistent.

    * Fixed some booleans to be simpler

    * Moved more functions to discordUtil for shared access

    * Made global twitch api strings

    * Fixed an issue where PyCharm doesn't recognise application as the correct class

    * Added filter to for to avoid needing to check for membership

    * Exposed port 443

    * Fixed an issue where if the twitch temp file did not exist it would fail to start

    * Fixed an issue caused by changing of program starting dir

    * Changed createhook command to require a name and channel as parameters

    * Updated how notifications are posted for channels so that a channel now is tied to a specific webhook instead of the server as a whole.

    - This change was made with the Esports Hub in mind where different games may not care about other games' streams.

    * Updated README to include the changes to Webhooks and the tracking of channels

commit fa9c188
Author: Laura Demkowicz-Duffy <[email protected]>
Date:   Thu Aug 19 15:17:49 2021 +0000

    Move from `send_to_log_channel` to `client.adminLog` (#153)

    * Add adminLog usage to voice master cog

    * Explicit guildID passing

    * Correct adminLog invocation

    * Add to log, admin and default role cogs, move changes learned from those back to voicemaster

    * Remove send_to_log_channel function

commit 6f09ad3
Author: Laura Demkowicz-Duffy <[email protected]>
Date:   Sun Aug 8 00:37:17 2021 +0000

    Env var cleanup (#152)

    * Have docker postgres get configuration from secrets file

    * Fix secrets file git handling

* Updated user_strings.toml manually as the merge wanted to overwrite the develop branch entirely

* Group music commands together (#173)

* Group music commands together

* Add invoke_without_command to command groups so they show up in the help command

* Rename music_channel group to music_channel_group for better verbosity

* Remove invoke_without_command

* Note command changes in README

* Add `version` command (#177)

* Add version command

* Fix various problems, ignore version file

* Get version string from file in AdminCog constructor

* Cleanup README formatting (#179)

* Run formatter over README

* Add newlines after titles, between text and bullet points, use 1. for all numbered lists

* Remove spaces from first list

* Indent code in first list

* Use correct numbering on first list

* Use numbering in lists with code

* Fixed an issue where all messages would be deleted when the music channel is set (#181)

* Added function to delete missing roles upon startup (#182)

* Moved changes from old develop format to the new one (#151)

* Moved changes from old develop format to the new one

* Resolved conflicts

* Hotfixes from Testing Session (#183)

* Remove reference to deprecated function

* Move music channel management commands to their own group to avoid falling into channel checking problems

* Fixed an issue caused by moving default_role_id to its own table from Guild_info

* Fixed an issue where a VM child would not be created if the Parent VC was joined from another VM Child

* Correct musicchannel command in README

* Fixed an issue where youtu.be links would not work

* Fixed an issue where songs would not play when supplying the URL directly

* Added missing doc strings for EventCategoriesCog functions

Co-authored-by: Laura Demkowicz-Duffy <[email protected]>
Co-authored-by: Fluxticks <[email protected]>

* Remove .env workaround as it didn't work on all systems (#189)

* Fixed missing field in DB Row creation for pingable settings (#190)

* Altered environment variables as to remove duplication and resolve copying issues (#191)

* Changed path to .cert and .key files to use env vars (#192)

* Changed path to .cert and .key files to use env vars

* Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

* Moved the cert and key files into src  (#193)

* Changed path to .cert and .key files to use env vars

* Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

* Fixes issues caused when running in docker

Changed the directory of the ssl certificates as ../ did not work as intended when running in docker.

* 1.1 features (#196)

* Custom help command implementation  (#187)

* Added a custom handler for the help command

* Added docstrings and commenting

* Moved MusicCog help strings into user_strings.toml

* Added support for user_string defined help strings as well as still supporting function defined help strings

* Added missing help string for musicadmin command group

* Replace hyphens with underscores for the help string dict key

* Fixed angled brackets not being escaped in README

* Moved PingableRolesCog help strings into user_strings.toml

* Added hints for pingme command groups

* Changed VoicemasterCog terminology to use parent/child terminology over master/slave

* Fixed missing newlines for list options in Voicemaster README section

* Moved VoicemasterCog help strings into user_strings.toml

* Renamed clear_messages command

* Added missing README documentation for the version command

* Fixed incorrect command name in VoicemasterCog

* Fixed an issue where checks for commands were not properly restored after the help command was used.

* Added support for hiding hidden commands from non-administrators

* Made dev-only commands hidden

* Moved help strings for AdminCog.py to user_strings.toml

* Fixed missing newlines for the log channel section in the README

* Moved help strings for LogChannelCog into user_strings.toml

* Moved help strings for TwitterCog into user_strings.toml

* Fixed missing newlines for Default Roles section in README

* Moved help strings for DefaultRoleCog to user_strings.toml

* Moved help strings for EventCategoriesCog to user_strings.toml

* Moved help strings for RoleReactCog to user_strings.toml

* Moved help strings for VotingCog to user_strings.toml

* Fixed missing await in send_cog_help

* Moved help strings for TwitchCog to user_strings.toml

* Fixed outdated README for Twitch Cog section

* Command to easily set Game Rep permissions (#194)

* Added a command to set rep roles automatically given a list of channel IDs

* Changed set-rep command to use *args

* Changed permission overwrite to use discord.PermissionOverwrite

* Fixed issues caused by missing permissions

* Standardised and cleaned up codebase (#195)

* Removed unused assignments and fixed lines over 127 chars

* Removed unused code and imports

* Fixed case conventions

- Variables and functions are all snake_case
- Classes are all CamelCase

* Chane DBGateway functions to be static

* Fixed typos in DBGateway

* Fixed flake8 errors

* Added missing docstrings to all cogs and most functions

* Added final docstrings for remaining classes

* Squashed commit of the following:

commit bd8f51d
Author: Fluxticks <[email protected]>
Date:   Wed Sep 15 14:11:23 2021 +0100

    Moved the cert and key files into src  (#193)

    * Changed path to .cert and .key files to use env vars

    * Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

    * Fixes issues caused when running in docker

    Changed the directory of the ssl certificates as ../ did not work as intended when running in docker.

commit dbad99f
Author: Fluxticks <[email protected]>
Date:   Wed Sep 8 15:38:59 2021 +0100

    Changed path to .cert and .key files to use env vars (#192)

    * Changed path to .cert and .key files to use env vars

    * Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

commit f64d89b
Author: Ryth-cs <[email protected]>
Date:   Wed Sep 8 12:42:01 2021 +0100

    Altered environment variables as to remove duplication and resolve copying issues (#191)

commit 2bb96bc
Author: Fluxticks <[email protected]>
Date:   Tue Sep 7 15:59:54 2021 +0100

    Fixed missing field in DB Row creation for pingable settings (#190)

commit a958a24
Author: Laura Demkowicz-Duffy <[email protected]>
Date:   Wed Sep 1 01:44:26 2021 +0000

    Remove .env workaround as it didn't work on all systems (#189)

* Fixed issues raised during user testing for pingme roles (#197)

* Pingable Roles polls now show vote threshold

* Added a check and response for Pingable Roles for presence of default settings

* Changed admin_log and updated any usages of admin_log (#198)

* Fixed an issue to do with the interaction of DefaultRoles and Discord Rules

* Fixed missing logging user_string for voicemaster

* Fixed old admin_log implementations missed in previous update

Co-authored-by: Laura Demkowicz-Duffy <[email protected]>
Co-authored-by: Trimatix <[email protected]>
Co-authored-by: Ryth-cs <[email protected]>
Co-authored-by: Laura Demkowicz-Duffy <[email protected]>
Fluxticks added a commit that referenced this pull request Feb 1, 2022
* Add yapf style file (#74)

* Add yapf style file with 'sensible' defaults

* Move styling to setup.cfg and add sections for other tools

* Add git attributes file for line ending normalisation

* Add mypy configuration

* Remove error context from mypy

* Add dict entry option to styling

* Fix styling since merge funkiness removed the last one (#119)

* Add yapf style file with 'sensible' defaults

* Move styling to setup.cfg and add sections for other tools

* Add git attributes file for line ending normalisation

* Add mypy configuration

* Remove error context from mypy

* Add dict entry option to styling

* Run formatter

* send an empty message with new signin channels for event categories

* pass event role mention to success string format

* send empty string in reaction role menu creator

* fix targetMember check in pingme role creation menu voting

* only check targetMember in inline menus if one is set

* add debug printing for reactionClosesMenu

* more debug printing

* stop overwriting emoji with None

* Add EsportsBot.multiWaitFor. Decrement vote counts on vote removal. Account for message deletion.

* correct pingme command signatures

* show member counts in pingme_list

* fix command prefix not being fetched from env vars

* help string for pingme command category

* remove command names from usage strings

* add docs for pingme commands and polls to the project readme

* remove args from pingme remove-role-emoji docs

* Fixed bugs relating to MusicCog (#133)

* Minimum versions in README (#91)

* Set docker image version tags

* Add minimum versions as badges to README

* Reformat README badges

* Add user strings to voice master cog (#84)

Co-authored-by: Ryth-cs <[email protected]>

* Add strIsUserMention and strIsChannelMention functions (#81)

* Add strIsUserMention and strIsChannelMention functions

* Use regexes for isXMention functions

* Migration to SQLAlchemy for DB communication (#137)

* Revert "Migration to SQLAlchemy for DB communication (#137)" (#138)

This reverts commit 567204a.

* Migration to SQLAlchemy for DB communication (#139)

* README Standardisation (#135)

* Update .gitignore

* updated README

* created template secrets file

* Added COMMAND_PREFIX and UNKNOWN_COMMAND_EMOJI variables with default values

* Moved template secrets file out of src to root

* Added Twitch Credential instructions

* Changed Ensure to Be Sure in set up instructions

* Specified Python version in non-docker instructions

* Fixed Unknown Command emoji default and README errors

* Default emoji is now the correct string

* README now instructs env file to be called .env instead of secrets.env as secrets.env is not auto-detected by dotenv

* Updated gitignore to exclude all env files

* Updated referenced path to user_strings.toml

* Added new DB vars to template

* Altered to create DB on startup if it doesn't exist (#142)

* Fix user_strings.toml path to not reference top-level directory (#143)

* Fix user_strings.toml path to not reference top-level directory

* Amend README to use directories and environment file correctly

* Revert "Amend README to use directories and environment file correctly"

This reverts commit 914afb9.

* Undo all auto-formatting

* Add explicit path loading to load_dotenv

* Added help strings to commands that lacked them (#147)

* Add dependency on PG for PGAdmin, alphabetically order docker-compose attrs, use apt-get in dockerfile (#141)

* Implemented posting Twitter Status updates to Discord Channels (#94)

* Implemented TwitterCog using Tweepy and Discord Webhooks

* Changed command names to be more specific to Twitter

* Removed check for quoted retweets

* Added command to get list of currently tracked twitter accounts

* Updated README

* Updated README

* Update requirements.txt

* Removed snscrape dependancy as it was used for the Twitter integration but is no longer needed.

* Fix/proper cog modularity (#148)

* Minor code cleanup

* Moved event code for DefaultRoleCog.py inside of cog

* Moved event code for VoicemasterCog.py inside of cog

* Moved event code for MusicCog.py inside of cog

* Fixed missing parenthesis on decorators

* Implemented newer ReactableMenus for EventCategoriesCog

* Updated README to reflect updated functionality

* Implemented load_dict method

* Applied YAPF formatting

* Fixed bugs regarding permissions for the channels created for the event

* Removed development code

* Created command group for events

* Updated README to reflect new command group

* Fixed usage strings for EventCategoriesCog commands

* Changed how emojis and descriptions are generated in reaction menus

* Added a confirmation menu when deleting an event with EventCategoriesCog

* Implemented __dict__ for ReactableMenu to ensure it is serializable without having to call to_dict()

* Included poll end time in its to_dict() function and fixed some bugs regarding emojis

* Refactored PingablesCog to PingableRolesCog and implemented create-role command with new reaction menus

* Removed minimum poll length requirement from PingableRolesCog

* Implemented __dict__ method for MultiEmoji

* Implemented updating pingable settings with commands

* Added basic logging to main functions

* Removed some TODOs

* Removed old client events from bot.py

* Added the ability to convert roles to and from pingable ones

* Added role ping cooldown edit command so roles can have individual cooldowns

* Moved settings commands to new subcommand

* Added command to update the reactable emoji for a pingable role

* Added command to enable/disable pingable roles and their reaction menus

* Completed TODOs

* Updated README and aligned command help info with the updated README

* Fixed an issue where arguments in angled brackets were not appearing in README

* Cleaned up old code from client.py and ran YAPF style formatter

* Fixed a bug when the user would not receive confirmation that the role had been deleted

* Moved monthly ping report to PingableRolesCog

* Fixed an issue where animated emojis would not be loaded correctly from DB

* Created new cog for managing role reaction messages

* Updated README to reflect new implementation

* Restored missing on_guild_join event handler

* Created VotingCog.py to implement user polls with new reaction menus

* Implemented new DB interface for TwitterCog

* Removed relative imports

* Applied YAPF formatting

* Updated secrets template to include env vars for new cogs

* Updated bot.py launch to add cogs based on new env vars

* Added ability for developers to load, unload, reload cogs with commands

* Fixed a bug where all commands would be deleted by MusicCog on_message function

* Moved MusicCog commands to their own sub group

* Moved TwitterCog commands to their own sub group

* Added backup for allowing admins to manage loaded cogs when no dev IDs are given

* Removed old reaction menu implementations

* Stop the AdminCog from being unloaded

* Added docstring to EventCategoriesCog

* Added docstring to PingableRolesCog

* Fixed a bug that allowed users to set the poll emoji to the threshold emoji

* Fixed a bug that allowed users to set the poll emoji to the threshold emoji

* Added docstring to VotingCog

* Squashed commit of the following:

commit 987ba78
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 16:41:24 2021 +0200

    Updated README to reflect new command usages

commit 4086d76
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 15:53:31 2021 +0200

    Added command to unlink a channel from being a music channel

commit 4c7243a
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 14:21:27 2021 +0200

    Added volume to the preview embed

commit 6103f8a
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 14:15:09 2021 +0200

    Added doc-strings to all functions

commit 5ca41cb
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 13:11:40 2021 +0200

    Bot will now leave empty voice channels

commit 14dcabf
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 13:03:53 2021 +0200

    Applied YAPF formatting

commit 90f519c
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 13:03:15 2021 +0200

    Fixed awaiting non-async method in skip song command

commit be927ac
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 13:02:25 2021 +0200

    Fixed a bug that caused volume level to not be saved between songs

commit ad54045
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 12:56:13 2021 +0200

    Fixed a bug that caused songs to not be moved if there were only 2 songs and a song was being moved back in the queue

commit 9b36721
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 12:33:49 2021 +0200

    Added move song command

commit 274d347
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:53:43 2021 +0200

    Added get queue command

commit 362dee0
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:43:59 2021 +0200

    Added confirmation message for remove song command

commit b08a845
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:43:27 2021 +0200

    Fixed a bug where the bot would not start playing if it was not already in a channel with the play song command

commit 9290fdd
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:33:18 2021 +0200

    Fixed an issue that caused a non-critical error when kicking the bot

commit d3b575c
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:31:36 2021 +0200

    Added remove song command

commit c0b1606
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:12:27 2021 +0200

    Added pause song command

commit 803134e
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 11:08:40 2021 +0200

    Added resume song command

commit cc0ff12
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:52:03 2021 +0200

    Added clear queue command

commit 42ebade
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:51:30 2021 +0200

    Added checking for bot activity to commands

commit d817eef
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:42:16 2021 +0200

    Added shuffle command

commit 3124086
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:38:17 2021 +0200

    Added volume command

commit cffd781
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:37:41 2021 +0200

    Added skip command

commit 7e7762f
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 10:05:57 2021 +0200

    Tweaked how string query thumbnails and titles were determined

commit e0b7339
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 09:59:20 2021 +0200

    Added try/except to on_message_handle to ensure the music channel does not get clogged when there is an error

commit bd54225
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 09:40:38 2021 +0200

    Fixed a bug where the last song in the queue would be played instead of the first

commit 044dfef
Author: Fluxticks <[email protected]>
Date:   Tue Jul 27 09:40:03 2021 +0200

    Implemented basic playback features and queuing features

commit 0ab8da2
Author: Fluxticks <[email protected]>
Date:   Mon Jul 26 17:40:20 2021 +0200

    Implemented base functionality for setting up music channels and bot voice state changes

* Standardised ready and loaded logging messages

* Fixed an issue when the current guild was not in Guild_info table when trying to set/get/remove the logging channel

* Changed dictionary accessor method to fully utilise flexibility of defaultdict

* Fixed an issue when using defaultrole commands when the guild did not exist in the Guild_info DB table

* EventCategoriesCog can now use the defaultrole of the server

* Fixed an error caused when the user was not in any voice channel

* Fixed an error caused when the bot did not have move members permission in a guild

* Fixed an error caused when a guild did not exist in the Pingable_settings table

* Added response message when default settings applied with command

* Fixed an issue where a poll end time would be reset when loaded from DB and when polls end, reacted users get the given pingable role

* Turned checking of guild membership in pingable settings DB table into function

* Fixed an issue when a pingable role was deleted while the bot was down

* Fixed an issue where the bot was using an old instance of the message causing reactions to not be removed/added correctly

* Fixed incorrect key for formatting user string

* Fixed string typos

* Fixed incorrect conversion from TextChannel to str

* Fixed an issue where new music channels weren't added to the Cog dictionary

* Ensured the preview and queue messages are updated when the bot leaves

* Fixed wrong index sent as confirmation music

* Made list queue command list entire queue instead of the truncated song list

* Added `quiet` option to youtube_dl opts to stop unwanted output

* Added `nowarning` option to youtube_dl opts to stop unwanted output

* Bot will self deafen upon joining the channel

* Removed DEV IDS from template

* Env var cleanup (#152)

* Have docker postgres get configuration from secrets file

* Fix secrets file git handling

* Move from `send_to_log_channel` to `client.adminLog` (#153)

* Add adminLog usage to voice master cog

* Explicit guildID passing

* Correct adminLog invocation

* Add to log, admin and default role cogs, move changes learned from those back to voicemaster

* Remove send_to_log_channel function

* Implemented posting Twitch Live notifications to Discord Channels  (#140)

* Implemented verification for POST requests to ensure the message is from Twitch

* Added basic logging to TwitchListener

* Added TwitchApp class to handle any data the Request handler needs to keep between requests

* Added docstring to existing methods

* Implemented send_webhook so that notifications get sent to their respective channels.

* updated requirements.txt

* updated generate_schema.py

* updated gitignore

* Implemented the TwitchCog with hook creation and account adding

* Added removetwitch and listtwitch commands

* Added remove twitch hook command

* Added docstrings to command methods

* Changed CALLBACK_URL to use env var

* addtwitch channel now accepts a string for the custom message and also supports sending a twitch url as the channel

* Added user facing strings

* Added command to set custom message

* Added command to get custom message

* Applied YAPF formatter

* Added check to not allow webhook names to be the webhook prefix

* Moved all commands to be subcommand of `twitch`

* Changed module name to reflect new module name in bot start

* Ensured consistency of use of the word channel over account when refering to a Twitch channel

* Added help and usage strings to commands

* Fixed an bug that caused an error when given a Twitch channel that doesn't exists

* Made channel names in user strings be inline code blocks for easier reading

* Fixed missing turning list into a dict for channel info

* Added new string for channels that are not tracked but are real channels

* Added check for empty environment variables

* Updated some logging lines

* Applied YAPF formatter

* Fixed typos

* Added module docstring

* Notifications now include the custom 'go live' message

* Added preview command to see what a notification for a channel will look like

* Applied YAPF formatting

* Deleted TwitchIntegrationCog

* Implemented new DB accessor

* Moved load_discord_hooks to discordUtil

* Made reusable functions for loading/saving bearer tokens

* Updated load_tracked_channels docstring to be more consistent.

* Fixed some booleans to be simpler

* Moved more functions to discordUtil for shared access

* Made global twitch api strings

* Fixed an issue where PyCharm doesn't recognise application as the correct class

* Added filter to for to avoid needing to check for membership

* Exposed port 443

* Fixed an issue where if the twitch temp file did not exist it would fail to start

* Fixed an issue caused by changing of program starting dir

* Changed createhook command to require a name and channel as parameters

* Updated how notifications are posted for channels so that a channel now is tied to a specific webhook instead of the server as a whole.

- This change was made with the Esports Hub in mind where different games may not care about other games' streams.

* Updated README to include the changes to Webhooks and the tracking of channels

* Revert "Implemented posting Twitch Live notifications to Discord Channels  (#140)" (#155)

This reverts commit 0ddeeb8.

* Altered logging to use the user_strings file (#166)

* Fix incorrect error causing quotes catching to fail silently (#167)

* Reopening this PR for merging TwitchCog into develop (#156)

* Implemented verification for POST requests to ensure the message is from Twitch

* Added basic logging to TwitchListener

* Added TwitchApp class to handle any data the Request handler needs to keep between requests

* Added docstring to existing methods

* Implemented send_webhook so that notifications get sent to their respective channels.

* updated requirements.txt

* updated generate_schema.py

* updated gitignore

* Implemented the TwitchCog with hook creation and account adding

* Added removetwitch and listtwitch commands

* Added remove twitch hook command

* Added docstrings to command methods

* Changed CALLBACK_URL to use env var

* addtwitch channel now accepts a string for the custom message and also supports sending a twitch url as the channel

* Added user facing strings

* Added command to set custom message

* Added command to get custom message

* Applied YAPF formatter

* Added check to not allow webhook names to be the webhook prefix

* Moved all commands to be subcommand of `twitch`

* Changed module name to reflect new module name in bot start

* Ensured consistency of use of the word channel over account when refering to a Twitch channel

* Added help and usage strings to commands

* Fixed an bug that caused an error when given a Twitch channel that doesn't exists

* Made channel names in user strings be inline code blocks for easier reading

* Fixed missing turning list into a dict for channel info

* Added new string for channels that are not tracked but are real channels

* Added check for empty environment variables

* Updated some logging lines

* Applied YAPF formatter

* Fixed typos

* Added module docstring

* Notifications now include the custom 'go live' message

* Added preview command to see what a notification for a channel will look like

* Applied YAPF formatting

* Deleted TwitchIntegrationCog

* Implemented new DB accessor

* Moved load_discord_hooks to discordUtil

* Made reusable functions for loading/saving bearer tokens

* Updated load_tracked_channels docstring to be more consistent.

* Fixed some booleans to be simpler

* Moved more functions to discordUtil for shared access

* Made global twitch api strings

* Fixed an issue where PyCharm doesn't recognise application as the correct class

* Added filter to for to avoid needing to check for membership

* Exposed port 443

* Fixed an issue where if the twitch temp file did not exist it would fail to start

* Fixed an issue caused by changing of program starting dir

* Changed createhook command to require a name and channel as parameters

* Updated how notifications are posted for channels so that a channel now is tied to a specific webhook instead of the server as a whole.

- This change was made with the Esports Hub in mind where different games may not care about other games' streams.

* Updated README to include the changes to Webhooks and the tracking of channels

* Squashed commit of the following:

commit 277df81
Author: Fluxticks <[email protected]>
Date:   Thu Aug 19 17:46:18 2021 +0100

    Revert "Implemented posting Twitch Live notifications to Discord Channels  (#140)" (#155)

    This reverts commit 0ddeeb8.

commit 0ddeeb8
Author: Fluxticks <[email protected]>
Date:   Thu Aug 19 16:18:17 2021 +0100

    Implemented posting Twitch Live notifications to Discord Channels  (#140)

    * Implemented verification for POST requests to ensure the message is from Twitch

    * Added basic logging to TwitchListener

    * Added TwitchApp class to handle any data the Request handler needs to keep between requests

    * Added docstring to existing methods

    * Implemented send_webhook so that notifications get sent to their respective channels.

    * updated requirements.txt

    * updated generate_schema.py

    * updated gitignore

    * Implemented the TwitchCog with hook creation and account adding

    * Added removetwitch and listtwitch commands

    * Added remove twitch hook command

    * Added docstrings to command methods

    * Changed CALLBACK_URL to use env var

    * addtwitch channel now accepts a string for the custom message and also supports sending a twitch url as the channel

    * Added user facing strings

    * Added command to set custom message

    * Added command to get custom message

    * Applied YAPF formatter

    * Added check to not allow webhook names to be the webhook prefix

    * Moved all commands to be subcommand of `twitch`

    * Changed module name to reflect new module name in bot start

    * Ensured consistency of use of the word channel over account when refering to a Twitch channel

    * Added help and usage strings to commands

    * Fixed an bug that caused an error when given a Twitch channel that doesn't exists

    * Made channel names in user strings be inline code blocks for easier reading

    * Fixed missing turning list into a dict for channel info

    * Added new string for channels that are not tracked but are real channels

    * Added check for empty environment variables

    * Updated some logging lines

    * Applied YAPF formatter

    * Fixed typos

    * Added module docstring

    * Notifications now include the custom 'go live' message

    * Added preview command to see what a notification for a channel will look like

    * Applied YAPF formatting

    * Deleted TwitchIntegrationCog

    * Implemented new DB accessor

    * Moved load_discord_hooks to discordUtil

    * Made reusable functions for loading/saving bearer tokens

    * Updated load_tracked_channels docstring to be more consistent.

    * Fixed some booleans to be simpler

    * Moved more functions to discordUtil for shared access

    * Made global twitch api strings

    * Fixed an issue where PyCharm doesn't recognise application as the correct class

    * Added filter to for to avoid needing to check for membership

    * Exposed port 443

    * Fixed an issue where if the twitch temp file did not exist it would fail to start

    * Fixed an issue caused by changing of program starting dir

    * Changed createhook command to require a name and channel as parameters

    * Updated how notifications are posted for channels so that a channel now is tied to a specific webhook instead of the server as a whole.

    - This change was made with the Esports Hub in mind where different games may not care about other games' streams.

    * Updated README to include the changes to Webhooks and the tracking of channels

commit fa9c188
Author: Laura Demkowicz-Duffy <[email protected]>
Date:   Thu Aug 19 15:17:49 2021 +0000

    Move from `send_to_log_channel` to `client.adminLog` (#153)

    * Add adminLog usage to voice master cog

    * Explicit guildID passing

    * Correct adminLog invocation

    * Add to log, admin and default role cogs, move changes learned from those back to voicemaster

    * Remove send_to_log_channel function

commit 6f09ad3
Author: Laura Demkowicz-Duffy <[email protected]>
Date:   Sun Aug 8 00:37:17 2021 +0000

    Env var cleanup (#152)

    * Have docker postgres get configuration from secrets file

    * Fix secrets file git handling

* Updated user_strings.toml manually as the merge wanted to overwrite the develop branch entirely

* Group music commands together (#173)

* Group music commands together

* Add invoke_without_command to command groups so they show up in the help command

* Rename music_channel group to music_channel_group for better verbosity

* Remove invoke_without_command

* Note command changes in README

* Add `version` command (#177)

* Add version command

* Fix various problems, ignore version file

* Get version string from file in AdminCog constructor

* Cleanup README formatting (#179)

* Run formatter over README

* Add newlines after titles, between text and bullet points, use 1. for all numbered lists

* Remove spaces from first list

* Indent code in first list

* Use correct numbering on first list

* Use numbering in lists with code

* Fixed an issue where all messages would be deleted when the music channel is set (#181)

* Added function to delete missing roles upon startup (#182)

* Moved changes from old develop format to the new one (#151)

* Moved changes from old develop format to the new one

* Resolved conflicts

* Hotfixes from Testing Session (#183)

* Remove reference to deprecated function

* Move music channel management commands to their own group to avoid falling into channel checking problems

* Fixed an issue caused by moving default_role_id to its own table from Guild_info

* Fixed an issue where a VM child would not be created if the Parent VC was joined from another VM Child

* Correct musicchannel command in README

* Fixed an issue where youtu.be links would not work

* Fixed an issue where songs would not play when supplying the URL directly

* Added missing doc strings for EventCategoriesCog functions

Co-authored-by: Laura Demkowicz-Duffy <[email protected]>
Co-authored-by: Fluxticks <[email protected]>

* Remove .env workaround as it didn't work on all systems (#189)

* Fixed missing field in DB Row creation for pingable settings (#190)

* Altered environment variables as to remove duplication and resolve copying issues (#191)

* Changed path to .cert and .key files to use env vars (#192)

* Changed path to .cert and .key files to use env vars

* Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

* Moved the cert and key files into src  (#193)

* Changed path to .cert and .key files to use env vars

* Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

* Fixes issues caused when running in docker

Changed the directory of the ssl certificates as ../ did not work as intended when running in docker.

* 1.1 features (#196)

* Custom help command implementation  (#187)

* Added a custom handler for the help command

* Added docstrings and commenting

* Moved MusicCog help strings into user_strings.toml

* Added support for user_string defined help strings as well as still supporting function defined help strings

* Added missing help string for musicadmin command group

* Replace hyphens with underscores for the help string dict key

* Fixed angled brackets not being escaped in README

* Moved PingableRolesCog help strings into user_strings.toml

* Added hints for pingme command groups

* Changed VoicemasterCog terminology to use parent/child terminology over master/slave

* Fixed missing newlines for list options in Voicemaster README section

* Moved VoicemasterCog help strings into user_strings.toml

* Renamed clear_messages command

* Added missing README documentation for the version command

* Fixed incorrect command name in VoicemasterCog

* Fixed an issue where checks for commands were not properly restored after the help command was used.

* Added support for hiding hidden commands from non-administrators

* Made dev-only commands hidden

* Moved help strings for AdminCog.py to user_strings.toml

* Fixed missing newlines for the log channel section in the README

* Moved help strings for LogChannelCog into user_strings.toml

* Moved help strings for TwitterCog into user_strings.toml

* Fixed missing newlines for Default Roles section in README

* Moved help strings for DefaultRoleCog to user_strings.toml

* Moved help strings for EventCategoriesCog to user_strings.toml

* Moved help strings for RoleReactCog to user_strings.toml

* Moved help strings for VotingCog to user_strings.toml

* Fixed missing await in send_cog_help

* Moved help strings for TwitchCog to user_strings.toml

* Fixed outdated README for Twitch Cog section

* Command to easily set Game Rep permissions (#194)

* Added a command to set rep roles automatically given a list of channel IDs

* Changed set-rep command to use *args

* Changed permission overwrite to use discord.PermissionOverwrite

* Fixed issues caused by missing permissions

* Standardised and cleaned up codebase (#195)

* Removed unused assignments and fixed lines over 127 chars

* Removed unused code and imports

* Fixed case conventions

- Variables and functions are all snake_case
- Classes are all CamelCase

* Chane DBGateway functions to be static

* Fixed typos in DBGateway

* Fixed flake8 errors

* Added missing docstrings to all cogs and most functions

* Added final docstrings for remaining classes

* Squashed commit of the following:

commit bd8f51d
Author: Fluxticks <[email protected]>
Date:   Wed Sep 15 14:11:23 2021 +0100

    Moved the cert and key files into src  (#193)

    * Changed path to .cert and .key files to use env vars

    * Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

    * Fixes issues caused when running in docker

    Changed the directory of the ssl certificates as ../ did not work as intended when running in docker.

commit dbad99f
Author: Fluxticks <[email protected]>
Date:   Wed Sep 8 15:38:59 2021 +0100

    Changed path to .cert and .key files to use env vars (#192)

    * Changed path to .cert and .key files to use env vars

    * Changed SSL_CERT_FILE and SSL_KEY_FILE to require names of files instead of paths

commit f64d89b
Author: Ryth-cs <[email protected]>
Date:   Wed Sep 8 12:42:01 2021 +0100

    Altered environment variables as to remove duplication and resolve copying issues (#191)

commit 2bb96bc
Author: Fluxticks <[email protected]>
Date:   Tue Sep 7 15:59:54 2021 +0100

    Fixed missing field in DB Row creation for pingable settings (#190)

commit a958a24
Author: Laura Demkowicz-Duffy <[email protected]>
Date:   Wed Sep 1 01:44:26 2021 +0000

    Remove .env workaround as it didn't work on all systems (#189)

* Fixed issues raised during user testing for pingme roles (#197)

* Pingable Roles polls now show vote threshold

* Added a check and response for Pingable Roles for presence of default settings

* Changed admin_log and updated any usages of admin_log (#198)

* Fixed an issue to do with the interaction of DefaultRoles and Discord Rules

* Fixed missing logging user_string for voicemaster

* Fixed old admin_log implementations missed in previous update

Co-authored-by: Laura Demkowicz-Duffy <[email protected]>
Co-authored-by: Trimatix <[email protected]>
Co-authored-by: Ryth-cs <[email protected]>
Co-authored-by: Laura Demkowicz-Duffy <[email protected]>

Co-authored-by: Fluxticks <[email protected]>
Co-authored-by: Trimatix <[email protected]>
Co-authored-by: Ryth-cs <[email protected]>
Co-authored-by: Laura Demkowicz-Duffy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-blocking HTTP requests for Twitch cog Non-blocking HTTP requests for all cogs
2 participants