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

Dpy 1.7 #39

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Dpy 1.7 #39

wants to merge 22 commits into from

Conversation

Silari
Copy link
Owner

@Silari Silari commented Apr 12, 2021

Updates bot to discord 1.7.1 and brings some improvements allowed by the new version.

Again, this won't be pushed to master until PicartoWatch itself is updated, but this is 100% useable as is.

Silari added 19 commits October 18, 2020 16:15
…he discord API.

Embed image is now removed without transforming to dict thanks to that being added to discord.py.
Changed deprecated fetch_offline_members parameter to Client to chunk_guilds_at_startup.

Fix to copy dict keys to list when iterating over SavedMSG to prevent an error from modifying the dict during iteration.
savedata no longer returns False if no data to save, instead return is optional.
loaddata type updated - only one dict.
Change to how it checks for an HTML document return - used to see if piczel is in maintenance mode.
…to internal discord.py structures to remove the role without a full Member instance.
Resolved issue where removemsg would continue the loop without removing the savedmsg if the channel or message were not found.
API down message now includes date and time of the occurrence.
…not being redirected to the class specific agetstream.
…ents.

TwitchContext now grabs the user records for any streams that come online, which is preserved across update checks. This gives us a bit more information for their embeds: user avatar and total viewers are now part of simple and default announcement embeds. Detail embeds from the detail command are unchanged.
…dMSG - this allows them to be immediately re-announced and stops the bot from trying to edit them anymore.

Removed debug embed - changes to agetstream made it nonfunctional.

Minor updates to basecontext/dbcontext comments/function descriptions for typings and such.
Corrected comment - we're based on 1.5.1 now.
detail and add commands will no longer attempt API calls if the API is down - instead returns a message stating it is down and to retry later.
Added __repr__ function to Updated class. Returns either "True" or "<#> failures".
APIs are marked as down immediately on class creation - this should be updated by the initial update before the bot is even fully ready for Discord. If not, the API is almost certainly down even if it hasn't hit the timeout yet, so commands will give the proper API down message. Loading data successfully will also mark the API as up (since it meant the API was up recently).
… Also removed some unnecessary spaces.

Updated some comments to take in account changes previously made.
Unknown commands once again prompt a message from the bot instead of being silently ignored.
…'showtime' which is a bool that determines if the message shows how long the stream has run (when an announcement is created, this is False).

Updated detailembed doc string.
Removed oldestid getting from removemsg and updatemsg, as it was no longer needed to find how long a stream has run for.
Refactored updatemsg to not create embeds until needed, though still only make once per call.
Bulk message deletion now calls the event for message deletion, to purge removed announcement messages.
…rd extra information in records when they first come online, we want to preserve all that data. The needed space is only temporary in any case, while the bot restarts, not for long term storage.
…er would always cause an AttributeError anyway.

A few function docstrings updated/corrected.
dbcontext.py now checks for the correct discord.py version. An ImportError will be raised if it is not the expected version.
Added a few items to gitignore.
…on't work in discord.py 1.5+. The manage module is currently the only user, but an important one.

We're skipping 1.5 to go to 1.6 directly anyway as Discord still hasn't turned off the endpoints used by 1.4.
Update discordversion to 1.6.0 as we're writing for 1.6 now.
…t initiated the request, unless the response may not be in the same channel (detail command is in the announcement channel regardless of where the command is performed).

Handler responses for built in contexts (except debug) are now a reply to the message the initiated the request, unless the response is not in the same channel or is in a DM.
Together, this resolves #37 unless further testing shows the command needs to be modified to prevent a mention ping.

Discord version updated to 1.7.1. No other changes were required to allow the new discord version.
Silari added 3 commits April 12, 2021 13:04
Bot replies will not trigger mentions.
Re-arrange/remove some debug commands.
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
Improvements
  
In progress
1 participant