aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | | | | | | | | | | | | | * HelpChannels: remove obsolete channel position trace logGravatar MarkKoz2021-01-04-1/+0
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | * HelpChannels: refactor stat trackingGravatar MarkKoz2021-01-04-27/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move significant code related to stats to a separate module.
| | | | | | | | | | | | | | * HelpChannels: move function to the channel moduleGravatar MarkKoz2021-01-04-42/+45
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | * HelpChannels: prevent user from claiming multiple channels quicklyGravatar MarkKoz2021-01-04-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's conceivable for a user to be able to quickly send a message in all available channels before the code has a chance to add the cooldown role. Place a lock on the author to prevent the claim code from running multiple times for the same user.
| | | | | | | | | | | | | | * HelpChannels: await init task at the start of event listenersGravatar MarkKoz2021-01-04-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It feels safer to do this since the init task moves channels to different categories and the listeners check if channels are in certain categories.
| | | | | | | | | | | | | | * HelpChannels: use a more accurate lock for messagesGravatar MarkKoz2021-01-04-47/+35
| | | | | | | | | | |_|_|_|/ | | | | | | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the `lock_arg` decorator to keep a separate lock for each channel rather than a single lock used by all messages. Separate the core logic in `on_message` into a separate function to facilitate the use of `lock_arg` - not everything in `on_message` needs to be under the lock.
* | | | | | | | | | | | | | Fix issues with multiple gets being suspended when a refresh startsGravatar Numerlor2021-01-22-6/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With a normal event, if multiple gets were suspended and a refresh started, we'd continue the refresh after the first get finished and set the event which would be the same behaviour as the one it tried to fix. This is avoided by using a counter that's incremented every time a context manager is entered around an event and only setting the event when that counter reaches a zero after everything exited the context mgr
* | | | | | | | | | | | | | Use inspect.unwrap instead of manually unwrappingGravatar Numerlor2021-01-21-3/+1
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Use a defaultdict for item futuresGravatar Numerlor2021-01-15-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to set the attribute at the start of the coro we need to be able to access the item's future before we know about all the other items. This also saves us from having to add them all as the queue parser or get_markdown will create the futures for us dynamically
* | | | | | | | | | | | | | Prevent an inventory refresh while waiting for item cacheGravatar Numerlor2021-01-14-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an inventory refresh was started while the symbol embed coroutine was suspended, it could cause the parser to try to fetch a non existent future if the markdown was requested after it was cleared but before new inventories were loaded in.
* | | | | | | | | | | | | | Raise an error or log a warning if there's a global name conflictGravatar Numerlor2021-01-14-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When wrapper uses a global name, which conflicts with a global name from wrapped's module that wrapped uses for its annotations, we run into a situation that can't be solved without changing one of the names, so an error is raised to give this clearer meaning. The check may be erroneous in some edge cases or the objects the conflicting names refer to can be functionally identical, so the error can be turned into a logged warning.
* | | | | | | | | | | | | | Ensure footer is actually max 100 charsGravatar Numerlor2021-01-14-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shortening the renamed symbols string to 100 chars is not accurate as the footer also contains a string before that, subtracting its length fixes this.
* | | | | | | | | | | | | | Set the user_requested attribute at the start of the coroutineGravatar Numerlor2021-01-14-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A context switch may occur when we're waiting for the web page response, during which a clear could be triggered. If the event is not set before that we could end up with the dictionary changing sizes, or if a copy was made, a future that'd never finish as it'd be cleared from the queue and the futures dict
* | | | | | | | | | | | | | Reuse the redis key instead of creating a new string for the expires setGravatar Numerlor2021-01-14-2/+2
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Change typehint name casing to PascalCaseGravatar Numerlor2021-01-14-8/+9
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Keep trakck of the init task and cancel it when the cog is unloadedGravatar Numerlor2021-01-14-1/+2
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Simplify control flowGravatar Numerlor2021-01-14-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: MarkKoz <[email protected]>
* | | | | | | | | | | | | | Use different task ids for every inventory reschedule attemptsGravatar Numerlor2021-01-14-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The scheduler can't keep track of multiple tasks with the same id, and rescheduling the update task using the same id within an already scheduled update task caused the new task to get ignored as the old task only got deleted from the scheduler after it was finished
* | | | | | | | | | | | | | Correct return type annotationGravatar Numerlor2021-01-14-1/+1
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Turn update_single into a normal functionGravatar Numerlor2021-01-14-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method no longer runs anything asynchronous
* | | | | | | | | | | | | | Fix docstringGravatar Numerlor2021-01-11-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The decorator works in revers to what the docstring explained
* | | | | | | | | | | | | | Return whitespace to its previous stateGravatar Numerlor2021-01-11-1/+1
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Make REFRESH_EVENT an instance variableGravatar Numerlor2021-01-11-6/+6
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Merge remote-tracking branch 'upstream/master' into doc-impGravatar Numerlor2021-01-11-1234/+646
|\| | | | | | | | | | | | |
| * | | | | | | | | | | | | Merge pull request #1350 from python-discord/mbaruh/developerectomyGravatar Dennis Pham2021-01-10-720/+14
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Annihilate all traces of Developer and Unverified roles
| | * | | | | | | | | | | | | Annihilate all traces of Developer and Unverified rolesGravatar mbaruh2021-01-11-720/+14
| |/ / / / / / / / / / / / /
| * | | | | | | | | | | | | Make sure that users without the Developers role can use tag.Gravatar Matteo Bertucci2021-01-10-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a check in place to restrict tag usage to a certain role, but our default is the Developers role, and some users now don't have this code. This commit fixes this by using None as a default and adding a truth test in the check_accessibility method.
| * | | | | | | | | | | | | Upped duckpond threshold to 5Gravatar Boris Muratov2021-01-08-1/+1
| | |_|_|_|_|_|_|/ / / / / | |/| | | | | | | | | | |
| * | | | | | | | | | | | Merge pull request #1340 from python-discord/ks123/raw-fixGravatar Matteo Bertucci2021-01-04-2/+6
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add check does user have permission to get raw message and re-enable raw command
| | * \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into ks123/raw-fixGravatar Matteo Bertucci2021-01-04-71/+131
| | |\ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / | |/| | | | | | | | | | | |
| * | | | | | | | | | | | | Merge pull request #1152 from python-discord/Make_nomination_reason_optionalGravatar Dennis Pham2021-01-03-8/+8
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make nomination reason optional.
| | * \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into Make_nomination_reason_optionalGravatar Dennis Pham2021-01-03-45/+60
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / | |/| | | | | | | | | | | | |
| * | | | | | | | | | | | | | Merge PR #1345 - Update d.py to fix webhook message publishingGravatar Mark2021-01-03-45/+60
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|/ / / / / / / | |/| | | | | | | | | | | | |
| | * | | | | | | | | | | | | Update discord.py to fix webhook message publishing.Gravatar Den42002021-01-01-45/+60
| |/ / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related to #1342.
| | * | | | | | | | | | | | Removed 'Optional' import.Gravatar xithrius2021-01-02-1/+1
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | Removed unnecessary debugging logs.Gravatar Xithrius2021-01-02-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Dennis Pham <[email protected]>
| | * | | | | | | | | | | | Set reason to default as an empty string.Gravatar Xithrius2021-01-02-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Dennis Pham <[email protected]>
| | * | | | | | | | | | | | No nominaton reason blank replaced by italic NoneGravatar xithrius2021-01-02-2/+4
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | Rebased master into this branch.Gravatar xithrius2021-01-02-6460/+7705
| | |\ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | The cogs folder no longer exists, but the merge command was able to automagically find the correct files to merge into. Nomination reason is now optional.
| * | | | | | | | | | | | | Merge pull request #1334 from python-discord/bug/precommit-pycharmGravatar ks1292020-12-31-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix flake8 pre-commit hook running through PyCharm
| | * \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into bug/precommit-pycharmGravatar ks1292020-12-31-297/+322
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / | |/| | | | | | | | | | | | |
| * | | | | | | | | | | | | | Merge pull request #1339 from python-discord/swfarnsworth/infoGravatar Dennis Pham2020-12-31-3/+3
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `!user` command says if a user is "Verified", rather than "Pending"
| | * | | | | | | | | | | | | | "Pending: False" to "Verified: True" to agree with new semantics.Gravatar Steele2020-12-30-1/+1
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Merge branch 'master' of https://github.com/python-discord/bot into ↵Gravatar Steele2020-12-30-14/+59
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | swfarnsworth/info
| * | | | | | | | | | | | | | | Merge pull request #1016 from ks129/bug-fixesGravatar ks1292020-12-29-14/+59
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some bug fixes
| | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into bug-fixesGravatar ks1292020-12-29-554/+567
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / / / | |/| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | | Log info instead error for watchchannel consume task cancelGravatar ks1292020-12-17-1/+1
| | | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | | Merge branch 'master' into bug-fixesGravatar ks1292020-12-17-55/+274
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | |_|_|_|_|_|_|_|_|/ / / / / | | | |/| | | | | | | | | | | | |
| | * | | | | | | | | | | | | | | Merge branch 'master' into bug-fixesGravatar ks1292020-12-02-1079/+1215
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| | * | | | | | | | | | | | | | | | Remove unnecessary f-stringGravatar ks1292020-12-02-1/+1
| | | | | | | | | | | | | | | | | |