160bf89 Moves Off Topic Name Translator - HassanAbouelela
66cda4f Makes Off Topic Name Search Case Insensitive - HassanAbouelela
0b11d7d Add truncate_message util - gustavwilliam
e1d269d Add function to DM users when opening help channel - gustavwilliam
e6483d6 Add green question mark to default config - gustavwilliam
#dev-log
1 messages · Page 67 of 1
Connected!
Description
One of the biggest hurdles that people face when setting up the bot, is the lack of helpful information when things go wrong. From redis, to the API, plenty can go wrong, and it requires experience to read the traceback and figure out why.
Inspiration
This PR aims to take a step in fixing that, by offering more descriptive errors on startup. This is inspired by #1385, but only covers a portion of the proposed changes.
Implemntation
This PR does two things:
- It lo...
It seems to be working fine, cheers!
[python-discord/snekbox] branch deleted: dynamic\-parent\-cgroups
Is there any reason why we don't make a user install rather than a system install?
900923c Catches All Site Startup Issues - HassanAbouelela
Nitpicky, but it can just be
raise
This should be an isinstance check and it should be a tuple, not a list :P
I believe you meant
super().__init__()
This should exit with a non-zero code
4c566bb Cleans Up Startup Error Handler Code Style - HassanAbouelela
283857f Call Super init in Startup Error - HassanAbouelela
I'd rather a constant set of email appealable infractions, but it is fine like this
Could we make it a mention of the modmail bot? Changing ModMail to @barren sonnet should do it.
We use this style of multiline strings throughout the code base.
INFRACTION_APPEAL_MODMAIL_FOOTER = (
'If you would like to discuss or appeal this infraction, '
'send a message to the ModMail bot'
)
It looks pretty good, I left a few little comments. Also, it seems like it broke the modlog tests.
fb7e21a Removes Unused Variable - HassanAbouelela
I would like to work on this.
Thanks you @Shivansh-007, assigned !
Looks like a good change, thanks.
@bast0006 was this eventually taken care of, or do we need to make a PR? As far as I saw, we just added another regex filter.
We've got a regex registered as a custom filter, but I think it'd be a good idea to immortalize it within the filter_token cog
I'd much rather this be a multiline string, as it's quite hard to parse as is.
This shouldn't be a blind filter. If admin is true, it should be included, as this will be important information to include in the admin panel.
Preliminary feedback:
- Add the env variable to the Readme
- We do the parsing of user code into the template on the backend. Can we instead do it in snekbox?
I'll do a more complete review later, this is just what I had time to look over.
GitHub Actions run 599580467 succeeded.
GitHub Actions run 599582275 succeeded.
GitHub Actions run 599582238 succeeded.
[forms-backend] Branch feat/9/unittest\-validation was force-pushed to `99f9a0a`
Would this possibly go along with the PR i made about python facts?
Should I make use of the line pagination here, since some examples are really big. For example the walrus operator example.
As to why it happens, https://github.com/python-discord/bot/blob/master/bot/exts/backend/error_handler.py#L208 shows that we simply use .replace on user input, we probably could simply just put the suggested command name instead of parsing whole user input and replacing it with suggestion. Would you like to work on it?
@sebkuip will you be updating this PR relatively soon within the future?
Sorry was under the impression that I already merged the requested changes. I have merged these now.
@Shivansh-007 just an idea, could we add it as a subcommand for the .pyfacts command PR #596 ?
I'm busy currently; anyone is free to work on this.
A better place for this file would be pydis_site/apps/api/pagination.py. It shouldn't be under viewsets since it's not a viewset.
The documentation doesn't have to be extremely detailed, but what you currently have is too vague. It doesn't really provide any information the reader doesn't already know.
I think relying on GC is fine. However, how will you know if the value is still the default? If the config happens to have the same value as the default, then that value should still be accessible if the class unloads since it's not relying on the class for the value.
We haven't updated the topics in the .topic command for a while.
Some of the topics included in the #python-general section including IDEs were problematic, so we moved them over to the #editors-ides channel.
Many more topics have been added for offtopic channels.
@swfarnsworth Please review when you're available.
Is TLI a thing? Searched around a bit and only found a few uses, I believe TUI would be a more familiar and fitting term
Should this use a more precise term in place of database, something like DBMS?
Sorry, misspelled. It's TUI, thanks for catching that!
Per my previous review, "your JSON is invalid in its current state" may be unnecessarily technical.
At any given time, it should be made clear whether an "empty json" refers to a completely empty json file or an object with no keys.
I don't think we should refer to "objects" or "arrays" because these have different meanings in the context of Python, and all that seems to matter is that one puts some valid content in the .json file.
Connected!
@Xithrius Actually I'm having my exams right now, so hopefully I will be able to complete it by the end of March.
Alright. Good luck with your exams!
I am a little confused with the executor part, so the bot will become the guesser?
Ahh I am not in favour of that, this should be kept separate.
Connected!
Probably the same comment as above.
Minor thoughts, but otherwise all looks good and works locally.
It would be nice to iron out the startup KeyErrors
Can we avoid the startup KeyError on first use by using .get() here?
self.threshold = parse_duration_string(settings["threshold"]) if settings.get("threshold") else None
Is it possible that we won't be able to read from redis properly? because if there is, a KeyError will allow us to find out about it.
I'm not aware of such a situation, if we had connection problems then that'd manifest elsewhere.
Right, but then you are also reminded that your defcon settings aren't synced and that you should bring them back if defcon was active. If it's not desirable I don't mind changing it, but that's pretty much the goal of the try clause.
I think the proper solution here is to have a fallback that this cog falls to, not just let everything crash and burn. If we want to add an alert system, that's fine, but it's complementary to the other solution.
It does have fallback, it just sets to the default 0. You can still use defcon, it's just unsynced
I mean we shouldn't error out just because redis is having trouble. The cog should continue without errors, or with proper error handling, and the report should be handled seperately.
It continues, it just lets you know that it wasn't able to sync
I can suppress any errors while updating actually. But other than that defcon is functional even without a connection.
729e7ed Add endpoint issue template to GitHub repository - Sebastiaan Zeeff
This is constant, so this should be uppercase. Also, I think _DURATION_REGEX would be a better name.
f32ce49 Add issue template for endpoints to repository - SebastiaanZ
[python-discord/api] New branch created: add\-endpoint\-issue\-template
cad6995 Add issue template header to endpoint template - Sebastiaan Zeeff
cea82da Supressing any exceptions while updating the th... - mbaruh
Seems to be working as intended.
@jb3 yeah so in short the purpose here is to catch that key error or any other error that might indicate things aren't working well. Do you want to remove that?
Looks excellent! Well done.
So, I haven't tested with redis locally, but if we start up the bot and don't immediately set a defcon will it just alert the moderators on every startup?
I think a better idea is to alert and then actually take action and set the preferences.
This sounds like something I'm interested in, only problem is I've never worked with cogs...
No, it will only misfire when the PR is merged because the cache is new. Once we set the cache once it won't do that anymore.
Practically speaking you run !dc t 0 once and that's it. The issue is that you need to have the keys in the cache.
Connected!
[python-discord/bot] branch deleted: startup\-errors
c5e1137 Adds More Descriptive Startup Error Messages - HassanAbouelela
866f315 Adds Site Readiness Checks - HassanAbouelela
900923c Catches All Site Startup Issues - HassanAbouelela
4c566bb Cleans Up Startup Error Handler Code Style - HassanAbouelela
283857f Call Super init in Startup Error - HassanAbouelela
Connected!
06173ee Remove all child cgroups before removing parents - jb3
[python-discord/snekbox] New branch created: recursive\-remove\-cgroups
After #91 was merged we starting seeing errors with large stdout causing errors like the following:
2021-02-26 16:02:56,706 | 14 | snekbox.nsjail | INFO | Executing code...
2021-02-26 16:02:56,741 | 14 | snekbox.nsjail | INFO | Output exceeded the output limit, sending SIGKILL to NsJail.
2021-02-26 16:02:56,743 | 14 | snekbox.nsjail | INFO | nsjail return code: 137
2021-02-26 16:02:56,744 | 14 | snekbox.api.r...
Also worth noting that the RAM limits and PID limits are not affected by this, only evaluations which result in a large stdout.
<img width="1110" alt="Screenshot 2021-02-26 at 17 07 18" src="https://user-images.githubusercontent.com/20439493/109331719-17190100-7855-11eb-8fdf-26f3e70a0935.png">
It does solve our current issue, thanks captain Joe!
[python-discord/snekbox] branch deleted: recursive\-remove\-cgroups
Connected!
de226ea Make "event" plural in socketstats embed - gustavwilliam
[python-discord/bot] New branch created: plural\-events
This is how the socketstats embed previously looked:
This is how it looks now:
Notice the new "s"? Yep, events is now plural.
the most important PR to ever reach our repositories
Is this how I request changes?
Connected!
IIRC it's cause the user site is not on PATH. It's more convenient to use sudo in this case.
I don't know if this issue is still relevant, when was the last time the API went down without the entire server going down? Regardless, the best solution today would probably be something to do with redis, Maybe a redis queue that we try to keep empty and add to if API requests fail. I don't think bypassing the API and going straight for the DB is very wise.
What happens when Redis goes down? Well first contact DevOps because something has gone horribly wrong if both site and redis are do...
v1.6.0 is now released. 🎉
On a more serious note, 360 has been merged for over a year, tasks should probably be pretty stable, and this issue has been dormant for so long it probably has not come up at all since. Have we stopped using create_task? I don't believe so.
The library support is there for it, but the question is: is this still relevant?
This seems like a pretty simple fix, but I don't know about having a huge list of valid characters sitting somewhere in some file, looking ugly. Is there any way to better predict which letters are going to be valid, without hardcoding every single one? (P.S o7 cmdr)
Closing this for the same reason mentioned in python-discord/meta#88. Feel free to reopen if you believe this is different.
b3ad47a Feature: suggest command usage for misspelt com... - F4zii
adfb87e Merge branch 'master' into feat/F4zi/CommandSug... - Akarys42
dfe9dd8 Seperated tags.get_command into a function and ... - F4zii
eb01f3f Feature: suggest command usage for misspelt com... - F4zii
777088b Merge branches 'feat/F4zi/CommandSuggestion' an... - F4zii
Title is self explanatory, I think.
Code and logic wise, looks good.
If we add something like the following, it might become a bit more clear what has happened:
print(x) # Prints 5
You could also write it like if it was in a repl. Both are fine with me, but some more context would be nice, considering that the people who mess this up probably don't have too much experience with python.
This is often referred to as the "assignment operator" iirc. What do you think about writing that instead of "equals operator"?
Thanks—I like how simple and clean this tag is. Well done!
There are a few things that caught my eye though, where I've left comments. In most cases, it's not meant as a "this is right", but rather to see what you think and if it's worth changing.
The double equals operator (`==`) is used to compare values.
What do you think about adding code blocks around the ==, since it's referring to code?
Yes. It may seem like it doesn't come up because exceptions are not caught anywhere and this is more of a proactive measure than a reactive one.
I made some progress by implementing this https://github.com/python-discord/bot/blob/master/bot/utils/scheduling.py#L160-L164
However, there is no support for scheduling on a loop (which is necessary to be able to schedule tasks before the loop starts) nor is there support for retrying upon failure. Still, logging exceptions is beneficial for a...
ed9e1c8 Add package docstrings to init.py files - SebastiaanZ
7dd5168 Add docstrings to modules and functions - SebastiaanZ
9e01891 Configure Settings to automatically read from .env - SebastiaanZ
169354a Add commit sha to API health check response - SebastiaanZ
cb938a3 Add dependencies for async tests - SebastiaanZ
Is there an equally concise name for the other? Equality operator? Equivalence operator?
f542866 Improve examples and add codeblocks where needed. - SavagePastaMan
99f7e00 Adds Hassan Abouelela To Code Owners - HassanAbouelela
[python-discord/forms-backend] New branch created: abouelela\-codeowners
[forms-backend] Branch abouelela\-codeowners was force-pushed to `dd4d4b7`
Remember to target the dewikification branch with this pull request
We should add functionality to group resources by experience level, for example some of our editors are really suited for beginner programmers and some for advanced, but we have no way of distinguishing that right now.
Each resource in our collection should have a difficulty rating which is one of:
- Beginner
- Intermediate
- Advanced
This issue supersedes python-discord/meta#49.
[python-discord/forms-backend] branch deleted: abouelela\-codeowners
Wow, really really nice work! 😃
87012d5 Bump starlette from 0.14.1 to 0.14.2 - dependabot[bot]
993b230 Merge pull request #55 from python-discord/depe... - ks129
0da9c70 Bump motor from 2.3.0 to 2.3.1 - dependabot[bot]
c6cd8fe Merge pull request #56 from python-discord/depe... - jb3
dd4d4b7 Adds Hassan Abouelela To Code Owners - HassanAbouelela
[python-discord/forms-backend] branch deleted: feat/9/unittest\-validation
GitHub Actions run 607617737 succeeded.
GitHub Actions run 607622546 succeeded.
GitHub Actions run 607623236 succeeded.
GitHub Actions run 607624121 succeeded.
[python-discord/forms-backend] branch deleted: dependabot/pip/uvicorn\-0\.13\.4
For all infractions that remove the individual from the server, the infr_type argument that gets passed to this function is 'Ban' (upper-case B), as opposed to 'ban' or 'kick', which are the names for those infractions used elsewhere in the code base. I therefore decided on a string literal in the function so that we don't give the false impression that 'Ban' is used elsewhere.
I tried this and it didn't render as expected, presumably because the DM is out-of-guild content.
That's fine. Perhaps we could add that rule to the pre-commit checks?
75f2b9d Update the tests to reflect changes in expected... - swfarnsworth
@Akarys42 I'll commit the change you requested regarding the formatting of multi-line strings along with any other requested changes.
Alright, it is fine like this then
Hmm yeah it can cause issues if it isn't in the cache. Could we maybe have both, like having a mention in parenthesis along with the bot name?
We've actioned this through other means, so changing our modmail branding is not necessary.
f429ce6 Add issue cog to staff channels. - ChrisLovering
[python-discord/sir-lancebot] New branch created: Add\-lancebot\-to\-staff\-channels
Description
Add staff category and staff voice to constants.py and added them to the list in the issues cog.
Reasoning
To make use of the already present code.
Did you:
- [ ] Join the Python Discord Community?
- [ ] If dependencies have been added or updated, run
pipenv lock? - [ ] Lint your code (
pipenv run lint)? - [ ] Set the PR to allow edits from contributors?
https://github.com/python-discord/sir-lancebot/blob/f429ce6aaa57d680893be0cbd5a7760de947aac6/bot/constants.py#L130-L135
Should be in the same order as the following:
https://github.com/python-discord/sir-lancebot/blob/f429ce6aaa57d680893be0cbd5a7760de947aac6/bot/exts/evergreen/issues.py#L26-L28
Also, this
https://github.com/python-discord/sir-lancebot/blob/f429ce6aaa57d680893be0cbd5a7760de947aac6/bot/constants.py#L96-L127
Should be in the same order as
https://github.com/python-discor...
Looks excellent! Just one minor tweak and it'll be great.
print(x) # Prints 5
Let's make sure this follows pep 8
fbef11f Make assignment vs equals tag pep 8 compliant - gustavwilliam
Perfect. This is a very well needed tag.
[python-discord/bot] branch deleted: comparison\-tag
e82429c Create comparison.md - SavagePastaMan
f040a27 Merge pull request #1439 from python-discord/co... - Xithrius
Connected!
Thanks for the changes, I think this is good to be merged once you address the reordering.
[sir-lancebot] Branch Add\-lancebot\-to\-staff\-channels was force-pushed to `b61aa30`
For #594 commands.max_concurrency won't work, as it can only impose the limits to a single command, rather that at a group at a time.
This isn't true, you can put thecommands.max_concurrencycheck on the group and every time the group's subcommand are invoked it will use that check.
The seems quite wordy to me, maybe a comma could help?
- What is something you know now, that you wish you knew when you were starting out?
Maybe even
- What is something you know now, that you wish you knew when starting out?
These look good to me! One minor point about one of the topics, but not enough to stop the merge!
For #594 commands.max_concurrency won't work, as it can only impose the limits to a single command, rather that at a group at a time.
This isn't true, you can put the
commands.max_concurrencycheck on the group and every time the group's subcommand are invoked it will use that check.
Huh, maybe my tests we're conclusive enough. I'll give this another look soon.
[python-discord/sir-lancebot] branch deleted: Add\-lancebot\-to\-staff\-channels
Connected!
ebf62a2 Add banner pattern tiles - gustavwilliam
[python-discord/branding] New branch created: banner\-pattern
The tiles are repeated in a grid to form a banner pattern.

