aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | | | | | * | | | Test incidents: correct avatar referenceGravatar Matteo Bertucci2021-10-05-1/+1
| | | | | | | | | |
| | | | | | * | | | Defcon: ignore create thread permsGravatar Matteo Bertucci2021-10-05-4/+0
| | | | | | | | | |
| | | | | | * | | | avatar.url -> display_avatar.urlGravatar Matteo Bertucci2021-10-05-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | avatar can apparently be none, which means traceback and a very sad akarys
| | | | | | * | | | Modlog: change thread logging to past-tenseGravatar Matteo Bertucci2021-09-21-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Bluenix <[email protected]>
| | | | | | * | | | Bot: remove inaccurate docstringsGravatar Matteo Bertucci2021-09-19-1/+0
| | | | | | | | | |
| | | | | | * | | | Bot: update comment on joining threadsGravatar Matteo Bertucci2021-09-19-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Bluenix <[email protected]>
| | | | | | * | | | Modlog: reuse logic for the message blacklistGravatar Matteo Bertucci2021-09-19-13/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Bluenix <[email protected]>
| | | | | | * | | | Modlog: thread supportGravatar Matteo Bertucci2021-09-15-0/+58
| | | | | | | | | |
| | | | | | * | | | Defcon: add thread perms to (un)shutdownGravatar Matteo Bertucci2021-09-15-2/+16
| | | | | | | | | |
| | | | | | * | | | Silence tests: use thread permsGravatar Matteo Bertucci2021-09-15-10/+54
| | | | | | | | | |
| | | | | | * | | | Silence: remove thread related permissionsGravatar Matteo Bertucci2021-09-12-2/+16
| | | | | | | | | |
| | | | | | * | | | Modlog: respect blacklist with threadsGravatar Matteo Bertucci2021-09-12-19/+36
| | | | | | | | | |
| | | | | | * | | | Silence: forbid threads from being silencedGravatar Matteo Bertucci2021-09-06-1/+7
| | | | | | | | | |
| | | | | | * | | | Make the bot auto-join threadsGravatar Matteo Bertucci2021-09-06-1/+17
| | | | | | | | | |
| | | | | | * | | | Migrate to Discord.py 2.0a0Gravatar Matteo Bertucci2021-09-06-139/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the Discord.py repository has been archived, we can switch to the latest commit of 2.0a0, knowing no breaking change will occur (still pinned to the commit just in case). This commits fixes any problem related to the migration: - New avatar interface - TZ aware datetimes - Various inernal API changes
* | | | | | | | | | Add incidents check in delete and reaction handlers alsoGravatar Shivansh-0072021-10-17-3/+5
| | | | | | | | | |
* | | | | | | | | | Check for webhook availability before extracting msg linksGravatar Shivansh-0072021-10-17-3/+4
| | | | | | | | | |
* | | | | | | | | | Use scheduling create_task util instead of creating from loop directlyGravatar Shivansh-0072021-10-12-2/+4
| | | | | | | | | |
* | | | | | | | | | Update typehintsGravatar Shivansh-0072021-10-12-13/+13
| | | | | | | | | |
* | | | | | | | | | Add error handling on modlog channel fetchGravatar Shivansh-0072021-10-12-1/+6
| | | | | | | | | |
* | | | | | | | | | Correct discord message link regexGravatar Shivansh-0072021-10-12-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The biggest size a Discord snowflake can be is 20. Co-authored-by: Bluenix <[email protected]>
* | | | | | | | | | Refactor `shorten_text` utility functionGravatar Shivansh-0072021-10-11-9/+20
| | | | | | | | | |
* | | | | | | | | | Apply requested grammar and style changesGravatar Shivansh-0072021-10-11-36/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Bluenix <[email protected]> Co-authored-by: Boris Muratov <[email protected]>
* | | | | | | | | | Goodbye enhanced incidents editsGravatar Shivansh-0072021-10-11-64/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Was discussed with Mr.Webscale (joe), Xithrius in dev-voice
* | | | | | | | | | Sends msg embeds for helper readable msgs onlyGravatar Shivansh-0072021-10-11-2/+9
| | | | | | | | | |
* | | | | | | | | | Handle message not found speciallyGravatar Shivansh-0072021-10-11-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally message not found would be passed into discord.Exceptions and then would be logged which was unnecessary for a `MessageNotFound` error. Now this has been handled, if the bot receives a deleted message it would look through the last 100 messages of mod_logs channel to check if a log entry exists for that message. If one exists, then the incident embed would have this log entry message linked to it, if it doesn't it would send a message not found error embed. In future, we could maybe do the modlog deleted message entry finding via the python discord API, rather than using hard coded values and checking if they are existing in the log entry.
* | | | | | | | | | Remove unnecessary check for embed when sendingGravatar Shivansh-0072021-10-11-1/+1
| | | | | | | | | |
* | | | | | | | | | Correct log trace link to show the correct behaviourGravatar Shivansh-0072021-10-11-1/+1
| | | | | | | | | |
* | | | | | | | | | Mock id,content attribute rather than type castingGravatar Shivansh-0072021-10-11-5/+6
| | | | | | | | | |
* | | | | | | | | | Update tests for message link embedsGravatar Shivansh2021-10-11-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit updates the test in accordance with 0b35f2a and 0c5561d.
* | | | | | | | | | Use raw message delete listenerGravatar Shivansh2021-10-11-8/+8
| | | | | | | | | |
* | | | | | | | | | Use `on_raw_message_edit`Gravatar Shivansh2021-10-11-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally it was using `on_message_edit` which would have failed if the message was not in the bot' cache. Therefore we would have to use a raw listener.
* | | | | | | | | | Delete msg link embed if no link on editGravatar Shivansh2021-10-11-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier, if we edited a message which contained message links originally but not now, then the webhook message wouldn't get deleted. This commits fixes that bug.
* | | | | | | | | | Make `extract_message_links` an instance methodGravatar Shivansh2021-10-11-31/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since it was used cog's state (`self.bot`), it would be better to move it to the cog.
* | | | | | | | | | Use better variable namesGravatar Shivansh2021-10-11-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit also adds a line which was got removed by mistake earlier.
* | | | | | | | | | Apply requested changes to doc stringsGravatar Shivansh2021-10-11-4/+4
| | | | | | | | | |
* | | | | | | | | | Only process the first 10 message linksGravatar Shivansh2021-10-11-3/+1
| | | | | | | | | |
* | | | | | | | | | (incidents):Log with error if webhook not foundGravatar Shivansh2021-10-11-0/+3
| | | | | | | | | |
* | | | | | | | | | (incidents): Use subtests for test_shorten_textGravatar Shivansh2021-10-11-4/+4
| | | | | | | | | |
* | | | | | | | | | (incidents): Add test for text shortnerGravatar Shivansh2021-10-11-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | (incidents): Refactor text shortnerGravatar Shivansh2021-10-11-10/+16
| | | | | | | | | |
* | | | | | | | | | Rework text shortner.Gravatar Shivansh2021-10-11-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explanation: It is unnecessary to show 300 characters, when there is only one word which is so long, so if there is only one word in the text, it would be truncated to 50 words. Also in some cases, there are messages of many lines with 1 word on each line(say), this would again make the embed big and polluting, so it would limit the number of lines to a maximum of 3. Rest of the feature is the same as before. This implementation has been inspired from the `format_output` function of snekbox cog.
* | | | | | | | | | Write tests for this featureGravatar Shivansh2021-10-11-3/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | Fix truncation bugGravatar Shivansh2021-10-11-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you take a long message, just one word of 400 A's then the truncated wouldn't be able to handle it properly and just return the placeholder. This is a bug in the textwrap.shorten function. To solve this, I went the long way to use slicing on the list. This commit seems to have resolved the bug.
* | | | | | | | | | Handle discord.errors.NotFound while deleting msg link webhook embedsGravatar Shivansh-0072021-10-11-1/+4
| | | | | | | | | |
* | | | | | | | | | Remove leading whitespace from msg link embed contentGravatar Shivansh-0072021-10-11-1/+1
| | | | | | | | | |
* | | | | | | | | | Rename 'send_webhooks' to 'send_message_link_embed'Gravatar Shivansh-0072021-10-11-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Boris Muratov <[email protected]>
* | | | | | | | | | Appy requested grammar changes.Gravatar Shivansh-0072021-10-11-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Boris Muratov <[email protected]>
* | | | | | | | | | Remove redundant codeGravatar Shivansh-0072021-10-11-4/+2
| | | | | | | | | |
* | | | | | | | | | Rework message link embed.Gravatar Shivansh-0072021-10-11-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Instead of default black colour, use gold to give it some shine! - Mention the channel also in the channel field. - Add message ID in footer, so it is easy to figure out for which message link is that embed.