Yes, exactly like that. Would we be able to call it CONTRIBUTING.md and have it displayed automatically when going into the directory, or would we need to call it README.md? I think both would be fine.
#dev-log
1 messages ยท Page 59 of 1
Since allowing several mutes could lead to issues, this issue should deal only with mutes applied on users already auto-muted by the bot, which is where this need arises the most.
The PR is merged and now it just fails to apply the infraction, which is something we handle in apply_infraction.
I think it should be better to do this in __init__ function, as constants is meant to be static, but loading them from file makes them dynamic.
I'd prefer here for readability:
if insert_word.endswith("s"):
[python-discord/bot] New branch created: cleanrework
As it stands, the class supports items and keys but not values. That's something we may want to have.
I don't think you can access command-based arguments if we use the check function, so I will be sticking with the current implementation.
@aaravm4 How did it go? Any further thoughts on the implementation?
Hi. I have been pretty busy the past few months, but it's finally Thanksgiving break, so I can spend more time on an implementation.
Alright, sounds good! Life happens; There's no hurry.
Thanks for the contribution! I don't know enough about Wonder Twins to understand what these phrases are, but they seem funny.
This is purely a code review and I'll test the command on a later date.
I don't fully understand the last part of this docstring. It would be nice with a slightly more straightforward sentence.
self.water_types, self.objects, self.adjectives = info
This looks clearer to me. If you don't like the proposed solution, I think putting it on 3 lines would look the best. The original code had a bit too much going on in that single line, in my opinion.
What is the purpose of this list?
2d8f8a8 Removed unnecessary shadow infractions - mbaruh
We have several infractions that are never used, most moderators don't even know they exist, and frankly there is no reason they should be used. This PR removes them.
These infractions are:
- shadowkick
- shadowmute
- shadowtempban
Postgres backup completed!
Description
Adds voice channel muting functionality, similar to text channel muting.
- Allows muting any channel from any other channel or itself
- Allows unmuting any channel from any other channel or itself
- Implements a more lenient channel converter, to accept both voice and text channels as arguments.
- Relays mute confirmation/failure to both the invocation channel and the muted channel (in the case of VC, the muted channel is replaced with the text-channel with the same nam...
Connected!
[python-discord/branding] New branch created: x\-icon
Adds source and distribution files for a new red cross icon. This will be used in, at least, the new code of conducts channel. Here's the new icon:

And here it is in a code of conduct message (just an example):
The color of it is: #F91134
After a discussion in the Admin meeting, we've decided to expand the Bounty Board and integrating a leader board into the whole process.
My thoughts are as follows:
- The board should be linked to GitHub so that we can track the PRs (ideally completed) and code reviews.
- The board should have 4 columns: Username (GitHub and/or Discord), number of PRs, number of code reviews, some sort of scoring combining the two.
Scoring is something I want input on. My current thinking is 2 points...
Requires #1298 to be completed before this can be tackled.
Since we're going to be creating the leader board, it would be nice for users to check their own individual rank or total PRs and reviews via the !user command. While they will be able to see a leaderboard, we may only have the top 10 or 20 listed, so in order for people to see where they stand, it may be good for people to see what they have.
As stated, this would require the leader board issue to be completed first. In the...
This was updated to use a less saturated color. The one we decided on was #E63645.
@HassanAbouelela Sorry only saw your comment now. I don't think it should mute anyone, it just needs to lock the channel (which could be translated into revoking connect permissions for Voice Verified in that channel), and then disconnecting everyone in it.
I wouldn't mind it being a separate command, but I'm not sure I understood your proposed alternative.
[python-discord/branding] branch deleted: x\-icon
What I was getting at was that the channel would still maintain its members, but revoke all speaking permissions (and move the members to sync the new permissions). This could be useful if the silencing is for a short period, or just to get an announcement out or something.
I am not fully aware of what exactly this will be used for, so if you think just removing all members is better, I'd be happy to rewrite it to that instead.
660c9b4 make init variables more readable, fix docstrin... - fisher60
c73005f fix typos in docstring - fisher60
This breaks the help of multiple commands like tempban or doc.
Is this worth taking care of? I don't think there's a proper way for us to differentiate between newlines added for readability in the source and the ones that are also necessary in the help output. That'd mean we'd have to change the docstrings with some special syntax or using line continuation which imo is not worth the tradeoff of complicating how it looks in the source code for the small improvement to what's sent on discord
I agree that silencing for a short duration could be useful and in that case there's no reason to disconnect anyone, and there's another issue for that (which I see you replied on).
In other instances we would just want to complete shut down the conversation for a while, in which case disconnecting and disallow people to reconnect for a bit would be preferable.
I have a few questions:
- Would this be specifically for things on the bounty board or on the repos in general?
- In what channel would this leaderboard be?
The reason I bring up the second question is that the Development category is getting quite large. If we want to add another channel, like #dev-leaderboard, we may want to consider splitting the category up into multiple parts. This would probably mean a Dev Info and Dev Discussion category, but the exact name is a later question...
I'll add an optional parameter to disconnect everyone then.
We should probably keep this quite simple, since the !user command isn't a fully fledged review checker command. Here's my view on this:
User command
We could add a contributions category in the embed, where we display very basic data, like total number of contributions and contribution rank in the leaderboard โ or we could make individual fields for it.
However, we must remember that most users checking the user command aren't looking for their full contributions history. Most people...
Looks good to me. I still haven't been able to test this, but I think it's simple enough that one person testing it would be enough. This seems like a fun command.
As a pure code review, this looks good to me.
Postgres backup completed!
You can ping me on discord if you feel like its going stale. This is my work github, not that often checked
I have the same concerns as Vest.
This might just turn into a perpetual Hacktoberfest 2019, with the flood of more or less polished PRs, where contribs will just want to see their name on the leaderboard, without especially looking to contribute in a meaningful way.
This is even scarier if we include reviews, as we would have people just looking to earn a point, but not actually review the code, or just leaving approvals without even knowing what the PR is about.
At the end of the day...
Note on 985b681 which implements an optional kick parameter:
Ideally, the kick parameter would be the last parameter, as it is optional even if other arguments such as channel are passed, but because channel is starred, that wouldn't be possible.
I agree with Akaryas42 and Vest here.
Instead of having a user based leaderboard, we could keep track of the number of PRs, code reviews, additions, and deletions(if possible) done per month, more like statistics keeping track of GitHub activity.
This will not highlight any user(s) and will not lead to competitiveness.
This data can be displayed every month in the #dev-announcements channel.
Note: We have already seen such a thing at the end of hacktoberfest when Joe posted October's Gi...
I think we should have leaderboard for Contributors role owners, as when they got role, this means that user have already made good contributions and (hopefully) don't start making flooding PRs and reviews.
Ks made a really good point, in my opinion, restricting it to Contributors sounds like the way to go.
The current idea we discussed in the admin meeting was indeed to go for a contributors+staff board.
I trust our staff members and contributors to not act to the detriment of our projects and, frankly, if they would do that, they should not have the contributors or staff position. In any case, if we do have concerns about the conduct of contributors/staff members in regards to the board, we can discuss it with them. It's not like we're working with a group of strangers.
We don't want to give the users the option to pass any sort of image to cogs, as it can result in inappropriate content to be used and passed through our bot.
I'm afraid that's something we aren't going to support.
Code looks good. Tested it locally too, ran ~30 times this command and at my level of English, everything looks right.
[python-discord/site] New branch created: ks123/dewikification/event\-pages
Makes sense, I didn't think about that.
I'm closing this as it is a duplicate of #428.
I think we should adjust the scoring system a bit to incentivize reviews a bit more. In the ideal world we should be doing more code reviews than actual PRs.
So maybe flipping the weight or having it be 1.5 pts for a code review and 1 pt for a PR.
@janine9vn I like the idea of incentivizing the reviews. The question is how that would look in practice.
Imagine that you get 1.5 points for a review and something requires 3 rounds of reviews. That would mean 4.5 points to the reviewer and 1 to the person who wrote the code.
Maybe keeping it 1:1 would work better, but that sends a signal that we care about them equally. Do we really, or maybe it's better to test this out with an even higher score for reviews, like you proposed. Either way...
I don't think it should necessarily be points per review. It should be a "did you review this PR (however many rounds it takes" and help it get approved? In my mind a code review is not a single round of review, but working with the PR owner to fully review the code and get it in a good place.
I agree about that in theory, but I'm not sure how that could be automated.
If we only count the fact that they've started a review, isn't that saying that we'd rather see you review a little bit on more things, instead of in-depth reviews on fewer things? What this boils down to is a question of quantity versus quality.
As we've talked about a lot, our contributors and staff members will probably be sound in the reviewing, but I think it's worth pointing out that there may be such drawback...
I have been messing around with the GitHub API a bit and especially this endpoint:
https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls#reviews
In the API response, the list of users along with the state of the review is mentioned. we can use the state of the review to determine whether the reviewer gets points or not.
The following are my opinions:
Condition to get points:
- If state = APPROVED or state = CHANGES_REQUESTED.
- I am considering both t...
If we are intending for this leaderboard to be a separate channel, it'll get a bit messy in the dev category. This would be the layout (the exact order of channels isn't important, but I find this one to make the most sense โย alternatively moving #dev-log):
<img width="240" alt="Screenshot 2020-11-23 at 19 32 05" src="https://user-images.githubusercontent.com/65498475/100000909-93b5c280-2dc2-11eb-87e9-80ddd4782fe7.png">
Instead, I propose the following option, where we split it into two...
I would suggest having the leaderboard at the top of #dev-bounty-board. The channel does not get flooded with messages as solved issue messages get deleted and the bot can constantly update the leaderboard by updating the leaderboard message.
I'd be fine with that. The exact order doesn't matter too much to me in the info category.
Something to keep in mind is that this leaderboard is likely to only be for staff and contribs. It's more of an internal fun thing for us. The Bounty Board, however, will be made public. This has been decided outside of here after some additional discussions.
With #dev-core and #dev-ops, the category is cluttered enough to deserve a split I think, even if most of them are hidden to normal users.
About the scoring part, I'd say that 1:1 would be a good start, and we can try more scoring methods later.
This is place where adding type hint to variable is good.
Use here get or fetch pattern. When some channel/role is not found, this should unload cog and show warning about it, because everything is required there. Also, use asyncio.Event to wait for items loading.
Connected!
More Implementation Details
- There will be 5 leaderboards that have to be combined and sorted into a custom PyDis community leaderboard that we share as an embed. We effectively need to re-implement AoC's scoring system. See below for more info on the specifics.
- How do we distribute which join code gets sent to which user and track when a leaderboard is full? There's a cap of 200 people per leaderboard and I'd rather not run into an issue of a person trying to join a leaderboard that ...
Connected!
ad84a56 Restructure Build & Deploy sequence in CI - SebastiaanZ
[python-discord/site] New branch created: sebastiaan/backend/refactor\-deployment
I've restructured the build & deploy sequence in our GitHub Actions CI workflow:
-
There's now a separate workflow to deploy to our cluster
-
The Build workflow has an additional
ifcheck to ensure we're only starting the build & deploy sequences for pushes to master -
We now checkout the python-discord/kubernetes repo to fetch the deployment.yaml file located in there
Note: This PR is stalled until python-discord/kubernetes#42 is merged.
You can ping me on discord if you feel like its going stale (chibli/floppy). This is my work github, not that often checked
Sure, thanks alot!
The file name would likely be fine as just deploy.yml unless you foresee additional workflows for other deployments. Even in that case, a name with "deploy" as the prefix would be better for sorting purposes, like deploy-kubernetes.yml or just deploy-k8s.yml.
Is the default token inadequately scopes to access private repos? By the way, don't forget to make sure this secret is actually set.
It's good practice to use safe_load but it's okay here since the YAML content is a static resource.
935ed4d feature/add wonder twins command - fisher60
23cf970 move constants to init, change [-1] to .endswith() - fisher60
660c9b4 make init variables more readable, fix docstrin... - fisher60
c73005f fix typos in docstring - fisher60
252ed41 Merge branch 'master' into feature/wonder-twins... - ks129
[python-discord/sir-lancebot] branch deleted: feature/wonder\-twins\-command
Connected!
Yes, it's inadequate; it's scoped to the current repository. The secret is currently set at an organization level.
Postgres backup completed!
I tested this with all the commands I could find in help, and I got the following:
Broken:
- tempban
- tempmute
- tempvoiceban
- superstarify
Improved:
- eval
- close
I'm not actually seeing any difference in doc, so I won't address it. All the other broken commands have their doc syntax in common. I'm seeing a few possible solutions:
- Modify the doc of eval and close.
- Modify the docs of the broken commands.
- Add a check for the doc syntax of the broken commands.
- ...
I think this should wait until the migration to server-bootstrap/smartconfig; what do you think?
Description
The current code for the [Reddit cog] in the Python bot is taking care of updating the #reddit channel. This should be migrated to Sir-Lancebot in order to remove the cog from Python.
Reasoning
For quite a while now, we have two reddit commands, on both Python and Sir-Lancebot, we shall annihilate Pythonโs version.
Once the #reddit channel will be managed by Sir-Lancebot (see https://github.com/python-discord/sir-lancebot/issues/530), the Reddit command should be removed from Python.
This is stalled until https://github.com/python-discord/sir-lancebot/issues/530 is completed.
Didn't get a chance to review tests tonight. Will do that later.
Don't think there's a good way to do it dynamically since the names don't exactly match.
You can map the voice channel ID to the text channel ID rather than doing it by name. It will be more accurate and won't be susceptible to channels being renamed. At that point, this function would be redundant; it'd become equivalent to self.bot.get_channel(channels[channel.id]), which is short enough to not warrant a separate function. The redundancy would be especially true considering this function is currently only called in one place.
These need to have default values set in the config YAML. @python-discord/admins can you provide the IDs?
I don't think it should be a separate filter. It could be integrated into the existing one. The way I envision it is that simply specifying the domain will filter all its subdomains too. This would apply to any level. So b.a.com will filter itself and any further level subdomains of it like c.b.a.com but not a.com. Granted, it would then be impossible to filter only all subdomains and not the current level. However, I don't foresee that being required.
Though I think that issue could be addressed together with this one, even if set aside, my other points still need to be addressed. Someone could easily spoof the filter by omitting the scheme or specifying a port.
These are already in the default_config.
Lines 203 & 204
The comment is no longer accurate since a warning isn't logged.
Should use a variable to ensure the message is the same between it returning False and raising a CommandError. Could even go further and have a Markdown + newline template within which to format the message.
Sorry, I didn't realise. However, those are the IDs for the voice channels, not the text channels. In any case, with my suggestion in another comment, you'd need the IDs for both the text and voice channels.
I hadn't seen that guide before, thank you. I'll fix the rest of the style issues.
Thanks for the heads up, the rest of the channels grouped with that one in the config are the text channels, so there will need to be quite a few channels added to the config.
I'm not actually seeing any difference in doc, so I won't address it. All the other broken commands have their doc syntax in common. I'm seeing a few possible solutions:
- Modify the doc of eval and close.
- Modify the docs of the broken commands.
- Add a check for the doc syntax of the broken commands. (I've prepared an implementation for this if this approach is of interest.)
- Ignore and close the issue.
Sorry, it's the get subcommand of doc. Doing the checks at ru...
[python-discord/sir-lancebot] New comment on issue #530: Migrate the Reddit channel to sir\-lancebot
I would like to work on this
I will take care of this along with the lancebot's issue
[python-discord/sir-lancebot] New comment on issue #530: Migrate the Reddit channel to sir\-lancebot
I will also be completing #348 along with this.
Connected!
Connected!
I don't follow what you mean here. The function is only responsible for sending alerts to the source and target channel (replacing the target channel with a voice chat channel in case of VC). Choosing between the invocation channel and a channel argument was left up to the caller.
There is one check that is sort of related to that, the one that compares source to target channel to prevent duplicate messages.
Persisting to JSON doesn't work anymore. Use Redis instead.
[python-discord/sir-lancebot] New branch created: ks123/advent\-of\-code
Sure, I don't mind that.
Don't do this, you can directly loop over the values as self.messages is a dict.
And also, you are not using the keys from the dict.
for data in self.messages.values():
#seasonalbot_commands channel does not exist anymore, it is now renamed to Channels.community_bot_commands
Initial reviewing on looking through the code briefly. Not tested yet.
The command description could be better.
example: Register/add your spookified version of the name
How would you get the overwrite object in the if and else branches without calling the overwrites_for first? Since it's different for both branches, you'll need to have duplicate code inside the branches or have two checks (current implementation).
The code of the bottom branches (line 238-247) can be refactored into the top branches (226-233), but then the call on 235/236 has to be duplicated.
I will be completing this along with #530
These commands would help in moderation by allowing mods to give temporary screen sharing permissions with one command
stream {duration default 1} {time unit default hour} - gives user video role for specified duration
revokestream - takes away video role
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
ok forgot to fix flake8 issues
That is true, however, this function was intended to be a more general kick/mute function that can work for other features (see related: #1160).
I'd be fine with removing that until I get started implementing the other features if you believe that would be better.
They are just ignored (I believe at the d.py level, as PermissionOverwrite objects can accept any permissions). Do you think it would be better to add checks here and set the overwrites based on the channel type?
These commands would help in moderation by allowing mods to give temporary screen sharing permissions with one command
stream {duration default 1} {time unit default hour} - gives user video role for specified duration
revokestream - takes away video role
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
The default config (and constants file) is missing the following channels:
- Code/Help 1 (voice)
- Code/Help 2 (voice)
- General/Offtopic (voice)
- code-help-voice-1 (text)
- code-help-voice-2 (text)
- staff-voice (text)
- admin-voice (text)
A lot of these channels either have the voice portion or the text portion, but not both. I've prepared a PR to address this.
Closes #1304
Adds the following channels to default config:
- Code/Help 1 (voice)
- Code/Help 2 (voice)
- General/Offtopic (voice)
- code-help-voice-1 (text)
- code-help-voice-2 (text)
- staff-voice (text)
- admin-voice (text)
Note: admin-voice (text) is still missing an ID.
I tried sepearting out the two groups (text chat and voice chat), as it is confusing in the current form:
L200-L201: voice
...
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
The lock_arg is locking on ctx.channel. This is no longer adequate since you've added a channel arg that may be specified instead of using the context. Therefore, the lock decorator needs to be adjusted so it can lock on the correct channel.
I don't understand how that issue differs from what you're already doing. It compares it to !shh, which is just an alias for the silence feature in this cog. The two issues look like duplicates. Muting individual users could be done through the Discord UI. If needed, a command could be added to keep track of user infractions like we do for bans and kicks, which could also be done through the UI. However, that is out of scope.
No, it's fine if they're being ignored.
I missed that, sorry. The overwrites_for will just have to be duplicated in the if and else blocks at the top.
It's still incorrect. Every argument must be on a separate line You also inconsistently used 4 and 8 space indents. There is also some test code which has similar style issues. For long function calls, consider assigning an argument to a variable and then passing the variable to the function. This will avoid having to break up the function into multiple lines. For example,
self.scheduler.schedule_later(
30,
afk_channel.id,
...
I didn't mean to completely get rid of the converter, just to change it's implementation to rely on the existing converters. When using a union, there isn't going to be an error for an ambiguous matches.
An alternative implementation is to create a subset of the text channel converter which does not support matching by plain text names. Such converter in a union with the regular voice channel converter would effectively funnel all plain text names to the voice converter. Of course the down...
Connected!
Connected!
This can be simplified
# Reply to invocation channel
source_reply = message
if source_channel != target_channel:
source_reply = source_reply.replace("current channel", target_channel.mention)
await source_channel.send(source_reply)
# Reply to target channel
if alert_target:
if isinstance(target_channel, VoiceChannel):
voice_chat = await self._get_related_text_channel(target_chan...
Saving the result of isinstance is unnecessary since it's a cheap operation. The code could be simplified as follows:
if isinstance(channel, TextChannel):
role = self._verified_msg_role
else:
role = self._verified_voice_role
overwrite = channel.overwrites_for(role)
if prev_overwrites is None:
log.info(f"Missing previous overwrites for #{channel} ({channel.id}); defaulting to None.")
...
I think you misunderstood what I was aiming for. The problem is that there are if statements that are avoidable. The problem is not with calling isinstance twice. What you've done still keeps the avoidable if statements. I've corrected my original code suggestion for this (https://github.com/python-discord/bot/pull/1297#discussion_r529262670) and I still think you should implement it like that.
Connected!
Connected!
That's a much neater implementation, thank you.
I definitely did, I'll go ahead and implement that correctly.
I removed the original converter because I realized all that's lost would be the ability to mix case, and as you mentioned, the ambiguity warning.
It didn't seem like those were critical features, and the discord library just picked the first option when the argument was ambiguous. Regardless, I'll go ahead and reimplement it with the suggested changes as it doesn't complicate the code base much.
But on the note of mixing case, would it be better to not allow that? It can lead to ambigu...
Postgres backup completed!
I had originally understood that issue as something similar to mute, acting on a per-user basis. After rereading, this functionality will not be needed for either of the issues, so I'll remove it.
If you want to enforce the user argument then don't define it as optional. The default error message for a missing argument will suffice in that case.
Use a Scheduler to schedule removal of the role at a precise time rather than a task that polls.
Use the extant Duration converter instead of rolling your own. In fact, it'd be even better to use Expiry defined there too. This will support specifying exact timestamps too and make it consistent with the infraction commands.
Yeah, I agree that those features aren't critical. I just figured that since you already did most the of the work, you may as well leave it in. However, since you've removed it again, I could live without it. I'll leave that decision up to you and other reviewers.
discord.py's converters are case sensitive so you don't need to worry about mixed case. I'm suggesting that you rely on them to do all the comparison work (i.e. by calling their convert() methods within your convert()) rather...
This is meant to resolve issue #1256. The code as previously written would remove the help cooldown role from the person who invoked the !close command, even if was a staff member who was not the claimant. This version worked as expected for all the cases I thought of when tested manually.
#1294 may need to be approved first
This log seems relatively expensive performance wise. The items are still retrieved even if the log isn't printed.
I suppose this refactor is okay, but didn't seem necessary. I'd prefer for at least the second if statement to not be negated, and just have the couple lines nested under it rather than returning early.
This could be None if the member has left the guild. That needs to be accounted for.
Is there a reason why it's wrong in this particular case?
It is not really wrong. I mainly found it unnecessary. The suggestion at the end is mainly because it'd make the code shorter:
if not await self.dormant_check(ctx):
return
await self.move_to_dormant(ctx.channel, "command")
self.scheduler.cancel(ctx.channel.id)
versus
if await self.dormant_check(ctx):
await self.move_to_dormant(ctx.channel, "command")
self.scheduler.cancel(ctx.channel.id)
It also makes the control flow slightly easier to f...
@MarkKoz Thanks for your feedback. I believe I've made all the requested changes and will report back when I've had a chance to test them.
I think early exiting makes it easier to tell which lines are doing what the function is generally expected to do versus which lines are handling a special or unexpected case, though I'll defer to your judgement.
I added the !r to add the quotations around the name.
If I move this variable outside, I will need to use global EMOJIS_VAL, so shall I do that?
Postgres backup completed!
Left a few comments, but nothing that stops an approval. It looks good and it really helps with keeping things tidy and organized.
Do you have specific side effects in mind here? And is it a technique we should be using more often? I'd be happy with a reply in server as well; this isn't strictly commentary on this PR, rather just me trying to learn something from you.
Simplify excluded channel check if we go with the suggestion I made for line 13.
return not isinstance(channel, discord.TextChannel) or channel.id == EXCLUDED_CHANNEL
We could take this moment to remove the constants.Channels.how_to_get_help from the EXCLUDED_CHANNELS constant. The only non-"help channel" that's currently in a help channel category is the cooldown channel.
I kinda like the constant, as it labels the constant as an excluded channel, so we could do something like this (combined with the suggestion for line 57):
EXCLUDED_CHANNEL = constants.Channels.cooldown
Then again, keeping it as it is allows us the freedom ...
How does this relate to #1305? since both are making changes to constants.py and are about the voice channels.
This PR was just adding an existing config parameter to the constants file. #1305 adds new fields and restructures the default config, so I split it out into its own PR, as to not clutter this one.
It's necessary to merge this PR before #1297
8c2e7ed Add voice_ban to supported types of the scheduler - SebastiaanZ
[python-discord/bot] New branch created: sebastiaan/bugs/add\-voiceban\-to\-scheduler\-types
The voice_ban infraction was not listed as a supported type for the infraction scheduler. This meant that the scheduler did not schedule the expiry of voice_ban infractions after a restart. Those unlucky users were voice-banned "forever".
[python-discord/bot] branch deleted: sebastiaan/bugs/add\-voiceban\-to\-scheduler\-types
Connected!
415f550 Update constants to match with new format of Ao... - ks129
e956170 Add staff AoC channel to whitelist - ks129
2f62366 Add comments about AoC env config order and cha... - ks129
85ddb6d Implement different invitation codes for staff ... - ks129
c3bbbbd Implement staff and public leaderboards - ks129
Relevant Issues
Closes #522
Description
This makes difference between should this use staff leaderboard data or combined public data based on channels. When this is refreshing leaderboards, this is overwriting all current local data, because it is hard to keep track what is already cache. This sends different join codes for staff and normal users. Users will not notice big changes from last year, as UI is same. This links users with 1 leaderboard.
Additional Deta...
3f490ab Changes requested by @MarkKoz, new `unclaim_cha... - swfarnsworth
Sorry if there's a way to do this that I'm not realizing, but if there is it should be documented. I see that I could fork this image and provide my own Pipfile, but is there any way that I can add custom dependencies to the out-of-the-box solution (e.g. through passing some parameters to the run command ideally)?
8c2e7ed Add voice_ban to supported types of the scheduler - SebastiaanZ
e164da7 Merge pull request #1307 from python-discord/se... - SebastiaanZ
1097a31 Merge branch 'master' of https://github.com/pyt... - swfarnsworth
You can use docker exec to run pip install ... within your running container. Keep in mind packages installed this way won't be part of the image; if the container is deleted, then so will the extra packages you installed.
Yes. I forgot to document it. e5b073c
I removed the constant but kept it as a tuple to maintain support for excluding multiple channels in the future.
I think I did this to avoid sending the log message, but I now realise it causes a bug so I've removed the done() check. See the message of d9f87cc for more details.
Connected!
Connected!
Automatic extension discovery has to import this subpackage to check if it's a valid extension. This is mainly to be able to list all extensions with the command that shows the loaded/unloaded status. Otherwise, it could have taken a more dynamic approach which attempts to load extensions as requested and considers them invalid if discord.py throws an error.
If this extension is not being loaded, then any code that gets executed upon importing the package is just a waste. Side effects coul...
[python-discord/bot] branch deleted: feat/help/refactor
ed68051 Help channels: move to a subpackage - MarkKoz
a1b2e8e Help channels: remove get_clean_channel_name - MarkKoz
abd6953 Help channels: move name and channel funcs to s... - MarkKoz
0cc221a Help channels: move validation code to init.py - MarkKoz
aa7eff2 Help channels: rename modules to use singular t... - MarkKoz
Connected!
Checking if it's cancelled is redundant
If the callback has already been canceled or executed, this method has no effect.
Why is it being cancelled in here too? I don't see how the function can be called again before a previous one is executed.
Should follow the style guide. Each argument needs to be on a separate line as well as the closing parenthesis.
Since the message is the same, these can be merged by doing or e.status == 403.
f"Can't pardon {infraction['type']} for user {infraction['user']} because user left the guild."
I think this should be logged as an exception rather than a warning to be consistent.
Infoblock tag helping people install Microsoft Visual C++ Build Tools on Windows.
Special thanks to those who helped proof-reading this on Discord.
Thank you for contributing to Python Discord!
Please check out the following documents:
- Join the Discord server! - If you have not already, join the Discord server and introduce yourself in our #dev-contrib channel.
- Python Discord Contributor Wiki - A set of resources about setting up our services
- Python Discord Code of Conduct - Code of conduct for our commu...
Postgres backup completed!
I think Leterax made a really good point in #meta, what if we send the DM only when you get your first answer? The obvious upside is that you'll know when you'd have a potential answer, and the less obvious one is that it'll reduce the number of API calls made when opening a help channel.
I think I fixed all pointed out issues and implemented requested changes. Thx for pointing out the Scheduler as it actually made it much simpler
A few small changes need to be made, but everything is looking good.
Can you add a code comment here explaining what this loop is looking for.
This will throw an error if the leaderboard was deleted, as the API will just return another page, of type html.
It currently silently fails. Can you catch the ContentTypeError here and send an alert? Class creation should also be forced to fail.
This check is redundant as the leaderboard always contains the creator, or gets deleted.
The file name would likely be fine as just
deploy.ymlunless you foresee additional workflows for other deployments. Even in that case, a name with "deploy" as the prefix would be better for sorting purposes, likedeploy-kubernetes.ymlor justdeploy-k8s.yml.
Ah, yeah, I meant to change that back. Thanks for catching it.
PyCharm's validator picks ups deploy.yaml as a special kind of YAML file (haven't found out which one yet) and starts screaming that it doesn't follow the sch...
f795ec9 Rename kubernetes-deployment.yaml to deploy.yaml - SebastiaanZ
Some grammar things in comments
# Public AoC cookies in environment must be in the same order as AdventOfCode.leaderboard_public_ids
Grammar
# Public join codes in environment must be in the same order as AdventOfCode.leaderboard_public_ids
# Check whether we are in the 25 days of advent
ffa3619 Fix adventofcode extension (and constants) grammar - ks129
Connected!
[python-discord/forms-frontend] New branch created: jb3\-patch\-1
a9f531c Add check for core dev approvals on pull requests - SebastiaanZ
[python-discord/sir-lancebot] New branch created: sebastiaan/ci/add\-core\-dev\-approval\-check
Connected!
This commit adds a workflow that checks if a pull request has received at least one approval from a core developer. If not, the check will fail and block us from merging the Pull Request.
The reason we're adding this check is because we're moving away from making the entire Core Developers team a "code owner" of every line in every repository. This created a lot of "notification" spam, which drowned out the actually relevant notifications.
As we still want to make sure that there's at l...
[python-discord/forms-frontend] branch deleted: jb3\-patch\-1
Connected!
Connected!
After some discussions in the mod channels, we decided to do some things differently. I'll open a different pull request.
[python-discord/bot] branch deleted: mbaruh/commands\-del
[python-discord/bot] New branch created: mbaruh/infractions
grammar
"""Updates public leaderboards' cached member amounts every 30 minutes."""
Why is this a list comprehension?
Wording here is pretty confusing, perhaps something like the following is a little clearer:
"""Checks if staff leaderboard should be refreshed and refreshes when required."""
Postgres backup completed!
Trying to voice ban someone who left the server leads to:

The voice ban still registers, but the exception should be caught.
Closes #386
Migrated all current event pages to dewikified event pages system.
Adafruit are a wonderful company who helped sponsor one of our code jams some time back, but should probably not be listed alongside Linode, Notion, Sentry and these other companies who are ongoing sponsors that provide us with value month after month.
Let's remove Adafruit from that sponsor block on the front page.
Note: We should not remove them from the code jam info page where they were a sponsor, of course.
06a4af8 Remove Adafruit from front-page sponsors listing - ks129
[python-discord/site] New branch created: ks129/frontpage\-adafruit\-remove
Closes #428
Remove Adafruit from front-page sponsors listing.
@ks129
images/sponsors/adafruit.png is used elsewhere, then? or will be in the dewikification branch when code jam pages are moved, is that your thinking?
d59186a Delete Adafruit PNG file from static - ks129
Actually, this is not used anywhere, because code jam pages doesn't contain it.
This PR implements some small but useful changes which were discussed internally:
- Removes the unnecessary and undesired
shadowkickandshadowmuteinfractions. - Gives mutes a one hour default duration.
- Adds the
ialias to the infraction command group, and theealias to theeditinfraction subcommand, which closes #1278
Hi, thank you for contributing!
The thing with changes to moderation features, is that they need follow internal discussions to decide on whether we want it, and how we would use it - which in turn affects the implementation.
That is not to say that you can't PR such a feature, but rather that the right course of action here would be to open an issue first to allow us to discuss it properly, and to prevent a case where you would do a lot of work that would end up not being used.
I will...
Hello, thanks for your contribution! The tag looks pretty good, although I'd rather prefer have it named something like microsoft-build-tools (which should still make build-tools match) to communicate that it is a Windows/Microsoft specific thing.
[python-discord/bot] New branch created: mbaruh\-codeowners
[python-discord/bot] branch deleted: mbaruh\-codeowners
Connected!
I don't know what the final decision will be yet, but I've moved that code into its own function until we decide what to do.
Updated the PR description to reflect this.
[python-discord/site] branch deleted: ks129/frontpage\-adafruit\-remove
ad84a56 Restructure Build & Deploy sequence in CI - SebastiaanZ
f795ec9 Rename kubernetes-deployment.yaml to deploy.yaml - SebastiaanZ
6e17536 Merge branch 'master' into sebastiaan/backend/r... - SebastiaanZ
582aa51 Merge branch 'master' into sebastiaan/backend/r... - Den4200
5ec3971 Merge branch 'master' into sebastiaan/backend/r... - Den4200
[python-discord/site] branch deleted: sebastiaan/backend/refactor\-deployment
I don't think this log needs to be INFO, maybe DEBUG instead.
Same here: I don't think this log needs to be INFO, maybe DEBUG instead.
These variables should be assigned on separate lines.
I think code_help_voice_1 may be a better name for this, following suite with the other code help voice channel.
This channel doesn't actually exist.
Agreed, I just left it in the original format to minimize changes, but I've updated it.
Sorry for just realizing, the channels need to be alphabetized as well.
I don't think we want to keep !shadowtempban either - it can probably be removed as well.
https://github.com/python-discord/bot/blob/7b3d8ed6e655b787c2538541ca35301f2fadb508/bot/exts/moderation/infraction/infractions.py#L201-L225
Superstarify needs to be fixed too.
As a bit of an update, there is no real good way to fix the output, without changing the docstrings. Paragraphs that pass the 80 character limit have to be spaced onto multiple lines for linting, but discord embeds can't really automatically handle that. There is no good way to stay under the limit, and present a good output.
This means we will have to shorten or break up the broken doc strings or implement a parsing solution.
I'd like to keep shadowtempban. It's the one that was actually being used from time to time in case we want to tempban someone who's just left the server.
Since it was actually being used, I'd rather not remove it
There's no harm in keeping it.
Hello, thanks for your contribution! The tag looks pretty good, although I'd rather prefer have it named something like
microsoft-build-tools(which should still makebuild-toolsmatch) to communicate that it is a Windows/Microsoft specific thing.
Thanks for the suggestion! Just made the change 54540bf9dcf88f7d3e2e0f389a2127456d6c877f
Connected!
Is it feasible to make !d set without other arguments an alias to !d get set?
The config file can use some cleaning up, just organizing a few things into alphabetical order. I can tackle this if this is a needed fix.
Examples (these are all individual items, categories and sub-categories can also be reorganized):
This is a comma splice. Either use a full stop to make them separate sentences or use a semicolon to join the independent clauses.
raise BadArgument("The provided package name is not valid; please only use the _ and a-z characters.")
Symbols from the same page will expire at roughly the same time. If a page URL is used as the key and symbols are stored under it, then it'd be viable to use EXPIRE. The key can be prefixed with the package name to make it possible to search redis for all keys matching a pattern and delete them. This is slower than having a single key to delete like you currently do, but deleting packages won't be a common occurence.
There's processing time for the symbol queue as well as some symbols bein...
This doesn't follow the established format. In order for the license to be re-usable by other copyrights, the copyrights should be separate from the license content.
Applies to:
- Copyright (c) 2007-2020 by the Sphinx team (see AUTHORS file). All rights reserved.
- bot/cogs/doc/inventory_parser.py: _load_v1, _load_v2 and ZlibStreamReader.__aiter__.
---------------------------------------------------------------------------------------------------
join() is overcomplicated for this task and also implies at a glance that something more complicated is happening.
return self.base_url + self.relative_url_path
Is this local dict used to work around the uncertainty of when redis will actually store an item?
There may be a race condition here. While clearing I believe you need to lock to ensure that no new items can be queued.
What's your idea for how to fix it?
I would have used a thread cause that's what I'm familiar with, but if this works then I suppose it's fine. I don't know enough to comment on it.
The code is being ran synchronously so nothing yields control to the event loop.
But I had a concern that I forgot about with the cancel here as I'm not sure how exactly it works. The docs mention that the exception will be raised at the next cycle of the event loop. Does that mean if this was getting executed while _parse_queue is suspended It'll be cancelled immediately when it gets control or on the next await inside of it?
Only user fetched symbols are stored in redis, to prevent thousands of items that nobody will ever access from being stored, but we still parse those items and they are cached through this dict to be available instantly if somebody does end up fetching one
I couldn't really think of anything that wouldn't unnecessarily complicate this because we also need to hold the connection within the context manager and the conditional is in the middle of it
@Akarys42 That would mean that people are reminded to go back to the channel and engage on a message, which could be a good thing. It also gives them a place to see the conversations that were at least not totally ignored.
On the flip side, I think it's odd not giving the user a complete log of help channel activity in their DMs. What if they wanna find back to a question that wasn't answered? What if they wanna update their question but has left the channel?
Taking all of this into account...
Signatures aren't always valid syntax because of optionals etc.
From the previous condition we know that the character before the quote is a backslash, if that backslash is escaped the quote is a valid closing quote. But this made me realize that the code assumes ' and " are used interchangeably in python, which they aren't, and probably is worth accounting for
That shouldn't really be a problem because we're ignoring commas to split on anyway if we're within brackets, however the parsing fails when we decrease depth on string matches below without knowing if the initial depth increase came from a string or one of the brackets
How much are things like warnings looked at and who has access to them? Wondering if this would be more suited as a message in some staff channel, it'd require some more logic around it as it'll most probably get logged multiple times when an updated page is fetched and there may be some false positives from weirdly structured docs
Should we capitalize Markdown everywhere in the code?
Only user fetched symbols go to redis as pages may contain a lot of symbols (monolithic doc pages like discordpy's api reference may contain thousands behind a single url) that simply won't ever get fetched by user or very rarely, storing them feels like a waste when there's only a small cost to the fetching and in case it's a more used url it'll already be cached in CachedParser's internal dict as mentioned in https://github.com/python-discord/bot/pull/1014#discussion_r532129908
It'll just pass through
In [28]: from urllib.parse import urljoin
In [29]: urljoin("http://www.baseurl.com/path/to.ext#something", "txe#somethingelse")
Out[29]: 'http://www.baseurl.com/path/txe#somethingelse'
In [30]: urljoin("http://www.baseurl.com/path/to.ext#something", "http://www.anotherurl.com/path#id")
Out[30]: 'http://www.anotherurl.com/path#id'
Beautifully documented and well written, nice work! Everything looks correct to me, but I have not tested it.
Postgres backup completed!
Connected!
Maybe we could send a message if their help channel was closed without being answered, with a link to the "asking good questions" page and saying that they are free to open a new channel after the cooldown wears off? I think this would be even better.
ed68051 Help channels: move to a subpackage - MarkKoz
a1b2e8e Help channels: remove get_clean_channel_name - MarkKoz
abd6953 Help channels: move name and channel funcs to s... - MarkKoz
0cc221a Help channels: move validation code to init.py - MarkKoz
aa7eff2 Help channels: rename modules to use singular t... - MarkKoz
I know the original specification for this task was to give points, decrementing from 100, but I did more research and found this on private leaderboards:
For N users, the first user to get each star gets N points, the second gets N-1, and the last gets 1.
This ultimately will not have a major effect on the final results, but if there is time, remove the list splicing on these two lines, and the points = 100 should just become the length of leaderboard_users.
I won't request this a...
Some of the specifications of what we want have changed. I'm working on an updated version.
73dff91 Add constants parsing for multiple leaderboards - SebastiaanZ
0c79e90 Remove adventofcode.py in favour of subpackage - SebastiaanZ
1444c81 Rewrite Advent of Code leaderboard logic - SebastiaanZ
159c2eb Remove redundant _error_embed_helper function - SebastiaanZ
b13667c Remove now redundant advent_of_code_staff constant - SebastiaanZ
5ce12af Set correct channel ID as default for AoC channel - SebastiaanZ
c352c80 Fix docstrings and add a few explanatory comments - SebastiaanZ
c6b89c2 Add global leaderboard command back - SebastiaanZ
60ace6a Update information for the .aoc about embed - SebastiaanZ
I have a few changes in mind, but I wanted to verify that these are changes we'd want before I potentially clutter the commit history with them.
Generics
These two type aliases are currently defined as follows:
RedisKeyType = Union[str, int]
RedisValueType = Union[str, int, float, bool]
If we redefine them using TypeVar then we can have generics for RedisCache and RedisQueue, but that might count as a backwards-incompatible change depending on what the spec is inte...
This PR is ready for review again.
Postgres backup completed!
Description
Instead of putting each line as a separate entry in the lines parameter, .extension list will create a line with newline characters in it, like so
https://github.com/python-discord/sir-lancebot/blob/b0bddb905b8b7e311aad103570c8245f7c0a0683/bot/exts/utils/extensions.py#L164-L168
While this can seem harmless, this will cause the line length check to fail, and raise a RuntimeError
https://github.com/python-discord/sir-lancebot/blob/b0bddb905b8b7e311aad103570c8245f7...
These can be removed now, because they are already in AOC_LEADERBOARDS.
These two comments don't match (24th and 25th).
This should be also under helpers.
These two lines are now unused with the new parse function.
Can we use the month decorator here, so it is easier to debug? A check to disable the day check if debug mode is on would also be helpful, but I don't necessarily know how that would affect testing.
This line non-fatally errors while parsing, as it can't decode "\u2b50" (white-star). Perhaps a replace on full_leaderboard before calling the update?
Ee probably can, but this is part of the old code. I'm more in favour of getting this merged quickly so people can actually join the event. Could you make an issue for it?
That's interesting. It does not give any errors or warnings for me. Could you send me a sample of the warnings you are getting? And, what emits them? Also, which OS are you on?
Why? This is a straightforward conditional expression, in the most basic form.
This is part of the old, existing code. I'd rather focus on getting the new feature merged before trying to polish the older parts. We simply don't have time; we need the new features ASAP.
This is part of the old, existing code. I'd rather focus on getting the new feature merged before trying to polish the older parts. We simply don't have time; we need the new features ASAP.
This is part of the old, existing code. I'd rather focus on getting the new feature merged before trying to polish the older parts. We simply don't have time; we need the new features ASAP.
We should focus on the new features, instead of polishing the code that was part of the code for a long time. It's a bit difficult, as the move/split of the files messed with the git blame history, but do try to think of whether a chance a this point is essential.
The event starts in less than 17 hours.
I'll resolve this, and open a separate issue.
OS: Windows 10
Command: aoc leaderboard
Config:
- Fake Redis is True
- Last year's python discord private leaderboard
Exception:
https://paste.pythondiscord.com/alafejusus.rust
Some of the unicode characters that raise the error: \u2b50, \u0142
Resolving this, as it seems to be unrelated to this code specifically, but rather as Sebastiaan pointed out, a logging problem. I will investigate and open a seperate issue.
I've changed the docstring to reflect it
I think this is useful logging to have in production, at least for the first event, given the new join code setup.
I think this is useful logging to have in production, at least for the first event, given the new join code setup.
I think this is useful logging to have in production, at least for the first event, given the new join code setup.
809da33 Set character encoding for logging to utf-8 - SebastiaanZ
Some grammar things in comments
09a70a1 Update CODEOWNERS for Den4200. - Den4200
[python-discord/sir-lancebot] branch deleted: sebastiaan/ci/add\-core\-dev\-approval\-check
Connected!
a9f531c Add check for core dev approvals on pull requests - SebastiaanZ
fbab3c5 Merge branch 'master' into sebastiaan/ci/add-co... - Akarys42
09a70a1 Update CODEOWNERS for Den4200. - Den4200
95e740f Merge pull request #532 from python-discord/seb... - Akarys42
6acee91 Merge branch 'master' into ks123/advent-of-code - SebastiaanZ
Let's get this merged. The code looks good and the core functionality works as expected. We can always go back and tinker with it later.
[python-discord/forms-backend] New branch created: add\-form\-schema
Update SCHEMA.md with the form structure.
[python-discord/forms-backend] branch deleted: add\-form\-schema
Alright, let's merge this.
415f550 Update constants to match with new format of Ao... - ks129
e956170 Add staff AoC channel to whitelist - ks129
2f62366 Add comments about AoC env config order and cha... - ks129
85ddb6d Implement different invitation codes for staff ... - ks129
c3bbbbd Implement staff and public leaderboards - ks129
[python-discord/sir-lancebot] branch deleted: ks123/advent\-of\-code
Connected!
We should use pydantic to create models for our form structure.
This issue should purely implement the models, there is no reason to add any routes for this yet.
Where possible we should perform as much validation as possible to ease stray data entering the database.
We should sanitise all fields that are not in the SCHEMA.md file in the root of the repository to avoid having MongoDB control characters entering the fray.
Right now the authentication route will set an admin property to True in the token if a record exists in the admin collection that looks like:
{
"_id": "112233445566778899"
}
Let's write a couple of decorators for use across the application:
- Validate that tokens provided in the
Authorizationheader are legitimate (signed by us), else return an error. - Validate that the authentic token has admin set to true, else return an unauthorized error.
Add a route that can be used to create a form using the fields in SCHEMA.md.
This should use the decorators created in #5 and the Pydantic models created in #4.
We should store this in the forms table with the properties in the SCHEMA file. There are already routes to query forms in place that you can use to test your changes.
Update the schema file with the schema that should be used for recording the responses to forms.
Update the existing form submission code to store data tied to a form.
Right now the implementation has some code to perform anti-spam and Discord data collection, but there is no method for validating the submitted data matches the fields on the form.
The current implementation also does not record anything, just returns it to the user to show that the route is working.
This is a long term goal!
We should have the ability to define a set of unittests and run user code on snekbox to automatically calculate the results of this.
This could be used for code jam qualifiers and other tasks which require a completed code element.
If users fail the unittests we will return this feedback to them in the browser so they cannot actually submit until their code works.
d3a708e Enable AOC commands before December - SebastiaanZ
Connected!
Connected!
Description
Currently, the .aoc leaderboard command says "Here's our current top 9! :christmas_tree::christmas_tree::christmas_tree:". This is confusing because it is actually not the current top 9, because the leaderboard only updates every 30 minutes. This already led to a bit of confusion in the #advent-of-code channel. The leaderboard command should make it clear that it updates every 30 minutes so what it shows may not be accurate.
Reasoning
Less confusion over the lea...
The info embed does already show you the last time the leaderboard has been updated:

We're Python programmers (surprise! :tada:). It would make sense to be able to validate form responses with Python snippets.
The way we should do this is write a standard interface for validating form responses.
Validation functions will look like:
def validate(value):
if value == "correct":
return True
else:
return False, "error message here"
We'll run this inside snekbox so need to decide on a serialisation method to bring data in and out of...
Oh completely missed that. Closing issue.
Connected!
[python-discord/forms-backend] New branch created: ks123/models
- Installed new dependency:
pydantic. - Added following new constants:
QUESTION_TYPES: All supported question types.REQUIRED_QUESTION_TYPE_DATA: Required question data (options, text etc.)FormFeatures: Form features enum.
- Create
QuestionandFormmodels.
I can work on a patch for that.
Closes #1309.
Checks is a user is a guild member, before performing guild operations (such as kicking from voice or removing roles) when using voice mute or general mute.
I made winter logo same size as previous server icons. I still have to make numbers larger but I need a day or 2 to do that.
new: https://raw.githubusercontent.com/Harbys/branding/master/seasonal/christmas/server_icons/festive_256.gif
 - Harbys
The code is being ran synchronously so nothing yields control to the event loop.
Each event is awaited. That provides many opportunities to yield control. It may also be an issue that the events dictionary could get updated during iteration.
Does that mean if this was getting executed while _parse_queue is suspended It'll be cancelled immediately when it gets control or on the next await inside of it?
Not sure. Probably the former.
Did you determine that the cache would be too large if all the symbols were stored in redis?
Sentry would only create one issue for this and the Sentry webhook would only relay it once. It could be marked as resolved and later be automatically unresolved by Sentry as a regression. The raw logs are not looked at actively. They are looked at only rarely when something seems wrong and there's no other info. I'm not sure if this is adequate.
[python-discord/bot] branch deleted: pure/feature/infraction\-append
Yes because it's a proper noun. It's the same reason Python or Java would be capitalised.
Connected!
Is it really a small cost? You'd end up fetching the page and parsing all its symbols, which is especially bad in monolithic pages as you mentioned. Every time the bot restarts, the dict is cleared. It's conceivable that for every restart, a different symbol from the same page would be requested. Though individual symbols may be rare, combined together, the chance of any "rare"/new symbol being request seems relatively high.
It may be more likely for the current parser to split incorrectly than it is for a signature to be invalid syntax. I wonder if it's worth the complexity to use ast and fall back to the current parser. I haven't seen how this performs with practical data.
Oh right I was focused on the clears themselves when thinking about it and skipped over the waits at the start. Will lock the commands when a refresh is taking place
An another problem with ast is that it destroy the information of how the initial source looked, but the custom parser just lets it through.
I don't think there are many cases where the current parser will fail after the string errors are handled, it won't be able to split conditionals because it can't tell apart an optional bracket or a list arg but should do fine in other cases as it only needs to keep count of the brackets
I don't think it'll be very big (maybe a dozen mb or so), just feels wasteful, but if we're updating with the set_if_exists then perhaps it's worth it as a redis op is taking place anyway. the current structure is ...Docs:<package>, should be fine if we create a key for every relative url path namespaced after the package and set expires on that as you mentioned. The differences between when the individual items inside were parsed and added to redis are negligible compared to the timeout they...
Connected!
That's a good point. I'm still not particularly confident in this split function but we can roll with it and fix parsing bugs along the way if we encounter any common cases.
Connected!
Postgres backup completed!
Would appreciate a re-review, bearing in mind some changes still need discussion.
Discussion needed on:
- Keeping or removing the custom channel converter, in favor of a text-voice union
- Should the AFK voice channel be assumed to always exist (or should we keep the temporary channel creation function)
[python-discord/forms-backend] New branch created: ks123/admin\-authentication
Closes #5
Implemented JWT user + middleware for authentication. This return authenticated scope for every authenticated user, but also admin when user have admin key True in token data. To make endpoint working only for admins, use @requires(["authenticated", "admin"]) decorator.
Connected!
But one thing with having a consistent 15-minute cooldown is the question might have had a short answer, and they close the channel.
If they encounter another problem then this makes it so that they can't claim a help channel and might keep on asking their question in other channels
Connected!
[python-discord/forms-backend] branch deleted: ks123/admin\-authentication
11a9f41 Use plain string as type for question id - ks129
0627b7c Add validating emails collecting login - ks129
e98dd18 Ignore too long line for if statement - ks129
[python-discord/forms-backend] branch deleted: ks123/models
82a6007 Add function that allows tasks to sleep until AoC - SebastiaanZ
cb41813 Let status update task sleep until the AoC starts - SebastiaanZ
575fedc Ensure status countdown waits for bot start-up - SebastiaanZ
3e5cff4 Let puzzle notification sleep until AoC starts - SebastiaanZ
d9e98c3 Clarify time_left_until_est_midnight function - SebastiaanZ
[python-discord/sir-lancebot] New branch created: sebastiaan/advent\-of\-code/refactor\-background\-tasks
The Advent of Code extension runs two background tasks during the event:
countdown_dayto announce the release of the next puzzlecountdown_statusto update the bot's status with the time left until the next puzzle is released
However, both tasks were written with Season Manager in mind, meaning that they rely on the extension only being loaded in December. In addition, some changes in Discord's API flow mean that the countdown_status task has a high chance of failing during ...
Postgres backup completed!
Resolved by #11 . Closing.
Description
The logic for the custom Advent of Code leaderboards is unable to handle duplicate names, leading to instances where the score and the actual work done do not line up. Line 56 of This Public Leaderboard.
Steps to Reproduce
- Register two accounts with the same username on the AoC website.
- Submit with the first username only.
- Join one leaderboard, and set it in the environment variables.
- Call the `aoc lead...
Connected!
5ddbcaa Move from PyMongo to Motor driver for asynchron... - ks129
baf067f Lock all forms showing to admins only - ks129
6e7ea2a Fix Question circular import and use cls instea... - ks129
a47c499 Use cls instead self for Question model validators - ks129
a494835 Move MongoDB output to Form model and after con... - ks129
[python-discord/forms-backend] New branch created: ks123/forms\-routes
- Migrated PyMongo to asynchronous Motor.
- Made small fixes in models:
- Removed circular import of Question
- Use cls instead of self (Pydantic stuff)
- Fix form features validation (plain
__members__.values()don't work).
- For listing views, move data to model before returning to:
- catch broken data
- return
idinstead_id
- Locked all forms listing endpoint only to admins.
- Created endpoint for creating new forms (
/forms/new, POST). - Closes #6.
Description
make a music bot that can play music from any website and any video
Reasoning
it would be a great addition to python discord server because i know many people that like to listen to msuic while coding
Proposed Implementation
i give code
Additional Details
Would you like to implement this yourself?
- [ ] I'd like to implement this feature myself
- [ ] Anyone can implement this feature
Hello @Dragon-Batch,
Thank you for your interest in contributing to one of our open source projects. Unfortunately, we don't want to add the proposed feature to one of our bots or have such a feature available in our community.
One of the reasons is that most music bots violate both copyright laws as well as the terms of service of the websites/service they use as the source for the music they play. Another reason is that we don't want to have such bots in our voice channels: Our voice ...
Description
Currently, the way we check if an error is handled locally in the cog/command is different in both the bots.
@Sir-lancebot checks if the command has the attribute on_error whereas @Python checks if the error has the attribute handled
Proposed Implementation
Use @Python bot's way of checking if the error is handled locally, i.e, to check if the error has the attribute handled.
This is being done to keep the bots on the same page.
Would you like to i...
When an user invokes a command in a channel seasonal bot doesn't have whitelisted, the bot will dump a list of all the channels the commands is allowed in as a part of the response; with the global whitelist most of those channels are not visible to regular users. The error embed gets deleted after a bit but is still quite large and pushes out the conversations in the channel
When constructing the channels string the bot can get the channels from its cache and check whether the user can se...
closes #538
Error handler now checks if the error has the attribute "handled" for locally handled errors instead of checking if the command has the attribute "on_error".
Did you:
- [X] Join the Python Discord Community?
- [X] If dependencies have been added or updated, run
pipenv lock? - [X] Lint your code (
pipenv run lint)? - [X] Set the PR to allow edits from contributors?
I tested this change locally on my test server and I haven't found anything super breaking. It's a simple enough change and I couldn't find anywhere else in the code that uses the on_error attribute for the ctx.command.
Description & Reasoning
Some of the advent of code commands can be rather "spammy" and clog up the primary channel when there's good discussion going on. This PR aims to limit some of the advent of code commands to #aoc-commands and only allow the shorter ones that are more likely to foster discussion in the primary channel.
Screenshots
Image of what happens if a user tries to use the .aoc stats command in the primary channel, followed by subscribe.
:
Added requested tshirt template
preview:

[python-discord/bot] branch deleted: fix/tagp/graceful\-stasd\-connect
Connected!
@Harbys did you decrease the value of the numbers? They look slightly dimmer in this newer version.
@Harbys did you decrease the value of the numbers? They look slightly dimmer in this newer version
Yes for python logo, I feel like it makes the outline more readable
Xmas tree is the same but appears dimmer because of lower mesh density caused by increased number size
Can the border avoid overlapping the numbers at least vertically (like the original) if not in both directions?
Yes and No. gifs are limited to 256 color so I can't use shading/transparency to hide it so the only option is to remove numbers that are too close to the outline and that makes it look empty
I mean by removing and realigning the numbers rather than using any sort of transparency.
@Harbys I personally think the brighter colors work better. There's not enough contrast in the new version.
This is just things to make it even better. The icon is great. It's easy to get caught in critiquing and not spreading enough positivity.
In my opinion, it would look better to make the colors at least slightly sharper again.
@MarkKoz That would require redoing the whole numbers mesh again and playing with scale. Might do it later this week. Don't have enough time now.
@gustavwilliam I can play around with emission values and we'll see. Just keep in mind that what made last years icon pop was bloom effect and it can't be done due to gif format limitations
A commonly asked question I see is something where someone has to add a directory to the Path environment variable, and I think it would be nice to add some command that shows some links or tutorials on how to add something to Path for Windows and Unix-Based operating systems. This way, it will be faster and easier to direct someone to the correct resources and help them out, rather than trying to talk them through it.
I disagree here @gustavwilliam . I think darkening the inside colors makes the border sharper and makes it a bit more apparent as the Python logo. This was the consensus as well for half a dozen people in the voice chat when reviewing this.
I think as it stands currently for a animated server icon, it's great.
@janine9vn True, regarding the visibility of the python logo element. I still think it's a bit too dark, however, but as long as the consensus is that the dark logo is better, we should go with that one.
I agree with @janine9vn here, the darkened inside colors make the outer border much more apparent than before. I think it looks much better and the darkness is at the perfect level.
That would be a handy resource, however, I think that there is a higher chance of things going wrong when you aren't guiding the person through it step by step. Messing up the PATH, and not knowing how the user got there would it make it difficult to correct, and can have a large impact on how they use their system.
In my opinion: when possible, try to get people to use the Add to PATH option from the installer, and if really necessary, then guide them through it yourself.
The bot tries to delete infractions that fail to apply on the Discord side of things. This is cause it sends the infraction to our API before applying it on Discord. However, our API doesn't actually support the delete method so it returns a 405.
I know the original was an exception but we should take the chance to change this to an info log. Semantically a warning would make more sense, but since this would be an unactionable issue, we don't want Sentry creating an issue for it.
Postgres backup completed!
I only reason I could think of settings the value to false is when you want the local error handler and the global error handler to handle the error:
if isinstance(error, BadArgument):
# Maybe user just wants to log some data in the local error handler
error.handled = False # default error handling by global error handler.
The only way it is kinda helping is readability by convaying the message that both the error handlers should be hit.
These situation are kinda...
As you can see here, for some reason I am getting a flake8 error:
./bot/exts/halloween/spooknamerate.py:75:73: F821 undefined name 'EMOJIS_VAl'
./bot/exts/halloween/spooknamerate.py:82:44: F821 undefined name 'EMOJIS_VAl'
./bot/exts/halloween/spooknamerate.py:150:22: F821 undefined name 'EMOJIS_VAl'
./bot/exts/halloween/spooknamerate.py:161:34: F821 undefined name 'EMOJIS_VAl'
./bot/exts/halloween/spooknamerate.py:219:38: F821 undefined name 'EMOJIS_VAl'



