| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
| |
Forgot to update the additional_spec_asyncs when changing the name of
this Bot attribute to be public.
|
| |
|
|
| |
Mostly trace and exception logging.
|
| |
|
|
| |
It's a public attribute, we're accessing it from RedisCache.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Sometimes, we just want to store a counter in the cache. In this case,
it is convenient to have a single method that will allow us to increment
or decrement this counter.
These methods allow you to decrement or increment floats and integers by
an specified amount. By default, it'll increment or decrement by 1.
Since this involves several API requests, we create an asyncio.Lock so
that we don't end up with race conditions.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There really was no compelling reason why this method should return an
AsyncIterator or than that `async for items in cache.items()` has nice
readability, but there were a few concerns. One is a concern about race
conditions raised by @SebastiaanZ, and @MarkKoz raised a concern that it
was misleading to have an AsyncIterator that only "pretended" to be
lazy.
To address these concerns, I've refactored it to return a regular
ItemsView instead.
I also improved the docstring, and fixed the relevant tests.
|
| |
|
|
| |
We provide suggestions for how to solve these problems now.
|
| |
|
|
| |
Thanks to @MarkKoz for suggesting most of these in their code review.
|
| |
|
|
|
|
|
| |
It's leaner to just move that code out of the class and up to the module
level as constants.
This commit also renames ValidRedisType to RedisType.
|
| |
|
| |
Co-authored-by: Mark <[email protected]>
|
| |
|
|
|
|
| |
Instead of relying on __str__ representation,
we'll use the __name__ dunder.
Co-authored-by: Mark <[email protected]>
|
| |\ |
|
| | |\
| | |
| | | |
Filtering: don't delete messages in DMs
|
| | | |\
| | |/
| |/| |
|
| | | |
| | |
| | |
| | | |
Bots are incapable of deleting direct messages authored by others.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It's not feasible to mock it because all the commands return futures
rather than being coroutines, so they cannot automatically be turned
into AsyncMocks. Furthermore, no code should ever use the redis session
directly besides RedisCache. Since the tests for RedisCache already use
fakeredis, there's no use in trying to mock redis in MockBot.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Thanks to @kwzrd for this idea, basically we're making a constant with
the typestring prefixes and iterating that in all our converters.
These converter functions will also now raise TypeErrors if we try
to convert something that isn't in this constants list.
I've also added a new test that tests this functionality.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously we would try to .delete keys that did not exist if a default
was provided when calling .pop. This is okay to do (because HDEL will
just ignore any attempts to delete non-existing calls), but it does add
an additional pointless API call to Redis, so I've added some validation
as a small optimization.
This also adds a few additional lines of documentation as requested by
@SebastiaanZ in their review.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This was incorrectly suggesting the user needed to
create an instance of RedisCache, when in fact it is
the parent that needs to be instantiated.
Co-authored-by: Sebastiaan Zeeff <[email protected]>
|
| | | | |
|
| | | | |
|
| | | | |
|
| |\ \ \
| | | |
| | | |
| | | | |
redis_persistence
|
| | |\| | |
|
| | | |\ \ |
|
| | | | |\ \
| | | |/ /
| | |/| | |
|
| | | |\ \ \ |
|
| | | | |\ \ \
| | | |/ / /
| | |/| | | |
|
| | | |\ \ \ \
| | | | | | |
| | | | | | | |
Increase snekbox re eval timeout to 30 seconds
|
| | | | |\ \ \ \
| | | |/ / / /
| | |/| | | | |
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
publish can take place
|
| | | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
Add message publishing to Reddit cog
|
| | | | |\ \ \ \ \
| | | |/ / / / /
| | |/| | | | | |
|
| | | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Add mutability.md tag
|
| | | | |\ \ \ \ \ \
| | | |/ / / / / /
| | |/| | | | | | |
|
| | | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Use `send_help` to ensure that our help command is correctly invoked
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
As @mathsman5133 pointed out, it's better to use the `Command`-instance
we typically already have in the current context than to rely on parsing
the qualified name again.
The invocation is now done as: `await ctx.send_help(ctx.command)`
|
| | | |/ / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
After the refactoring of the help command, we need to use the built-in
method of calling the help command: `Context.send_help`. As an argument,
the qualified name (a string containing the full command path, including
parents) of the command can be passed.
Examples:
- await ctx.send_help("reminders edit")
This would send a help embed with information on `!reminders edit` to
the Context.
- await ctx.send_help(ctx.command.qualified_name)
This would extract the qualified name of the command, which is the full
command path, and send a help embed to Context.
- await ctx.send_help()
This will send the main "root" help embed to the Context.
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Co-authored-by: kwzrd <[email protected]>
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|