aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2021-03-14Branding: log event path alongside errorGravatar kwzrd-1/+1
Knowing which event failed would probably be quite useful.
2021-03-14Branding: avoid sending #changelog notification on resyncGravatar kwzrd-7/+12
The notification is now sent conditionally depending on whether we're entering a new event. This prevents sending a repeating notification in the case of a manual resynchronisation. A practical example of when this may trigger is when a staff member temporarily applies custom assets & then uses the sync command to reapply the current event.
2021-03-14Branding: make 'cog_unload' synchronousGravatar kwzrd-1/+1
Discord.py doesn't await the return value.
2021-03-14Branding: show success information in 'sync' responseGravatar kwzrd-6/+17
Now that the boolean flags are propagating from 'apply_asset', we can present them to the user.
2021-03-14Branding: propagate success-indicating boolean from 'apply_asset'Gravatar kwzrd-19/+43
The sync command will now be able to use present this information to the invoking user. This commit also prevents the cached banner & icon hash from being overwritten in the case of asset upload failure. As a result, the daemon will attempt to re-apply the assets the following day.
2021-03-14Branding: do not call 'rotate_icons' from rotation initGravatar kwzrd-2/+6
It makes more sense for the init and the rotation to be separate operations. In a subsequent commit, the separation of responsibility will allow the `rotate_icons` function to have a meaningful return value.
2021-03-13Branding: replace ugly lambda with 'attrgetter'Gravatar kwzrd-1/+2
2021-03-13Branding: add calendar command groupGravatar kwzrd-0/+63
2021-03-13Branding: cache all available eventsGravatar kwzrd-11/+56
This is a prequel to adding a calendar command. To avoid re-querying the branding repo on command invocation, event information will be cached whenever we make requests. The command can then simply get an up-to-date event schedule from the cache, with the option of forcing an update via the 'populate_cache_events' function. Since we cannot easily serialize entire 'Event' instances, we simply store what's needed - the event name, and its duration. The author has verified that the cache maintains order; in this case chronological order based on event start date.
2021-03-13Branding: extract duration string in helper functionGravatar kwzrd-9/+17
2021-03-13Branding: add missing early exitGravatar kwzrd-0/+1
2021-03-13Branding: lock commands to mods+ where necessaryGravatar kwzrd-1/+3
2021-03-13Branding: implement command interfaceGravatar kwzrd-1/+85
2021-03-13Branding: gate sync via helper functionGravatar kwzrd-8/+19
Sync make also be invoked with a command; avoid logic duplication.
2021-03-13Branding: implement daemonGravatar kwzrd-3/+109
2021-03-13Branding: implement internal utilityGravatar kwzrd-2/+174
This adds the core logic of branding management. In comparison with the previous version, we now maintain all state in Redis, which allows the bot to seamlessly restart without losing any information. The 'send_info_embed' function is intentionally implemented with the consideration of allowing users to invoke it on-demand. It always reads information from the cache, even if the caller could pass a 'MetaFile' instance. So while this may look needlessly indirect right now, it should begin to make sense once the command API is implemented.
2021-03-13Branding: expose SHA on remote objectsGravatar kwzrd-0/+1
2021-03-13Branding: implement asset application logicGravatar kwzrd-0/+51
2021-03-13Branding: do not require 'RemoteObject' instance to fetch fileGravatar kwzrd-5/+5
2021-03-13Branding: correctly annotate optional attributeGravatar kwzrd-1/+1
2021-03-13Branding: make event instances aware of their locationGravatar kwzrd-2/+6
This allows us to add a neat string representation.
2021-03-13Branding: add event gettersGravatar kwzrd-0/+51
These methods form the API to the repository abstraction.
2021-03-13Branding: define event construction methodologyGravatar kwzrd-0/+90
2021-03-13Branding: add HTTP fetch helper methodsGravatar kwzrd-0/+54
2021-03-13Branding: migrate constantsGravatar kwzrd-11/+11
Constants will only be used in one place and there's not enough of them to warrant a separate module.
2021-03-13Branding: initiate repository abstractionGravatar kwzrd-0/+15
2021-03-13Branding: remove current implementationGravatar kwzrd-812/+32
Since we're planning substantial changes, it will be easier to build from scratch.
2021-03-07Pipenv: add 'python-frontmatter' & re-lockGravatar kwzrd-48/+59
2021-03-06Remove trailing whitespaceGravatar Boris Muratov-1/+1
2021-03-06Filtering hotfixGravatar Boris Muratov-1/+7
Bug caused by an outdated function signature in a previous commit in the #1402 PR
2021-03-06Version lock JSON loggerGravatar Joe Banks-2/+2
2021-03-06Use JSON logging when debug mode is disabledGravatar Joe Banks-16/+33
2021-03-06Add JSON logging dependenciesGravatar Joe Banks-98/+163
2021-03-02Improved docstring for threshold command.Gravatar mbaruh-1/+8
2021-03-01Provide default cache values when syncingGravatar Boris Muratov-2/+2
2021-03-01Change to handle specifically redis errorsGravatar Boris Muratov-11/+15
The idea to ignore alerts on fake redis didn't solve the problem completely, because sometimes you'll just develop with a real redis. It also didn't solve the ping we would get on first start up. After looking into it there seems like there's no actual reason to alert on key errors, as they should only happen if the cache gets wiped for some reason, which shouldn't happen, but in which case we have bigger issues. Alerts are therefore limited to connection errors raised by redis. This additionally handles only redis errors when writing to it as well. If any other error is raised it is ok for the function to stop at that point, as all variables have already been set. The only thing which doesn't get executed is the confirmation message and logging, the lack of which is an exception message in itself.
2021-03-01Add !stban alias for !shadowtempbanGravatar Bast-1/+1
2021-03-01Add !superstar and !unsuperstar aliases for !superstarifyGravatar Bast-2/+2
2021-03-01Add alias !tban for !tempbanGravatar Bast-1/+1
2021-03-01Add alias !u for !userGravatar Bast-1/+1