Application
Used in the site's custom error pages as part of a repeating background pattern. This PR will need to be merged before the error pages will be functional. Here is current version of the page in question:
:
| Old | ![]() |
|---|---|
| New | ![]() |
40eac26 Fix artifact in banner pattern png - gustavwilliam
[python-discord/branding] New branch created: fix\-pattern
Fixes an issue where the left side of the png has an approximately 1 px wide strand of semi-transparency. This led to the tile being rendered in a strange way when combined with other tiles. This is the original:

This is the updated version:

This was mo...
41633a5 Fix artifact in banner pattern png (#125) - gustavwilliam
[python-discord/branding] branch deleted: fix\-pattern
Connected!
We are using Motor, which is asynchronous.
Let's give refresh default value False.
Please set this to false by default in docker-compose.yml.
I don't think that really makes sense to be honest. It's a value that will highly depend on the situation, and will significantly alter the way the function works, so it should be explicitly specified by the caller.
c175279 Allows All CORS Requests On Development - HassanAbouelela
This wasn't enough on its own due to the way docker handles external traffic, so I just resorted to allowing all non-production traffic.
Use html.unescape to replace html escape characters with their Unicode equivalent in reddit text and titles.
Examples:
[python-discord/site] New branch created: error\_pages
This PR adds pages for 404 and 500 errors on the site. They are following the same structure as the recently merged custom CF error pages (python-discord/error-pages#1).
Preview
404
500
We don’t really need the full library here.
from html import unescape
8cdd0b3 Improve wikipedia command to send a snippet of ... - Shivansh-007
86dc294 Goodbye Wikipedia Class, no need of you anymore - Shivansh-007
fa9e205 Add log.info() statement if the wikipedia api r... - Shivansh-007
439873d Don't use enums for wikipedia error messages, u... - Shivansh-007
db4b3d4 Merge branch 'master' into feature/improve-wiki - Shivansh-007
Connected!
[python-discord/bot] New branch created: license\-year
It seems like we were enjoying a good old 2018 license. Time to update!
Looks very good overall. Excellent work, @gustavwilliam.
I'm nitpicking, but in RFC7231 where this error code is defined, it's styled with capital letters, like 404 Not Found.
<h1>404 — Not Found</h1>
Same thing here, see https://tools.ietf.org/html/rfc7231#section-6.6.1
<h1>500 — Internal Server Error</h1>
Looks good. Minor comment on wording + including a Discord link on the 500 page as well as the 404 one.
<p>Something went wrong at our end. Please try again shortly, or if the problem persists please let us know <a href="https://discord.gg/python">on Discord</a></p>
Since we have implicit copyright for 95 years it isn't necessary to update this. If we make major alterations to the project we can add a year like ":copyright: 2018, 2021" but at this stage I don't think that is necessary.
For certain, we should not rebuke our 2018 license, as that is the time of publication.
[python-discord/bot] branch deleted: license\-year
:shipit::shipit::shipit::shipit::shipit:
[python-discord/site] branch deleted: error\_pages
:shipit::shipit::shipit::shipit:
I like where this PR is going. Please consider making these changes.
Sorry for hitting you with all of this at once.
Thank you for contributing to Sir-Lancebot!
This needs a return annotation.
We should sanitize the rhyme_scheme with regex, as we don't want random characters going into the GET request that goes off here:
https://github.com/python-discord/sir-lancebot/blob/ef61267835e0e37bd4e772fa394e678d857d72c7/bot/exts/valentines/markov_poem_generator.py#L227-L230
I don't see any use of this attribute outside this function. Do we need it?
@ncDevMan are you still planning on working on this feature?
@RohanJnr are you still interested?
I don't see any use of this attribute outside this function. Do we need it?
It would be caught in non handled errors if we don’t set this attribute.
Thanks for the info. I've never set this before.
Also do fix the merge conflicts. For the pipfile.lock, just reset it and then run pipenv lock.
Greetings. Great idea y'all, I think this should be implemented.
Hello @LeptoFlare, it seems the other user has become inactive. Would you like to take over this?
931fb3e Verify channel constants on startup - WillDaSilva
b907c4c Add docstring to check_channels - WillDaSilva
7bec6f4 Capitalize "ID" in error message - WillDaSilva
52d6261 Merge branch 'master' into startup-channel-check - WillDaSilva
a9fbfd2 Merge branch 'master' into startup-channel-check - Xithrius
As of #584 getting closed, we can't really work on GIFs given the possibility of them being very long.
CPU usage is also a problem, as this would definitely take up a large portion of it.
Maybe we can do this in the future, but for now we'll have to put it off until we can afford more computations.
Connected!
@PureFunctor are you still planning on implementing this?
I've communicated with @gustavwilliam. This is still in the works, and is a bit on hold.
I hope this feature works out, very cool stuff.
I can't say I can work on this for now; I suppose further discussion might be needed in terms of the implications towards complexity or feature parity with the other bot.
@ramansrivastava would you still be willing to work on this? I'm not completely sure if this bug still exists.
Thank you for the quick response. I hope everything works out in the end.
@slushiegoose are you still planning on making a PR for this?
@aaravm4 I'd like to see this feature in Sir-Lancebot. Are you still willing to implement this?
When users use the !pypi command with an invalid module, you currently get a response saying "Package could not be found.".
What I'm proposing it that after a delay (I believe we have bot.constants.RedirectOutput.delete_delay for this) the bot should delete both its response and the invocation message, like !d currently does.
This would help reduce channel flooding when someone is trying to reme...
Relevant Issues
Closes #602
Description
Gets the fuzzy match of a search query, returns None if the ratio is below 90 else returns the fuzzy match. If the return is None, then we send our custom Error Message else it sends the link to the subsection of the WTF Python README.md.
Reasoning
Approved by a staff.
Screenshots
On Dark Theme
? - [x] Set the PR to allow edits from contributors?
Yea, I can still implement it.
I'll approve for the purpose of the hotfix, but I think there should be a split between channels which are constant are actually required, and ones which are temporary.
An even better approach would be for each cog to specify which channels it needs.
Alright @mbaruh I will have a look at that. Can u tell how should i progress with the second method of implemented. Like how should the channel - cog map be stored/
@Shivansh-007 This shouldn’t be part of this hot fix. There will be another issue for it.
Connected!
According to the API, your request is malformed.
If @Kronifer would like to take this, he may. I tested a few API's- one around NASA. But I did not get very far.
@ncDevMan I'd love to! I'm gonna go over cogs and get started.
@Xithrius the command file should go in the bot/exts/Easter folder, right?
Holi, also known as the festival of colors, festival of love, or the festival of spring is March 28-29 this year. It'd be super chill if we had a logo for this since we had a logo for Diwali.
If anyone is interested in making a logo for this please comment here~
64593eb Adds Basic Prism Stuff - HassanAbouelela
[python-discord/forms-frontend] New branch created: prism\-code\-demo
54fd22c Saves Username & Scopes On / Path - HassanAbouelela
I have no real feedback, everything seems fine. The only change I would ask for is for the method of shutting down defcon to be added to the help command.
Looks pretty good, just a few things.
What would you say about adding an error handler to relay any failure in defcon to Discord directly, as it is a quite critical cog?
Can I make one for holi?
ca3389e Improved docstring for threshold command. - mbaruh
91d9748 Merge branch 'mbaruh/defcon' of https://github.... - mbaruh
Connected!
Hey! I haven't worked with the bot in a while, but I'd to see if I can take a crack 😄
Alright, cool! Be sure to include features mentioned in https://github.com/python-discord/sir-lancebot/issues/321 as well.
@Xithrius the command file should go in the bot/exts/Easter folder, right?
Yep!
Alright, perfect! I'll get started on that soon.
Alright, I'll shove it into that cog.
Description
The .http_status .status and .httpstatus commands do not recognize HTTP status code 418 (I am a Teapot) as described in RFC-2324 : Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)
2.3.2 418 I'm a teapot
Any attempt to brew coffee with a teapot should result in the error
code "418 I'm a teapot". The resulting entity body MAY be short and
stout.
Steps to Reproduce
Input any of the following commands in ...
[python-discord/bot] New branch created: mfa\-token\-filter
Hey @Xithrius , I'm trying to do this with the unsplash API. Is there somewhere we can store secret keys for the bot?
Hey checkout:
https://github.com/python-discord/sir-lancebot/blob/a3bd208580ff223cd0120d0c4b5a1bf3c28d03e5/bot/constants.py#L264-L266
Basically, you add an environment variable to this list, and we'll set it up on our end before we merge the feature. Just be sure to leave a note asking us to do so in the pull request.
@HassanAbouelela so when it's ready, should I email one of you guys the keys?
No, we'll create our own app, and I see they have a process for requesting a production token, which we will have to go through.
I'm having a quick look through the API, please note that:
All applications must follow the API Guidelines, including properly providing attribution for the photographer and Unsplash.
This is something you'll have to keep in mind with your implementation, as well as all their other rules.
@HassanAbouelela thanks for clarifying! I'll make my own for testing purposes then. I'll be sure to keep in line with the rules 🙂
I really like the idea of using the frontloaded YAML for the meta file. Assuming the #changelog notif will be sent as an embed, we will basically have a tag with some extra meta information (not to digress, but could Python's tag system also benefit from this?).
However, I think we need to decide on how to define the time periods. The proposed example is a little different to what I imagined, which was to have year-agnostic dates, e.g.:
period: 24/12 # Active on the 24th of Decemb...
Everything proposed in this issue sounds great to me. Provided we design the meta.md files well, none of this should be difficult to implement, though I'd still like to update the cog's internals a little bit, in particular:
- Probably use d.py's tasks extension for the daemon
- Use Redis to persist the last icon cycle date so that the cycle maintains a consistent n-day schedule even across restarts
Are there any commands that ...
For the date formats, we agree with @jb3 that using the month name may be the best option, especially since we can still parse it with datetime:
>>> datetime.strptime("January 5", "%B %d")
datetime.datetime(1900, 1, 5, 0, 0)
So the config file could look like:
start_date: January 5
end_date: March 12
This remains easy to parse both programmatically and humanly.
I have a quick suggestion. Maybe add a branding command (eg. !branding) that anyone would be able to use to see what the current branding is, what it means, and why it's there.
This could help with certain events like international holidays such as the Diwali ones where many people may not known what it means. This is just a rough idea, but maybe something like:
Branding
Right now, PyDis's current branding is for Saint Patrick's Day.
_Goes on to elaborate about the da...
This has been discussed a couple of times in the past. I believe we came to a general consensus that we don't need to use the http module to check the status code. Instead, we can just send a request to the site and if the status code returned is invalid, display a 404 dog/cat.
According to issue https://github.com/python-discord/sir-lancebot/issues/428, we'll probably be waiting until we can upgrade to 3.9 without any worries.
Added .earth_photos command
Closes issue #174
Description
Added a .earth_photos command by using the unsplash api
Reasoning
An approved issue I was assigned to.
Screenshots

Additional Details
Please add environment variable UNSPLASH_KEY and set it to the key for an unsplash app created on their API
Did you:
- [x] Join the [**Python...
Hi there, I ran the linter but it seems to not have returned the errors that are showing on the server check.
What command did you run?
@Xithrius pipenv run lint
If you haven't already, try running pipenv run precommit, and then pipenv run lint.
I'm re-running it now.
@Xithrius I ran pre-commit, it's buffering on Flake8 right now
By installing the precommit hook, committing will be blocked until you fix all of its complaints.
@Xithrius it didn't complain when run but checks failed on github action. Flake8 passed now.
Nevertheless, I think it'd be quite amusing for a 404 status dog/cat to appear for invalid status codes. I don't see any reason not to fix this now and remove our dependency on the http module either.
GitHub Actions run 616341012 failed.
GitHub Actions run 616351056 failed.
GitHub Actions run 616366380 succeeded.
Another way is to use regex and get all the status codes.
Please consider making these changes.
Sorry for hitting you with all of this at once.
Thank you for contributing to Sir-Lancebot!
Since the discord.py bot framework is asynchronous, the requests library cannot be used. You can check out other cogs in this repository for examples on how to use aiohttp to make asynchronous web requests.
def __init__(self, bot: commands.Bot) -> None:
init has no special meaning in Python. It's just a method.
__init__ is the magic method that's called automatically on object instantiation.
Can we break this down into lines for easier readability, for example like this:
embed = discord.Embed(
title=random.choice(ERROR_REPLIES),
color=Colours.soft_red,
description="You don't have permission to view this channel."
)
This PR is looking good so far, but it is not in compliance with the unsplash API, so I am blocking it. The rules it violates are:
API Guidelines, Technical Guidelines Section, Point 2: "you must send a request to the download endpoint". See here for a more complete review of how this should be done.
[API Guidelines, Technical Guidelines...
Apologies for abandoning this, after missing the first deadline of having it included in the 2019 event I kinda lost interest =/ I've since lost my progress on it, so I'd be happy for someone else to pick it up.
I concur with @Den4200 I think we should remove the http module check and just call the status sites directly. Then rely on them sending a 404/302 and dealing with that.
I've approved it now, and assigned you. I think you'd be best off following Den's suggestion yeah.
Relevant Issues
Closes #428
Closes #500
Closes #608
Description
Removed HTTPStatus from the equation entirely in favor of just relying on the cat/dog servers to send us back errors if we get bad input.
Minor refactor to pull strings out of the executable code into variables at the top.
Reasoning
Implemented design and strategy suggested by staff in #608 discussion.
Screenshots
Did you:
- [X] Join the [Python Discord Community](https://di...
PR is up, please do your worst! I'll take brutality over pushing dodgy code any day of the week.
:cat: The most important PR ever received :tea:
Some minor comments on wording, tested locally and all works well.
This docstring is used in the .help documentation, so we should keep it more human friendly.
"""Send a cat version of the requested HTTP status code."""
Same as above
"""Send a dog version of the requested HTTP status code."""
ERR_404 = 'Unable to find status floof for {code}.'
ERR_UNKNOWN = 'Error attempting to retrieve status floof for {code}.'
[python-discord/bot] New branch created: ks123/talentpool/migrate
@kwzrd
I think your suggestion is fine, provided that we accept an optional years parameter for non-recurring events, like we discussed in the community.
@dawnofmidnight
I don't necessarily mind having a !branding command, but I'm not sure if it's necessary if that information is always going to be available in #changelog. Either way, it'd have to be implemented after we're done with these initial changes, as I'm hesitant to expand the scope of this task further.
If you're keen ...
Note: This has to be merged exactly same time than python-discord/site#447
Migrates talent pool to the new system. More exact changes are in the commit message body.
Closes #1425
Probably use d.py's tasks extension for the daemon
Use Redis to persist the last icon cycle date so that the cycle maintains a consistent n-day schedule even across restarts
Excellent ideas.
Are there any commands that the cog currently doesn't offer, that would be useful to have?
There was a suggestion in https://github.com/python-discord/branding/issues/123 to add a sort of branding info command that would just display the same as we're gonna put into #changelog. I'm not opp...
Bug 🙃
Could you list some reproduction steps to help @sam-heller with fixing it?
Also, I'm not sure about passing user input directly into a web request like this, without sanitising it first.
I also realise this is the way is was before this PR too, but looks like something we should fix.
@Shivansh-007 Could you list some reproduction steps to help @sam-heller with fixing it?
We can make use textwrap module and then do something like this:
textwrap.shorten(code width=50, placeholder="...")
We could also just validate that codes are below some sane value, like 999.
Convert to an integer and handle any failure there, then check the integer is greater than 0 and less than 999, we don’t need to bring textwrap into it.
On 3 Mar 2021, at 14:28, Shivansh-007 notifications@github.com wrote:
@Shivansh-007 https://github.com/Shivansh-007 Could you list some reproduction steps to help @sam-heller https://github.com/sam-heller with fixing it?
We can make use textwrap...
This is closed by #120 . Thanks for the contribution by the way!
Absolutely, I'll assign you now.
We have one now! Check #120
@MarkKoz I remember there being some work done on this but unsure if anything was merged?
@Xithrius @HassanAbouelela so as I'm seeing it, I need to do the following:
[ ] Switch to aiohttp
[ ] Remove unneeded modules
[ ] Change docstrings
[ ] Reformat embeds
[ ] Make sure stuff complies with the unsplash API
Give me a day or two and I'll try to fix these!
This PR is looking good so far, but it is not in compliance with the unsplash API, so I am blocking it. The rules it violates are:
API Guidelines, Technical Guidelines Section, Point 2: "you must send a request to the download endpoint". See here for a more complete review of how this should be done.
[API Guidelines, Technical Gu...
The style for hanging indents in the projects is to have the closing parentheses on their own line which isn't used in the build_embed if chain. I believe only creating the embed objects in the if bodies and then having a send at the end of the function will look better and won't need any splitting up of the lines
This won't catch invalid dog codes, as those redirect to their 404 image page through the 302 response code, and will go to the generic handler
This doesn't work, you'll have to set the footer through embed_obj.set_footer(text=...)
The yoda condition looks a bit weird to me as I don't think I've seen it anywhere else in the codebase but I suppose it's fine
Taking another look and it's definitely not the most readable. What do you think about swapping it with
if response.status in range(200,299):
?
@HassanAbouelela The issues you presented should be fixed.
Use self.bot.http_session here instead of making a new client session
We should pass params using a dict and the params kwarg with aiohttp, rather than adding directly to the url.
Is this used for anything?
you mean self.current_channel? I got rid of it i thought
i added the changes requested
Ah, so this line specifically is doing nothing, we just need to send the get request?
yeah, but i needed to call er.status or it wouldn't lint
@ChrisLovering self.bot.http_session only works once.
This PR is looking good so far, but it is not in compliance with the unsplash API, so I am blocking it. The rules it violates are:
API Guidelines, Technical Guidelines Section, Point 2: "you must send a request to the download endpoint". See here for a more complete review of how this should be done.
[API Guidelines, Technical Guidelines...
@ChrisLovering never mind, fixed
I've dismissed my review for now, as it seems we are now in compliance with the API's requirements. I tried to make sure we meet them to the best of my ability, but I am not a lawyer. If someone is more legally inclined, or if someone has time to sort through a bunch of requirements, I'd appreciate a second set of eyes looking over: https://help.unsplash.com/en/articles/2511245-unsplash-api-guidelines.
@ChrisLovering i have made the changes requested.
it seems pipenv failed install on the lint check, should I re-commit or will someone re-run it?
It seems I forgot to lock, fixing now.
Alright, lint passed!
This would be in my interest if I had access to CodeSpaces
Description
Similar to the issue open for supporting GitHub CodeSpaces. When you try to use Gitpod for sir-lancebot, you have to install lots of things manually.
Reasoning
Quicker development times online as there is no need to manually install dependencies.
Proposed Implementation
Creating a .gitpod.yml file, described here
Would you like to implement this yourself?
- [ ] I'd like to implement this feature myself
...
Okay, sounds like I can start moving things around. It quickly became apparent to me that I will be writing some sort of validation script for my own self anyway, to be safe that all event directories are setup correctly. So we'll see, maybe I'll include it in the PR.
I'm interested what kind of CI setup we'd come up with. Since it'll depend on something (python-frontmatter works well, although it hasn't had a commit since late 2019, but it...
Uhhh what does line do?
color=Colours.grass_green
)
Can you reset this to upstream/master.
I like where this PR is going. Please consider making these changes.
@Shivansh-007 I think this should be planned out a bit more before we do something.
I have to keep them for getting specific data, unless there's a better way, I don't work with web requests much
Sorry I didn’t get you.
userlinks is being used anywhere and even a few others so I don’t see a need of them.
userlinks is used to get profile link for embed, downloadlinksdata for the download links, linksdata for the embed links, embedlink is self-explanitory, userdata is also self explanitory, username is for crediting the person who made the image as of here, name crediting is needed for production app, profile is used for a link to the profile
@Shivansh-007 I've fixed everything over in my repo
I am, and it is still not solved.
Am talking about er.status.
I have to call er.status otherwise the lint fails
because then flake8 returns er is defined but never used
This is still not fixed.
Oh wow, Im stupid! Sorry @Shivansh-007 , I looked at it wrong
@Shivansh-007 it seems some of this is outdated, as the logging thing no longer exists as shown here
Hi @Shivansh-007 , I cant do this as it breaks pipenv and the packages, sorry!
Flake8 never fails on this issue. You have added it in b2ee1b9e79766b8cfe7b45670f6c86e7166ee84f commit and I don’t see it failing before. And you can replace it with _, it is used to indicate that the result is being deliberately ignored.
It doesn’t beak them. You are doing pipenv lock, am asking you to reset it to what it is at the main branch master that is, what it is here
@Shivansh-007 it seems some of this is outdated, as the logging thing no longer exists as shown here
Which logging thing are you talking about?
sorry, im not sure how to do this, what would i use?
oh sorry, i ran flake8 locally and it freaked on me
Copy the Pipfile.lock from python-discord/sir-lancebot and paste it into yours.
sorry, two under the linked comment
@Shivansh-007 I did this but as soon as I ran pipenv sync --dev locally it reset this
it failed identify install when I made the change
@Shivansh-007 all changes have been made
While any code is executing in this context manager, the underlying event will not be set;
I apologise for the long delay. I've been busy recently with things outside OSS.
A lot of my suggestions relate to documentation and comments. With a feature this complex, I think future readers will appreciate having some comments.
Why is it called api_package_name rather than package_name. More specifically, why is it important to make a distinction here between a name coming from our API and a name from elsewhere?
It's singular, so use is. Also, specifying the type in the docstring is redundant due to the use of type annotations.
* `package` is the content of a intersphinx inventory.
Your name is good enough; not worth bikeshedding over it. The docstring already explains what the class does very well.
I don't have any great ideas for it either. My ideas were not concrete but involved the name containing some form of SymbolMarkdown or QueuedParser.
Yeah, I think you're right. await self.item_fetcher.clear() is the first opportunity to yield control to the event loop, at which point it all scheduled tasks should raise the exception (docs say it happens at the next cycle of the event loop).
Before the inventory file parser was implemented the intersphinx package/project name was also exposed in the function, but I suppose package_name should be sufficient now
I left it in as without it the bot will consume all available resources for a task that's really low priority - at the cost of maybe delaying the next user request by up to 100 ms; can remove it if that won't be an issue.
Maybe that was the case back at 758dd3ef6ca5c1cd7615f0eb6688d7d2f19578ea, but you've since added multiple io-bound coroutines. I doubt it's still an issue, but I have not tried it.
If the coro suspends here, and a refresh deleting the doc_item (or an equal value) occurs then the get_markdown would fail, thinking about it I'm not sure if it's possible depending on how asyncio works but I'd rather be safe unless you think it's unnecessary.
All the other code in the function is either synchronous or safe to switch on
We use the tasks here that you mentioned in a comment to prevent locking up the queue waiting for one of them, so the only await here is for the cpu bound executor. Locally on a 4 thread CPU the process takes up roughly 33% of the overall usage
Refreshing inventories doesn't clear the cache.
The containers in the BatchParser will be cleared and an old doc_item will be passed to get_markdown if it continues from here
Using this event here doesn't prevent such situation: as soon as an item is fetched from redis (or not found), the event will be set and the refresh will finally be allowed to continue. It will end up clearing everything potentially before get_markdown is called.
To avoid crashes in get_markdown, store the relevant future as a local variable rather than always accessing it through the dict.
Actually, that last suggestion is a bad idea since the future will never set and it will wait forever.
[python-discord/bot] Pull request opened: #1446 Enhancing information within the incidents channel\.
Relevant Issues
Closes #1226
Description
Whenever a staff member would post a message in #incidents channel, it would be searched through a regex and all the message links in it would be extracted.
Then the bot would send this the messages the link point towards in embeds.
The Embed would contain the following information -->
Author: @Jason Terror ♦ (736234578745884682)
Channel: Special/#bot-commands (814190307980607493)
Content: This is a...
Don't parse manually, use MessageConverter from discord.py instead.
Message can also be None if not found.
Connected!
b3ad47a Feature: suggest command usage for misspelt com... - F4zii
adfb87e Merge branch 'master' into feat/F4zi/CommandSug... - Akarys42
dfe9dd8 Seperated tags.get_command into a function and ... - F4zii
eb01f3f Feature: suggest command usage for misspelt com... - F4zii
777088b Merge branches 'feat/F4zi/CommandSuggestion' an... - F4zii
Could you please rename this to unsplash_access_key to make it clear for anyone in future, as unsplash give you different two keys.
Could you add a check here, so that if the token isn't set the cog doesn't try to load. As it raises an error currently if the token isn't present.
For example from the games cog:
https://github.com/python-discord/sir-lancebot/blob/a3bd208580ff223cd0120d0c4b5a1bf3c28d03e5/bot/exts/evergreen/game.py#L472-L481
Could you please remove this wrapper and use Tokens.unsplash_key directly in your param's dict.
I've done this, i just dont have it commited yet as far as I know
this makes sense, okay!
For the more language time parsing feature, can we make use of parsedatetime?
we already have arrow as a dependency, so maybe we can make use of that?
we already have
arrowas a dependency, so maybe we can make use of that?
That would do it too! Yes 👍
@ChrisLovering made the requested changes
Looks good to me!
Note to core devs: We should make sure this env var exists in the bot env before mreging, and we should update the contributing guide too
Thanks @ChrisLovering !
Can anyone contribute or possibly provide inspiration/ideas for this? If so, where should images be posted? Is there any sort of "idea board" area? Thanks!
Looks awesome! Just a few nitpicks 😛
Take this inside the indent. As it is part of
await with ctx.typing()
description="A photo of Earth 🌎 from Unsplash.",
Emoji can be ignored, came up on my keyboard and just put it. It looks good tho
I don’t like the word 'made' here, the photos are not made but rather added or clicked.
GitHub Actions run 621741164 succeeded.
GitHub Actions run 621742490 succeeded.
GitHub Actions run 621742515 succeeded.
@Shivansh-007 all changes made
Can it refresh before get_markdown is called? The event will be set when the last get finishes and the context mgr is exited, after which the next context switch can only occur after user_requested is set to true on the item in get_markdown making the clear wait for that to be parsed
Looks like you're right, but I believe allowing a refresh to run in the middle of get_markdown is still a problem. The two problems are that _page_doc_items and _item_futures, causing KeyErrors later in get_markdown.
There is still a bit more that needs to be added. This article recommends that you have both the author and the site links. It also requires you use a referral link instead of a regular link. Check the article for all the specifics.
oh, whoops! I'll get going on that
I'm not sure why you removed the spaces here, they were added for readability
This shouldn't be a bare exception
Similarly here, your change isn't in line with the rest of the codebase
First review. Looks pretty good overall.
GitHub Actions run 622191316 succeeded.
GitHub Actions run 622209925 succeeded.
GitHub Actions run 622216241 succeeded.
Made a quick update to the info at the top, make sure to take a look as it is important for api verification
"""Override to skip metadata i.e. `count`, `next`, and `previous`."""
Response is paginated but the result is returned without any pagination metadata.
This works fine and I will approve it. However, I've left some more minor suggestions to clean up the documentation and make it more consistent.
Add blank line between responses
## Required response
Very clean PR, and works as expected. We are now blocked by the API application, but the code is ready.
replace this embed code with:
embed.add_field(
name='Suggestions',
value="Suggest more topic [here!](https://github.com/python-discord/meta/discussions/93)"
)
This looks great, just one critique so far!
to the people merging this:
It should take 5-10 business days for unsplash to review an application
Hmmm... why do you want to take out “Want to suggest a fact?” 🤔
Ok, i understand, a little wordy
for consistency with .topic
Storing these here for the application, but I have the raw versions too.


I would be interested in taking this!
awesome! thanks for the animations
what would have to be done to do this?
Connected!
Does validation on the API side need to be updated too?
There is a PR that I forgot about open for it, I'll take a look at it.
It should be quite simple on django. Add a URL for robots.txt which returns a basic text response. The response will depend on the consensus of this issue, but it mostly seems to be:
User-agent: *
Allow: *
It may be wise to block certain routes, such as admin, but that requires more discussion.
alright, sounds good!
I'm mostly okay with this PR. There are grammar issues, but it looks like it does what it needs to do.
# The serializer will truncate and get rid of excessive data
is not allowed and invalid fields are ignored. If `user` already has an
active nomination, a new nomination entry will be created and assigned as the
Single quotes.
{'actor': ['Actor don't exist or have not nominated user.']}
Mainly grammar + code style fixes, but otherwise looks good.
Grammar
{'actor': ['This actor has already endorsed this nomination.']}
I don't understand what this means, but I think this is an improvement. (It may be the opposite).
{'reviewed': ['This field cannot be set while you are ending a nomination.']}
Everything looks good. Went through and tested it on my end. Was able to remove the role, let it naturally be removed by the time set, as well as restart the bot in the middle of it having someone in the timeout list and then having it sucessfully remove the role.
I'm more than happy to see this go forward.
If this is going to be changed, it's needs to be changed in the test as well
Make sure to change the test as well.
make sure to adjust the test as well
@Kronifer The token is ready, please update the app name to Sir Lancebot (I believe in code that would be Sir%20Lancebot
Maybe unpacking this type into match, certainty could help with readability of the if statement below.
Remove debug print, or make it a log.trace()
Minor grammar.
"""Gets the content of README.md from the WTF Python Repository."""
@HassanAbouelela thats done!
Connected!
7ba7149 Add .pyfacts command - MrKomodoDragon
b112226 Change bot: Bot to commands.Bot for consistency - MrKomodoDragon
fdfa5c7 Remove unused import - MrKomodoDragon
e571087 Merge branch 'master' of https://github.com/MrK... - MrKomodoDragon
06d600f Move loading of file outside of command - MrKomodoDragon
This change itself looks good an resolves the linked issue.
Connected!
@Xithrius is it ok if I take this one?
Why does the mock need to be reset? Isn't each mock in the list a separate instance?
These should be await asserts in all the tests. In general, you should go over all your tests and make sure anything that's a coroutine is using the await assert.
Perhaps irrelevant since this test needs to be redone anyway:
- This message can be constant.
- Because it is constant, it does not need to be included in the tuple.
- It doesn't have to be
MSG_SILENCE_SUCCESS; an arbitrary string literal can be used, which would simplify the test by avoidingformat()andreplace().
There weren't any changes to Pipfile so relocking is unnecessary. Please undo these changes to the lock file.
This function is also redundant.
await ctx.send(f"{Emojis.check_mark} Changed temporary permission to permanent.")
Addressed this in 70ecd087 as we already take care of many edge cases over the cog anyway
I've removed it in fbe52273 and replaced it with a simpler system. A future is created either when an user requests it or the parsing of its associated doc item begins, then it is kept in the dict until its result is set.
I've replaced the redis set task with a normal await to prevent a potential race condition when the cache wouldn't be set before the item deletion and an another request for the item came in from an user.
I believe it didn't introduce any race conditions or logic errors bu...
I've moved it outside of the try; the item access can't really fail now but the code is flatter and clearer with it outside.
What do you mean with the invariant? I'm afraid I didn't quite get that
Connected!
I believe I've encountered a few where the parsing algo ended up with an empty string (or all whitespace, only saw it on discord), do you propose we use Unable to parse the requested symbol. for the description in those cases too?
I've set the future exceptions at first to let the errors get to the users directly, but didn't consider that there is still useful information to provide even if the parsing failed. I've removed the exception set in df5c7de8 and use the None default for the handling
Similarly here, your change isn't in line with the rest of the codebase
I needed import of Bot from discord.ext.commands earlier, but later I didn't need it and I forgot to remove it from here.
Is the error going to be posted to the channel? I'm not sure that's desired. I'd say it should log the error and return without creating an embed.
It would be posted along the other embeds with the webhook. I did this so it is easier to know what happened about that message link. I could just log it with a log.info and not create a embed for it
If we get through the request I don't think this can really fail unless the data gets corrupted in some way. The HTML is auto generated and the parser is fairly generous in what it allows
No, it is talking about how it parses the README.md into self.headers
Should we retry the connection, or just let the users know it failed with the request and let them redo it if they want to?
Hi, please add @MrKomodoDragon to the issue, were doing this together
I imagine that most failures are of a nature for which retrying immediately would not succeed. Furthermore, conversations may move on, so adding a delay between retries won't be good.
I think it wouldn't hurt to take the precaution, but it's not strictly necessary. I'll leave it up to you to decide.
The presence of the future corresponding to a queue item is an internal invariant. It means that the program expects that there will always be a future for the queue item it popped. I'm proposing to add an assertion for that.
That's not where I was going with this. I was just wondering if Discord allows empty strings as descriptions or if it wants it to be None in such cases. I'm not sure if making such substitution for empty strings is accurate. Couldn't it be a case of a symbol truly lacking a description rather than it being a result of a parsing error?
Alright. Good luck on development! Remember, if you have any questions, feel free to post in #dev-contrib.
They will have to participate in this issue if you want me to assign them.
54eca6d Fix grammar of nomination endpoints documentation - ks129
72693a6 Replace double quotes with single quotes - ks129
In many places of the code we use a bare exception, and for the similar case I using this, If any error occurs it should be mentioned in the embed, whether it is Channel Not Found, Channel Unreadable or Message Not Found. This is then set as the header of the error embed for that particular message link.
GitHub Actions run 623620365 was cancelled.
GitHub Actions run 623620365 was cancelled.
I'm not sure if a symbol like that can exist, or at least be directly parsed with an "empty" description by the parser as it'll always try to look for something.
But functionally the description works fine with an empty string
fdafa7423596d8a11b5c25a7f6a9ab47ed3ce6b6 changed the dict to a defaultdict, doing the assert on that would be redundant
Thanks! This is starting to look pretty good.
This is what the lemoji looks like in use:
There is nothing like discord.Member.disconnect or VoiceChannel.disconnect(member)
There is member.move_to(None), but is that related to this repository?
Sorry, wrong rep and thank you for your help
Ahh, so
self.headersis aname: linkdict? If so, could you update this docstring to say that it parses the readme into theself.headersdict, where the key is the heading and the value is the link to the heading?
Yes you are right! Alright will update the doc-string.
Yes
d = {'a':1, 'b':2, 'c':3}
print(d.keys())
print(type(d.keys()))
Will give:
001 | dict_keys(['a', 'b', 'c'])
002 | <class 'dict_keys'>
Yea, I know that, but as far as I can see process.extractOne() will work with a dict_keys class directly as its an iterable.
@MarkKoz It does not kick them out. We would have to boot them from the voice channel. Currently, I'd prefer if we don't implement anything for it at the moment, as Mods+ do have permissions to boot someone from VC manually.
Typically if it came down to that, either they'd be receiving a voice ban or some other full infraction, which would bump them off call anyway. Even a regular server mute does so.
In my opinion, the use case for revoke would be if someone finishes up their help session or what have you before it would expire, rather than having to remove it due to bad behavior.
I will be taking over this issue, had a talk with @gustavwilliam.
I'm too busy to implement this myself, but let's wait for a core dev to assign you, before getting started.
Looks good, other than the changes mentioned by Akarys I don’t think anything is needed.
722d9b2 Fix Pipfile merge conflicts - ChrisLovering
931fb3e Verify channel constants on startup - WillDaSilva
b907c4c Add docstring to check_channels - WillDaSilva
7bec6f4 Capitalize "ID" in error message - WillDaSilva
52d6261 Merge branch 'master' into startup-channel-check - WillDaSilva
3616302 Add connect four cog supporting player vs playe... - Shivansh-007
When a user joins the voice chat for the first time, they receive a ping in the #voice-verification channel. This was done in an attempt to solve new users' confusion as to why they couldn't talk when joining the chat. However, it does not seem to be having the desired effect, as there are still quite a few users still confused.
The proposal now is to send a DM to the user with a link and explanation so that they have a lasting link and reminder on how to get verified. Message requir...
The line above could be moved into this if statement as a walrus operator
if text := unescape(data["selftext"]):
We usually recommend that you raise issues before raising a PR directly to the repo, as it's possible the core dev team will have opinions.
As far this change, we are currently porting this over to Sir Lancebot with https://github.com/python-discord/sir-lancebot/issues/530 and https://github.com/python-discord/sir-lancebot/pull/569
If we decide that we want these changes in the meantime, my comments are below.
Could we have this and the line above in a single assignment?
title = textwrap.shorten(
unescape(data["title"]),
width=64,
placeholder="..."
)
Only a code review, haven't tested yet. Mostly grammer
I think "You have already nominated this user" sounds better
await ctx.send(":x: You have already nominated this user")
The wording here is a little confusing, I'd go for something like:
"""Edits the reason of a specific nominator in a specific active nomination."""
This should be in parentheses
msg += f"\n\n({len(history)} previous nominations in total)"
The code on master doesn't do any handling around it and it doesn't look like there were any issues with it. I'll leave it for now, with my points above in mind, and if an issue pops up in the future it can be addressed then
I mostly saw it as an opportunity to not store unnecessary data in the redis keys, with the added benefit of them looking a bit nicer when they're inspected during development
Can we add this color (0xFF0000) to the constants.py or use it from there?
Doesn’t user.name return a string data type?
Actually, this will fall under the broad exception handling added in 51a11cc4
I've moved the creation of the footer text before the get symbol await to avoid this.
I've moved the handling around getting the DocItem from doc_symbols and fetching the markdown from redis/the BatchParser to separate methods in 4f5f284d3eec46b9209d19142d5c21456c4c403a, do you think this is still worth moving, leaving the method to just manage the few calls and some hadnling around htem?
Another small correction
help_text="Whether a review was made."
"""A nomination entry created by a single staff member."""
active nomination, a new nomination entry will be created and assigned to the
help_text="The nomination this entry belongs to.",
[python-discord/bot] New branch created: json\-logging
JSON logging allows for greater filtering with our log aggregator, Loki.
This PR introduces JSON logging when debug mode is set to false (i.e. the bot is running in production).
You should keep commit titles short. If you want to add more detail you should do it in the commit body.


