aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2021-10-11Remove leading whitespace from msg link embed contentGravatar Shivansh-007-1/+1
2021-10-11Rename 'send_webhooks' to 'send_message_link_embed'Gravatar Shivansh-007-3/+3
Co-authored-by: Boris Muratov <[email protected]>
2021-10-11Appy requested grammar changes.Gravatar Shivansh-007-5/+5
Co-authored-by: Boris Muratov <[email protected]>
2021-10-11Remove redundant codeGravatar Shivansh-007-4/+2
2021-10-11Rework message link embed.Gravatar Shivansh-007-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.
2021-10-11Bug fixesGravatar Shivansh-007-16/+14
- `await` message link embeds cache get - don't double send webhook embeds (edit, send) on message edits
2021-10-11Don't send errors, instead log them.Gravatar Shivansh-007-9/+9
Errors shouldn't be sent in #incidents. Instead, log them with log.exception and make the function return.
2021-10-11Do required flake8 changes in docstrings.Gravatar Shivansh-007-4/+8
2021-10-11Use tasks to fetch incidents channel webhook.Gravatar Shivansh-007-9/+13
2021-10-11On msg edits, edit the msg link embed rather than deleting itGravatar Shivansh-007-4/+9
2021-10-11Make incidents channel webhook a cog level attributeGravatar Shivansh-007-6/+6
This would not fetch it everytime.
2021-10-11Use str() rather than f string for single variable.Gravatar Shivansh-007-1/+1
Makes the intent much more clear.
2021-10-11Don't allow more than 10 embeds per report.Gravatar Shivansh-007-53/+32
If more than 10 embeds found, just get the first 10 and ignore the rest.
2021-10-11Revert changes done by black.Gravatar Shivansh-007-43/+13
2021-10-11Updates type hints for `message_link_embeds_cache`.Gravatar Shivansh-007-1/+7
2021-10-11Refactors code.Gravatar Shivansh-007-26/+94
Earlier on message edit the message wasn't run through extract message links to see if new message links are added or if some got deleted. Similarly the cache was updated when a message got deleted. Now it makes extract message links a helper function and runs it on message edits and deletes in case there are some changes in the message links. This commit also updates the doc strings for functions according to the new changes done.
2021-10-11Use `DiscordException` instead of broad exception clause.Gravatar Shivansh-007-2/+2
2021-10-11Apply grammar and style changes.Gravatar Shivansh-007-13/+20
2021-10-11Run black code formatter.Gravatar Shivansh-007-21/+53
2021-10-11Ignore N802 in 'asyncSetUp' and 'asyncTearDown' function in test_incidents.pyGravatar Shivansh-007-2/+2
2021-10-11Allign comments to maintain readabilityGravatar Shivansh-007-3/+3
2021-10-11Modify tests to support redis cache, done with the help @SebastiaanZGravatar Shivansh-007-16/+16
2021-10-11Run webhook message deletion if webhook_msg_id var is TrueGravatar Shivansh-007-5/+7
2021-10-11Update regex to support all message links i.e. support for 'app', 'canary', ↵Gravatar Shivansh-007-3/+4
'ptb'
2021-10-11Add a docstring to 'send_webhooks' functionGravatar Shivansh-007-0/+9
2021-10-11If message content more than 500 characters shorten it done to 300 charactersGravatar Shivansh-007-24/+34
2021-10-11Rollback to changes which aren't requiredGravatar Shivansh-007-6/+6
2021-10-11Fix tests according to the changes done to incidents.pyGravatar Shivansh-007-3/+19
2021-10-11Use str() when checking for message.contentGravatar Shivansh-007-1/+1
2021-10-11Use MessageConverter to find messagesGravatar Shivansh-007-25/+35
2021-10-11Send multiple webhook messages in case of more than 10 message linksGravatar Shivansh-007-9/+22
2021-10-11Add incidents webhook to default config templateGravatar Shivansh-007-0/+1
2021-10-11Send webhook embed containing information about the message if there is a ↵Gravatar Shivansh-007-4/+70
message link in the incident report
2021-10-10Fix typo in bot/exts/info/doc/_cog.py Gravatar Richard Si-1/+1
it only took 5 people looking through the diff ... Co-authored-by: Bluenix <[email protected]>
2021-10-10Handle 400 when setting pre-existing doc packageGravatar Richard Si-1/+9
If you run, for example: !doc setdoc black https://black.readthedocs/en/stable/objects.inv twice over. You'll get an unhelpful "According to the API, your request is malformed." error message back. This commit adds an error handler to catch the HTTP 400 and tell the user the package already exists.
2021-10-06Kill subdomains from configuration file.Gravatar Johannes Christ-3/+3
This will need a coordinated rollout with @jb3, in order to make the appropriate changes in Kubernetes beforehand.
2021-10-06Add appeal categories to mod categoriesGravatar Chris Lovering-0/+4
This allows us to run moderation commands in the appeal categories
2021-10-06Revert "Apply infractions before DMing"Gravatar Matteo Bertucci-10/+8
2021-10-05Use `isinstance` instead of `hasattr` to determine if `Member`Gravatar Izan-2/+2
2021-10-05Fix lintingGravatar TizzySaurus-0/+1
Reverted accidental line deletion
2021-10-05Fix if statement errorGravatar TizzySaurus-10/+9
Adds `messages_as_list` for easy indexing of `self.messages.values()` Also updated the comment above if statement and tidied some code
2021-10-05Make attachments check explicitGravatar TizzySaurus-1/+1
Co-authored-by: Matteo Bertucci <[email protected]>
2021-10-05Improvements to anti-spam log messageGravatar TizzySaurus-3/+9
- Removed redundant f-string - Made it so that messages with attachments will *always* upload to the log site. - Made it so that truncates messages will also upload to the paste site, for full viewing. - Fixed a previously unnoticed bug where truncating didn't account for extra characters of the ellipses.
2021-10-04Use utcnow() and lower a logging level in patch_typingGravatar Chris Lovering-3/+3
2021-10-04Move all monkey patches to their own fileGravatar Chris Lovering-23/+22
2021-10-04Monkey patch http.send_typing to catch 403sGravatar Chris Lovering-1/+35
Sometimes discord turns off typing events by throwing 403's, so we should catch those
2021-10-03Check cache for Members and UsersGravatar Chris Lovering-5/+5
By swapping the isinstance to check for int, the else block now catches the case where target is Member or User, this allows for editting the nomination reason of members that are off server.
2021-10-03Block helpers from editing nomination reasons in channels other than ↵Gravatar Chris Lovering-3/+7
#nominations
2021-10-03Handle channel category being None in antispam/malware checksGravatar wookie184-2/+2
The code already handled the attribute not existing (e.g from a DM channel), but didn't handle TextChannels not in a category
2021-10-03Force kwargs when calling helper utilGravatar ChrisJL-1/+2
Co-authored-by: Bluenix <[email protected]>