#dev-log
1 messages · Page 65 of 1
Since there’s no way to filter links based on extensions without having a lot of false positives, let’s close this. Feel free to add a comment if you can think about a better way of doing this.
@Anubhav1603 Greetings. I hope you've recovered and are feeling better.
Will you be willing to pick this PR back up? If not, I can take over for you.
By the looks of it, it has been fixed in Discord.py 1.6:

Further more, after testing it with int eval message was proved not to update the .author reference to User object even if the author in question has left the server.
I don't think it should be occurring anymore.
@Harbys are you planning on continuing this PR?
I'd like to see these changes get implemented.
df897e5 Adds Member Checks Before Changing Voice - HassanAbouelela
37bfd75 Cleans Up Tests - HassanAbouelela
41e861c Merge branch 'master' into fix-voiceban-member-bug - HassanAbouelela
06c5eba Restructures Voice Ban Action - HassanAbouelela
a41b932 Updates Apply Infraction Docstring - HassanAbouelela
I don't think this is needed anymore since we don't have eso challenges anymore. At worst we can have a tag explaining what esoteric python is.
Connected!
Connected!
@Xithrius Yes, I want to finish this pr, but I have very little spare time recently so I'm sorry it will be probably another week until I get it done.
[python-discord/forms-backend] branch deleted: dependabot/pip/starlette\-0\.14\.2
Connected!
Tbh I'm kinda stupid and dunno how to make a PR, so If someone who ants to they can
Connected!
@Xithrius Yes, I want to finish this pr, but I have very little spare time recently so, I'm sorry it will be probably another week until I get it done.
Take your time, I'm just making sure this will eventually get done.
Have a good one! :heart:
[python-discord/snekbox] New branch created: dynamic\-parent\-cgroups
For some reason, when two memory intensive tasks were running in parallel, even while in child cgroups, the parent cgroup memory limit was tripping and sending an OOM kill to the child processes, even if theses processes were behaving reasonably under the 50MB limit. This issue is shown #83.
This PR resolves that by dynamically creating the parent cgroups which nsjail templates off, assigning them a random UUID name, prefixed by snekbox for clarity.
In testing I could not encounter the ...
Looks good to me, except this one thing.
Is this to check if the user is in the server? If not, could you explain why it's here?
Looks pretty darn good to me, besides a few changes.
Since the help command shows up as the screenshot below, I thought it would be better if the command was named directly after the animal.

