| Commit message (Collapse) | Author | Age | Lines |
| ... | |
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Our duckpond suffered from a race condition: If multiple raw reaction
events were received in quick succession and a message had enough ducks
to take it over the duckpond threshold, the message would be relayed
multiple times.
The reason this happened is because the green checkmark emoji that stops
a message from being relayed multiple times is only added after the
message has been relayed. This means that multiple event triggers can
make it past the green checkmark check before any of them has a chance
to add a green checkmark.
The solution was to create a relay lock that needs to be acquired before
checking for the presence of a green checkmark and is only released
after adding a green checkmark. This prevents multiple events from
making it past the sentinel check.
As our Cogs are potentially initialized before the event loop is
created, the lock is load lazily when needed.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
As announcements already get a lot of exposure and have a high risk of
getting "ducked", duckpond will now ignore those channels and never
relay those announcements to our duckpond.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Some of our members have expressed concern that their messages would be
"ducked" by staff members and relayed to the staff-only duckpond. Since
duckpond is supposed to be a funny, staff-only affair, I've made
duckpond ignore messages from non-staff members.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
|
| | | |/ / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Instead of maintaining a list of duckpond IDs manually, it's a much
better idea to detect ducky emojis dynamically using the new emoji name
grouping we've introduced: All emojis that start with `ducky_` will now
be counted as a duckpond ducky.
The unicode duck emoji obviously still counts in addition to custom
emojis with the `ducky_` prefix.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
As we're now planning on using Redis in multiple applications, it's
important to minimize the risk of namespace collisions between different
applications.
The `async-rediscache` packages allows us to set a global namespace on
an application level. I've chosen "bot" as the namespace for this
application, which means all individual namespaces will automatically be
prefixed by `bot.` whenever they are accessed.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
As we're now using the `async-rediscache` package, it's no longer
necessary to keep the `RedisCache` defined in `bot.utils.redis_cache`
around.
I've removed the file containing it and the tests written for it.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
|
| | | |/ / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
I've migrated our redis caches over to the async-rediscache package that
we've recently released (https://git.pydis.com/async-rediscache). The
main functionality remains the same, although the package handles some
things, like getting the active session, differently internally.
The main changes you'll note for our bot are:
- We create a RedisSession instance and ensure that it connects before
we even create a Bot instance in `__main__.py`.
- We are now actually using a connection pool instead of a single
connection.
- Our Bot subclass now has a new required kwarg: `redis_session`.
- Bool values are now properly converted to and from typestrings.
In addition, I've made sure that our MockBot passes a MagicMock for the
new `redis_session` kwarg when creating a Bot instance for the spec_set.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | |
| | | | | | | |
| | | | | | | | |
Co-authored-by: Dennis Pham <[email protected]>
|
| | | | | | | | |
| | | | | | | |
| | | | | | | | |
Co-authored-by: Dennis Pham <[email protected]>
|
| | | | | | | | |
| | | | | | | |
| | | | | | | | |
Co-authored-by: Dennis Pham <[email protected]>
|
| | | | | | | | |
| | | | | | | |
| | | | | | | | |
Co-authored-by: Dennis Pham <[email protected]>
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | |_|/ / / / /
|/| | | | | | |
|
| |\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Upload eval output with codeblock escapes to pastebin
|
| | | | | | | | | |
|
| | | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The output can't be sent to discord, but it won't affect anything in the
paste service and can safely be uploaded to it.
|
| |\ \ \ \ \ \ \ \
| |_|_|_|_|_|/ /
|/| | | | | | | |
Implement with(out)_role checks and decorators using has_any_role
|
| | |\ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | |
| | | | | | | | |
Bunch of things were renamed, which mainly caused import conflicts.
|
| |\ \ \ \ \ \ \ \
| |_|/ / / / / /
|/| | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | |\ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | | |
|
| |\ \ \ \ \ \ \ \
| |_|_|_|/ / / /
|/| | | | | | | |
Move cogs to subdirectories
|
| | |\ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | | |
|
| |\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Updated the names of reddit emotes
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
Truncate internal eval.
|
| | |\ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
After moving constants to config, the docstring references were not
updated accordingly, and remained uppercase.
This commit also removed the redundant list indentation.
|
| |\ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|_|/
|/| | | | | | | | |
Take steps to increase verification rate
|
| | |\ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Prevent the tasks from starting again if the bot restarts.
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Consistency with the new `_stop_tasks` method.
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
I really didn't like the constants, but the construction of allowed
mentions instances is syntactically noisy, so I prefer to keep it
out of the important logic.
Abstracting it behind a function seems to be the best approach yet.
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
A Discord error code 50_0007 signifies that the DM dispatch failed
because the target user does not accept DMs from the bot.
Such errors are ignored as before.
Any other 403s will however cause the bot to stop making requests.
This is in case the bot gets caught by an anti-spam filter and
should immediately stop.
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Prevent a ghost ping from occurring upon reaction.
Co-authored-by: Senjan21 <[email protected]>
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
If the kwarg isn't passed, it uses the value that was given to the
bot on init (False), despite the kwarg defaulting to True.
Thanks to Mark and Senjan for helping me understand this.
Co-authored-by: MarkKoz <[email protected]>
Co-authored-by: Senjan21 <[email protected]>
|