aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| * | | | | | | | | | Merge pull request #1446 from Shivansh-007/feature/enhance-incidentsGravatar Boris Muratov2021-11-19-17/+342
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Enhancing information within the incidents channel.
| | * \ \ \ \ \ \ \ \ \ Merge branch 'main' into feature/enhance-incidentsGravatar Shivansh-0072021-11-18-566/+1123
| | |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / | |/| | | | | | | | | |
| * | | | | | | | | | | Merge pull request #1953 from python-discord/jb3/guild-features-channelsGravatar Joe Banks2021-11-17-1/+4
| |\ \ \ \ \ \ \ \ \ \ \
| | * \ \ \ \ \ \ \ \ \ \ Merge branch 'main' into jb3/guild-features-channelsGravatar Xithrius2021-11-17-2/+14
| | |\ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / | |/| | | | | | | | | | |
| * | | | | | | | | | | | Don't log threads in admin channels (#1954)Gravatar ChrisJL2021-11-16-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change disables the mod-log for any changes to threads in channels that mods don't have read perms to. Co-authored-by: Kieran Siek <[email protected]>
| | * | | | | | | | | | | Add #bot-commands to guild features in !serverGravatar Joe Banks2021-11-14-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents spam in dev-contrib and dev-core from people trying to find which Discord feature flags are enabled for Python Discord. It's not ideal that we have to increase output size in #bot-commands but it prevents spam in #dev-contrib.
| | | * | | | | | | | | | Check if log entry has embeds before indexing themGravatar Shivansh-0072021-11-10-1/+4
| | | | | | | | | | | | |
| | | * | | | | | | | | | Explicitly show there is no message contentGravatar Shivansh-0072021-11-07-5/+4
| | | | | | | | | | | | |
| | | * | | | | | | | | | SHow thread parent name if linked message in threadGravatar Shivansh-0072021-11-07-1/+3
| | | | | | | | | | | | |
| | | * | | | | | | | | | Attach attachments if present in linked messageGravatar Shivansh-0072021-11-07-0/+2
| | | | | | | | | | | | |
| | | * | | | | | | | | | Add no message content handlingGravatar Shivansh-0072021-11-07-4/+6
| | | | | | | | | | | | |
| | | * | | | | | | | | | Merge branch 'main' into feature/enhance-incidentsGravatar Shivansh-0072021-10-21-98/+127
| | | |\ \ \ \ \ \ \ \ \ \
| | | * | | | | | | | | | | Missed a change for 43bed60Gravatar Shivansh-0072021-10-21-1/+1
| | | | | | | | | | | | | |
| | | * | | | | | | | | | | Fix helpers view perms check to use 'permissions_for'Gravatar Shivansh-0072021-10-21-3/+2
| | | | | | | | | | | | | |
| | | * | | | | | | | | | | avatar.url -> display_avatar.urlGravatar Shivansh-0072021-10-21-1/+1
| | | | | | | | | | | | | |
| | | * | | | | | | | | | | Fix incident webhook fetch validationGravatar Shivansh-0072021-10-19-2/+3
| | | | | | | | | | | | | |
| | | * | | | | | | | | | | Add message creation timestamp to message link embedGravatar Shivansh-0072021-10-19-1/+2
| | | | | | | | | | | | | |
| | | * | | | | | | | | | | Make docstring clear about max lengthGravatar Shivansh-0072021-10-19-2/+6
| | | | | | | | | | | | | |
| | | * | | | | | | | | | | Removing config validation checksGravatar Shivansh-0072021-10-19-5/+1
| | | | | | | | | | | | | |
| | | * | | | | | | | | | | Refactor shorten_text utility functionGravatar Shivansh-0072021-10-18-8/+10
| | | | | | | | | | | | | |
| | | * | | | | | | | | | | Merge remote-tracking branch 'upstream/main' into feature/enhance-incidentsGravatar Shivansh-0072021-10-17-712/+1036
| | | |\ \ \ \ \ \ \ \ \ \ \
| | | * | | | | | | | | | | | 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.