aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| * | | | | | | | | Revert "Add a mod_log.ignore_all context manager."Gravatar Leon Sandøy2020-05-31-35/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0737b1a6 This isn't gonna work, because async is a thing.
| * | | | | | | | | Merge branch 'master' into multichannel_purgeGravatar Leon Sandøy2020-05-31-44/+3
| |\ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | |
| * | | | | | | | | Fix a bug with invocation deletion.Gravatar Leon Sandøy2020-05-31-21/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command was written to support only a single channel, and with the move to multi-channel purges, we need to rethink the way the invocation deletion happens. We may be invoking this command from a completely different channel, so we can't necessarily look inside the channels we're targeting for the invocation. So, we're solving this by just deleting the invocation by using ctx.message. We do this before we start iterating message history, and then we only need to iterate the number of messages that was passed into the command. A much cleaner approach, which solves the bug reported and identified by @MarkKoz.
| * | | | | | | | | Add a mod_log.ignore_all context manager.Gravatar Leon Sandøy2020-05-31-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new context manager makes it easier to make the mod_log ignore actions like message deletions. The only existing method is the `ignore()` method, which requires that you pass all the messages you want to ignore into it. This one just ignores everything inside its scope. This isn't the DRYest approach, but it's low-cost and improves the readability of clean.py quite a bit. Ideally we should go through and give modlog a proper cleanup, because it's kinda ugly right now.
| * | | | | | | | | Remove unnecessary conditional.Gravatar Leon Sandøy2020-05-31-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks @MarkKoz!
| * | | | | | | | | Better channel mentionsGravatar Leon Sandøy2020-05-31-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Mark <[email protected]>
| * | | | | | | | | Remove a completely unacceptable newline.Gravatar Leon Sandøy2020-05-30-1/+0
| | | | | | | | | |
| * | | | | | | | | Add multichannel !purge via commands.GreedyGravatar Leon Sandøy2020-05-30-31/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can now pass in as many channel mentions as we want after any !purge command - for example `!purge all 5 #python-general #python-language`
| | * | | | | | | | Merge branch 'master' into stop_sending_avatar_hashGravatar Leon Sandøy2020-05-31-408/+1588
| | |\ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | |
| | * | | | | | | | Fix failing tests related to avatar_hashGravatar Leon Sandøy2020-05-27-5/+0
| | | | | | | | | |
| | * | | | | | | | Remove all sending of avatar_hash.Gravatar Leon Sandøy2020-05-27-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a companion commit to this PR: https://github.com/python-discord/site/pull/356 This PR must be merged before this commit.
| | | * | | | | | | Fix a bad check in get_staff_channel_count.Gravatar Leon Sandøy2020-05-31-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also changes a few aesthetic problems pointed out in review by @MarkKoz and @kwzrd.
| | | * | | | | | | Merge branch 'master' into staff_count_serverGravatar Leon Sandøy2020-05-31-106/+356
| | | |\ \ \ \ \ \ \ | |_|_|/ / / / / / / |/| | | | | | | | |
| | | * | | | | | | Move counting of channels to a separate methodGravatar MarkKoz2020-05-30-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This de-clutters the main `server_info` function and improves its readability.
| | | * | | | | | | Simplify counting of staff channels and improve efficiencyGravatar MarkKoz2020-05-30-49/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplification comes from being able to access permissions as attributes on the overwrite object. This removes the need to iterate all permissions. Efficiency comes from checking all roles within a single iteration of all channels. This also removes the need to flatten and filter the channels afterwards, which required additional iterations.
| | | * | | | | | | Merge branch 'master' into staff_count_serverGravatar Leon Sandøy2020-05-30-1/+1
| | | |\ \ \ \ \ \ \
| | | * | | | | | | | Don't membership check in an itertools.chain.Gravatar Leon Sandøy2020-05-30-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're using the set comprehension to prevent duplicates anyway, so flipping these back makes more sense. Also added a missing ctx and tested ok.
| | | * | | | | | | | Prevent duplicates, and break into function.Gravatar Leon Sandøy2020-05-30-27/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - We're using a set comprehension and flipping the order for counting the number of channels that are both staff allow and @everyone deny. - We're breaking the staff channel count stuff into a separate helper function so it doesn't crowd the server_info() scope. These fixes are both to address the code review from @MarkKoz, thanks Mark.
| | | * | | | | | | | Fix busted test_information test.Gravatar Leon Sandøy2020-05-30-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I wish this test didn't exist.
| | | * | | | | | | | More precise staff-channel check.Gravatar Leon Sandøy2020-05-30-13/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now check: - Does the @everyone role have explicit read deny permissions? - Do staff roles have explicit read allow permissions? If the answer to both of these are yes, it's a staff channel. By 'staff roles', I mean Helpers, Moderators or Admins.
| | | * | | | | | | | Merge branch 'master' into staff_count_serverGravatar Leon Sandøy2020-05-30-0/+1
| | | |\ \ \ \ \ \ \ \
| | | * | | | | | | | | Adding staff member count to !server.Gravatar Leon Sandøy2020-05-30-4/+10
| | | | | | | | | | | |
| | | * | | | | | | | | Clean up channel counts and add staff channels.Gravatar Leon Sandøy2020-05-29-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaning up a particularly dirty line by turning it into like 10 lines, and also adding the number of channels that are hidden to the `@everyone` role - which we're classifying as "Staff channels".
| | | | | | * | | | | | Stats: Implement rules statsGravatar ks1292020-06-05-0/+3
| | | | | | | |_|/ / / | | | | | | |/| | | | | | | | | | | | | | | Increase every shown rule uses count when command called.
| | | | | | | | | | * Fix potential race condition.Gravatar Leon Sandøy2020-06-06-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of first checking if the channel.id exists and then checking what it is, we just do a single API call, to prevent cases where something fucky might happen inbetween the first and the second call.
| | | | | | | | | | * Store epoch timestamps instead of strings.Gravatar Leon Sandøy2020-06-06-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're also switching from datetime.now() to datetime.utcnow().
| | | | | | | | | | * Store booleans as integers instead of strings.Gravatar Leon Sandøy2020-06-06-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means we don't need to rely on strtobool, and is a cleaner implementation overall. Thanks @MarkKoz.
| | | | | | | | | | * Refactor help_channels.py to use RedisCache.Gravatar Leon Sandøy2020-06-06-28/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More specifically, we're turning three dicts into RedisCaches: - help_channel_claimants - unanswered - claim_times These will still work the same way, but will now persist their contents across restarts.
| | | | | | | | | | * Add support for bool values in RedisCacheGravatar Leon Sandøy2020-05-31-3/+15
| |_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're gonna need this for the help channel handling, and it seems like a reasonable type to support anyway. It requires a tiny bit of special handling, but nothing outrageous.
* | | | | | | | | | Merge pull request #973 from python-discord/kwzrd/improve-freeGravatar kwzrd2020-05-31-2/+2
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Link #how-to-get-help in !free tag
| * \ \ \ \ \ \ \ \ \ Merge branch 'master' into kwzrd/improve-freeGravatar kwzrd2020-05-31-42/+1
| |\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | |
* | | | | | | | | | | Merge pull request #971 from python-discord/remove_periodic_pingGravatar kwzrd2020-05-30-42/+1
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | | Remove the periodic ping from #verification
| * | | | | | | | | | Merge branch 'master' into remove_periodic_pingGravatar kwzrd2020-05-30-63/+354
| |\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | |
| * | | | | | | | | | Oops, add the return back.Gravatar Leon Sandøy2020-05-30-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not wanna process bot messages.
| * | | | | | | | | | Merge branch 'master' into remove_periodic_pingGravatar Leon Sandøy2020-05-30-0/+1
| |\ \ \ \ \ \ \ \ \ \ | | | |_|_|/ / / / / / | | |/| | | | | | | |
| * | | | | | | | | | Removing the periodic ping from verification.Gravatar Leon Sandøy2020-05-30-43/+1
| | |_|_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's no longer needed, and causes problems with anti-raid and anti-spam.
| | | * | | | | | | Free tag: link #how-to-get-helpGravatar kwzrd2020-05-30-2/+2
| |_|/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This creates a clickable link in the response embed. Referencing the category is no longer necessary.
* | | | | | | | | Merge pull request #864 from ks129/ban-kick-reason-lengthGravatar Mark2020-05-30-42/+159
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Ban and kick reason length fix
| * \ \ \ \ \ \ \ \ Merge branch 'master' into ban-kick-reason-lengthGravatar Mark2020-05-30-350/+1571
| |\ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | |
* | | | | | | | | | Merge pull request #930 from MrGrote/test_antimalwareGravatar Sebastiaan Zeeff2020-05-30-20/+194
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / |/| | | | | | | | | Add tests for the antimalware cog
| * | | | | | | | | Merge branch 'master' into test_antimalwareGravatar Sebastiaan Zeeff2020-05-30-965/+2124
| |\ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | |
* | | | | | | | | | Merge pull request #972 from Numerlor/tag-encodingGravatar Mark2020-05-29-1/+1
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / / |/| | | | | | | | | Specify encoding when reading tag files
| * | | | | | | | | Tags: explicitly use UTF-8 to read filesGravatar MarkKoz2020-05-30-1/+1
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all operating systems use UTF-8 as the default encoding. For systems that don't, reading tag files with Unicode would cause an unhandled exception. (cherry picked from commit adc75ff9bbcf8b905bd78c78f253522ae5e42fc3)
* | | | | | | | | Merge pull request #965 from Akarys42/patch-1Gravatar Dennis Pham2020-05-29-0/+1
|\ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / |/| | | | | | | | Ignore response when posting python news
| * | | | | | | | Merge branch 'master' into patch-1Gravatar Dennis Pham2020-05-29-31/+8
| |\ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | |
* | | | | | | | | Merge pull request #966 from python-discord/sebastiaan/help-channels/ratelimitsGravatar Joseph Banks2020-05-29-31/+8
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / |/| | | | | | | |
| * | | | | | | | Reduce the number of help channel name changesGravatar Sebastiaan Zeeff2020-05-29-29/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discord has introduced a new, strict rate limit for individual channel edits that reduces the number of allow channel name/channel topic changes to 2 per 10 minutes per channel. Unfortunately, our help channel system frequently goes over that rate limit as it edits the name and topic of a channel on all three "move" actions we have: to available, to occupied, and to dormant. In addition, our "unanswered" feature adds another channel name change on top of the move-related edits. That's why I've removed the topic/emoji changing features from the help channel system. This means we now have a generic topic that fits all three categories and no status emojis in the channel names.
| * | | | | | | | Fix `check_for_answer` breaking on missing cacheGravatar Sebastiaan Zeeff2020-05-29-2/+5
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `check_for_answer` method of the HelpChannels cog relies on the channel->claimant cache being available. However, as this cache is (currently) lost during bot restarts, this method may fail with a KeyError exception. I've used `dict.get` with an `if not claimant: return` to circumvent this issue.
| * / / / / / / Ignore response when posting python newsGravatar Matteo Bertucci2020-05-29-0/+1
|/ / / / / / / | | | | | | | | | | | | | | Sometimes a mailing list user doesn't press respond correctly to the email, and so a response is sent as a separate thread. To keep only new threads in the channel, we need to ignore those.
* | | | | | | Merge pull request #947 from python-discord/redis_persistenceGravatar Sebastiaan Zeeff2020-05-28-182/+1061
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | RedisCache - Data Persistence