[python-discord/bot] New branch created: fetch\-guild\-members\-on\-boot
#dev-log
1 messages ยท Page 84 of 1
This ensures that the member cache is fully populated before we mark the guild as ready, as this is what a lot of cogs use as indication of all caches being populated."
GitHub Actions run 1251474813 failed.
We're in the Discord Beta for Role Icons! Let's make some role icons~
Constraints/Guidelines:
- Must be a png/jpg or emoji from the server
- Cannot be animated
- Be under 256kb
- Should be at least 64x64 pixels
Roles we'll be looking at:
- Patrons & Discord Boosters
- Moderators
- Helpers
- Media Team
- Help Cooldown
- Project Leads?
- Contributors?
I'd love some help with feedback and brainstorming~
The purple Discord diamond thing could work for boosters.
Before merging, it might be worth seeing how long this takes to chunk on the main server.
Because of how long this event takes to run, it could have problems with where that event is waited for. In addition, that event is called every time this guild comes up after an outage. This could be problematic because it would be calling await guild.chunk() multiple times while the other ones are still running. I think this pr could be a major source of problems and should be investigated further
On GTA Online, a server with 390K members, this takes about 4 seconds.
Interesting, its taken over 11 minutes to chunk in pydis.
Ignore previous comment, I was thinking of a different thing we run at startup, testing again now
GitHub Actions run 1251581143 succeeded.
Ready for review, the main functionality seems to be there.
Examples:
.color name periwinkle

.color rgb 238 130 238

.color hex #FFE5B4

Connected!
This is a weird one, this isn't the solution to the problem, as we don't know what the problem is.
After redeploying the bot, the cache is full...
[python-discord/bot] branch deleted: fetch\-guild\-members\-on\-boot
;-; ... You know, you'd think I'd be able to spell GitHub correctly at this point.
GitHub Actions run 1251765522 failed.
GitHub Actions run 1252157240 succeeded.
Yes will update the comments
Stale comments, will be updated
Apologies, was referring to riddle command when coding
Have updated the text so "all" is not mentioned, looking at the json file it seemed very hard for people to get all the anagrams correctly, so to reduce complexity and make it easier for people, even if someone mentions a correct anagram I have added them to the winners list
Made these variable changes, had to update some variables at the end of script so not committing your suggestions directly
GitHub Actions run 1251765522 failed.
GitHub Actions run 1252392377 succeeded.
This sounds good. Putting a block on the thread part until we support threads publicly, but feel free to implement the rest.
How about this for mods?