@http_status_group.command(name='dog')
Good use of the finally statement.
URL should be a constant.
Connected!
Mentioned the requested changes @Xithrius !
It basically override the channels it can be used in,
- Allowing everyone to use the command will allow the command to be used in channels.
- Then i put a check to see whether it is in the white listed channels or the categories, If it is, then it returns None.
- Else, it continues to give out the output.
661ab2c Add http status dog and add http_cat to group h... - Shivansh-007
f5eae5b Remove unused imports - Shivansh-007
c87f6e0 rename the cog to HTTPStatusCodes - Shivansh-007
e32182e Add similar repsonse.status check to too, and ... - Shivansh-007
aee64f8 Add not Implemented error handler for .status c... - Shivansh-007
Connected!
@Xithrius I didn't see your edit sorry :/
Now, come to think of it, I don't think it needs to be removed anymore. It can help promote the feature to new users, even if can be weird when the user deletes the first message. I was going to close it anyway.
Glad we can come to an agreement.
Have a good one!
ea69c56 Add docker py package as a dev dependency - MarkKoz
a325600 Add a Python script to manage containers during... - MarkKoz
e0e8e9a Prune dangling images after building dev image - MarkKoz
f1d79b5 Remove intermediate containers after building d... - MarkKoz
5c929c2 Fix build cache not being used for dev image build - MarkKoz
[python-discord/snekbox] New branch created: feat/env/73/py\-scripts
Closes #73
dev.sh is now docker.py and has the following CLI:
root
usage: docker.py [-h] {start,exec} ...
Utils for managing a snekbox container during development.
optional arguments:
-h, --help show this help message and exit
subcommands:
Available actions to perform.
{start,exec}
start create and run a snekbox container
exec execute a bash command within a snekbox container
exec
usage: docker.py exec [-h] ...
dd99fd3 Add Python 3.8 compatibility for docker script - MarkKoz
aa0b863 Bump webpack from 5.20.0 to 5.20.1 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/webpack\-5\.20\.1
Bumps webpack from 5.20.0 to 5.20.1.
Release notes
Sourced from webpack's releases.
v5.20.1
Bugfix
fix Caching failed for pack: RangeError [ERR_OUT_OF_RANGE] warning when serializing the cache
Commits
82edd91 5.20.1
1f8a750 Merge pull request #12573 from webpack/dependabot/npm_and_yarn/babel/core-7.1...
bcf160f Merge pull request #12576 from webpack/bugfix/binary-middleware-oor
29d957d fix allocation sizes
a4d1f7c improve BinaryMiddleware test cas...
54adbe7 Bump html-webpack-plugin from 4.5.1 to 5.0.0 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/html\-webpack\-plugin\-5\.0\.0
Bumps html-webpack-plugin from 4.5.1 to 5.0.0.
Changelog
Sourced from html-webpack-plugin's changelog.
5.0.0 (2021-02-03)
⚠ BREAKING CHANGES
Drop support for webpack 4 and node <= 10 - For older webpack or node versions please use html-webpack-plugin 4.x
Entry javascript resources are now beeing loaded deferred in the <head> tag to improve the page load performance by default - You can set the scriptLoading option to 'blocking' to...
97befc5 Bump @types/node from 14.14.22 to 14.14.24 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/types/node\-14\.14\.24
0da9c70 Bump motor from 2.3.0 to 2.3.1 - dependabot[bot]
[python-discord/forms-backend] New branch created: dependabot/pip/motor\-2\.3\.1
Bumps motor from 2.3.0 to 2.3.1.
Changelog
Sourced from motor's changelog.
Motor 2.3.1
Motor 2.3.1 fixes two bugs related to change streams.
Bug-fixes:
The :meth:motor.motor_asyncio.AsyncIOMotorCollection.watch,
:meth:motor.motor_asyncio.AsyncIOMotorDatabase.watch, and
:meth:motor.motor_asyncio.AsyncIOMotorClient.watch methods now properly
support passing :class:~motor.motor_asyncio.AsyncIOMotorClientSession via
the session argument.
Avoid exhausting Mot...
It looks nice to me overall, just a few minor changes can be done according to me.
The response looks very abrupt to me, could you try wrapping this with the async with self.bot.typing?
You could make a variable holding this and use it in both the places. It won't matter much, but it'll look a little cleaner to me.
description = ("**Result Of cht.sh**\n"
f"```python\n{body_text[:body_space]}\n"
"... (truncated - too many lines)```\n"
f"Full results: {url} "
)
This would look neater than the \ escaping of the string I think. Also, if you do change this, please change it for the next description variable also. (Also, the formatting isn't very good in this so please fix it when you change it)
The response is pretty past, I don't see the need of that.
You could make a variable, named url or something and assign it to URL.format(search=quote_plus(" ".join(search_terms))) and use it wherever you mention URL.format(search=quote_plus(" ".join(search_terms)))
It wasn't very fast for me, especially ones that had a large response like .cht :learn
Using the has_any_role_check without passing a fake context didn't seem feasible, so I opted to use the any(role.id in Moderation_Roles) structure seen elsewhere in the codebase.
Come to think of it, that should become it's own helper, but that's out of scope for this PR.
GitHub Actions run 536582689 failed.
GitHub Actions run 536584927 failed.
GitHub Actions run 536584944 failed.
So we would have a function running for duplicates attributes? I’m not sure if it is a good idea, since we could have some issues with user defined code overriding values coming from configuration files, that would be a pretty weird behavior.
The idea here would be to have it for user defined code. For example, the extension library will need to have a list of all the defined entries, I think it is pretty useful to store them here.
With the current setup, they don’t get removed, but I don’t think it is much of an issue since adding the default isn’t a destructive operation, and reloading the file would result in the same global configuration.
So we have to check that each node is a mapping when walking the tree?
Thanks, I'll look into this and see how we can support in a way that makes sense.
This will need some special handling to prevent trying to decode bytes into utf8 but will allow users to serialize arbitrary data in a more compact manner.
[python-discord/sir-lancebot] Issue opened: #574 Remove Member Intent Reliant Features From Lovefest
Description
After discord introduced the intents system, sir-lancebot no longer has access to the list of members for a role. This has led to a weird situation with some of the commands in the lovefest cog, as they relied on fetching members for a given role.
Steps to Reproduce
(Make sure your bot does not have the members intent enabled)
- Sign up for the lovefest role.
- Try to use one of the commands that rely on fetching members, such as
.bemyvalentinewith no argu...
I'd like to give this one a go. I'll take a look through the cog tonight and come up with a few solutions that I think will work and get some feedback on them here.
Relevant Issues
Closes #574
Description
- Removes random selection of members who have love fest role which was causing a caching problem since we don't have
intents.members = True - Again caused due to intents, the bot was not able to find the user on DMChannel, so i changed it to be passed through the sir-lancebot-commands channel and deletes the their message. Rest it acts similarly, sending the errors/confirmation messages in DMs and sending the valentine message in DMs...
Description
The Bot should skip when a message is sent to it on DMs since it is checking for the category and the DMChannel has no category.
message.channel.category.id in WHITELISTED_CATEGORIES
AttributeError: 'DMChannel' object has no attribute 'category'
Steps to Reproduce
Send a DM message to your test bot, and check your terminal.
Behaviour
Should ignore the message which isn't being done currently,
Possible Solutions
if isinstance...
I don't think we should delete the message that invokes the command. Have the command that caused the error s good reference for the user, to see where they went wrong.
What was the reason for changing this from a DM? should we do the same change for the rest of the messages sent via DM in this cog?
f9493a2 Fix coverage ownership only if running tests - MarkKoz
b9b8fa3 Improve error messages of docker helper script - MarkKoz
I've gone ahead and broke those out into their own tests, in part because I had to add more tests and didn't want a long list of subtests, and in part because of your suggestion.
I've also tried to apply that to the rest of my tests.
[python-discord/bot] New branch created: dynamic\-available\-help\-channels
Users sometimes get confused on which channels are available for them to claim.
With this PR, a message in the #how-to-get-help channel will be edited to reflect which channels are currently available.
If the bot cannot edit the most recent message in the #how-to-get-help channel, then it knows it's trying to edit the webhook message that contains the guide for claiming a channel. It will send the dynamic message if this occurs.
If we do decide to remove or add more channels in the `...
Again caused due to intents, the bot was not able to find the user on DMChannel, so i changed it to be passed through the sir-lancebot-commands channel and deletes the their message. Rest it acts similarly, sending the errors/confirmation messages in DMs and sending the valentine message in DMs.
00201c7 Move development environment guide to a separat... - MarkKoz
b50c5e3 Categorise and sort scripts in Pipfile - MarkKoz
d274d25 Replace dev.sh with Docker Compose - MarkKoz
dcb902d Rename "snekbox" script to "webserver" in Pipfile - MarkKoz
12548fb Replace protoc shell script with a Python one - MarkKoz
[python-discord/snekbox] branch deleted: feat/env/73/py\-scripts
I deleted it so that it still acts like a "Secret", and confirmation are sent to the user on DMs, so the user always has reference.
Everything is looking solid so far. I have a few functionality concerns, but everything works as expected in general.
You can save one edit if you remove this update. The next thing that runs after this task is another update.
Since we gaurntee the how_to_get_help channel later on, can we avoid this fetch, and use channel.category instead?
Could you add a check for how_to_get_help being an instance of TextChannel? GuildChannels could be voice or category channels, which don't all impleemnt fetch_message, send, and last_message.
Perhaps we should log a warning and abort if the channel is not of the correct type.
d2a10cd Alphabetized config-default.yml. - Xithrius
I don't think this is necessary since there's no plans of having a voice channel anywhere near the available help channels.
3a4d38b Removed unnecessary update method call. - Xithrius
88b88ba Replaced fetching available category for old one. - Xithrius
Forgot that the self.available_category attribute exists.
[python-discord/snekbox] New branch created: bug/tests/nsjail
#88 left tests in a broken state. This wasn't noticed since CI had a bug that prevented the step from failing despite tests failing. This PR fixes both of these issues.
Clean, and works as expected. LGTM
How does it look if we do this:
**Currently available help channel(s)**: {available}
Hmm, i like it with bold, let's see what others prefer.
38a6b88 Bump webpack from 5.20.0 to 5.20.2 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/webpack\-5\.20\.2
Bumps webpack from 5.20.0 to 5.20.2.
Release notes
Sourced from webpack's releases.
v5.20.2
Bugfixes
fix caching issue with asset modules causing undefined files
fix problem that rebuildModule doesn't follow dependencies
v5.20.1
Bugfix
fix Caching failed for pack: RangeError [ERR_OUT_OF_RANGE] warning when serializing the cache
Commits
f5a2637 5.20.2
2acc6c4 Merge pull request #12591 from webpack/bugfix/asset-modules-caching-crash
5723110 fix me...
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/webpack\-5\.20\.1
d562ca2 Bump @sentry/react from 6.0.4 to 6.1.0 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/sentry/react\-6\.1\.0
[python-discord/forms-frontend] Pull request opened: #126 Bump @sentry/react from 6\.0\.4 to 6\.1\.0
Bumps @sentry/react from 6.0.4 to 6.1.0.
Release notes
Sourced from @sentry/react's releases.
6.1.0
We updated the way how we calculate errored and crashed sessions with this update. Please be aware that some numbers might change for you and they now should reflect the actual reality. Visit our docs for more information.
[browser] feat: Rework how we track sessions (#3224)
[hub] ref: Simplify getting hub from active domain (#3227)
[core] re...
0d90398 Bump @types/node from 14.14.22 to 14.14.25 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/types/node\-14\.14\.25
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/types/node\-14\.14\.24
Connected!
I prefer the bold version to catch the eyes
After further consideration I see the appeal of the bold. I will change this now.
2940ba3 Modified the dynamic to be bold to catch eyes. - Xithrius
Here's what the dynamic message now looks like.

555c1a8 Add jumplink to deleted messages - Senjan21
[python-discord/bot] New branch created: feat/1280/deleted\-jumplink
This fits into one line comfortably
Why are we storing ids instead of the channels themselves?
What's the reason for creating a task and immediately awaiting it? If it's because of queue_tasks and their cancellation then it should be unnecessary, as the init task itself is cancelled when the cog is unloaded
Closes #1280
Implements jumplinks to deleted messages in logs.
Thank you @Senjan21, very cool.
[python-discord/bot] branch deleted: feat/1280/deleted\-jumplink
Connected!
+1 to this. It will also make formatting the message more straightforward with channel.metion
message = f"You cannot send a valentine to {user} as they do not have the lovefest role!"
message = f"You cannot send a valentine to {user} as they do not have the lovefest role!"
Update the doc string:
Send a valentine to specified user with the lovefest role.
Update doc string
Send an anonymous Valentine via DM to to a specified user with the lovefest role.
discord.Forbidden is raised when the bot tries to DM a user, but they have DMs disabled.
In this case, the person the bot was trying to send the valentine to had DMs disabled.
I this case though, removing the author from this changes it so that the bot does contact the author of the command via DM. If this was your intention, I think we should remove the other ctx.author.send too, or wrap those in discord.Forbidden try/except blocks too.
Hello, thank you for your Pull Request! The tag content is quite good, although I wonder if it would be worth renaming the tag to dict-get or something like that.
I left a few comments related to formatting.
This should be an empty line to visually split the blocks and keep it readable.
Discord doesn’t support markdown titles sadly
**The `dict.get` method**
Let’s put an inline codeblock around the function names.
The [`dict.get`](https://docs.python.org/3/library/stdtypes.html#dict.get) method will return the value for the key if it exists, or None (or a default value that you specify) if the key doesn't exist. Hence it will _never raise_ a KeyError.
Maybe include a example of KeyErrors being raised.
>>> ages = {'Jim': 30, 'Pam': 28}
>>> ages['Michael']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'Michael'
Ah, figured the title would be used in the Embeds title field
Messed up and made a separate branch for this, my bad.
I've edited the dict-get tag to also refer to this.
c346c2b Fix #1371 error via adding errors. - Senjan21
[python-discord/bot] New branch created: bug/1371/moderation\-check
This PR aims to fix #1371 via raising a new error if user being infracted is not a bot and handling it within error handler.
I'd like to work on this. There's a few other places that don't behave well when the ctx is from a DMChannel, I'll sort those at the same time.
GitHub Actions run 541303993 succeeded.
GitHub Actions run 541313261 succeeded.
GitHub Actions run 541321601 succeeded.
Relevant Issues
Closes #576
Description
I've made sure that anywhere with an on_message listener properly deals with messages from within DMs. This has been done by checking if message.guild is truethy, if so, its in a guild.
i found these by searching for on_message and running .help in a DM to see if anything raised an error.
Reasoning
This first pass just makes the bot ignore messages from DMs that were causing errors to be thrown.
Screenshots
Fo...
Even if it is the correct term, I am also of the mindset that we use python keywords. The tags in my opinion are by no means an extensive resource, but more of a quick overview to explain a concept, and set someone on the right path of looking into it.
The source you included uses object. If someone is interested in learning more about JSON, they can follow that and learn more. It does not make sense to have it that far removed from python though when the original question is probably in...
Even if it is the correct term, I am also of the mindset that we use python keywords. The tags in my opinion are by no means an extensive resource, but more of a quick overview to explain a concept, and set someone on the right path of looking into it.
The source you included uses
object. If someone is interested in learning more about JSON, they can follow that and learn more. It does not make sense to have it that far removed from python though when the original question is proba...
Hi all, I found this looking for a 'good first issue' (this is the only one).
After some research, I found out that maybe this can be closed because of https://github.com/python-discord/sir-lancebot/commit/5e249bc2e0a944d0683ba35a2e1ee459d60668ce ?
If this doesn't already have a default value set in Python then it should. Alternatively, the default can remain in the compose file but I prefer defining it in Python.
The default is currently set to redis.default.svc.cluster.local https://github.com/python-discord/sir-lancebot/blob/c6353a8613d8e30d66a91fc4ed4017b16c4390ab/bot/constants.py#L278
Okay, that's the production host and it should stay that way. Therefore, it's best to leave it set to redis within the compose file since it can spin up a redis container. If running without Docker Compose, I presume users are already told they have to manually enable fakeredis?
I've added the default back in.
They are, but it's a little buried in the lancebot wiki atm https://pythondiscord.com/pages/contributing/sir-lancebot/sir-lancebot-env-var-reference/
I'm planning on drafting a guide to be added onto the wiki for the docker setup (As it's not currently documented).
Yeah, this no longer seems to be an issue. I'm sorry there wasn't an issue marked to work on, but if you are still interested, drop into the [dev-contrib channel](#dev-contrib message) on the discord server, and we could look for issues you can work on 😄.
Connected!
docker-compose up already loads a .env automatically if it exists in the same directory as the compose file, but I suppose being explicit isn't bad.
if not (ctx.guild and any(r.id in ignore for r in ctx.author.roles)):
This should be above current_channel check.
81af009 Implement showing filterlist entry comment in a... - ks129
[python-discord/bot] New branch created: ks123/watchlist\-trigger\-reason
[python-discord/bot] Pull request opened: #1402 Implement showing filterlist entry comment in alerts
Closes #1394
This PR make filtering functions returning reason about triggered entry what will be shown in main embed (except for guild invites what show this in guild info embed):


I thought back then that it would be necessary for this task to be cancelled if the cog was unloaded.
I now see that there's no significant reason to do so.
Can we spread this across lines?
AVAILABLE_HELP_CHANNELS = """
**Currently available help channel(s):** {available}
"""
Can we have a log.trace() statement here?
It seems more readable, """ are multi line strings, so either change it to " single quotes or keep it as it was before
(my opinion)
After looking at other cogs, it does seem that one liners should have single double quotes. An example can be seen here.
88fba5f Formatted available constant, added missing dyn... - Xithrius
Tbh I'm kinda stupid and dunno how to make a PR, so If someone who ants to they can
If you're new to git, I recommend this video.
I purposely put it below so that if there is a current riddle going on, the user will be notified where.
I'm trying to check if the ctx is within the guild, wouldn't this change would invert that?
I haven't been able to produce this behaviour. Having the .env file in the root and running docker-compose up doens't seem to load the variables automatically
bbce0a8 Create local-file tag about sending local files... - ks129
[python-discord/bot] New branch created: ks123/discord\-py\-local\-file\-tag
d0c87c7 discord.Channel -> discord.TextChannel - ks129
44be3e8 discord.Messageable -> discord.abc.Messageable - ks129

I think codeblocks should be like they are not one big. This helps explaining it.
Closes #1389
1a9d820 Ignore attachment-only messages for duplicates ... - ks129
[python-discord/bot] New branch created: ks123/duplicates\-ignore\-attachments
Closes #1356 because we already have attachments rule, but this still should ignore attachment-only messages in duplicates.
Looks all good however it'd be nice to add hyperlinks to the objects and methods you mention for easier documentation access imo.
e1fa318 Mention instance in comment about Messageable - ks129
90a9bac Add hyperlinks for local file tag discord.py re... - ks129
This issue is available to be worked on.
This shouldn't contain a backslash since we want to have a line break
While you can use a `try` and `except` block to catch the `KeyError`, Python also gives you some other neat ways to handle them.
>>> print(my_dict.get("foobar", 3)) # here 3 is the default value to be returned, because the key doesn't exist
[python-discord/bot] New branch created: swfarnsworth/tag\_messages
I rewrote three tags for reasons described in the respective commit messages. The content I'm submitting is informed by my belief that tag messages should be specific so that we're not trying to address too many potential questions in the relatively small amount of space that we have.
... to set an attachment as an image:
discord.Embedinstances have aset_imagemethod which can be used to set an attachment as an image:
...send an embed with an attachment ...
Getting
bot_1 | Traceback (most recent call last):
bot_1 | File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
bot_1 | await coro(*args, **kwargs)
bot_1 | File "/bot/bot/exts/backend/error_handler.py", line 86, in on_command_error
bot_1 | await ctx.send(f"Cannot infract that user. {e.original.reason}")
bot_1 | AttributeError: 'InvalidInfractedUser' object has no attribute 'reason'
8f51f23 Fix grammar of local-file tag - ks129
I did not intend for the "can" to be removed. Sorry if the instructions were unclear.
The whole line should read "After this, you can send an embed with an attachment to Discord:"
4961290 Add back removed 'can' to local-file tag - ks129
65ea165 Add missing 'a' article in local-file tag - ks129
I would like to try implementing a lemoji with star struck eyes, useful in the case when you are delighted by an action and are surprised at the same time, it would be based on this emoji :star_struck:, I am thinking about making it similar to lemon_hearteyes but let me know if I can design it in a better way, here's a rough implementation

691f239 Remove unnecessary period from local-file tag - ks129
Great idea! I think this would be very cool. Just remember to use the updated lemoji base, even if :lemon_hearteyes: doesn’t use it yet.
Hello, this error is no more.
Yeah this wasn't ready for review. I became too busy to continue and fix those issues.
Added lemoji :lemon_starstruck:,
This is how the 128x128 png looks like-

PR for the issue #114
Thanks! Over all, this looks great. I just have two minor comments:
- The mouth color is pretty light. Check out some of the other lemojis and see what color we often use to bring contrast to the mouth
- The mouth is not symmetrically rotated. Could you try to align it properly?
For reference, this is what one would see if they evoke the !docs collections.defaultdict command that is available currently.

I agree that we can make one that's better for our purposes.
Thank you for submitting this PR; I hope that my suggestions don't obscure the appreciation that I have for the time you've taken to make it. Let me know what you think and we can proceed from there.
I don't think it's very popular to instantiate a defaultdict from another dict, so it may be more useful to just have my_dict = defaultdict(int). Otherwise people might erroneously assume that passing an empty dict is necessary if they don't need any key-values to start, or something.
In a repl setting, my_dict without the call to print would display the value.
Calling int a function in this context is dubious because it is an instance of type that returns 0 when called. You might consider:
In this example, we've used the
intclass, which returns0when called like a function, so any missing key will get a default value of0. You can also get an empty list by default withlistor an empty string withstr.
If "filename" isn't the name of a token of some kind, it should be "a file name". If it is a variable, it should be filename with backticks on either side. I see that it has backticks on the following line.
Overall, you've significantly reduced the amount of clutter. I like this change. There are just a few minor things to consider before I'm fully satisfied.
This results in two spaces after the code block, like in the following screenshot. Let's remove it.
<img width="501" alt="Screenshot 2021-02-06 at 22 16 55" src="https://user-images.githubusercontent.com/65498475/107129892-06fea900-68c9-11eb-8171-5707ef8e971e.png">
With one space, it instead looks like this:
<img width="537" alt="Screenshot 2021-02-06 at 22 17 19" src="https://user-images.githubusercontent.com/65498475/107129904-15e55b80-68c9-11eb-86fd-4d6bdf455f89.png">
Note that even when you include an expression that isn't a string, like `number * 2`, Python will convert it to a string for you.
Both work, but this version seems more direct.
Is there a reason to remove this piece of information? We may want to say that it works in a similar way, instead of that it work out of the box, for the other types. From using the tag in the community, I've found this to be a nice addition to the tag, by showing them that there's more to the comps than just list comps. It's a pretty nice fact.
[python-discord/sir-lancebot] New branch created: upgrade\-override
Other types of comprehensions have differences that people need to know about in order to use them and given that it would take too many words to describe those differences, I think we shouldn't refer to them at all. I think this is especially true for generator expressions, as I think most people learn list and dict comprehensions (and maybe set comprehensions as well) before they learn about lazy iteration.
!dictcomp is another tag.
The [`dict.get`](https://docs.python.org/3/library/stdtypes.html#dict.get) method will return the value corresponding to the key, if it exists, and None (or a default value that you provide) if the it doesn't. Hence it will _never raise_ a KeyError.
Thanks for the PR! This seems like a highly useful tag to have.
The tag looks good in general, but I have a few thoughts how we could perfect this, before going live.
While using dictionaries in Python, you may run into `KeyError`s. This is raised when you try to access a dictionary item that isn't present in the dictionary. Python gives you some neat ways to handle them.
This could be condensed and more clear.
**Providing default values**
We don't really underline sections in the tags. They're generally just bolded, so this would seem more consistent.
The change of wording isn't necessary, but it's something to consider.
>>> print(my_dict.get("foobar", 3)) # Here, 3 is specified as the default value
3 # The default value is returned, since the key doesn't exist
Let's make sure that the comment follows PEP 8. I'd also like to see this split up in a way like the above, but I'll leave the details to you.
90eeeb0 Removed extra blank line.
- swfarnsworth
9a9eb8f "handle converting" -> "convert ... for you".
- swfarnsworth
I think you're right that they have quite a few differences that you need to know. However, this is something that I actually found very useful when reading the tag a while back. List comps are pretty common, so mentioning that there are similar things and underlining the fact that there are differences and that they'll need to do some further resource is crucial. At the same time, I see this as a great opportunity to sneak in some "you didn't know you wanted to know this, but you really want...
[sir-lancebot] Branch upgrade\-override was force-pushed to `9e71410`
Description
This PR removes the in_channel_override, with the more feature-rich whitelist_check. This allows for more granularity with the checks. Other improvements include allowing commands to ignore the global checks if need be.
The improvements will not materialize immediately in this PR, but it will help other currently open PRs in implementing features smartly.
Reasoning
The whitelist_check allows the checks to utilize categories, and roles, whereas previously catego...
I would love to see a mention of generators, dicts and sets as well, but I'll leave it to you to decide. Either way, I'm positive to this change. Thanks!
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/types/node\-14\.14\.25
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/sentry/react\-6\.1\.0
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/webpack\-5\.20\.2
453ed66 Bump webpack from 5.20.0 to 5.21.1 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/webpack\-5\.21\.1
Bumps webpack from 5.20.0 to 5.21.1.
Release notes
Sourced from webpack's releases.
v5.21.1
Bugfixes
fix a crash when using colors in stats
v5.21.0
Features
add webpack_base_uri to change base URI at runtime
add stats.errorDetails: "auto" to show error details automatically when there are only 1 or 2 errors
Bugfixes
fix a hanging build when using the persistent cache without a package.json in cwd
Developer Experience
add typings for...
[forms-frontend] Branch dependabot/npm\_and\_yarn/webpack\-5\.21\.1 was force-pushed to `f725595`
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/html\-webpack\-plugin\-5\.0\.0
[forms-frontend] Branch dependabot/npm\_and\_yarn/webpack\-5\.21\.1 was force-pushed to `3c6330f`
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/webpack\-5\.21\.1
54adbe7 Bump html-webpack-plugin from 4.5.1 to 5.0.0 - dependabot[bot]
38a6b88 Bump webpack from 5.20.0 to 5.20.2 - dependabot[bot]
d562ca2 Bump @sentry/react from 6.0.4 to 6.1.0 - dependabot[bot]
0d90398 Bump @types/node from 14.14.22 to 14.14.25 - dependabot[bot]
a33f51b Merge pull request #127 from python-discord/dep... - jb3
This PR mainly focuses on cleaning up dependencies. It moves type libraries to the devDependencies section, as they are not needed for building. Additionally, it removes cross-env as a project requirement, following the ability to set NODE_ENV as a webpack setting from the CLI.
The PR changes the way dependencies are installed for the workflows, opting to use a prod install for releases, such as netlify and sentry, and using development for everything else. This has the added benefit of ...
Approved, but I agree with @gustavwilliam's comments and want to see that addressed before merge.
So I took the mouth from :lemon_pleased:, and aligned it properly like it is on other lemojis

Though the color still seems light, and the next shade of brown makes it a bit darker, so I was wondering what color i can actually use
bbce0a8 Create local-file tag about sending local files... - ks129
d0c87c7 discord.Channel -> discord.TextChannel - ks129
44be3e8 discord.Messageable -> discord.abc.Messageable - ks129
6db5023 Remove additional newline from end of tag - ks129
e1fa318 Mention instance in comment about Messageable - ks129
[python-discord/bot] branch deleted: ks123/discord\-py\-local\-file\-tag
Connected!
Can i work on this? (Well actually am already working and opened a PR, but commented for getting assigned to this to avoid confusion)
I don't think we have to port things over from bot, in the help cog, there is code already to handle HelpQueryNotFound error. But after a lil testing, it is not being handled properly. the way to fix this is to look at the code and see whats missing from raising the HelpQueryNotFound error and handling it
I'll be doing this on a new PR, then.
Thank you for your time, I hope you've gotten better!
Can you also change the over-ride for
.chtcommand?
Thanks, I've gone ahead and fixed that.
Description
Implement a .stackoverflow or .so command which takes a search query and lists the top (5?) results. This command would be limited only to #sir-lancebot-commands. The command structure would be very simple, just .stackoverflow
Reasoning
This would help quickly getting solutions to problems that are not apt to use a help-channel, or questions which aren't python related. It would also reduce a little stress on the help channels.
Proposed Implementation
...
Nicely Done! LGTM (Tested locally)
c1a680c Updates README Permissions - HassanAbouelela
[python-discord/sir-lancebot] New branch created: change\-permissions
Connected!
I was told to mention the try - except option in a single line here, do you think I should omit it?
I didn't know how to split the comment whilst also keeping to the REPL look (with the >>>), wouldn't a lone comment look a bit odd?
Anyone using the server template will need to update their config to move the how-to-get-help channel out of the help available category, but it shouldn't be a big deal. This is not important for the test server, as it uses the same channel for cooldown and how-to-get-help.
Thanks! Works like a charm — unless we go into some edge cases.
When lowering the maximim amount of help channels (restarting bot in-between), the higher number of help channels will be listed in the available help channels message. Let me show you an example, where we go from 3 to 2 channels. After restarting the bot with the new config, the following will happen:
- The bot keeps updating the message with 3 help channels. One of them will be there statically (and incorrectly), while th...
Thank you for your approval!
I think that any of these edge cases will have to include a bot redeploy, as rules would probably have to be changed in order for them to take effect. If we encounter these edge cases, I'll be sure to put it into high/critical priority.
[python-discord/bot] branch deleted: dynamic\-available\-help\-channels
Connected!
1cb760e Revert "Dynamic available help channels message" - HassanAbouelela
[python-discord/bot] New branch created: revert\-1396\-dynamic\-available\-help\-channels
Reverts python-discord/bot#1396
[python-discord/bot] branch deleted: revert\-1396\-dynamic\-available\-help\-channels
[python-discord/bot] Checks Successful on PR: #1406 Revert "Dynamic available help channels message"
GitHub Actions run 545258947 succeeded.
Connected!
Connected!
If you want to do so, include it. I personally think it's a bit redundant.
Hmmm. This looks fine to me. It might also be worth considering putting the explanation outside of the code block, if you don't like putting the comment on the new line.
[python-discord/bot] New branch created: dynamic\-available\-help\-channels
Bot can fetch a message that was previously deleted, which causes a discord.NotFound error since it cannot find the message to edit.
On the actual server, no message has been deleted. The bot this time finds the webhook message, then tries to edit it.
I will make a change to check if the last message was sent by the bot. If not, it will send a dynamic message (or something similar to this)
. aioping.ping does not seem to handle that, and will throw a getadderinfo error. (Full TB if needed). This issue does not affect the Python bot...
I can reproduce the first bug, and the second one by changing my OS time.
Since the second bug is because of a host configuration issue, I'd rather show it as a warning, such as Failed to get valid current time instead of using zero.
The first bug affects my instance as well.
I agree with Akarys that displaying a warning would be optimal in the second scenario. Adding a "if time is less than 0, use this," to the ping command might be sufficient. Something like Invalid time configuration or Could not fetch might be clear enough.
Putting the username (and avatar) in bot embeds in commonly used to signal who invoked the command, on other bots. Seeing my own name and possibly avatar in something like a resources embed because someone pinged me doesn't seem very appealing, and might make me think that I somehow invoked the command. I'm not a huge fan of the idea.
@gustavwilliam i agree for the embedding of username/avatar like other bots do, i was more thinking of putting the username in the actual text along the lines of
Hey {username}, if you want to paste code you can use paste.pydis.com
this would not seem like the mentioned person invoked the command
00201c7 Move development environment guide to a separat... - MarkKoz
b50c5e3 Categorise and sort scripts in Pipfile - MarkKoz
d274d25 Replace dev.sh with Docker Compose - MarkKoz
dcb902d Rename "snekbox" script to "webserver" in Pipfile - MarkKoz
12548fb Replace protoc shell script with a Python one - MarkKoz
Why did you decide to close this?
That might work, but tags like !paste are in embeds. How would this be combined with the idea you just proposed?
Sorry @rijusougata13, @liorsanders has already requested this to be assigned to them. Feel free to reach out to them on discord to offer your assistance though!
You can mention users in embed bodies, they just won't get notified.

Description
Fixes cheatsheet command, which was sending raw html output as cht.sh had reverted the change of aiohttp User Agent. To fix this, I have added curl/7.68.0 as the User Agent which is being passed through headers.
Screenshots
Before:

After:
![Screenshot from 2021-02-08 05...
Looks fine to me, except this one thing.
You could just directly pass in the HEADERS here instead of defining a variable.
Thanks for the review, I could do that but i would like it as a separate constant being passed it.
Sure! It was just a suggestion, it looks fine like this too.
dfa142e Bump webpack from 5.21.1 to 5.21.2 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/webpack\-5\.21\.2
Bumps webpack from 5.21.1 to 5.21.2.
Release notes
Sourced from webpack's releases.
v5.21.2
Bugfixes
json with constructor property now caches correctly
json generation with object prototype property now works correctly
tree shaking json array when accessing length property now works correctly
fix incorrect call context when calling properties on imports from CommonJS modules
Commits
6661bd9 5.21.2
87f9382 Merge pull request #12621 from webpack/de...
54d2727 Bump @emotion/react from 11.1.4 to 11.1.5 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/emotion/react\-11\.1\.5
Bumps @emotion/react from 11.1.4 to 11.1.5.
Release notes
Sourced from @emotion/react's releases.
@emotion/react@11.1.5
Patch Changes
4d2e732e #2206 Thanks @jimmydief! - Added export for SerializedStyles Flow type.
Commits
2fe9e0e Version Packages (#2207)
d029350 Removed type for as prop for composite components (#2240)
f3c2e81 Added option & fallback AMP props to the list of valid props (#2232)
b62647e Fix regex to comply with no-useless-e...
78c9614 Bump @types/node from 14.14.22 to 14.14.25 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/types/node\-14\.14\.25
LGTM, thanks for your PR!
After going through the int eval on bot, I think i can work on this issue. Thanks!
After going through the
int evalon bot, I think i can work on this issue. Thanks!
We should be porting the code from our closed source project Black Knight to both of our bot, I believe @SebastiaanZ is working on it. Thanks for your interest in this issue though!
df897e5 Adds Member Checks Before Changing Voice - HassanAbouelela
5e93396 Add an allow_moderation_roles argument to the w... - Akarys42
eb78b9c Restrict paginator usage to the author and mode... - Akarys42
c3c869c Merge branch 'master' into trashcan-mods - Xithrius
37bfd75 Cleans Up Tests - HassanAbouelela
LGTM, thanks for updating this.
We do not support searching by agent yet, adding that as a sub command would be nice.
You can get stats about the infractions through grafana and have fancy graph, I don’t think a command for that is much needed.
Since our current setup works by copying the whole file, this shouldn’t be an issue. This setup is bound to disappear at some point anyway.
Closing this for now, feel free to reopen if you feel like we should still do this.
e221e20 Remove unnecessary separator from sent form ret... - ks129
978754f Move container and return styles back to FormPage - ks129
bdb8ed5 Use border-color: transparent instead border: none - ks129
6c88ec3 Toggle visibility instead returning null when n... - ks129
39fe1ec Use public state instead of event value for com... - ks129
ff1e4bc Improve and simplify checkboxes gathering - ks129
This have to re-render component, otherwise this don't trigger error showing.
Description
Quite a few commands don't quite work when being invoked from a DM. https://github.com/python-discord/sir-lancebot/pull/577 resolves some that raise errors, however there are other cogs that I have not looked into. This issue should cover going over every command and making sure the behave well when invoked via a DM.
Reasoning
Some people may want to invoke commands from DMing the bot. In this case, we should either output the result as normal, or respond with a mea...
While we should make sure that the bot doesn’t go down in flames when a command is being invoked through DMs, I don’t think we should actually allow it. Keeping everything in the server is useful for both moderation and debugging, and I’d prefer if we can keep everything there (except for cogs that requires the use of a private channel, such as the battleship game).
So should we change the requirement from make it work, to always tell the user to go to bot commands channel?
So should we change the requirement from make it work, to always tell the user to go to bot commands channel? If so, I think something generic could be done, rather than at the cog level
I think so, if everyone agrees to that.
Yea, I agree with the moderation and debugging points, I hadn't thought of it like that. I'll update the issue and get further feedback.
[python-discord/forms-frontend] New branch created: github\-annotations\-eslint
This PR creates a new ESLint formatter that outputs errors in GHA annotations format. Also added this to workflow.
e0ea61a Remove quiet flag to show warnings - ks129
d01f655 Remove quiet flag from Husky hooks to show warn... - ks129
Had to remove it cause Flake8 is supper unhappy about this
D202 No blank lines allowed after function docstring
ee7e6cb Undo testing rules breaking - ks129
This is still unresolved. This suggestion only works if you set the position, otherwise elements are still pushed down. Additionally, it might be a good idea to set a negative z-index to hide the element if it gets overlapped by something else like a menu.
visibility: ${props.show ? "visible" : "hidden"};
You use different names for the same thing onBlurHandler across the JSX statements in this file. Pick one and stick with it for clarity.
128bb2a Set z-index and position for error message CSS - ks129
6e55034 Change ShortText blur handler name - ks129
97fcbf5 Change blur handler name in Select - ks129
21659a4 Make all blur handler names matching - ks129
Good idea on simplifying examples, should be much easier for people to understand them now.
fbdfaea Rewrite to use simpler examples. - swfarnsworth
9655acb More robust example with no reference to Python... - swfarnsworth
d333a77 New example to emphasize the mapping functional... - swfarnsworth
90eeeb0 Removed extra blank line.
- swfarnsworth
9a9eb8f"handle converting" -> "convert ... for you". - swfarnsworth
[python-discord/bot] branch deleted: swfarnsworth/tag\_messages
Connected!
make the "!otn s" command non case sensitive for easier querying
bcfc2f0 Bump husky from 4.3.8 to 5.0.9 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/husky\-5\.0\.9
Bumps husky from 4.3.8 to 5.0.9.
Release notes
Sourced from husky's releases.
v5.0.9
fix(install): do not fail if not inside a Git directory (closes #851)
See https://github.com/typicode/husky/releases/tag/v5.0.0 for v5 release notes
v5.0.8
fix(install): better handle Git <2.9 (#846) closes #844
v5.0.7
fix(shell): double quote params (#824)
v5.0.6
Remove unused files
v5.0.5
Fix custom directory support #827
v5.0.0
👉 See https://typicode.gith...
3a05c43 Bump @typescript-eslint/eslint-plugin from 4.14... - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/typescript\-eslint/eslint\-plugin\-4\.15\.0
Bumps @typescript-eslint/eslint-plugin from 4.14.2 to 4.15.0.
Release notes
Sourced from @typescript-eslint/eslint-plugin's releases.
v4.15.0
4.15.0 (2021-02-08)
Bug Fixes
eslint-plugin: [no-extra-parens] handle ESLint 7.19.0 (#2993) (4615048)
eslint-plugin: [prefer-function-type] correct fixer when signature ends with a semi (#3002) (898dd39)
scope-manager: fix visiting of TSImportType (#3008) (ce4f...
:+1: Tested locally. Error reply could use a :x:, but it isn't important.
Connected!
Different data types are also supported. If you wish to read more on these, please refer to the following article: https://www.tutorialspoint.com/json/json_data_types.htm
Different data types are also supported. If you wish to read more on these, please refer to [this article](https://www.tutorialspoint.com/json/json_data_types.htm).
Making this a text link hides the long link, saving some space
2f032a7 Add location mocks to the wolfram cog - Akarys42
[python-discord/sir-lancebot] New branch created: wolfram\-mock\-locations
Previously the server IP address could be leaked using some query such as “what is the weather here?” or simply “what’s my ip?”. This aims to fix it by using mock locations.
Closes #1408.
This PR allows the search command for otn to accept punctuation and differently cased letters. In order to accomplish this, results from the database, and the user query run through the reverse translation used to make channel safe names, before being passed through the regular searching.
Results displayed to the user are the same names stored in the database.
When tested on my own instance of Sir-Lancebot and my own API key for Wolfram Alpha (non-commertial), this change did not block the bot from showing my general location (obviously everything has been obliterated from existence) so no one can find anything.
Couple comments:
-
There are a few missed conditional branches for filters that do not return a reason:
https://github.com/python-discord/bot/blob/81af0099ffd552aa5cb2a61de30cf7bd16a013eb/bot/exts/filters/filtering.py#L435
https://github.com/python-discord/bot/blob/81af0099ffd552aa5cb2a61de30cf7bd16a013eb/bot/exts/filters/filtering.py#L448
https://github.com/python-discord/bot/blob/81af0099ffd552aa5cb2a61de30cf7bd16a013eb/bot/exts/filters/filtering.py#L497 -
The majority of filters d...
87c4066 Apply mock locations to every subcommands - Akarys42
This now no longer shows my location.
[python-discord/sir-lancebot] branch deleted: wolfram\-mock\-locations
Connected!
Thanks! Looks Good To Me!
...the key, if it exists, and None (or a default value that you provide) if it doesn't... Small grammar correction :smile_cat:
No, we just need to catch the error and transform it into something that is clearer.
If there's a !REF to an attribute of a class that gets unloaded, then the reference will incorrectly resolve to the stale value rather than raising an exception.
This currently isn't exposed as a public API, and doing so will probably be bad since tampering could easily break things. If you think exposing this is useful for extensibility, then the way to go about it would be to expose a read-only view for the dictionary (or just the values if the paths aren't useful).
In any case, if it's going to be storing the classes, it may be better to use a weak reference dictionary.
I hinted at this in a discussion on Discord, but I'm having doubts over the path remapping feature. It's proven to complicate the implementation and doesn't seem too useful in retrospect. In fact, it may be an unintuitive feature for end-users that edit configurations, since it breaks the established 1:1 relationship between the paths in YAML and Python. It's not inherently transparent to users that an attribute has been remapped.
I'm in favour of dropping the feature at this point. What d...
Seems like there has been a lot of iteration on the tag content. I fundamentally like the final result but there are just a few minor improvements to phrasing.
It can be more explicit about what it's trying to convey
You most likely wanted to structure your JSON as a dictionary. To do this, edit your empty JSON file so that it instead contains `{}`.
Maybe it's just me, but I found the original phrasing a bit awkward.
Whilst having empty data is no problem, the file itself may never be completely empty.
GitHub Actions run 552417180 failed.
GitHub Actions run 552438070 failed.
GitHub Actions run 552440686 failed.
Maybe we should split this into two different code blocks so this can be more easily read?

[python-discord/bot] New branch created: internal\-api\-routing
Migrates away from the API fetching through Cloudflare to use cluster-local DNS and hit the Django service directly.
- Migrate API utilities to use internal DNS routing
- Migrate ping command to ping internal API
Can you update contrib guidelines to mention that the site_api has to be set too? I think it just needs to state that the value is identical to site for development purposes.
Checking if the production stuff is adequately set up for this is out of my scope.
Please keep it alphabetically sorted.
Other than Mark's requested changes, the code is solid.
9111f9f Alphabetical sorting in config-default.yml - jb3
Contribution guides at https://pythondiscord.com/pages/contributing/bot/ have been updated.
[python-discord/bot] branch deleted: internal\-api\-routing
Connected!
Connected!
caa6361 Bump cryptography from 3.3.1 to 3.3.2 - dependabot[bot]
[python-discord/site] New branch created: dependabot/pip/cryptography\-3\.3\.2
Bumps cryptography from 3.3.1 to 3.3.2.
Changelog
Sourced from cryptography's changelog.
3.3.2 - 2021-02-07
- SECURITY ISSUE: Fixed a bug where certain sequences of
update()calls
when symmetrically encrypting very large payloads (>2GB) could result in an
integer overflow, leading to buffer overflows. CVE-2020-36242
.. _v3-3-1:
Commits
82b6ce2 correct buffer overflows cause by integer overflow in openssl (#5747)
See full diff in...
Current when a user is banned or purgebanned this feedback message will be sent:
:incoming_envelope: :ok_hand: applied ban to USER permanently.
It would be nice to have purgeban instead of ban in the message.
To achieve that, we can add a purge: True entry to the infraction dictionary in
https://github.com/python-discord/bot/blob/bafa6a9dbf61ae30ef235537408f0b073a88dd19/bot/exts/moderation/infraction/infractions.py#L327
And append purge at the beginning of `infr_ty...
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/webpack\-5\.21\.2
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/emotion/react\-11\.1\.5
[python-discord/forms-frontend] branch deleted: dependabot/npm\_and\_yarn/types/node\-14\.14\.25
ee62508 Bump @typescript-eslint/parser from 4.14.2 to 4... - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/typescript\-eslint/parser\-4\.15\.0
Bumps @typescript-eslint/parser from 4.14.2 to 4.15.0.
Release notes
Sourced from @typescript-eslint/parser's releases.
v4.15.0
4.15.0 (2021-02-08)
Bug Fixes
eslint-plugin: [no-extra-parens] handle ESLint 7.19.0 (#2993) (4615048)
eslint-plugin: [prefer-function-type] correct fixer when signature ends with a semi (#3002) (898dd39)
scope-manager: fix visiting of TSImportType (#3008) (ce4fcbf), closes #3006
F...
a6e8f12 Bump typescript from 4.1.3 to 4.1.4 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/typescript\-4\.1\.4
Bumps typescript from 4.1.3 to 4.1.4.
Release notes
Sourced from typescript's releases.
TypeScript 4.1.4
This release contains fixes for a security risk involving language service plugin loading. More details are available here.
Commits
c329d68 Bump version to 4.1.4 and LKG
7bc7173 Allow only package names as plugin names
See full diff in compare view
[
Here's the help message:
![imag...
I think I messed up a little, I have reverted the issue matching regex by mistake :sweat_smile:
Connected!
Where are we at on this? Should we open a new PR?
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
I think we should change this to BucketType.user cooldown, rather than a global one.
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
The prevailing style for Sir Lancebot is to do from discord.ext import commands and then use commands.Bot as an example, rather than importing the individual pieces like this.
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
This should live in constants.Colours Either use a colour already there, or add this as a new one.
I will be opening a new PR for this, I'm still working out the logic.
that seems fine to me. I think this is ready to merge, when you commit the changes.
Most Python modules have an asynchronous implementation. For example, `sqlite3` has `aiosqlite`, and `praw` has `asycpraw`. You try searching on [PyPi](https://pypi.org), or check out [this curated list of Python asyncio frameworks](https://github.com/timofurrer/awesome-asyncio).
Grammar, and give the user info on what the link is to.
You can also ask in [#async-and-concurrency](/guild/267624335836053506/channel/630504881542791169/) for options.
Link to the async topical channel
still need to do unit test, but I think that the cog is good for review
Now it default to None and calculates time if duration is None
Description
Extend the 8bitify command to work with GIF profile pictures too. The output should be the full animated gif, but 8bitified.
Reasoning
As nitro users can have GIFs as their profile picture, we should have the ability to 8bitify their whole avatar!
Proposed Implementation
Same input & output as the current implementation, but make it work with GIFs
Additional Details
Would you like to implement this yourself?
- [ ] I'd like to implemen...
To kick off the discussion, I know the current 8bitify command can take a few seconds to run, I'm not sure how much more this would add to CPU load. It could also be open to abuse by users with long GIFs. The implementer should take this into consideration if we decide to approve this.
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
@command(aliases=["so"])
We don’t need this as the function name is already stackoverflow
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
Since now we are shifting to using emojis here, we can do something like this: link from Reddit migration .
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
Instead of ┃ , we can make use of emojis like the one we did for Reddit command.
And keep tags of a new line. So end result would be something like:
#Title of the search
- :upvote: upvote :viewcount: view count :answer count: answer count
- Tags: all tags here
[python-discord/sir-lancebot] New review comment on pull request #583: Add the stackoverflow command
I did try using emojis but they didn't look good. I couldn't try the reddit emojis since I didn't have them on my server. How could I add them? I couldn't find them on the pydis branding server either.
0e73efe Bump @testing-library/user-event from 12.6.3 to... - dependabot[bot]
Bumps @testing-library/user-event from 12.6.3 to 12.7.0.
Release notes
Sourced from @testing-library/user-event's releases.
v12.7.0
12.7.0 (2021-02-11)
Features
add type support for {home} and {end} (#536) (808c550)
Commits
808c550 feat: add type support for {home} and {end} (#536)
See full diff in compare view
[
See full diff in compare view
[
This was caused by the bot trying to edit the webhook in #how-to-get-help, which I didn't think was going to happen. On the test server, fetching the previous message with message.last_message could get...
Hello @Brodevil9989, thank you for your interest in our projects.
The tag doesn’t conform to our guidelines for posting tags: it is a copy paste of an help page, it doesn’t have any markdown formatting, it is too long to fit in an embed.
Besides, we aren’t really interested in just showing an help page to our users, we would rather have a tag explaining what pip is.
Besides, your contribution doesn’t follow our [contributing guidelines](https://github.com/python-discord/bot/blob/mas...
Helo, apparently .history still gets deleted messages. I get a NotFound if I run it, remove the message, then update the channels.
That's odd, I'll look into it.
[python-discord/bot] New branch created: pypi\-command
Closes #796, rewrite of #1237.
Fetches information of PyPi packages and displays said information to the user in a neat embed.
If anyone thinks any more information should be added to the embed, please let me know. Here are all the possible options within the info section.
Everything else can be seen here. Example created using the numpy package.

2fdb0e5 Make KeyError tag - anand2312
2c4d7f4 Update and rename keyerror.md to dict-get.md - anand2312
7214723 Fix faulty heading - anand2312
a6d65fd Refer to defaultdict tag in dict-get - anand2312
c346c2b Fix #1371 error via adding errors. - Senjan21
The approach taken is perfectly fine, I'd just like to mention the option of persisting the message ID with Redis, since it seems that we could remove some complexity that way. In fact, as long as you know the message ID (in Redis) and channel ID (in config), editing a message is possible with a direct call:
self.bot.http.edit_message(channel_id, message_id, content=new_content)
This avoids having to acquire and store the channel and message objects, allowing you to work...
@kwzrd Thank you for this information!
I'll see where I can get with Redis caching, and hopefully get this implemented.
Ok, will do next time
Description
Implement a .youtube or .yt command to get the top 5 results from YouTube with that search query.
Reasoning
Users can share videos with each other and recommend YouTube tutorials on different topics.
Proposed Implementation
Use the Youtube API.
Would you like to implement this yourself?
- [x ] I'd like to implement this feature myself
- [ ] Anyone can implement this feature
I'm a bit afraid that it could be used in a LMGTFY way. That is, instead of linking a tutorial or an article, just invoke that command with a query.
Hmm most sir-lancebot commands are locked to the bot channels, and a few others. As long as we don't allow this command within help contexts, I think we should be fine.
@HassanAbouelela That makes sense.
It's also important to set up some sort of rate limit. Besides the documented limits, Google also apparently has some undocumented rate limits, so you just have to be careful.
I'm a bit afraid that it could be used in a LMGTFY way. That is, instead of linking a tutorial or an article, a person can just invoke that command with a query.
@decorator-factory I think we have a few other Lancebot commands that are similar such as the Wikipedia, and in-development StackOverflow command, but I think like @HassanAbouelela said, we should be fine as long as we limit its usage.
Relevant Issues
Closes #585
Description
Implemented a new youtube cog which has a youtube (alias: yt) command to search youtube from a specified query. Additionally, there is a fifteen-second cooldown.
Reasoning
This allows users to share videos with each other and search for tutorials relevant to a conversation. I imagine staff might find this useful for linking tutorials that they recommend to other users.
Screenshots
Did you:
- [x] Join the [**...
Do we want a global cooldown here? Or would a user bucket be more suitable?
No need to pass the name here, as the function is already called youtube
Why does this function return an Optional? Seems like it always returns a list.
You could use enumerate(results, start=1) instead of adding 1 to each index
Shouldn't the description be markdown-escaped as well? Youtube videos can have any characters in their names.
I would also say that a DIct[str, str] isn't a very accurate type -- maybe you could use TypedDict https://docs.python.org/3/library/typing.html#typing.TypedDict or make a special NamedTuple type?
I think a user bucket is best, though I'm unsure how to implement it, are there examples elsewhere?
@ChrisLovering I would blame it on the requirement that every function must have a docstring. But I think I'm in the minority on that one.
It seemed like it never occurred when I was testing it, no matter how random the query, though I can make a catchall.
Since this description is built from the return of search_youtube(), which itself is escaped, I think this is fine?
I'll implement one for no results from the query and the rest as a catchall "Something went wrong here..."
What color would you suggest?
That's a good idea, I'll add that.
Yep, I'll remove Optional, and look into TypedDict, I agree that it wasn't the best typehint.
You should use query-building machinery provided by aiohttp: https://docs.aiohttp.org/en/stable/client_quickstart.html#passing-parameters-in-urls.
If someone searches for foo&bar=drop%20table%20students, the request string is going to be malformed.
You should use query-building machinery provided by aiohttp: https://docs.aiohttp.org/en/stable/client_quickstart.html#passing-parameters-in-urls.
If someone searches for foo&bar=drop%20table%20students, the request string is going to be malformed.
The description is escaped here:
results.append(
{
"title": escape_markdown(item["snippet"]["title"]),
"author": escape_markdown(item["snippet"]["channelTitle"]),
"id": item["id"]["videoId"],
}
On a side note, how can I highlight the code like you did?
What was
as well
referencing?
I forgot about that, I will fix that.
Yep, sorry, everything is good, I just didn't see that :+1:
@ChrisLovering it seems like it isn't possible for an error to occur on the users end: https://developers.google.com/youtube/v3/docs/errors#search, so I'll only implement the catchall.
This doesn't work if search has a space in it. You'll need to urlencode it here :(
"""Represents one video."""
It doesn't really represent a video -- it represents a video search result. Besides the linting rules, I would leave without a docstring.
Can we have this a constant variable which is being passed in here?
Well I don’t know about this, but what if the link (example) doesn’t exist it will catch a error then, we could make use of try(element doesn’t exist) or or (If element exists but is empty).
@Shivansh-007 search isn't constant :)
@Shivansh-007
If snippet or title or something else doesn't exist, it will throw an exception that will be caught at top-level.
That situation means that:
a) Google has changed their API, so this needs to be changed anyway
b) Google has a bug, which is pretty unlikely
(if that's what you're talking about)
in other words, I don't see the value in checking for that.
It does seem pretty unlikely, I don’t think so we need this, if we come across this while it is deployed the. We could add it.
Like said before (in Dev contribute) it would be good if this command acts like Reddit one, showing the viewcount and upvote.
@Shivansh-007
Exception handling in "user code" (implementation of commands) is needed when there can reasonably be an exception, which you can interpret as an error in the command input, or interpret as something useful. For example, if we had a regex command, we could interpret a failure to parse a string as a regular expression and report it to the user.
If, however:
- Google has changed their API
- There's a bug at Google
- There's a bug in Linux
- There's a bug in discord.py...
Personally, I'm opposed to displaying the like/dislike ratio and view count because it seems like unnecessary info, but I'm totally up for your opinion.
Let’s give it a try and see how it looks.
Alright, I'll have the time to implement it in an hour or so.
Shouldn't this be:
Returns:
YAMLStructure: The modified dest mapping.
Description
A simple command that would give you fun facts about python itself.
Reasoning
If people wanted to learn more about Python and get some trivia, this would be a useful command.
Proposed Implementation
I was thinking of using a text/json file, and pick a random fact from that.
Would you like to implement this yourself?
- [x] I'd like to implement this feature myself
- [ ] Anyone can implement this feature
Connected!
8ff1281 Bump @types/node from 14.14.25 to 14.14.26 - dependabot[bot]
[python-discord/forms-frontend] New branch created: dependabot/npm\_and\_yarn/types/node\-14\.14\.26
75c2a8e Bump sentry-sdk from 0.19.5 to 0.20.0 - dependabot[bot]
[python-discord/forms-backend] New branch created: dependabot/pip/sentry\-sdk\-0\.20\.0
Bumps sentry-sdk from 0.19.5 to 0.20.0.
Release notes
Sourced from sentry-sdk's releases.
0.20.0
Fix for header extraction for AWS lambda/API extraction
Fix multiple **kwargs type hints # 967
Fix that corrects AWS lambda integration failure to detect the aws-lambda-ric 1.0 bootstrap #976
Fix AWSLambda integration: variable "timeout_thread" referenced before assignment #977
Use full git sha as release name #960
BREAKING CHANGE: The def...
Tested. It works well. Thanks for this contribution!
a89961e Get env vars from .env file - ChrisLovering
12e15ff Default redis host in docker-compose - ChrisLovering
3242cc6 Add curl User Agent Headers - Shivansh-007
af1d110 Add comment explaining why we need to pass curl... - Shivansh-007
4109c05 Merge pull request #580 from Shivansh-007/fix/c... - HassanAbouelela
[python-discord/sir-lancebot] branch deleted: upgrade\-override
Connected!
@AvianAnalyst Greetings! I hope you're doing well.
I know this is 2 years later, but are you still interested in making a PR? I'd like to see this get implemented.
I think the first steps in this process was solved by #578, where whitelist overriding was given to a few commands.
Over time we should be able to cover the entire bot.
Clean code, but there are Discord limits that aren't addressed fully. In particular, the embed limits can be hit easily. Also, some fields returned by PyPi are empty strings, which embed fields do not allow.
An example that triggers errors for all three fields is the dingding package.

In order to never hit this limit, I think I'll be replacing the description field with the summary field.
This should solve the massive embed problem that can occur sometimes if we go somewhat below the limit.
That shouldn’t be necessary since we have a return typehint. Thanks though!
ed7fde7 Empty fields have been accounted for by getting... - Xithrius
I feel like the embed tittle should be the package name, or the package name should at least be in bold to make it stand out.

