| Commit message (Collapse) | Author | Age | Lines |
|
|
|
| |
This commit updates the test in accordance with 0b35f2a and 0c5561d.
|
| |
|
|
|
|
|
|
|
|
|
| |
Pass all 3 cases of text shortening to the test case and test them, the cases being:
i. If the message is just one word, then shorten to 50 characters.
ii. Maximum lines being 3.
iii. Maximum characters being 300.
This commit also removes a misc bug, of passing self, while asserting equal.
|
|
|
|
|
|
| |
In short, I have written two tests, one which tests the whether `extract_message_links` is called on message edits or not. And the second one to test the regex of `extract_message_links` and assert the message link embeds sent by it.
Special thanks to kwzrd💜#1198 for helping me out with it.
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| |
| | |
The util attaches an error logging callback instead of relying on python's
exception logging which only occurs when the task is destroyed
|
|/ |
|
|\ |
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| |/
|/| |
|
|\ \ |
|
| |\| |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The anti-spam cog now uses a cache instead of reading channel history.
The cache is for all channels in the guild, and does not remove deleted messages.
That means that the anti-spam logic now works cross-channel and counts deleted messages.
The size of the cache is determined via a new field in the config YAML file.
The cache was implemented as a separate class, MessageCache, which uses circular buffer logic.
This allows for constant time addition and removal form either side, and lookup. The cache does not support removal from the middle of the cache.
The cache additionally stores a mapping from message ID's to the index of the message in the cache, to allow constant time lookup by message ID.
The commit additionally adds accompanying tests, and renames `cache.py` to `caching.py` to better distinguish it from the new `message_cache.py` and convey that it's for general caching utilities.
|
|\ \ |
|
| |\| |
|
| | |\ |
|
| | | |\ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fixes a bug that stopped the duration `forever` from getting used as a
valid duration for silence.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | |\ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Updates the shh and unshh commands from the error handler to accept
channel and kick arguments, to give them the same interface as the
silence and unsilence command.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Updates the silence command to accept the silence duration or channel as
the first argument to the command. Updates tests.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Uses `.format` to create silence and unsilence messages instead of
`.replace`.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | |\ \ \ |
|
| | | | |\ \ \ |
|
| | | |/ / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Uses itertools.product to eliminate some nested for loops in tests.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Duplicates existing silence and unsilence cache tests for voice
channels.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Reduces the number of members created for each test to the bare minimum
required.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | |\ \ \ \ |
|
| | | |\ \ \ \ \ |
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Changes the mock used for creating an erroneous function in the silence
tests cog to use the side effect property instead of an extra function.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Removes redundant functionality from the `test_unsilence_helper_fail`
test as it is covered by another test. Keeps the functionality that
isn't being tested elsewhere.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Combine two tests that are responsible for checking the silence helper
uses the correct channel and message.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | |\ \ \ \ \ \ |
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Adds a missing test assertion, and seperates the voice and text
components of a test.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Adds a missing test assertion, and seperates the voice and text
components of a test.
Signed-off-by: Hassan Abouelela <[email protected]>
|