maybe ducky Dave, or some other relevant ducky for helpers :D ?
I also like the idea of contribs getting an icon. I think if we do, we should also have a core dev icon that looks like an "upgraded" version of the contrib icon.
Perhaps we should start compiling a checklist of things that need to be fixed?
I also like the idea of contribs getting an icon. I think if we do, we should also have a core dev icon that looks like an "upgraded" version of the contrib icon.
I like this idea! What about a single green cog for contrib and two light blue gears for core dev?
We currently have two tags, which both refer to virtual environments. These are !environments and !venv.
However, these two tags serve difference purposes (what a venv is and how to use one, respectively), so deleting one isn't really an option and they're too long to merge into a single tag.
The proposed solution for this (suggested by @Akarys42 which I agree with), is to wait for tag groups (#1663) is merged and then put these within a virtual environments tag.
[python-discord/bot] New branch created: tags\-revision
Closes #1832.
Fixes typos and grammar in tags, as well as changing a few examples etc. where I felt appropriate (e.g. in !precedence I changed to examples where the order is more obviously important).
GitHub Actions run 1249010535 failed.
GitHub Actions run 1251765522 failed.
GitHub Actions run 1249010535 failed.
Connected!
What's wrong with depending on threads?
The way I see it the Python bot will support threads when the PRs using threads are ready to be merged?
Even so, this system won't go into play until October and surely threads will be fully rolled out at places at that time.
[python-discord/bot] New branch created: add\-get\-or\-fetch\-util
This is now needed, as we have noticed that it's not guaranteed that the member cache will always be fully populated. Leading to members not having their help cooldown roles removed.
GitHub Actions run 1253730061 failed.
Sentry Issue: SIR-LANCEBOT-6E
TypeError: can't compare offset-naive and offset-aware datetimes
File "dateutil/relativedelta.py", line 154, in __init__
if dt1 < dt2:
File "bot/utils/time.py", line 80, in time_since
delta = abs(relativedelta(now, past_datetime))
File "bot/exts/utilities/emoji.py", line 110, in info_command
**Created:** {time_since(emoji.created_at, precision="...
Sentry Issue: SIR-LANCEBOT-6E
TypeError: can't compare offset-naive and offset-aware datetimes
File "discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/utilities/emoji.py", line 110, in info_command
**Created:** {time_since(emoji.created_at, precision="hours")}
File "bot/utils/time.py", line 80, in time_since
delta = abs(rela...
0b59a5e Emoji: make the datetimes offset-naive - Akarys42
[python-discord/sir-lancebot] New branch created: bug/875/emoji\-offet\-naive
You know the drill, due to discord.py 2.0a0 datetimes are now offset-aware, breaking some code.
Closes python-discord/sir-lancebot#875
GitHub Actions run 1254117982 succeeded.
So! I haven't done my formal review yet but here's my feedback so far. Overall, thank you for doing work on this command! My comments will be mostly about how the output looks and to have it be consistent with existing styling.
Currently, the output looks like:

I'd prefer it if it matched the overall leaderboard look:
 should probably be updated as fetch_member would already have been tried.
802fa0d Remove coveralls from lint-test - TizzySaurus
[python-discord/bot] New branch created: remove\-coveralls
Exactly as title says.
Removes coveralls from the lint-test stage due to the recent issues with their API.
GitHub Actions run 1254605845 succeeded.
run: pytest -n auto --disable-warnings -q
Shouldn't the coverage report not be generated now?
[python-discord/bot] branch deleted: remove\-coveralls
Connected!
GitHub Actions run 1254659061 succeeded.
I think we'd have the same problem here, correct me if i'm wrong
https://github.com/python-discord/sir-lancebot/blob/8a410f3abd39a1b48c514d32651a50d4bdced492/bot/exts/events/hacktoberfest/hacktober-issue-finder.py#L55-L58
Just to note, part of the reason for the removal is that we decided it isn't something we really need, so we wont be re-adding it.
I am currently getting an error when trying to run this. It seems to be here:
first_kata_div = await to_thread(soup.find_all("div", class_="item-title px-0"))
to_thread takes a function as the argument for what to run, this is instead running soup.find_all and passing the result to to_thread, which causes an error. Looking at the docs, https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread,
it seems something like
first_kata_div = await ...
I am currently getting an error when trying to run this. It seems to be here:
first_kata_div = await to_thread(soup.find_all("div", class_="item-title px-0"))
to_threadtakes a function as the argument for what to run, this is instead runningsoup.find_alland passing the result toto_thread, which causes an error. Looking at the docs, https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread,
it seems something like
...
GitHub Actions run 1254838611 succeeded.
GitHub Actions run 1254851592 failed.
GitHub Actions run 1254861332 failed.
@D0rs4n So my concern there is that if you want to view drastically different days (like day 2 and day 23) that's going to be a lot of clicking. I also wonder if a dropdown to select from the current available days wouldn't be better than clicking continually.
I'm also curious if this would only react to the person who invoked it or multiple people, but that's a minor implementation detail.
I think people would also like to view both days side by side, as it would be neat to see the dif...
[python-discord/bot] Issue opened: #1839 AttributeError: 'User' object has no attribute 'add\_roles'
Sentry Issue: BOT-1N6
AttributeError: 'User' object has no attribute 'add_roles'
(1 additional frame(s) were not displayed)
...
File "bot/exts/help_channels/_cog.py", line 477, in on_message
await self.claim_channel(message)
File "bot/utils/lock.py", line 108, in wrapper
except discord.Forbidden:
File "bot/utils/lock.py", line 108, in wrapper
except discord.Forbidden:
File...
@D0rs4n So my concern there is that if you want to view drastically different days (like day 2 and day 23) that's going to be a lot of clicking. I also wonder if a dropdown to select from the current available days wouldn't be better than clicking continually.
I'm also curious if this would only react to the person who invoked it or multiple people, but that's a minor implementation detail.
I think people would also like to view both days side by side, as it would be neat to s...
c272265 Indentation, type-hint, and documentation fixes - mbaruh
I'll leave handling the 400 errors to a separate PR (probably on the site repo). As far as I can see those are bugs which already exist in prod.
GitHub Actions run 1255019924 succeeded.
GitHub Actions run 1249010535 failed.
GitHub Actions run 1249723650 failed.
GitHub Actions run 1255079479 succeeded.
[python-discord/site] New branch created: new\-guides
71ce990 Adds Core Dev Voting To Changelog Blacklist - HassanAbouelela
e6ea46a Merge pull request #1826 from python-discord/ig... - ChrisLovering
3c1cc75 Add metricity to docker-compose - ChrisLovering
fe248cc Remove duplicate roles when defining allowed_me... - ChrisLovering
ec8e3e3 Merge pull request #1820 from python-discord/ad... - ChrisLovering
GitHub Actions run 1255120660 succeeded.
GitHub Actions run 1255123028 succeeded.
GitHub Actions run 1255124396 succeeded.
GitHub Actions run 1255292053 failed.
GitHub Actions run 1255810931 succeeded.
GitHub Actions run 1256616130 succeeded.
I think we'd have the same problem here, correct me if i'm wrong
https://github.com/python-discord/sir-lancebot/blob/8a410f3abd39a1b48c514d32651a50d4bdced492/bot/exts/events/hacktoberfest/hacktober-issue-finder.py#L55-L58
Indeed, it is a bit of a kaizen change but who cares. Changed in 24e099e.
Yep! It first was to make it listen to messages, but we deemed that as unnecessary. I still find it nice to have the bots in the member list.
I don't think you are looking at the right event. The API event for on_thread_join seems to be Thread Create, which fires both when a new thread becomes accessible by the bot and when the bot actually joins it.
Without this check, we would log the thread twice, once when it is created and the even first fires, and a second time when it actual...
9b82abd Modlog: change thread logging to past-tense - Akarys42
It also fites when anyone joins a thread.
GitHub Actions run 1256669225 succeeded.
Ahhh, I took a screenshot of the right event at first but then mixed it up.
Yes, Thread Update is the one that is sent when people join. But Thread Create is only sent when a thread is made available to the bot.

How does Discord behave if this is for example a 1x1 image?
I would prefer if these were subcommands that called a main method which would send the embed.
yes, which I believe is the one used by on_thread_join, since its behavior matches that. So we do need to have this check.
I don't understand, I am still not convinced. Thread Update is the one that gets sent when a thread gets updated, which it does when members join because now the list of joined members change.
discord.User.avatar is actually Optional, you need to change it to discord.User.display_avatar.
We should also think about giving the 3 Champion roles icons too. PyWeek, Game Jam and Code Jam
I also like the idea of contribs getting an icon. I think if we do, we should also have a core dev icon that looks like an "upgraded" version of the contrib icon.
I like this idea! What about a single green cog for contrib and two light blue gears for core dev?
Possibly :D
I'm bad at imagining what things may look like, so I have no opinions until I see the images lol
I cannot see the thumbnail if I set it to that:

I believe that is the size in pixels for the new image.
GitHub Actions run 1257269054 succeeded.
Yes I believe it is, the smaller the image the better. Could be good to play around with different sizes, the smaller the better.
Just noticed it for the hacktoberissues bit it also needs to be changed here, line 89
if option == "beginner":
self.cache_beginner = data
self.cache_timer_beginner = ctx.message.created_at
else:
self.cache_normal = data
self.cache_timer_normal = ctx.message.created_at
Tested after that change and seems to work so that should be all. Alternatively I guess the original datetime set...
LGTM
Some of the line-breaks make the help command look a bit off

This could be fixed by adding \s to the end of lines we don't want newlines on in the docstring, but I believe this is a greater issue across the bot, and i'm not sure what the current status of https://github.com/python-discord/bot/pull/1285 is, so it might be better to decide on a solution across...
This embed has inconsistent formatting with the ones above it, consider changing it
add a trailing comma to this line
colour=discord.Colour.red(),
There's a possible missed migration here (L143 of bot/exts/utils/reminders.py).
Also not sure but should the converter instead catch discord.ext.commands.MemberNotFound (the actual error rather than a parent class)?
There's a possible missed migration here (L143 of bot/exts/utils/reminders.py).
I purposefully skipped that since it's an generator, so I'd need to convert it to an async generator, so that cna be done in a different PR.
Also not sure but should the converter instead catch discord.ext.commands.MemberNotFound (the actual error rather than a parent class)?
This isn't a convertor, this is called fetch_member, which doesn't raise that error afaik.
I purposefully skipped that since it's an generator, so I'd need to convert it to an async generator, so that cna be done in a different PR.
This isn't a convertor, this is calling Guild.fetch_member, which doesn't raise that error afaik.
Looks good then. There's also the fact that the equivalent util for channels is called try_get_channel rather than get_or_fetch. Do we want to change one of these for consistency's sake or just leave it?
NB: The getLogger in bot.utils.members will also need to be migrated once #1837 has been merged.
Updated the code, all the embed where you mentioned should now have trailing commas
GitHub Actions run 1258299002 succeeded.
Made formatting consistent, it is now similar to all other embeds
Actually, I inspected a thumbnail image of some random embed, and found out that it's size is 80x80, so I just thought for larger monitors it maybe 100x100 (not sure though), and would be alright to keep...
But yeah, the smaller the better..
GitHub Actions run 1258654526 succeeded.
Unfortunately there's one issue with the new handling where I'm not sure how to modify the command help of the group so it's formatted like the get command through the
usagekwarg
Reading this back, I don't think I follow exactly what issue you're referencing. The brief is the first line in the docstring, so if you ca...
Instead of doing this, just add the commands.guild_only() decorator under commands.command
GitHub Actions run 1258998173 succeeded.
GitHub Actions run 1259008322 succeeded.
GitHub Actions run 1259074226 succeeded.
Closes #574
Restructures the bot guide to focus on getting users "through the door" first, and slowly adding additional information and options.
The guide is built in terms of showing ways to run the bot and how to achieve it, rather than listing all of the information for each configuration and environment variable right away.
That said, the attempt was to still present the reader with the full information they need, and to still be able to use as a quick reference for contributors who a...
GitHub Actions run 1259090621 failed.
Thinking about this, I think it would be nice if this command accepted some sort of indication of tz. So it would have a converter and accept both:
- Timezone (i.e. EST, EDT, IST)
- UTC offset
For timezones, since some of them can be ambiguous, if there's more than one option that fits this, you can use the Discord Button components to have the user select the correct timezone.
I believe this all can be accomplished with the help of arrow.
I believe this all can be accomplished with the help of arrow.
What do you mean by "arrow" specifically?
GitHub Actions run 1259135667 succeeded.
Have you considered making the helper a bot instance method, having the guild argument optional and defaulting to pydis? In some cases, caller code could then have:
bot.get_or_fetch_member(1234)
Instead of:
import guild id
import get_or_fetch_member
guild = self.bot.get_guild(guild id)
get_or_fetch_member(guild, member id)
I haven't thought about it much, maybe this is a bad idea.
If this is being changed anyway, I think the comma here is a splice comma and so should be replaced with a . or ;.
Potentially also put backquotes around the None to indicate it's the value (we usually do this with variables etc., but there are lots of cases where we don't with None specifically so didn't mention before now).
this is such a hard habit to get out of lol
I would put the \ in brackets or something as it's just showing what a backslash is. It's not part of the sentence.
Perhaps include instructions on how to get to the role list?
GitHub Actions run 1259174406 succeeded.
I haven't tested anything so won't formally approve, but after a few things discussed on Discord this all looks good now :+1:
eff7d7f Add cog as an alias to extensions command - mbaruh
[python-discord/bot] New branch created: mbaruh\-patch\-1
GitHub Actions run 1259237310 succeeded.
Connected!
Can we make this standout with some sort of callout? It's currently getting lost in between all the text and I think it would be helpful to mark this as a "this is useful info! Check it out if you need it".
Something like this:

(ref: https://pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/)
You are a hero amongst us mortals for actually getting this done. This reads so so so soooo much better than what we had previously.
I have some comments below. Take them as you see fit. Just going to keep it as a general comment since I don't think my review is worth blocking by requesting changes.
I'm not sure how necessary this example is. I think it's enough to say that "if something is present on the config.yml, it will override what is in the default-config.yml for that entry".
This example just separates the two options of:
- Create new file, copy and paste the provided template
- Duplicate default-config.yml and change values
so upon reading it seems like there's only 1 option.
Can we list these in the order that they appear in the config.yml? Small, but helpful change.
Also cc: @ChrisLovering I remember you told me to do extra stuff here once upon a time during the nightmare of setting up Python. I think it's related to this section?
[python-discord/bot] branch deleted: mbaruh\-patch\-1
Connected!
What does the anagrams.json file consist of?
If it is English words, I heavily recommend nltk for getting English words.
This is quite a large list, rather it could use nltk, a library that stands for natural language toolkit
There is a module within that library that contains a list of words, nltk.corpus.words, where the function to get the list of english words is nltk.corpus.words.words()
Though, I cannot see the anagrams.json as the load diff is too big, so if you ar...
GitHub Actions run 1259256512 succeeded.
As for showing days side by side.. I'm not sure, I could imagine it as a distinct command. Like.:
.aoc days 1 3and that would show the stats for day 1, and 3, and both of the stars for each of those days, with a dropdown similar to the one mentioned. It could send codeblocks separated from each other (for example in this case the first codeblock would show stats for day 1, and the second one would show the stats for day 3) for the sake of consistency and edit them as the user chooses a...
What does the
anagrams.jsonfile consist of?
If it is English words, I heavily recommendnltkfor getting English words.This is quite a large list, rather it could use
nltk, a library that stands for natural language toolkitThere is a module within that library that contains a list of words,
nltk.corpus.words, where the function to get the list of english words isnltk.corpus.words.words()Though, I cannot see the
anagrams.jsonas the load diff is too b...
since the restructure of lancebot, this code was incorrect, and is no longer blacklisting itself.
Relevant Issues
#dev-contrib message
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Description
Fixed the path name.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] ...
GitHub Actions run 1259272305 succeeded.
We are working on a solution though :P
We've been working on a solution for like... a year though >_>
It will have no effect. I guess it's not clear enough
My issue with this is that I still want the document to be a quick reference guide. If someone wants to see how to start it specifically with Docker after trying another method, it should tell them the exact configurations necessary for it.
This section is directly until the part which mentions how to start the site container (line 521). Do you think it should be mentioned again?
Ah, I missed it in the above paragraph. Maybe change it to: "The site has to have been started beforehand, see the above paragraph for the site contributing guide."
Also, for that above paragraph I would maybe change it to:
"You can run additional services on the host. This guide won't go over how to install and start the other dependencies on the host. If possible, prefer to start the services through Docker to replicate the production environment as much as possible.
The site, howeve...
Relevant Issues
Closes #812
Description
I ported over the implementation from my uwuifier and removed the old command.
Old uwu:
New uwu:

Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link re...
GitHub Actions run 1259447941 failed.
a5badc8 Allow helpers to edit their own nomination reason - ChrisLovering
[python-discord/bot] New branch created: allow\-helpers\-to\-edit\-their\-own\-nomination\-reason
Closes #1617
This allows helpers to specify a user and edit their own nomination for that user. Restricts this to only active nominations for ease of implementation.
[bot] Branch allow\-helpers\-to\-edit\-their\-own\-nomination\-reason was force-pushed to `3b57421`
[python-discord/bot] Checks Cancelled on PR: #1841 Allow helpers to edit their own nomination reason
GitHub Actions run 1259453433 was cancelled.
GitHub Actions run 1259455522 succeeded.
[bot] Branch allow\-helpers\-to\-edit\-their\-own\-nomination\-reason was force-pushed to `3adf7f9`
Following the discussion in https://github.com/python-discord/bot/pull/1815#discussion_r711755032 I think these two lines and the matching lines in shutdown should be removed. I don't think there even is a None option for global permissions.
Maybe?
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug for the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before.
To make it somewhat more tangible, if that makes sense.
Reading this back, I don't think I follow exactly what issue you're referencing. The brief is the first line in the docstring, so if you can change the docstring to fit enough information in one line then that will work.
Otherwise override the brief (assuming that line is the brief from discord.py).
I was talking about the signature specifically which is a property on the class object, but after reading through the source it became apparent that specifying usage does work on g...
GitHub Actions run 1259520950 succeeded.
GitHub Actions run 1260100703 succeeded.
78b00dc Remove WatchChannel parent of TalentPool and mi... - ks129
dda3490 Use more accurate command names and docstring f... - ks129
f144bac Migrate nominations history command to non-watc... - ks129
807a27e Migrate Talent Pool Reviewer class to non-watch... - ks129
2d47640 Migrate unnominate command to non-watchchannel - ks129
GitHub Actions run 1260439420 succeeded.
I left humanize_delta alone since all calls already check for None and when it is None they don't want to use the current time actually. I just changed format_duration to pass the current time if the 2nd arg is None.
Hmm it's literally just entering the server's settings and then you have a roles tab. Not sure what information to add
I almost committed "linky link" <_<
GitHub Actions run 1260880286 succeeded.
Shifted things around, is that clearer?
Reworded that section, is that better?
I highlighted it, but it's still inside the collapsible. You think it should be outside?
**Contribute to Python Discord's Open Source Projects**
I think this should have the apostrophe here to denote possession.
Perhaps add a brief explanation of what these are, possibly noting that Sir Lancebot is designed for people new to OSS.
e.g.
โข [Sir Lancebot](https://github.com/python-discord/sir-lancebot) - our fun, beginner-friendly bot.
โข [Python](https://github.com/python-discord/bot) - our utility & moderation bot.
I'd probably have one for site too if you took this approach, but not quite sure what descriptor to use there.
2. Chat with us in [#dev-contrib](/guild/267624335836053506/channel/635950537262759947/) to ask what to work on or for help with anything related to our open-source projects.
I'd slightly reword this, since #dev-contrib isn't solely for asking what to work on.
Still, I'd rather people didn't think we're not aware of this.
Can we please disable the emojis completely, it's so incredibly noisy and awful.
Other than that, I think this needs a little polish but the implementation itself looks okay.
I think it takes up a whole lot of vertical space for very little benefit when we put these regexes inbetween the helper functions instead of grouping them all together at the top. Yeah yeah, it has better locality, but it just makes this file so much more bloated.
I suggest we move all of these regexes and subst variables up below the constants, all together in a block. I don't think that will really make this harder to work with, but it'll make the file look better.
how about having it nonce
cute, but fuck no. Please use proper english in the code.
As for showing days side by side.. I'm not sure, I could imagine it as a distinct command. Like.:
.aoc days 1 3and that would show the stats for day 1, and 3, and both of the stars for each of those days, with a dropdown similar to the one mentioned. It could send codeblocks separated from each other (for example in this case the first codeblock would show stats for day 1, and the second one would show the stats for day 3) for the sake of consistency and edit them as the user cho...
[python-discord/site] New branch created: Relock\-poetry
For some reason the lock file was out of date, which caused issues when trying to poetry install on Windows without build tools.
[python-discord/site] New branch created: lock\_update
GitHub Actions run 1261249671 failed.
GitHub Actions run 1261265399 failed.
[python-discord/site] branch deleted: lock\_update
[python-discord/site] branch deleted: Relock\-poetry
GitHub Actions run 1261407495 succeeded.
@lemonsaurus I'm pretty attached to the emojis, how about we turn down the weight and maybe get rid of some of the more noisy ones?
GitHub Actions run 1262393549 succeeded.
Updated the PR with the mentioned code
GitHub Actions run 1262450446 succeeded.
Added the commands.guild_only() decorator
Apparently hyperlinks don't work in footers?

Not sure what to do here.
I get this error from running the .challenges command.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "/bot/bot/exts/utilities/challenges.py", line 298, in challenge
kata_embed = self.main_embed(kata_information)
File "/bot/bot/exts/utilities/challenges.py", line 167, in main_embed
color=int(MAPPING_OF_KYU[int(kata_information['rank']...
What is this by the way?

It is on the production site as well: https://pythondiscord.com/events/
Where's the video for this team?
Purposely not included.
Now that my two questions have been resolved, looks good!
"""Edit a nomination reason in the database after validating the input."""
ctx: Context,
*,
target: Union[int, Member],
Might as well make it kwarg-only if that is how you use it?
How does this work when multiple staff members nominate the same user?
This looks good, thank you.
@Kronifer should we document the gitpot support in the README, so people know where to quickly start working on the bot?
GitHub Actions run 1262899493 succeeded.
The actor kwarg is what controls which nomination to edit.
IE If you nominated Akarys, I would set the target to Akarys and the actor to you to update your nomination.
This is how we ensure helpers can only edit their own nominations, since we hardcode actor to be ctx.author in the helper command
40dd74b Force kwargs when calling helper util - ChrisLovering
The code seems really nice from when we looked through it together. My only complaint is the word list though, there can be somewhat inappropriate words in it, the rest I don't know because I don't know what they mean.
Do you know what "conspue" means?
It is pretty unsatisfactory to get these long words you have no idea what they mean. It is also impossible for me to look through the 133 K file to see what words we should remove, how did you get this file?
GitHub Actions run 1262909587 succeeded.
@jchristgit I'll do that once I get home
But the lookup is done by target ID. Do nominations for the same user have the same ID?
@lemonsaurus I'm pretty attached to the emojis, how about we turn down the weight and maybe get rid of some of the more noisy ones?
@lemonsaurus I'm pretty attached to the emojis, how about we turn down the weight and maybe get rid of some of the more noisy ones?
Here's the emojification based on punctuation and newlines and turned way down, what do you think?
<img width="1166" alt="image" src="https://user-images.githubusercontent.com/53479485/134398925-61d049b4-52f3-409a-bc32-42b...
"conspue" means "to spurn with contempt as if by spitting upon", had to look it up online.
@TizzySaurus found a word file with all the words, we picked out words which had same letters which could be used as anagrams.
We used the words_dictionary.json file from this repo
GitHub Actions run 1262975185 succeeded.
I don't think any discussion spawned from the last one-
You should add an attribute to the cog: last_fetched which will be a datetime of when this was last updated.
Then, when you use the command and self.last_fetched + datetime.timedelta(hour=1) < datetime.datetime.now() you can use asyncio.create_task(self.fetch_readme) (don't await it) to start a task fetching it in the background.
We still want to keep the response time good, so by using a task we don't need to wait for its...
Reviving this comment, this wasn't changed to re.search.
Search WTF Python repository.
I can move it to the description again
I feel like we can just use the url= kwarg that will lead to Quackstack (making the title "clickable").
Yea, that's right. Each nomination ID contains a list of nomination entries from different actors
Whoa I definitely thought that was updated.
This is why the edit_reason_command request both a nomination ID and an actor to edit
Hmm wait, I don't get it.
- Each helper can have one nomination of someone
- A helper can only edit their own nomination of that person
So that means that a nomination is identifiable by the actor and the nominee.
So that removes the need for an ID.
Yea, helpers don't need to supply an ID when running !tp edit, since the ID is retrieved on lines 372-374.
My comments above were in an attempt to describe the structure
The implementation looks good on the technical side, but I find the command structure confusing.
It's not clear to me semantically why the command group is the one which accepts the narrower option for a target. In other commands, when a group accepts arguments, it's the opposite - meaning, it accepts the wider definition of a certain argument (e.g infraction search).
While this is easier to write as code, technically speaking it's not much more problematic to replicate the same behav...
Additionally, I'd argue we should allow the tp top command be invoked by helpers as well, so that they can see what command are available to them.
GitHub Actions run 1263499497 succeeded.
I'm not particularly sure if this is the proper place to ask but I'm having issues running snekbox. It works fine on my local PC (Windows) but when I try and run it on my VPS (Linux, Debian) I get a PermissionError while trying to run code. It seems to have something to do with cgroup but I'm not particularly experienced with that so I can't figure out how to fix it. Traceback that happens each time I try and run code on it:
Traceback (most recent call last):
File "/snekbox/snekbox...
GitHub Actions run 1264469290 succeeded.
I have a few examples prepped:
Original 100 x 100:

80 x 80:

60 x 60:

40 x 40:
, whereas the message sent when you upload a python/text file uses https://paste.pythondiscord.com (full).
In fact, from the looks of it all messages (other than !paste) which share the paste-site (such as !e when output is too long) use the longer form. Due to this, I think !paste should be the one changed (since only requires on...
18b5fd8 Use full paste link - TizzySaurus
[python-discord/bot] New branch created: fix\-paste\-site\-inconsistency
Closes #1842
!paste now uses https://paste.pythondiscord.com instead of https://paste.pydis.com.
GitHub Actions run 1265251291 succeeded.
It was shorter, but I don't really have a strong opinion either way
[python-discord/bot] branch deleted: fix\-paste\-site\-inconsistency
Connected!
GitHub Actions run 1265270671 succeeded.
Nice, I've personally wanted this for a while ๐๐ป
Missing log migration: bot/exts/recruitment/talentpool/_cog.py
GitHub Actions run 1265666488 succeeded.
GitHub Actions run 1265791741 succeeded.
Yup, looks like it's using cgroup2

How should I go about changing it?
As documented here, you can set a couple of kernel parameters to go back to the v1 hierarchy. If you're curious what exactly those parameters do, they're documented in the systemd manpage. Snekbox really should be updated to support v2 though...
After https://github.com/python-discord/sir-lancebot/pull/860#discussion_r711644770 was commited this line of code wasn't changed.
color=MAPPING_OF_KYU[int(kata_information['rank']['name'].replace(' kyu', ''))],
@HassanAbouelela I think we should make a new PR for the docstrings if we are to manually format them.
This works by running these coroutines in an event loop, where the context of the running coroutine switches periodically to allow all of the coroutines to run, thus giving the appearance of running at the same time. This is different to using threads or processes in that all code runs in the main process and thread, although it is possible to run coroutines in threads.
Literally the only thing that I could find, everything else looks solid.
Yes, sorry. The class names were generated that way, there is a naming convention of some sort.
No need to be sorry at all ๐ I realized there was some convention. Thanks for updating it!
Also, how does the overall picture looks like? It had some problems with the messages module, but I fixed it, I believe.
With overall picture, do you mean whether this can un-drafted? From a quick view, it looks good to me, I can give it a thorough review once it's ready to go.
Sorry, that was the wrong button....
Yes, sorry. The class names were generated that way, there is a naming convention of some sort.
No need to be sorry at all ๐ I realized there was some convention. Thanks for updating it!
Of course, it was a bit inconsistent with this prefix.
Also, how does the overall picture looks like? It had some problems with the messages module, but I fixed it, I believe.
With overall picture, do you mean whether this can un-drafted? From a quick view, it looks good to me, I c...
PyCharm doesn't like the added of here, likely since it's somewhat grammatically redundant, which is why I removed it.

Sweet, I'm no English major so I'm good with it. If I say it out load I want to use of, but that could just be me. ๐
GitHub Actions run 1267446195 succeeded.
GitHub Actions run 1267504373 succeeded.
Connected!
1b6a709 Direct users to the appeals server when banned - ChrisLovering
[python-discord/bot] New branch created: new\-appeals\-process
This is a new appeals process we are trialing. Users who get banned join this server and DM a modmail bot, who relays the message to the main server for mods to discuss.
I have updated the shortening logic to allow for extra information to be included at the end of the embed, while still staying under the limit.
GitHub Actions run 1267820299 failed.
a77d115 Direct appeals to the appeals server - ChrisLovering
[python-discord/site] New branch created: new\-ban\-appeals\-process
Rather than mentioning the apeals email address, we now direct users to the appeal server, which will now be used for ban appeals.
GitHub Actions run 1267829158 succeeded.
GitHub Actions run 1267860493 succeeded.
GitHub Actions run 1267867600 succeeded.
Yeah I'm getting stuck on this one. I haven't used asyncio yet so maybe that is what is tripping me up.
Also, how can I get the "last" time the cog was loaded instead of just calling it immediately?
Here is what I have so far:
class WTFPython(commands.Cog):
"""Cog that allows getting WTF Python entries from the WTF Python repository."""
def __init__(self, bot: Bot):
self.bot = bot
self.headers: dict[str, str] = dict()
self.last_fetched =...
Seems pretty solid so far, just 2 small things
Wouldn't this be the "Ban Appeals" bot rather than ModMail? Potentially also means constant should be renamed to INFRACTION_BAN_APPEAL_BOT_FOOTER or alike
Likewise, is there a reason all the tests now have this under the description rather than footer?
Is there a reason this is now being sent in the description rather than footer?
INFRACTION_APPEAL_SERVER_FOOTER is used for bans, INFRACTION_APPEAL_MODMAIL_FOOTER is used for everything else.
The reason for this is because banned used cannot DM modmail, as they do not share a server, so they need to join the appeal server to be able to. Whereas other kinds of infractions don't get kicked from the server, so they have access to DM modmail directly.
This is to allow hyperlinking the guild invite
The message isn't in the footer, so it the tests tested that it was, they would fail.
756dc02 Move guild invite to constants file - ChrisLovering
GitHub Actions run 1269064061 succeeded.
GitHub Actions run 1269412139 succeeded.
In draft until we have a modmail plugin to control pings.
In draft until we have a modmail plugin to control pings
f8f2401 Add a 5 minute cooldown to the topic command - ChrisLovering
[python-discord/sir-lancebot] New branch created: topic\-command\-cooldown
[python-discord/sir-lancebot] Pull request opened: #880 Add a 5 minute cooldown to the topic command
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #868
Description
Using the command while it's on cooldown will hit the error handler, which sends an error message showing how long is left on the cooldown, which is deleted after 7.5 seconds.

Did you:
- [x] Join the [**Python Discord Communit...
GitHub Actions run 1269578295 succeeded.
This sounds like a good idea and can be quite fun.
If you wanted to as part of this, we could also add a profanity filter to sir lance, so that users can't get lance to parrot bad words. This is optional though, as we already have other similar commands that don't do this.
Do we currently handle the situation for kicks? Whilst it's rare that we kick instead of mute/ban someone, it does sometimes happen and so this should be handled. Presumably we'd want a different message saying "rejoin when you're ready to follow our rules and coc" or something.
Kicks currently also send the INFRACTION_APPEAL_MODMAIL_FOOTER we could have another message that explains it more along the lines that you suggest. But that's out of scope for this PR, so should be another issue/PR.
I'm not a fan of this solution. I think there are relevant reasons to use two topic commands in a five minutes span. I'd propose one of the following:
- Reduce to one minute
- Add a re-roll reaction that can be only used by the command runner
Thanks @ChrisLovering ! Yeah, that's a good idea, I will add the profanity filter as well.
What if the cool down was only per user?
@commands.cooldown(1, 300, commands.BucketType.user)
d3ee3df Allow topics to be refreshed - ChrisLovering
GitHub Actions run 1269746993 succeeded.
The reason for a channel cooldown was so that multiple users can't spam the topic command in a single channel
I'll work on this tonight / over next few days.
After some diving into the source code of bisect..bisect() and playing around with LOVE_DATA I found that tuple comparison was the bug. The fix I came up with was to pull the love percent thresholds out and bisect there instead of a half-arsed - 1 and a bad comment. I also force-pushed my branch to address the file restructuring.
After doing a load of testing, it seems the believed cause of the issue isn't actually the case.
There's two possibilities as to what happened here that I can think of:
-
The user was banned (which is the case), meaning they left the server just after the message was sent, but before the actual
discord.Messageobject was created by dpy, causing themessage.authorto be adiscord.User. -
Some sort of weird cache issue where the member wasn't in the cache, so dpy thought the user...
Sorry, I totally forgot I'd commented here. (I need to read my emails more often ๐ )
After some diving into the source code of
bisect.bisect()and playing around withLOVE_DATAI found that tuple comparison was the bug. The fix I came up with was to pull the love percent thresholds out and bisect there instead of a half-arsed- 1and a bad comment. I also force-pushed my branch to address the file restructuring.
Yes, this is roughly what I was going to suggest. That is, separati...
@wookie184 I'd probably just do the path tag
e082596 Add handling for when message.author is a `di... - TizzySaurus
[python-discord/bot] New branch created: fix\-sentry\-BOT\-1N6
Closes #1839.
Adds an isinstance check before trying to add cooldown role and DM, to see if the message.author is a discord.User/discord.Member.
Will cause a sentry warning when message.author is a discord.User, in hopes of helping debug the issue in future (cause of message.author being a discord.User is unknown -- some theories are posted in #1839. As @ChrisLovering said on discord, the level can be lowered if it becomes too noisy.
GitHub Actions run 1270392283 succeeded.
Yes I believe it is, the smaller the image the better. Could be good to play around with different sizes, the smaller the better.
Although I'd argue this could be a premature optimisation.
Consider creating typing.NamedTuple classes for the different colour modes. Eg
class RGB(NamedTuple):
r: int
g: int
b: int
Then you could make the required colour conversions methods of these classes, rather than static methods of the cog or nested functions of get_color_fields. I certainly think it would make more sense for the conversions to all be pure functions.
I've yet to test this, so I may be back with more comments ๐
I wouldn't make this a from import, as "process" could mean anything.
Ditto comment in hsv_to_rgb.
If the input is already a tuple of ints, then what is tuple_create doing here? It looks as if the type annotation for input_color should be str.
650e739 Suppress NotFound for batch deletion. - jchristgit
[python-discord/bot] New branch created: supress\-notfound\-messages\-on\-delete
[python-discord/bot] New branch created: suppress\-notfound\-messages\-on\-delete
I will copy my comment from the code, as it explains why we want this:
In the rare case where we found messages matching the spam filter across
multiple channels, it is possible that a single channel will only
contain a single message to delete. If that should be the case,
discord.py will use the "delete single message" endpoint instead of the
bulk delete endpoint, and the single message deletion endpoint will
complain if you give it that does not exist. As this means that we have
n...
Traceback found via pod logs:
2021-09-24 16:34:34 | bot | ERROR | Unhandled exception in on_message.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "/bot/bot/exts/filters/antispam.py", line 220, in on_message
await self.maybe_delete_messages(relevant_messages)
File "/bot/bot/exts/filters/antispam.py", line 253, in maybe_delete_messages
await channel.de...
(This probably also fixes some Sentry issue, but I don't have access to anything there, I will request access to the devops team there)
GitHub Actions run 1270834912 succeeded.
(This probably also fixes some Sentry issue, but I don't have access to anything there, I will request access to the devops team there)
added sentry ref to description
Did you go over other possible failure points for this in the cog? It is actually documented that discord.Message.author might be a discord.User if they left the guild. Maybe start by looking for other uses of that attribute in the help system. Are there any other member attributes that could be a user too?
Do you think it would make more sense to invert this i.e. check for the type it supports rather than checking for the one it can't support? Technically the author could be any abc.User.
[python-discord/site] Pull request opened: #594 docs: Added site documentation for editing on Gitpod
Just the title. This should be merged in conjunction with sir-lancebot#867.
Were you planning to handle this format:
.colour hsl(241, 47, 58)
(No space between mode and parameters.)
Also:
.colour #6563C7
Gitpod has full support for github urls even with the https://. Their docs state (in summary)
Just prepend your github link with
https://gitpod.io/#to get started. Its that easy!
Were you planning to handle this format:
.colour hsl(241, 47, 58)
(No space between mode and parameters.)Similarly:
.colour #6563C7
I was not prepared to handle those types of inputs, but I believe I could handle that in the if / elif statements.
Ahh yes I see what you mean. I'll add an error embed message if it cannot be split.
I was planning on handling these three situations:
.color hex #ff0000
.color hex 0xff0000
.color hex ff0000
Are you saying that if I fix the regex I can handle all three of those situations?
My intention was to handle a hex code with the prefixes of # or 0x
Good catch, this must have happened when I re-structured
Connected!
GitHub Actions run 1271070539 succeeded.
Yes, so you would want to change (#?[0x]?) in the regex to something like (#|0x)?.
I'm not sure what you mean sorry. See the code suggestion above.
Yeah. Although possibly this function should raise an exception, which can then be caught by the caller and an embed sent.
I sort of don't like functions like this having side effects. I usually aim to write pure functions if possible, which are then tied together with imperative code.
I'm not sure the last part of my above comment made sense ๐ Ask if you don't get what I mean.
Were you planning to handle this format:
.colour hsl(241, 47, 58)
(No space between mode and parameters.)
Similarly:
.colour #6563C7I was not prepared to handle those types of inputs, but I believe I could handle that in the if / elif statements.
Right. But that makes me think: might it be better to parse the arguments to this command yourself, rather than relying on discord.py to separate the mode?
GitHub Actions run 1271278151 succeeded.
Connected!
GitHub Actions run 1271280917 succeeded.
GitHub Actions run 1271281232 succeeded.
GitHub Actions run 1271289361 succeeded.
GitHub Actions run 1271307571 succeeded.
GitHub Actions run 1271323391 succeeded.
I did the User check first since then the comment directly correlates to the first statement. It doesn't really matter which way round the statement is, and afaik the only possible subclassess of abc.User is User and Member (can't be ClientUser, even when message is sent by the bot).
Did you go over other possible failure points for this in the cog? It is actually documented that
discord.Message.authormight be adiscord.Userif they left the guild. Maybe start by looking for other uses of that attribute in the help system. Are there any other member attributes that could be a user too?
There isn't any other cases where we rely on message.author being a discord.Member. Other cases just get the .id, which will exist regardless. Only exception is L593 of `_co...
However it's not the scope of this PR, would it mean a problem if I added PostgreSQL to the docker-compose file, and the drivers to the poetry environment? @jchristgit
(I have the changes prepared locally, since I was testing the models, but haven't added them to the PR just yet.)
This is like.. really cool. Love the way it uses the interactions. Just got a little bit lost when using the menu, see my comment.
Can the title for these include the title for the Kata the same way the main embed does?
Maybe in the style of "Main Information | Name on Billboard" (or the other way around) or in some other style if you prefer that. I got a bit lost after selecting other information.
Applies to the other embeds
lines = [f"{header}\n{'-' * (len(header) + 2)}"]
"""Button that fetches the statistics based on the dropdown values."""
Can't we just use self.star and self.day?
I am thinking something more like this:
README_REFRESH = 60 # Amount of minutes
class WTFPython(commands.Cog):
"""Cog that allows getting WTF Python entries from the WTF Python repository."""
def __init__(self, bot: Bot):
self.bot = bot
self.headers: dict[str, str] = dict()
self.last_fetched = datetime.datetime.now()
log.debug(f"{self.last_fetched = }")
asyncio.create_task(self.fetch_readme) # Start a first task
...
[python-discord/bot] branch deleted: suppress\-notfound\-messages\-on\-delete
Connected!
GitHub Actions run 1271724890 succeeded.
With all due respect @brad90four the structure of this PR is rather poor.
It seems like you're a bit confused by what I refer to as subcommands - luckily - discord.py has a FAQ entry here about it.
I think each mode should instead be a subcommand, and then they do the conversion to RGB and call a main method which sends the message to Discord.
Huh? Two new lines between each line?
These debugs should not exist when this is merged.
with open("bot/resources/utilities/ryanzec_colours.json") as f:
I understand why it is used, but we can just use this.
No need for the quotes, we're referring to mode as a mode. Not specifically as an argument
title="No mode was passed, please define a color code.",
Can we feature creep and take the time to recommend asyncio.run() instead?
The XY problem can be summarised as asking about your attempted solution rather than your actual problem.
This PR is supposed to be about improving grammar but adding a , there is invalid grammar.
โข Try to understand why the error occurred (in this case probably because `b` is `0`).
Relevant Issues
Closes #866
Description
Found flights are no longer displayed in the message content above the board image. Instead a new embed message is sent below the board and its text is edited with the flights.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the [contributing guidel...
GitHub Actions run 1272059317 succeeded.
Whoa that is awesome! Thanks for the super clear example.
GitHub Actions run 1272378635 succeeded.
I have cross referenced the file with most common words, so the anagrams should be easy to predict and file should now be reduced from 130k to 18k lines also cleaned some bad words from the file
I don't think so, no. This check is meant to check whether in the current interaction in the very moment when this button is pushed there is one value chosen from both of the dropdowns, since when the user pushes the fetch button, the interaction will revert itself to its original form. (This way we ensure that the placeholder will be shown every time they want to interact with the view). If I were to use those variables in this check, the view would just fetch the same view that was fetched...
You mean the element_map? If so, I came up with this, because I couldn't find an alternative to the built in children attribute, I mean that as in using them with indexes. If there's a better alternative I would be more than interested to implement it.
I think it is good there in the select menu, I am talking about the embed title.
The issue is that the main information has the title, but for example "Programming Languages" has exactly that as its title (not the name of the Kata included somewhere).
GitHub Actions run 1272550631 succeeded.
Even "most likely" isn't correct. We know categorically that b is 0 from this error. There's no other way for the error to be raised.
I agree that is flows better than must be though so will change that.
Also going to update the error message since apparently I forgot to do that.
I don't see how adding the , makes it invalid grammar. It's just adding a natural pause in speech.
However it's not the scope of this PR, would it mean a problem if I added PostgreSQL to the docker-compose file, and the drivers to the poetry environment? @jchristgit
No, not at all, go PostgreSQL!!! ๐
Same as above. I don't see how this comma is wrong.
This isn't a comma-splice because it's not joining two separate clauses. This is a subordinate clause (iirc that's the correct grammatical term for it).
I'll remove the second "you" though since the sentence does flow better without it.
As noted above, this is mostly just to add a natural pause in speech
Having Where as the next sentence doesn't make any sense to me here. Perhaps a semi-colon would be more appropriate?
I'm not at all familiar with asyncio so I'd need more info as to what to write.
However it's not the scope of this PR, would it mean a problem if I added PostgreSQL to the docker-compose file, and the drivers to the poetry environment? @jchristgit
No, not at all, go PostgreSQL!!! ๐
Alright! ๐
Apart from the linting errors(Should we change the max-line-length to 120?) , I believe it's done. I have tested out few of the checks and relationships, they seem to work just fine.
Yeah this one didn't feel "right" fully. "Where" itself may not be the right word?
I don't think I fully understand this sentence either. Is this sentence meant to convey that py and python are interchangable?
I disagree that this improves grammar but if this is a change you would like to make that is fine with me. I will mark all of the comments I made about the added commas as resolved.
You can see the documentation for some more context, but I'd recommend something like the following:
To run the top level async function from outside of the event loop we need to use
asyncio.run()like this:import asyncio async def main(): await something_awaitable() asyncio.run(main())
Then in the note after that change the reference of run_until_complete() to asyncio.run().
lines = text.split("\n")
# Limit to a maximum of three lines
if len(lines) > 3:
text = "\n".join(line for line in lines[:3])
async def fetch_webhook(self) -> None:
"""Set the guild related attributes to use in the cog."""
These should be updated with #1825 right?
Isn't there a helper for this?
How does this work/compare to #1570?
Ah right. Yes, the code I suggested should (although I haven't tested it) handle those three situations.
With all due respect @brad90four the structure of this PR is rather poor.
It seems like you're a bit confused by what I refer to as subcommands - luckily - discord.py has a FAQ entry here about it.
I think each mode should instead be a subcommand, and then they do the conversion to RGB and call a main method which sends the message to Discord.
Actually, I do agree with Bluenix that the structu...
Can we reach a consensus on this before moving forward please @Bluenix2 @brad90four @CyberCitizen01
I am completely okay with what you suggested here, subcommands was simply the first idea that came to mind but this will work out as well.
Can we reach a consensus on this before moving forward please @Bluenix2 @brad90four @CyberCitizen01
I am completely okay with what you suggested here, subcommands was simply the first idea that came to mind but this will work out as well.
Ah right. My thought was that it wouldn't be very user friendly to try doing .color hsl(241, 47, 58) and get a response saying that there is no hsl(241, sub-command.
I believe it's saying you can use py wherever you'd use python in the command line.
Perhaps Otherwise, you can access your installation using the py` command in Command Prompt rather than python.
Will look into this tonight :+1:
Hi! Cool that you're doing this, I remember seeing a couple really minor typos in the tags before, if I can find them I'll let you know
Hi! Cool that you're doing this, I remember seeing a couple really minor typos in the tags before, if I can find them I'll let you know
Sounds good! It's probably best to send anything you find in #1836 (the PR making the changes) rather than here, and would be helpful if you just double check I haven't already made the change on the PR (by checking the "Files changed" tab).
There has been a number of instances recently where users have been getting auto-muted by the bot for "spamming" bot commands / messages in response to commands.
This had lead to multiple discussions of reducing the strictness of our filters within the two bot command channels, and it seems no one is strongly against this.
In terms of what exactly should be done, I think the duplicates filter max should be increased to say 6 messages (from 3), and the newlines filter increased to say 12...
GitHub Actions run 1273655299 succeeded.
@Shivansh-007 will you be able to resolve these requests?
In fact, after re-reading the tag I realise this sentence is rather redundant as the previous sentence covers it, so I'll ignore for now
GitHub Actions run 1273737562 succeeded.
Can all other embeds also get this URL attribute?
What about keeping the title the same but moving the Supported Languages: part into the description?
kata_description += f" [continue reading]({kata_url})"
This way it mimics the mailing list's behaviour which I quite like.
Please add an on_timeout that will edit the message to have disabled components.
But you have self.star_select no?
This docstring needs updating, day_and_star is now a boolean.
First we say "Check Add Python to PATH" but then say "if you did not uncheck"?
Which means we can call `await something_awaitable()` directly from within the function. If this were a non-async function, it would have raised the exception `SyntaxError: 'await' outside async function`
Don't you think there should be it here instead?
This works by running these coroutines in an event loop, where the context of the running coroutine switches periodically to allow all other coroutines to run, thus giving the appearance of running at the same time. This is different to using threads or processes in that all code runs in the main process and thread, although it is possible to run coroutines in other threads.
The uncheck is referring to a separate setting (installing the Python launcher)
Huh, I don't even know the difference haha
GitHub Actions run 1273905496 succeeded.
Perhaps we should have the option in asterisks to better highlight it?
But you have
self.star_selectno?
I do, I did not realize the obvious.. thank you for pointing out. I'll patch my code.
This doesn't even work, I can select one of the dropdowns and fetch. I think it is unneccessary.
Actually, it does on the first interaction, however I did not take it into account, that the dropdown values will never be reverted to zero. I've found a workaround with the day and star variables.
Yeah we can put italic around Python Installer?
The installer has the setting as py launcher so will reword to this and add the asterisks
I'm not sure how that could work. As far as I'm concerned the on_timeout callback won't receive any kind of interaction, hence even if I disable the elements, or just clear the View, it won't take an effect.
However, after the timeout the View cannot be used.
GitHub Actions run 1273961812 was cancelled.
Yeah that's exactly what I would've hoped to not get.
I understand why on_timeout() doesn't give us an interaction but it does complicate things. There's ways to work around it but I don't think it is worth the bother then.
UPDATE: This is more complicated than I anticipated so I think we can skip this.
For all of these, or just the "Supported Languages" embed
This is actually not that complicated. At the end of the command, we want to the wait for the instance of the view to stop.
This is easily achieved with this method: https://discordpy.readthedocs.io/en/master/api.html?highlight=view#discord.ui.View.wait
After this, we can edit the message to remove the view, by running await message.edit(view=None)
I think it'll work for all other embeds yeah? Try it out, if you prefer it like it already is then we can keep it.
I am just coming with different ideas because I am not sure if it feels quite right.
Description
running .help quote sends no response
Steps to Reproduce
run .help quote
Expected Behaviour
Bot either gives help message or errors since it is not valid.
Actual Behaviour
No response is provided.
Known Impacted Platforms
- [ ] Web
- [ ] Desktop
- [ ] Android App
- [ ] iOS App
Possible Solutions
I have no idea what the error is internally.
Would you like to implement a fix?
***Note: For high-priority or critical ...
GitHub Actions run 1274348527 succeeded.
Description
Now that sir-lancebot is on dpy2 v2, lance can use buttons.
I'd like to see a button paginator on lance, rather than reactions.
Reasoning
Honestly, there's not much of an internal benefit, except for not having to listen for reactions ๐
Proposed Implementation
Basically, would change the external interface to this:

Here's an apples to ...
copying this from discord so its easier to reference:
It's highly worth removing them. Internally buttons and their names are referred to with a custom ID, which fwiw, should be manually set instead of setting the library decide--this will be useful in the end and I can explain why later.
When the bot receives an interaction over the gateway, it only receives the message and the button ID. this means that we'd be getting a lot of old requests if a user used an old button. It's n...
apparently this is a lot worse than i thought it was
or better, since this is more useful than one command not working ๐

Can we reach a consensus on this before moving forward please @Bluenix2 @brad90four @CyberCitizen01
Well I guess this looks great, but I have something to ask:
So now, the cog will handle .color <mode> <color> (explicit space between mode and color) via subcommands and inputs like .color rgb(255,255,255) via the main method, right?
I also think you should move the functions that perform the actual colour conversions out of the cog class and into the module.
Yeah I think, ...
Hey @Xithrius,
Unfortunately I haven't been getting enough time to mention the reviews due to my exams going on, if this is PR is on a high priority (or any of my other PRs), someone else can take them up as I won't be able to mention them until 15th October at-least. Otherwise, I would get them mentioned as soon a I am back from the break. And thanks bluenix and zig for the reviews!
You would probably forgot, I had pinged you in #dev-contrib with the same before I went off into a break...
Something to be though about here as well potentially is: do we apply these constraints to current members who haven't completed these requirements? maybe a period where new joins gets this applied, and then at the end of that, we do a mass apply to server members?
also, if a member loses the requirements by deleting messages or getting infracted, should they get given the new members role again?
I don't think that is what @lxnn originally thought about, what I must say I do like that compromise.
It means that you still get helpful directions in the help command.
Note that in the `asyncio.run()` where we appear to be calling `main()`, this does not execute the code in `main`, rather it creates a `coroutine` object which is then handled and run by the event loop via `asyncio.run`.
Would this be an improvement?
GitHub Actions run 1275059974 succeeded.
Well I guess this looks great, but I have something to ask:
So now, the cog will handle.color <mode> <color>(explicit space between mode and color) via subcommands and inputs like.color rgb(255,255,255)via the main method, right?
That's not correct. The invocations .color rgb(255,255,255) (without space) and .color rgb (255,255,255) (with space) would both be handled by the base command .color <color>. You would just define <color> to be flexible regarding whitespace...
@lxnn Thank you for the clarification ๐ ๐
returnI personally think it should have return.. Perhaps creates and returns` if you want to mention that the coroutine gets created?
Yeah I think that's a good compromise. I do think it is important to mention that main() is not main().
Due to https://github.com/python-discord/bot/pull/1663 becoming implemented along with other PRs expanding the domain of tags, the tests here are unfortunately going to be continuously changed.
We're thinking of focusing on tests which are more isolated such as utilities, so that the testing of said features aren't needed to be changed often.
Thank you to all who worked on this PR.
Seems to be a dupe of #863
This is very noticiable in the help command

GitHub Actions run 1275838103 succeeded.
Connected!
GitHub Actions run 1275843476 succeeded.
[python-discord/site] Checks Failed on PR: #594 docs: Added site documentation for editing on Gitpod
GitHub Actions run 1275848323 failed.
docs changed, this is outdated
GitHub Actions run 1275873545 succeeded.
[python-discord/sir-lancebot] New branch created: fix\-issue\-863
Relevant Issues
<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #863
Description
Fixed the traceback caused by process.extract returning 3 items when dict() can only take 2.
Ended up changing the data-structure of the argument sent to HelpQueryNotFound to list[str]` since only the keys where ever used anyway.
Also noticed there was some inconsistency within the file in regards to commands.Command so fixed that too...
GitHub Actions run 1275923180 succeeded.
A new PR will soon be made implementing the change in an easier way (roles). This one will be closed.
Trailing commas are only for multiline.
Relevant Issues
Closes #827
Description
Allowed the .bm command to be used everywhere by using our whitelist overrider.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the contributing guidelines?
GitHub Actions run 1275983732 succeeded.
@minalike It was an error on my part; the decorators' order was inversed. A new PR is coming up right now as we speak.
[python-discord/sir-lancebot] Pull request opened: #886 Allow \`\.bm\` command to be used everywhere
Relevant Issues
Closes #827
Description
Allowed the .bm command to be used everywhere by using the everyone role in the whitelist overrider.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the contributing guidelines?
GitHub Actions run 1276004050 succeeded.
Looks functional, two code suggestions which seem easy enough to fix.
This should go above commands.command to be consistent with how it was before; also keeps git diff to a minimum.
It was above, and that's why it didn't work.
This actually needs to go below the command decorator, otherwise it has no effect. I believe it did not work previously.
(yes, no one tested the old PR besides mina)
GitHub Actions run 1276025746 failed.
GitHub Actions run 1276031946 succeeded.
Connected!
GitHub Actions run 1276034727 succeeded.
I think that many starting out aren't that good with Git and won't know what upstream and origin means. Besides, it is only convention to name them like that.
Perhaps we can explain it more-so as parent and fork or similar?
You should mentioned to replace {your_username} with the user's username.
GitHub Actions run 1278491397 succeeded.
GitHub Actions run 1278762753 succeeded.
Converting to draft until @CyberCitizen01 and I get the restructure / refactor to a finished state.
@doublevcodes has [said on Discord](#dev-contrib message) they're no longer able to do this due to school work. If I'm able to, I'll approach this soon:tm:.
Can we change this to disable the items instead? That way they appear greyed out, see this attribute.
Instead of removing the view, just disable all of its children (the buttons and select menu) and edit it to that view then return.
This works as well, so if you prefer the current behaviour feel free to keep it.
22ca3a8 Add LT and GT to supported otn chars - ChrisLovering
[python-discord/bot] New branch created: add\-more\-supported\-symbols\-to\-otn
5a40f84 Add LT and GT to supported otn chars - ChrisLovering
[python-discord/site] New branch created: add\-more\-supported\-symbols\-to\-otn
Does what it says on the tin.
Does what it says on the tin.
https://github.com/python-discord/site/pull/595 must be merged first
[site] Branch add\-more\-supported\-symbols\-to\-otn was force-pushed to `f05f40f`
GitHub Actions run 1279924477 succeeded.
Should this second string be a constant since its in two places?
Are these the best unicode characters for this?
\u276e and \u276f might be better looking substitutes.
[bot] Branch add\-more\-supported\-symbols\-to\-otn was force-pushed to `c04832f`
Since I'm here, why not. Force pushed
GitHub Actions run 1279938220 succeeded.
Looked at what they all look like on discord, these are the best characters for this purpose.
[site] Branch add\-more\-supported\-symbols\-to\-otn was force-pushed to `dd76953`
GitHub Actions run 1279951344 succeeded.
[site] Branch add\-more\-supported\-symbols\-to\-otn was force-pushed to `3cb0a6b`
GitHub Actions run 1279965579 succeeded.
@TizzySaurus why didn't running the bot work on 2.0?
Did you rebuild the Docker image? (docker-compose build)
What were all of the force pushes for? I don't see any difference since the last time I reviewed it.
This feels like it could be done in a better way. Won't found_embed.description or "" be good enough for old_desc?
GitHub Actions run 1280014054 succeeded.
I don't really have much else to comment, looks good otherwise.
return False
is_moderator = any(role.id in MODERATION_ROLES for role in getattr(user, "roles", []))
Mostly a styling issue
Isn't the command itself a task?
return # Cache should be up-to-date
self.headers: dict[str, str] = {}
What were all of the force pushes for? I don't see any difference since the last time I reviewed it.
renamed the migration file, since it had it's auto generated name
@TizzySaurus why didn't running the bot work on 2.0?
Did you rebuild the Docker image? (
docker-compose build)
With a bit of guidance I was able to get it up-and-running, and can confirm that the code works as expected :+1:
GitHub Actions run 1280984325 succeeded.
GitHub Actions run 1281066190 succeeded.
Description
Currently, avatar commands use the user's avatar, and not the guild specific avatar.
Steps to Reproduce
run any avatar command
Expected Behaviour
the displayed avatar is used to make the images.
Actual Behaviour
the user's global avatar is used to make the images.
Known Impacted Platforms
- [x] Web
- [x] Desktop
- [x] Android App
- [x] iOS App
Possible Solutions
Change to the documented display_avatar() method in discord.py 2...
Akarys agreed that we should probably make these consistent, so I'm writing a util function which both methods will call (Akarys also said it's okay to keep part of this PR).
I'm not up to date on whether we are already using threads with Sir Lancebot. Is this issue currently blocked?
I'm not up to date on whether we are already using threads with Sir Lancebot. Is this issue currently blocked?
So, here's the thing: we can technically use threads manually, but that's not going to be very effective for this game, right? So what we are waiting on is the full release of d.py 2.0, after which we can upgrade the main Python bot so it can manage threads (there is a PR for it in the bot repo), and only after that could someone start working on this. So yes, you are right, t...
I have 2 alternative implementations that don't really require the use of threads.
-
What we could do is, instead of opening threads when the multiplayer game command is run, (I'm not even sure if this is possible) unlock a special channel where anyone can join the person who ran the command. This one has some problems, which I'm not sure if it's obvious or not so I'll say it anyway. Other people could join the new channel and spam it.
-
We could also do it like this: whenever someone run...
[python-discord/site] Checks Failed on PR: #594 docs: Added site documentation for editing on Gitpod
GitHub Actions run 1282738337 failed.
GitHub Actions run 1282751771 succeeded.
Overall it looks good, just saw a few things that could either be changed or left alone ๐
Just my opinion on this, but I think having the seconds explicitly stated could help with future contributions.
await asyncio.sleep(seconds=TIME_LIMIT)
Given shuffled letters, rearrange them into anagrams.
After a specific amount of time, list the correct answers and whether someone provided a
GitHub Actions run 1282786695 failed.
Connected!
GitHub Actions run 1282889001 succeeded.
[python-discord/site] branch deleted: add\-more\-supported\-symbols\-to\-otn
[python-discord/bot] branch deleted: add\-more\-supported\-symbols\-to\-otn
GitHub Actions run 1283192961 succeeded.
Connected!
GitHub Actions run 1283202135 succeeded.
@VikranthMaster are you still working on this? How's it coming along?
The r'' actually stands for raw, it is mainly useful with backslashes. r'\n' becomes the actual string '\n' while '\n' in the code becomes a new-line character. It is pretty common to think r is for regex but this is not correct.
The reason I say this is because you double-backslash in the subtitute strings, and always use raw strings in the regex compilation.
Side note: these should be all-caps for CONSTANTS.
Can't these be placed in the cog itself?
What does LUT stand for?
sir-lancebot | 09/28/21 18:18:55 - bot.exts.core.error_handler ERROR: Unhandled command error: sleep() got an unexpected keyword argument 'seconds'
sir-lancebot | Traceback (most recent call last):
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py",
line 167, in wrapped
sir-lancebot | ret = await coro(*args, **kwargs)
sir-lancebot | File "/bot/bot/exts/fun/anagram.py", line 77, in anagram_command
sir-lancebot | await a...
See my comment about quotes
Look over the quotes here, Python Discord uses double-quotes.
See my comment about quotes
sir-lancebot | 09/28/21 18:18:55 - bot.exts.core.error_handler ERROR: Unhandled command error: sleep() got an unexpected keyword argument 'seconds'
sir-lancebot | Traceback (most recent call last):
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py",
line 167, in wrapped
sir-lancebot | ret = await coro(*args, **kwargs)
sir-lancebot | File "/bot/bot/exts/fun/anagram.py", line 77, in anagram_command
sir...
I'm not up to date on whether we are already using threads with Sir Lancebot. Is this issue currently blocked?
Yes @lxnn we need to wait for Python bot's usage of discord.py to use threads anywhere. Even though Sir Lancebot does support threads.
I have 2 alternative implementations that don't really require the use of threads.
- What we could do is, instead of opening threads when the multiplayer game command is run, (I'm not even sure if this is possible) unlock a special...
This is no longer used since you decided to use discord.py's tasks.
This looks poor on dark mode:

Unneccessary, discord.py now takes care of this
I'm not up to date on whether we are already using threads with Sir Lancebot. Is this issue currently blocked?
Yes @lxnn we need to wait for Python bot's usage of discord.py to use threads anywhere. Even though Sir Lancebot does support threads.
I have 2 alternative implementations that don't really require the use of threads.
- What we could do is, instead of opening threads when the multiplayer game command is run, (I'm not even sure if this is possible) unlock ...
It won't, discord.py has been archived and Python bot will be moved to the most recent commit and use that for the time being.
GitHub Actions run 1283900947 succeeded.
Should this be a link or https://gitpod.io/#/python-discord/sir-lancebot?

Can't we tell the user to fork the repository then?
Make sure you replace `{your_username} with your Github username`. **You must have a fork of Sir Lancebot for this to work.**
Bumping this @Kronifer as I would like to see this fixed before being merged.
I'll fix this very soon
Thank you for your contribution
It won't, discord.py has been archived and Python bot will be moved to the most recent commit and use that for the time being.
What do you mean by "most recent commit"? Of dpy? And my guess is that commit does not include thread support, correct? If so, I'm curious to know how thread support will be added to the Python bot and when that will happen? @Bluenix2
Discord.py has been archived and Python bot (the same way Sir Lancebot does) install from the GitHub repository where there is thread support and support for interactions.
Discord.py has been archived and Python bot (the same way Sir Lancebot does) install from the GitHub repository where there is thread support and support for interactions.
So wait, you got me confused. Before you said we are still waiting on the thread support addition, but now it seems like you're saying the bots are supporting threads already? Please clarify @Bluenix2
Python bot doesn't use discord.py 2.0 yet.
Python bot doesn't use discord.py 2.0 yet.
Ok, thanks for clarifying.
I would like to implement this for the upcoming Hacktoberfest 2021. @MarkKoz, if there are no objections to removing the line numbers, could you please assign the issue to me.
GitHub Actions run 1284068209 succeeded.
Since the image is a .png, how can I change the embed background but only for dark mode?
You'll have to find a picture that works better on both platforms, there's no way to differentiate it like that.
I like that, but the capitalization is a bit over-the-top (just do Search results for 'del')
GitHub Actions run 1284593457 succeeded.
I could save it as a .jpg and add it to the resources folder?
GitHub Actions run 1284598056 succeeded.
Because of the license (see here) we actually could do that afaik.
For legal reasons I am not impliying anything and this is not legal advice ;)
How about no image at all?
GitHub Actions run 1285216903 succeeded.
Doesn't look to bad to me:

GitHub Actions run 1285237032 succeeded.
@Kronifer You might've forgotten about that one.
It seems like this issue has been abandoned. I would like to implement it if there are no objections.
Recently we've been having a problem with people joining and leaving the voice chat over and over and over. I'm wanting to have a new command made that will not only prevent them from being verified (for as long as the join ban is active) as well as prevent them from rejoining the channel.
In addition to that, we'd need to rename the current voiceban command as voicemute to better reflect what they do.
The implementation would likely be similar to how we have the mute command.
GitHub Actions run 1288341148 succeeded.
6fb6967 Use scheduling create_task util instead of crea... - Numerlor
f6a02d8 Use create_task util instead of asyncio.create_... - Numerlor
eff7d7f Add cog as an alias to extensions command - mbaruh
3e34deb Merge pull request #1840 from python-discord/mb... - ChrisLovering
18b5fd8 Use full paste link - TizzySaurus
[python-discord/bot] branch deleted: fix\-pynews\-markdown
GitHub Actions run 1288749393 succeeded.
Connected!
GitHub Actions run 1288761594 succeeded.
@WillDaSilva I don't think Python Discord's projects will be participating in Hacktoberfest 2021. In any case, I don't know what the consensus on this issue is.
Decided to go with commands to manage the list of appeal categories, rather than automating the creation & deletion of them, as it would require us to maintain the list of overrides in-code, rather than just doing t via the front end.
GitHub Actions run 1290870944 succeeded.
GitHub Actions run 1291732499 succeeded.
sir-lancebot | In components.0.components.1: The specified component exceeds the maximum width
sir-lancebot | Traceback (most recent call last):
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
sir-lancebot | ret = await coro(*args, **kwargs)
sir-lancebot | File "/bot/bot/exts/utilities/challenges.py", line 331, in challenge
sir-lancebot | await original_message.edit(embed=kata_embed, view=kata_vi...
Fuck, I thought I removed them
GitHub Actions run 1292054141 succeeded.
Is this ready for review or is this that issue we've been debugging @TizzySaurus?
Is this ready for review or is this that issue we've been debugging @TizzySaurus?
This is the issue we've been debugging :+1:
Oh, right. It makes sense, I was still thinking inside the box (view) ๐
Will push a patch, later today.
GitHub Actions run 1292345902 succeeded.
GitHub Actions run 1292402822 succeeded.
GitHub Actions run 1292776343 succeeded.
GitHub Actions run 1293063875 succeeded.
All works well, just some minor comments on a few things. Thanks for the PR!
GitHub Actions run 1294510152 succeeded.
Connected!
GitHub Actions run 1294515177 succeeded.
GitHub Actions run 1295972486 succeeded.
GitHub Actions run 1297463566 succeeded.
26943e5 Change pascal's triangle image - TizzySaurus
[python-discord/sir-lancebot] New branch created: fix\-pascal\-triangle\-image
Description
Pascal's image in .quiz command doesn't render.
Steps to Reproduce
Play .quiz math until you get the pascal's triangle question
Expected Behaviour
The image from the json file should be attached
Actual Behaviour
No image gets attached, although the image is definitely set


Did you:
- [x] Join the Python Discord Community?
- ...
GitHub Actions run 1298124081 succeeded.
I would prefer to keep the empty line here if possible
Is it a discord.py limitation or Discord limitation?
Isn't answer a tuple? Maybe we could format it more prettier?
return f"{match_string}-{match_string[-1]}" # Stutter the last character
Might as well use dict.items() like this:
for word, replacement in WORD_REPLACE_HASH.items():
input_string = input_string.replace(word, replacement)
"""Nyaifies a string by doing XYZ."""
Can you just add some more details here?
def _emoji_replace(self, match: re.Match, strength: float = 0.0) -> str:
def _stutter_replace(self, match: re.Match, strength: float = 0.0) -> str:
match_string = match.group()
Commiting suggestions.
It seems like this issue has been abandoned. I would like to implement it if there are no objections.
@WillDaSilva
If @ToxicKidz isn't interested in continuing their PR that sounds fine, although I think part of the reason that PR stalled is because there wasn't much of a conclusion on what the implementation should be.
Do you have a plan for implementation? Do you want to continue @ToxicKidz's PR (in which case do you have a plan for addressing Numerlor's comment there) ...
@wookie184 On second thought I would rather not implement this anymore. Sorry for any trouble.
@ToxicKidz will you be able to finish this, or should I put it up for grabs?
Sorry for the delay, I was stuck on the implementation for the PR and then I forgot about it. I'll try to finish this PR as soon as I can.
@wookie184 On second thought I would rather not implement this anymore. Sorry for any trouble.
No worries
RE handling extra stdout from the user, why do we need to support suppressing it? I can't think of any reason timing code should need to send anything to stdout, so we'd probably be fine just having the command error if there's anything more than the timeit output imo.
That makes sense, I guess I should just put a warning about printing anything to the stdout.
Do you have a suggestion? It is a tuple, but the answers are given in the form of tuples anyway. I'm not sure what else you would display it as.
Before, the embed started green and turned red when the game was over. Turning red is no longer possible, so I figured I'd unify the colors of the embeds.
It was possible before a discord.py update, so I'm guessing a discord.py limitation. I don't have intimate knowledge of the Discord API though.
The end_game function has two purposes: sending a scoreboard embed and editing the flights-found embed. That line is the culmination of the second process, so it's grouped with the other lines involved in that process.
So just to make sure I understand this you want to rename the current command to voicemute and this new one voiceban? But besides the naming of the command I agree that this is useful and I would be happy to implement it if you don't have the time to.
I wouldn't really say it is a big issue no. A table usually refers to a dictionary though and LUT may not be the most common acronym you can find so-to-speak (at least from my experience)..
If you would like to keep it as EMOJI_LUT then that's fine but changing it to EMOJIS could make it more clear. Especially considering you're using it with random.choice() later on.
[python-discord/bot] Issue opened: #1850 Always create a log if filtered messages have attachments\.
Currently, when creating a mod alert, the bot will not create a log of the messages if there is only one message involved, and will display it in the alert embed directly instead.
That should not be the case when there are attachements. If there are any, it should always create a new log and link to it instead of trying to display the contents of the message (which might not exist).
Example of an alert with no content (because it's a single message with only attachments):
. -->
Closes #819
Description
Added some further information in the error message as to what is accepted as a target message to bookmark.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to t...
GitHub Actions run 1300551630 succeeded.
LGTM, tested and seems to work smoothly
42d3e10 Ignore bot messages for spooky react - gustavwilliam
[python-discord/sir-lancebot] New branch created: spooky\-ignore\-bots
Spooky reactions are now limited to users.
The bot previously only ignored its own messages, but now ignores messages from all bots. Even though we love our bots, they simply aren't supposed to be a part of this Halloween tradition. Sorry Xith!
GitHub Actions run 1300598326 succeeded.
[python-discord/sir-lancebot] Checks Successful on PR: #891 Ignore all bot messages for spooky react
GitHub Actions run 1300600660 succeeded.
[python-discord/bot] branch deleted: add\-get\-or\-fetch\-util
b9f41c5 Add get_or_fetch_member util - ChrisLovering
15a8e7e Migrate all Guild.get_member calls to get_or_fe... - ChrisLovering
7a9828b Mock fetch_member in tests that user get_or_fet... - ChrisLovering
6cf9f54 Rename channel helper to be consistent with oth... - ChrisLovering
e52db75 Add new poetry tasks for pytest - ChrisLovering
[python-discord/sir-lancebot] branch deleted: spooky\-ignore\-bots
Connected!
GitHub Actions run 1300607346 succeeded.
Connected!
GitHub Actions run 1300608829 succeeded.
2f0b421 Handle channel category being None in antispam/... - wookie184
[python-discord/bot] New branch created: fix\-hasattr\-check
The code already handled the attribute not existing (e.g from a DM channel), but didn't handle TextChannels not in a category.
This doesn't currently affect the server as all our channels are in categories
GitHub Actions run 1300631339 succeeded.
Merged this now as the current code seems to work well, although anyone can feel free to open a new issue/PR if they have ideas for further changes
Connected!
GitHub Actions run 1300674868 succeeded.
We could limit this command to only be run in the nominations channel by helpers, although not really important. This all seems to work well ๐
My reasoning for adding this as a task onto the loop, rather than awaiting it directly was so that the refresh loop isn't considered as part of the command invocation directly, this mostly matters for things like timing how long a command takes to complete,
[sir-lancebot] Branch topic\-command\-cooldown was force-pushed to `1bd844f`
GitHub Actions run 1300866412 succeeded.
GitHub Actions run 1300872348 succeeded.
[python-discord/sir-lancebot] branch deleted: better\-bookmark\-error\-message
GitHub Actions run 1300906120 succeeded.
Connected!
GitHub Actions run 1300908538 succeeded.
Whenever I invoke the .challenge command then try to pick a selection option I get This interaction failed. Not sure why
Can this embed clarify that an option was found and what it is?
Well tuples become (item, item, item, item) but we could format it ourselves. Maybe as item, item, item, item and item.
Looks good to me, it's possible there's a workaround for getting the previous behaviour working again, but it would require some looking-into, and I think this way of doing it looks just as nice anyway.
Oops, yes. I wanted to test it out quickly before pushing a small change previously and I forgot to put it back.
GitHub Actions run 1300972432 succeeded.
We've had a chat in admins and decided the roles to target for now are just the champion roles, we won't have an icon for moderators, helpers, media/forms team, help cooldown or lead roles. We'll discuss a contributor icon for a later date.
I'll update the issue text appropriately.
What's the reasoning for no help cooldown icon?
What's the reasoning for no help cooldown icon
We felt that people will just open channels to get an icon and the cost of moderating that sort of thing outweighs the benefit of having people assigned an icon for opening a help channel, especially since it's carried across the whole server, not just the currently active help channel for that user.
and the contributors icon for a later date?
We're discussing with the Core Devs about whether they would like a Core Dev icon (Core De...
The command can resolve to a user. What happens if you try to nominate someone off-server?
c689b99 fix: apply layers in correct order - vcokltfre
[python-discord/quackstack] New branch created: vcokltfre/fix/item\-ordering
The equipment layer is now applied before the wing layer
Before:

After:

This is my favorite PR in this repo.
[python-discord/quackstack] branch deleted: vcokltfre/fix/item\-ordering
3aed1b3 chore: improve efficiency of docker build - vcokltfre
[python-discord/quackstack] New branch created: vcokltfre/chore/docker\-improvement
- Removed installing git since it's not required (used to be used for cloning submodules)
- Using slim-buster for python to improve download time
FROM --platform=linux/amd64 python:3.9-slim-buster
lets do this to be nice to people on M1 macs that are amd64-challenged
1c384f7 chore: use specific linux/amd64 platform - vcokltfre
[python-discord/quackstack] branch deleted: vcokltfre/chore/docker\-improvement
GitHub Actions run 1301316480 succeeded.
Expanding from this issue, we should probably establish a standard stating which reliable sites should we use images from (or even store them locally as binary files).
[python-discord/bot] branch deleted: fix\-hasattr\-check
Connected!
GitHub Actions run 1301356372 succeeded.
It'll just work, I'll swap this around, so it check isinstance of int and then an else to catch Member & User
d444ebd Check cache for Members and Users - ChrisLovering
GitHub Actions run 1301427343 succeeded.
I think the information is more clear with the parentheses.
@Bluenix2 I'm not sure why you're getting an interaction failed message, nothing is going wrong on my end? Did you spam it?
I'm not sure it makes sense to nominate someone outside the server at all, but that's out of scope for this PR. Looks good otherwise ๐
b9f41c5 Add get_or_fetch_member util - ChrisLovering
15a8e7e Migrate all Guild.get_member calls to get_or_fe... - ChrisLovering
7a9828b Mock fetch_member in tests that user get_or_fet... - ChrisLovering
6cf9f54 Rename channel helper to be consistent with oth... - ChrisLovering
e52db75 Add new poetry tasks for pytest - ChrisLovering
[python-discord/bot] branch deleted: allow\-helpers\-to\-edit\-their\-own\-nomination\-reason
eeb70ef Allow helpers to edit their own nomination reason - ChrisLovering
77f76cb Force kwargs when calling helper util - ChrisLovering
0bd2f1e Block helpers from editing nomination reasons i... - ChrisLovering
d444ebd Check cache for Members and Users - ChrisLovering
bf8a52f Merge branch 'main' into allow-helpers-to-edit-... - mbaruh
GitHub Actions run 1302282937 succeeded.
Connected!
GitHub Actions run 1302292766 succeeded.
Yes I did, I opened a lot of views.
That said I realize now what's wrong and I'll test your PR again today.
I'll be working on this over upcoming days.
Current plan is to change L86 to the following, as discussed with Zig internally:
if any((
len(self.messages) > 1,
self.messages[0].attachments,
self.messages[0].count('\n') > a_reasonable_amount
)):
```Will do some testing to figure out what exactly `a_reasonable_amount` is.
Currently, when you try to edit the duration of a note/warning, it will give the error message ":x: Cannot edit the expiration of an expired infraction.".
This issue proposes that there should be detection for whether the infraction is a note/warning, and if so, then return a different error message stating something like ":x: Cannot edit the expiration of a note/warning."
Should just be a case of checking the infraction type before [here](https://github.com/python-discord/bot/blob/...
This is my idea for now:
- FastAPI microservice
- Bot posts every message in a help channel to this service
- This service manages storing to a database
- opt-out command in the bot, which posts to an opt out endpoint in the api, which erases all data on that user
- users opted out still have their message posted to the API by the bot, the API manages whether to store them in the DB or not
- This removes the need for any logic in the bot itself
- controlled access to the data...
More than the quoted user query? Maybe the self.headers[match] to show exactly what the link is taking the user to?
GitHub Actions run 1303415371 succeeded.
Yeah something like that. So that it shows that it found for example "wtf imports" or similar.
GitHub Actions run 1303800335 succeeded.
Wouldn't this be more appropriate for python-discord/API?
Wouldn't this be more appropriate for python-discord/API?
We don't have an "API" repository, and this is a site endpoint for which code would need to be added in this repository.
Wouldn't this be more appropriate for python-discord/API?
We don't have an "API" repository, and this is a site endpoint for which code would need to be added in this repository.
This PR looks good to me now. Two small points:
- Could you look into fixing CI for our tests to pass?
- Since we now have the model definition in two projects, it would be great to maybe add some form of reminder to the site pull requests about whether they update the model definitions in a way that requires an update here. I do not think we should put a freeze to model changes on the old site, at all. First off, it's hard to implement, and second we still want to be able to make mod...
This PR looks good to me now. Two small points:
* Could you look into fixing CI for our tests to pass? * Since we now have the model definition in two projects, it would be great to maybe add some form of reminder to the site pull requests about whether they update the model definitions in a way that requires an update here. I **do not** think we should put a freeze to model changes on the old site, at all. First off, it's hard to implement, and second we still want to...
90a9dfe Monkey patch http.send_typing to catch 403s - ChrisLovering
[python-discord/bot] New branch created: catch\-403\-from\-Typing\-calls
Sometimes discord turns off typing events by throwing 403's, so we should catch those
[bot] Branch catch\-403\-from\-Typing\-calls was force-pushed to `17d100e`
GitHub Actions run 1304822653 was cancelled.
GitHub Actions run 1304826072 succeeded.

