#dev-contrib
1 messages ยท Page 26 of 1
do it then
botstrap makes pybot easier to set up than lance now
I have to set seven variables myself????? ๐คฎ /s
we should figure out the emotes thing
app emojis
app emojis is true
I'll let you know when I've figured this problem out myself
trying to solve it for Monty
ok bot#3417 is now ready for review
hmmm i could add some basic config to it to add config for like ๐ข and stuff where it makes sense
https://github.com/python-discord/bot/issues/3374 can be closed btw
crazy
my thought a while ago (and this was probably pre-app emojis was):
- A) we host a bot that people can add, it adds all the emotes from the emote servers and then leaves
- B) we host a web app that has people OAuth2 in, paste a bot token, confirm they own the bot token (or are in the team that owns it), confirm they have perms in the target guild and then add the emotes using their app
i am unsure if either of those are good ideas, but they'd be fun
they would be fun
mainly my idea is thinking what's the best way to support integrity checking without
- crashing
- making startups way too long
at least with bot we have botstrap and if we turn it into a cli we can add a sync app emojis command
for monty I've been considering a sort of complicated thing using github and last_changed
you have the current hash in the bot environment, right?
and comparing the ids of all of the emojis to api.github.com/repos/{owner}/{repo}/commits/?path=assets/emojis
Is there an example and filled out .env.server?
I don't know what format pydantic wants the webhooks envvars in and the contrib guidelines are vague about it
kat is this for the internal test guild?
#Webhooks
webhooks_big_brother__id=1430330254509211691
webhooks_big_brother__channel=1430304585095970951
webhooks_dev_log__id=1430330295152017549
webhooks_dev_log__channel=1430304584198525126
webhooks_duck_pond__id=1430330306732359820
webhooks_duck_pond__channel=1430304584626077710
webhooks_incidents__id=1430330317696139305
webhooks_incidents__channel=1430304584382939261
webhooks_incidents_archive__id=1430330335199232052
webhooks_incidents_archive__channel=1430304584382939262
webhooks_python_news__id=1430330340710416496
webhooks_python_news__channel=1430304583996932110
I have my own test server, I jsut want to know the format
use botstrap, it will create these webhooks for you and set that up
this is why i was wondering #dev-contrib message
I'd rather not. I'm aware of botstrap.
fair
if you have a reason you'd like to share, I'm curently working on both botstrap and the contrib guidelines about this very thing, so if you have more to add, I'd appreciate it
I have had my server forever. It's setup how I like it. I would rather stab a fork into my eye than have to migrate.
I just want to know the webhook config format that pydantic won't bitch about
Note to self: keep forks away from Kat
I just sent it above
Yeah that should be right
Yeah, that's still not enough information for pydantic looking at the docker logs

wild. That's generated with botstrap
what does pydantic want?
(what's it upset about?)
Put it in .env if using docker
and it keeps going. I have the channels defined above and I figured pydantic would be able to pull from that
Following the contrib guidelines tells me to build the .env.server manually
I'm going to follow the guidelines
volumes:
- .:/bot:ro
in theory this should mount .env
might say that, but I have a PR in the works that changes it to .env
I also have a 3 year old test guild
can you provide your webhook config here?
It's what you have posted above but with my own webhooks for my personal testing server
Okay, can you post what you have anyways?
It's only the values that change, so I don't see the need
Then I don't know what to tell you. it works for me
I'm posting here to ask the core devs as well, not necessarily specifically you
you do need to make sure that webhooks_big_brother__channel is also set
the double __ is important
So that part is what I did not know and what the contrib guide does not detail.
ahh yeah pydantic attributes
we should call that out with an admonition
it is not intuitive
Good lord I miss our old constants and config.yml setup compared to this
Can pydantic not reference to me setting it up earlier? Do I need to list the channel ids twice in 2 different places?
I'll see if I can add it joe
It's this
https://github.com/python-discord/bot/blob/main/bot/constants.py#L19
Because Webhook is a nested class here, you have to use the delimiter to move from _Webhooks into the Webhook
bot/constants.py line 19
env_nested_delimiter = "__",```
ugh
if they're in the same env file you can reference later with $variable but the model I would guess does not automatically look elsewhere at the channel constants
i do think the fact we're using __ is kind of a sign that maybe we've gone a little down the wrong path with configuration
class _Webhooks(EnvConfig, env_prefix="webhooks_"):
big_brother: Webhook = Webhook(id=569133704568373283, channel=Channels.big_brother)
this code requires channel to also be provided
given we only seem to use channel to create it if it doesn't already exist, and that is already mapped to something.......
we could have supported toml or even the old yaml files ๐ https://docs.pydantic.dev/latest/api/pydantic_settings/#pydantic_settings.TomlConfigSettingsSource
yea this is kind of what I think
and I think maybe that's the direction botstrap should go -- I think something like ```toml
[webhooks]
big_brother = { id = "1430330254509211691", channel = "1430304585095970951" }
is obviously cleaner than the `__` stuff
fixed
we only need to set the ID now
want me to seperate this from the other PR?
nice one
nah if you're changing botstrap this is fine to go in -- just make sure it has a decent commit message
all right
I also made an issue about cli but I didn't want to feature creep this one
noice
yay
its still a nested model for now because I don't want to break existing configuration
i think nested is fine -- i just think it needs to be something that's not an env file
which makes maintaining back compat down the line easier
yeah
I won't add support atm but we can consider moving to toml files
Problem with that is if we want to support
- autogen file
- env file
- user set toml file
which is a lot of configuration files lol
so botstrap can still be a first class configurable way to set the configuration
but then on that side, if we do switch to toml we can probably update that one configuration in place with tomlkit
and put autogen in the same file...
though it is nice to have "configuration file that my autogen will never touch" and seperation that way
bot#3420

and is nomination_discussion also a thread?
thanks, chose some twemojis to use as replacements:
that should be enough for now to provide some coverage
it sure fixes this finally
no that's a channel
its missing in the template
are you able to add?
also, is the template of the test server or is it a different server which literally exists for the template?
yea can do one sec
should be sorted
i believe it's just the one of the internal test server -- which is what I just updated lol
so if it's not that
then yikes
ye i see it too
i had to reload my client though lmao
it literally caches it forever
@patent pivot yay it worked!
okay so it may create roles in the wrong order
Discord pls
!ot this channel is for contributing to @pydis projects, not for other projects. If you're wanting to share a project with others, I recommend an off topic channel
#ot2-never-nesterโs-nightmare
Please read our off-topic etiquette before participating in conversations.
I have just realised that with an emoji regex I can actually add app emojis to botcore
except why would i bother doing that when i can just.... upload the emojis to the guild
lol
by using the peps.json api we lose the easter egg ๐
on the other hand, maybe its a feature that it doesn't show it in the embed
Should display names be counted in the name filter, even if the user has a nickname set?
hmm probably not
well
hmmmm
I will ask internally
the current behaviour is that they're not counted?
ye not included #ot0-psvmโs-eternal-disapproval message
whups didnot mean display name, meant..... whatever that user field is again
...whichever field is the User Display Name, not to be confused with the server/guild Nickname or the Username
nice we don't have a short link just for contributing
Guidelines to adhere to when contributing to our projects.
huh, you're right
(arguably contributing.md should be it)
maybe there's a reason why it doesn't...
CONTRIBUTING.md?plain=1 lines 1 to 3
# Contributing Guidelines
The Contributing Guidelines for Python Discord projects can be found [on our website](https://pydis.com/contributing.md).```
eh fair
seems that might benefit if it pointed to https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/site/ or https://pydis.com/contributing-site
A guide to setting up and configuring Site.
A guide to setting up and configuring Site.
yea I think we should probably link to both the guidelines and guidance from within those files
#dev-announcements message congrats!
btw the slash commands issue is on hold for now(I'm very busy this week), I will provide updates later. Thanks!
!remind 3h open issue / discuss about "Click here to delete recent paste" having a context button or link
Your reminder will arrive on <t:1761194770:F>!
Here's your reminder: open issue / discuss about "Click here to delete recent paste" having a context button or link
[Jump back to when you created the reminder](#dev-contrib message)
...how do renovate and dependabot rename a pull without causing an event to show up?
This PR contains the following updates:
Package
Change
Age
Confidence
ruff (source, changelog)
^0.5.1 -> ^0.14.0
โฆ
I've never seen that before
what do you mean
there are rename events in that log
rename events might only be shown to repo maintainers?
hahaha
I wish GitHub exposed discussions on the rest API ๐
And organization level discussions
meta#93 ๐
...tbh I think lancebot has a GitHub token? We could implement discussions using the graphql API
I just noticed an issue within pybot on https://discord.com/channels/267624335836053506/1431166143883640934 where it didn't automatically close the forum post when OP left the server, eivl had to close it himself
that's not an issue, it's intentional behaviour
the thread would still timeout after the regular wait period (1 hour from last post).
in the event a user leaves we put the message in the channel to make folks helping aware a user has left, but we purposefully don't close the channel in case people are still having a discussion / a wider conversation has started there.
well fuck, thought I noticed a bug
Yeah sorry, we don't write bugs around here
404
I believe a functionality was added to snekbox where you can write local files
Is it enabled by default in the docker image?
I'm tempted to use snekbox in a different project to evaluate Blockly scripts
Those files are written to a tmpfs IIRC
I think so yes
Hmm I'll have to look at how to inject a custom config then
@patent pivot May I get the hacktoberfest-accepted label on sir-lancebot#1702, site#1567, bot#3413?
done ๐
Thanks!
I'll fix 3413 soon and mark it as ready but covid vaccine took my energy the past few days and now I'm behind on my classes
I really do want to add pyright to bot.... So much so that I'll probably add it to my local files at minimum lmao
Unfortunately, fixing typing issues can sometimes result in new bugs
what do we actually get from adding type checking to CI?
if we do it i think we do it in a non-mandatory way
supporting github annotations is a nice feature that would highlight a decent few things especially if we are baselining it
especially if we generate that baseline based on the main branch, to very specifically only highlight new typing issues raised by a PR
maybe we should use mypy instead and just diff the results or something like that?
basically seperate it out of the lint workflow into it's own thing that:
- runs, generates a baseline on current main
- checks out PR
- runs again to highlight issues and add them as annotations
- does not fail the PR if problems are reported
(there's a mypy_baseline package, haven't used it)
main reason i was thinking basedpyright is it's probabyl closer to the pylance that a lot of folks already have in VS Code, I think most of our contributions probably come from people using that
but also basedpyrgiht supports github annotations natively
I would use mypy I don't really care
oh, mypy doesn't have this?
not natively afaik
This is so minor (to add support for) and so cool too
(genuinely it's just GITHUB_ACTIONS==true use a different output mechanism)
pyright/basedpyright will add on the order of a minute to the CI time
assuming it's only ran once and not also on main
actually no, it's significantly faster ๐ค I must be thinking of a different project
yeah, it's about 10s on my computer
When can we move botstrap to its own repo? ๐
I genuinely want to unify all of the configurations (backwards compatible) and then make botstrap able to generate all of the configs lol
yeah -- but remember we'd run it in parallel anyway so it'd be negligible compared to the docker build step
Sir Robin operates a bit differently and looser compared to other bots because it supports a fairly specific and time-dependent need
could put something in core to try move towards unifying it.
i think our crazy env files are getting a bit silly
Real
Also I am aware of the Advent of Code changes. We're handling the adjustments to that internally and when we get a bit closer.
I made an issue so it would be publicly tracked, as I wasn't sure it was known. I saw a lot of advent of code issues from 2024 or before that I also want to see about tackling if you'd like help
There are other things associated with Advent of Code that extend beyond just the bot, so it's being tracked and handled elsewhere until we get closer and have a confirmed plan on how we want to approach it.
Even issues like sir-robin#107?
? I'm not sure what you're asking. I'm just letting you know that we are aware, have been aware, but are tracking the aoc change separately because there are other parts of advent of code that are not associated with Sir Robin that we also need to deal with.
I'm asking if I can make that change above, not the other ones.
There's a few AOC issues I've been interested in implementing: sir-robin#65 sir-robin#107
That was not clear since the issue hadn't been commented on. I'll take a look at the issues in a week or so and triage what's still relevant, what's not, and what our approach is going to be.
Idea @patent pivot: if we do adopt basedpyright in a non-intrusive way, we could adopt some of the rules in an intrusive way because violating them is Just Wrong
- error on
reportGeneralTypeIssueswhich would catch nonsense annotations like:
def incorrectly_annotated(banana: 69 = 420) -> any:
...
- error on deprecated typing aliases like
typing.Callable. Because ruff's UP006 rule is buggy and does not catch all of them. - error on
reportMissingTypeArgumentto require all generics to have type parameters, likelist[Whatever]orlist[Any]instead of justlist, anddiscord.Context[OurBot]instead ofdiscord.Context reportUnboundVariableandreportPossiblyUnboundVariable: yes, this thing
bot/exts/help_channels/_channel.py lines 194 to 199
try:
# Fetch the post again, to ensure we have the latest info
post = await get_or_fetch_channel(bot.instance, post_id)
except discord.HTTPException:
log.trace(f"Not closing missing post #{post} ({post.id}).")
return```
Hadn't commented because I didn't see a label approving the issue, I normally wait until they're approved for that
But ye I'll go comment now
Like I said above, Sir Robin operates differently than our other bots because of it's highly specific usage and close ties to the Events Team. Pretty much all issues created are good for people to claim, comment with their approach, and things move forward from there.
If there's an issue that I think is a no-go, I'll be pro-active about it.
Sounds good
Yeah fs
Do we want to implement type checking on lance first before we implement on bot?
Or bot before lance
power move: abandon basedpyright, launch proprietary VSCode with Pylance in it in CI
If the screenshot is more than x% red color, fail the pipeline
-# and we set the theme to hot dog stand
enqueue red alert theme
Overcomplicate the configuration by putting it all in pydis core, and allow bots to extend it further... Hmmmmmmm. .... There has to be a good way to do this. Though yeah, for the most part it IS duplicated code on three or more repositories.
The issue with putting it all in one place is now there's no easy way to be tracking the minimum number of config variables for a bot
And I think that latter detail is significant
ehh
Eg if we have a channels object that contains all of the channels of pydis, there's nothing stopping lancebot from using more than the few variables it uses now and leaving contributing out of sync again
Even if there's just a diagnosis tool that can be used to see every config variable in use by lance/robin/pybot
the actual config needs to remain in the bots obviously, the parsing can be farmed out to the TOML and env modes of pydantic settings, the thing that we can try generalise is seeding a discord environment based on that config
I suspect we might be able to do some smart subclassing of pydantic field types to do that
something that appears transparently as an integer when fetched as config but can be read as a channel or role or something by botstrap
and then we just have dev_required=True on those things and botstrap only creaets those it needs
or even some sort of typing.Annotated thing
Does it need to remain in the bots itself? Defaults are provided for every role and channel variable that match the pydis server. Bot and lance and Robin have their own minimal roles and channels that are defined in all three bots, with bot having the most extensive amount.
Pydis core could have that complete configuration in it
we aren't going to do that because then updating config means updating a dependency on the bots
it is already a pain sometimes when we make a change to core we want on all bots related to a constant or osomething and have to then go and bump everything
I mean you could override it with a subclass but that becomes annoying too
then there's no real point in putting it in core
I was just thinking for channels & roles, not for everything
Cause then you can move a lot of the redirect output helpers and stuff to pydis core
yea -- it's not a bad idea but my thoughts are just that we have enough bespoke stuff that we're going to end up with a situation where our config is even more fragmented than it currently is
having config pulled from two places, one of which is a dependency, is worse than just having a local version that's got duplicated values
That's fair
But this is worth considering I think
yea the question there is that we don't need/use those utilities on other bots
there are things that we have copied between but generally we've been quite good at moving stuff to pydis_core now
Don't we use it on bot and lance?
Right I'm confusing identical commands having different checks
There was a check I thought on more than one, hmm
Ah well.
Theorized procedure:
- update botstrap on bot with existing PR
- draft updated constants to have dev_required fields and whatnot. Use init subclass and subclass from a custom base model and field class defined in bot_core which use a global registry to save all fields created: this allows botcore to create a configuration file from the constants defined in the consumer of botcore
Eg init_subclass checks all fields in the subclass to get the fields with dev_required=True so it can set those variables
We can probably move botstrap to pydis core and add a cli entrypoint
priority before that is probably adding some sort of toml support again to stop the env nesting madness
yeah
bot#3417 cleans up the botstrap code but I won't be making other changes to botstrap until its merged
since rewriting to use toml requires updating each line that writes to config_str
TIL Discord added clickable email syntax: hi@pydis.com
<hi@pydis.com>
Email and phone number markdown uses mailto: and tel: URI schemes respectively that can optionally be prefixed (e.g. mailto:nelly@discord.com). Email markdown supports headers, values must be URL Encoded (e.g. <nelly@discord.com?subject=Message%20Title&body=Message%20Content>).
๐
dear god
(I appreciate it was f-strings before which is not correct, but if you're adding some f-strings and some %s strings we may as well unify).
@floral lion what does this mean? You'd rather have %s or f in logging?
wrong ping -- but basically if the file is already using f-strings then probably stick with that, else move everything to %s formatting
the proposed changes appears to have a mix
on main it's currently just f-strings
thoughts on enabling https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
An extremely fast Python linter and code formatter, written in Rust.
potentially -- for now i'm more bothered about mixing multiple styles within one file
Aight will make them all %
there are still f-string statements in that file if you were trying to update all of them
I am also not sure if you've addressed all the review feedback I've left yet so just ping me once you have done -- but the webhook one needs addressing as well as the general over complexity of that with statement (needs breaking into functions)
& there are still a couple of audit log reasons which are unnecessarily verbose (e.g. including the name on emoji create is not very useful, it's always going to appear alongside the emoji name)
I haven't, I will rerequest when done
Been breaking it into a botstrapper class (bikeshed the name after I commit it smh)
I don't think I saw any but I also may have not pushed that yet
Ah yep
https://github.com/python-discord/bot/blob/57c92b0cdb3807dff58a87f39b57132b2f8f1001/botstrap.py#L171
I haven't pushed that
botstrap.py line 171
log.info(f"Server {self.guild_id} has been successfully updated to a community.")```
no worries -- just saw some force pushing and wasn't sure
@patent pivot that's change fr
big ol' "just change everything"
rather than functions just went with this cause it makes bot#3420 easier to manage in the long term
Lmao
#dev-log message
Oops
All good, I like rage baiting Joe too
hi, there
I am looking for a developer who can implement to login with FB, apple account
Still..
Just fixed it
-# in a parallel universe
holdon
all of this testing I've done and that code is useless?
in a new environment and wow
get this with no config
these lines aren't even used
because pydantic parses the configuration immediately when bot.constants is imported
๐คฃ
welp guess I'm going the long route and filtering the pydantic validation exception
otherwise i need to move load_dotenv above the import from bot
And I'm planning ahead for toml: if I have to change something related to dotenv handling then I'm making it not care about the loading method
....now I remember that when I was making user-facing code using pydantic I went with attrs and marshmallow
Data validation with useful errors for the end user is tedious
Yay fixing all validation errors with custom
https://docs.pydantic.dev/latest/errors/errors/ and some constants.py refactorings
@patent pivot I think implementing this to solve #dev-contrib message is probably large enough scope to be a second pull, as it will affect constants.py so I'm just gonna leave a comment documenting why we depend on load dotenv and so on so on
didn't we solve that by having the partial model thing
that is why there is a webhook change in your PR right?
Solve the underlying error yes, the cryptic error messages no
If I want to fix a single regex pattern, should I open an issue for it or can I just immediately make a PR?
uhhh if it's a bug just open a PR
where is this?
oh good god i broke discord again
just accidently bypassed the 10 webhooks per channel limit
spoo|y
pipe
I think don't fix. Leave the easter egg 
spoo||aaaaa
yk, I've been thinking of this as well
@lyric temple https://github.com/python-discord/sir-lancebot/commit/cacb8a287846cb3485114cfc176e66815d7e7bd9
named and shamed
lmfao great relevant issues matiiss
thank you thank you
i think it's a funny bug but the chances of it being discovered as an easter egg are low and we should make more fun easter eggs
doot! batwomen are a spooky danger to skeleton. Have you made a jack-o-lantern out of a pumpkin this halloween?
easter eggs that only work during october are THUMBS DOWN!
we should also add plural to some of them
and maybe use emoji to set these
cause this is unreadable \U0001F3F3\uFE0F\u200D\U0001F308
when we already depend on emoji
!pypi emoji
forgor we don't have ff-bot on lancebot 
tbf, the comment was pretty intimidating
this is why i use the github cli for my issues and pulls
it lets me open ones without the template ๐คก
we should just use character names
i was thinking this about the botstrap PR also tbf
i kind of hate unicode in source code
I'll make sure to reference that same screenshot and discussion for all my future regex PRs 
!e ```py
print("\N{JACK-O-LANTERN}")
:white_check_mark: Your 3.14 eval job has completed with return code 0.
๐
lmfao
:white_check_mark: Your 3.14 eval job has completed with return code 0.
๐ณ๏ธโ๐
!e ```py
print("\N{WAVING WHITE FLAG}\N{VARIATION SELECTOR-16}\N{ZERO WIDTH JOINER}\N{RAINBOW}")
:white_check_mark: Your 3.14 eval job has completed with return code 0.
๐ณ๏ธโ๐
๐คฃ
yeah its a bit.... long
devops repos have it
hype
but it's readable
can do /merge and it'll do a fast-forward merge so your commit signing gets retained
ah nice
!e
print("\N{BANANA}\N{DUCK}")
:white_check_mark: Your 3.14 eval job has completed with return code 0.
๐๐ฆ
oh yeah that reminds me that python 3.14 and 3.15 don't have commit signing on their releases
long for that specific instance but generally I much prefer it to unicode code escapes and actual unicode symbols in source files
agreed
non-ASCII unicode symbols*
no you don't
not another rickroll
this is perfectly fine code
ignore the red, I do use it
what does the str do?
there are still outstanding review comments
yeah I never said i finished them just that I updated it :^)
lol
also do you prefer the reviewer or the pr author to mark conversations as resolved when they've made the changes
ehh I don't mind really -- if it's been addressed exactly as suggseted then mark reviewed
btw, I wanted to create an issue on the repo, but ig I might as well ask here first, is lancebot not supposed to include embeds in bookmarks?
or I guess specifically images
This is my personality. An annoying nitpicking mosquito. Unfortunately I am not blessed with above average intelligence intelligence, so I'm not eligible to work in projects that desperately want this role, like nuclear reactors and foundational software.
You say something like "ord returns the ASCII value of the provided 1-length string" and you will hear the high-pitched buzzing sound even though I am 2000 km away
!duck 1432906604432326756
!duckify 1432906604432326756
thanks man
that one made me laugh
slowly but surely i will turn duck-pond into sean-in-devoops
Nice try. However, this is a continuation message that requires the crucial context that I identify as a mosquito.
what about it
arguably lance can use message forwards for bookmarks now and lessen a lot of the complexity
nothing specifically just a lot of dense methods
what about dense
but i've been writing fastapi apps for the last few months so maybe have got used to tiny methods
ah complex
just things like get_channels etc have a lot going on
also i will forever leave a review comment where comments don't have a capital letter
comments should always be fully formed sentences
if only we could get computer to point out formatting mistakes
that makes sense
thanks, i appreciate this
i Really Do
stupid question: why are we depending on httpx and aiohttp
my guess is sync cocde
hmmm
aiohttp is used by the discord api wrapper y'all use
yeah
we should Do Something About That someday
no i'm not refactoring it to use aiohttp this pr
yea i'll do it someday
genuinely a great piece of software
yeah it's nice
but I pass a custom transport in order to use aiohttp over httpcore
so I have httpx as my caller and then I just use my aiohttp session I use for other things too
its so useful
can't believe the httpx dev wants to split it into sync and async projects
people in 1995: we gotta prefer composition over inheritance you know...
botstrap: we inherit from httpx.Client 
sorry, I'm just adding unnecessary comments
joe i'm not rebasing and changing my history any more at this point
no we shouldn't though
i think i'm going to squash it excluding the change to constants anyway so don't worry about it
yeah fair
if you look at botstrap its actually somewhat close to toml support but not in this pull (because toml support requires lockstep with contributing guide which needs a pre-update before toml support)
dict !!
means its already ready for tomli_w.dump(s)
though possibly tomlkit for comments and supporting user provided config and preservation of format
@celest charm @patent pivot can i yeet the special handling of forum channels? I haven't managed to make a server without forum channels enabled
I think so, yes
sounds reasonable
now it rolled out everywhere
that cleans up a lot of the other special handling code
i suppose if you add that upgrade script in the future it might be worth handling the case where the expected channel types are different
however
i think that's a fair case where deleting the channel/telling the user to delete the channel and re-run works
upgrade script in the future will be entirely reconfirmation on everything
but upgrade script is after additional CLI refactor -> migration to pydis_core
yea
also will probably want to use click for pydis_core
given we only need the cli in dev it can be an extra
yea i think we need to probably sit down and specify how that all works a long time before any PRs start
specifically what ends up living where at the end of things
tool.pydis_core in pyproject.toml moment
I see nothing but provided value.
Only six for a shirt?
what is this in?
Hacktoberfest!
I asked Joe if I could have the tag lol
I just wanted the shirt (it's a very comfy shirt)
it's not a python discord project
we didn't explicitly tag issues with hacktoberfest
but merged and approved PRs count to hacktoberfest
so 6 PRS from a singular project or combined between a few
lol I have 3 PRs for pythondiscord
lemme see if I do another one for the / commands issue.
in like a few days
has to be in the next 2 days if you want it to count hahaha
yes ๐
imma try anyway
?
I prbably have PR's in other OSS projects
I have another PR in Kimi K2
so total of 4
any project on github
you can just login to hacktoberfest.com and it'll tell you
Oh the PR's should be between oct 1 to 31
the old PRS are in september
oh lol
@patent pivot Isn't the change as simple as
- @commands.group(name="docs", aliases=("doc", "d"), invoke_without_command=True)
+ @commands.hybrid_group(name="docs", aliases=("doc", "d"), invoke_without_command=True)
seems to not work. Is there something else that's causing it not to work?
no because we talked about how we should support autocomplete for symbols etc.
we are adding slash commands to make the experience better, not to have it be the same
i am unsure why it may or may not be working -- do you have an error?
nope, it just doesn't show up
hmm
that seems more likely a problem with syncing slash commands then
i can't remember how/if we do that reliably in dev
ideas?
not sure exactly -- we should sync commands to the guild that you are using for development https://github.com/python-discord/bot-core/blob/74072b3709d87dc811a4972aec1ef172101e49bf/pydis_core/_bot.py#L174-L178
pydis_core/_bot.py lines 174 to 178
async def _sync_app_commands(self) -> None:
"""Sync global & guild specific application commands after extensions are loaded."""
await self._extension_loading_task
await self.tree.sync()
await self.tree.sync(guild=discord.Object(self.guild_id))```
make sure you are restarting your discord client between running the bot and once it finishes syncing because this is probably a local issue
you have to add the label cause the topic isn't added to the repo
but when you add the label its automatically accepted even if not already merged
in other words you just need to open + get label in next day and a half
ah
btw I have 4 PR's open in a few hours somehow
I can open like 4 more tmr
and make a maintainer give me the tag
can you add it to a draft?
maybe I could make a [WIP] Docs slash command PR?
@patent pivot would you add the tag?
I mean don't open it if it's not ready and is just going to be commit spam getting it to a point where it's ready
I mean I don't have a working demo, Though I could commit [this](#dev-contrib message) ? what do you think?
uhh, maybe? if you've got nothing that works and that's not guaranteed to be the way to implement it I'm unsure, we might end up not being able to use hybrid commands here etc
for example !d is a group but we don't want it to be for the purposes of slash commands probably
Ill make aPR tmr, and we can go over it later. ok?
sure -- but don't open it for the sake of opening it, because your change above is not correct
ok listen-- botstrap was ready I just added more features each day
smh
-# and then a few more
-# and then another refactor the next time I looked at it
I mean tbf I thought it was done until I reviewed my own code after joe's comments
@patent pivot bot#3428 Can you add the tag?
I'd rather see some sort of actual attempt at the solution? As mentioned above, we cannot use hybrid_group here and at the very least it'd be good to see something functional.
We stopped participating heavily in Hacktoberfest because of the number of PRs like this at a volume that was unmanageable.
I will have a think about it but I'd rather you take a lower hanging issue with a quicker solution and actually PR a fix than PRing a line that's not the solution to the issue at all.
As I said above, don't open this for the sake of opening it. This PR isn't even passing the tests.
& if it's a WIP then open it as a draft
at the very least before adding the label I'd be looking for something functional and that actually passes tests, not a one line change that's invalid
Understandable, Ill look for other issues.
@toxic wren how good are you with regex?
bot#3415 is an easy-ish regex one that just needs to remove (?:C\d+)? from the provided urls, see the issue content
bot#3425 likely requires internal deliberation around how to allow attachments more than 6.
testing in another server, it seems like a single message with 10 attachments can take the entire window at once?
not sure if we want to allow that tbh
not that good, but I can try to take on bot#3415
Depends on the attachment type, images should always be coerced into a gallery view now (and the bot can tell whether they're images from the file type)
weird, might be bugged or something? (just sent a bunch of images from discord + a random game I had saved - that is all one message)
good lord thats cursed
how big is just one of them? presumably the difference between the 3x3 grid and one isn't as big as the 3x3+1 above
Please react with โ
to upload your file(s) to our paste bin, which is more accessible for some users.
sweet
the 3x3+1 is over double just one image
either way there's no flaw in 10 in one IMO. At the very least, it probably shouldn't time a user out for 10 attachments the first go, but maybe the second?
like the @here filter
yeah we probably shouldn't time out
but i don't know that allowing all 10 attachments (image or text) is a good idea
hm
so
the uv lock enforcement changes
(for good reason) now cause all dependabot PRs to fail lol
interesting
i take that back
apparently enabling beta ecosystems uses a version of dependabot uv support that does not support lockfiles
cc @vale ibex you may find that noteworthy for other dependabot repos we have using uv
Ah nice
at some point you had to enable it for uv support at all
and now it breaks with it, great stuff
excellent features from github as per usual
4
another got merged and maintainer forgot to add tag or did not read the msg
that's fine
they count if they get merged
iirc
oh wait no yeah it does need the label
interesting
seems a bit unclear from this
time for bot on 3.14
Wait for 3.14.1--------
It needs label if repo doesn't have hacktoberfest topic
there's not a huge reason to hold off is there
Hold off for Patience?
i haven't seen any major bugs reported in 3.14.0 that seem to be affecting us (going off the local build)
yea but i want to do a wider bump of dependencies and uv version etc. which doesn't really need 3.14.1 to come along, and when it does it should be a one or two line change
we automatically adopt patch versions anyway
we pin to minor
Dependabot pip support is different from uv ecosystem
so 3.14.1 will just happen when it is released
that's not what's happened here, having uv in the beta ecosystem supports less than the uv in the regular dependabot ecosystem
Pip bumps project.dependencies
uv ecosystem bumps uv.lock versions
Ah
Because beta was never bumped lmao nice
btw @fallen patrol
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/joe/Projects/python-discord/bot/botstrap.py", line 476, in <module>
changes_made = botstrap.run()
File "/Users/joe/Projects/python-discord/bot/botstrap.py", line 469, in run
changes |= self.write_config_env(config)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/Users/joe/Projects/python-discord/bot/botstrap.py", line 425, in write_config_env
with self.env_file.open("r+") as file:
~~~~~~~~~~~~~~~~~~^^^^^^
File "/Users/joe/.local/share/uv/python/cpython-3.13.7-macos-aarch64-none/lib/python3.13/pathlib/_local.py", line 537, in open
return io.open(self, mode, buffering, encoding, errors, newline)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '.env.server'
testing your PR
obv creating .env.server as an empty file fixes it, but doesn't check for existence right now
maybe a macos thing lol
cheeese
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'https://discord.com/api/v10/applications/@me'
hm
i should really update raise_for_status
pushed
noice
remove this
just remove it. It uses project.requires-python if this isn't defined
or make the pr and let me comment that for the coauthorship credit ๐
hahaha it's removed in my local version
then I'm saving the other comment for when the PR is made 
have to figure out not caching in a property.... hm
why not just use a method?
yeah it was easier than i thought
but functools.cache would add complexity because I need to manually update the cache
hmm
not necessarily
oh i guess if you want to not refetch next time
but you can just .cache_clear() or whatever
interestingly i found a genuine problem between 3.13 and 3.14
cool
Fixed
This is why the delay
Lol
cool so pytest-xdist now hates our mocks
Side question: when is a truly unbounded cache a good idea?
as in: @lru_cache(maxsize=None) instead of e.g. @lru_cache(maxsize=1_000_000)
cool so it's actually pytest-subtests
0.15.0 breaks with the DumpErrors
We noticed a regression between pytest-subtests 0.14.0 and 0.14.1 when using it in combination with pytest-xdist. When executing the following snippet with pytest -n 1 test.py: import unittest from...
Good to see the markdown tests doing their job, markdownify loves their breaking changes lol
Or .cache which is inherently unbounded
no i mean in some cases I need to set the cache object through a different method
yea i figured that after you said it -- when you do the patching etc. and refresh the object
patching to app info returns the updated app info payload which should replace the cached object
and creating channels in botstrap upgrade could be added to the cached channels but I've opted to not do that on account of depending on the order of cached channels
why do you pin every dependency in pyproject.toml and not use the lock file as.... a lock file? @patent pivot
dependabot do that for me 
but basically because we almost never want to automatically adopt any new versions, even patch versions, and so it's easier to have dependabot handle the upgrades and then look for stuff with uv tree --outdated --depth 1 every now and then (like now) for wider upgrades
Yeah that was what I meant. What's the use case for an unbounded cache? Seems like a bad idea
yes they all have the hactober label, none of the maintainer put a "accepted" label, they just merged it
oh well that's fine then
lets gooo
if it's in a hacktoberfest labelled repo and merged then it's accepted
something like that yea
assuming they haven't gone over 10,000 people that have claimed a shirt
I heard in the official dicord that they "don't check the PR's", they just wait for a week and if the repo is not disqualified then it is accepted
Im keeping my hopes up
whew that was a lot of work for 2 days
atleast I can enjoy Halloween
THIS EXISTED?
yes?
i got a code but i haven't redeemed it hm
yeah it's the only reason we pin versions like that lol
maybe I should do that
see I actually got about 50 from https://gh.arielle.codes/monty but i wanted to do it right and get my 6 from an org i'm not affliated with
yeah true
we need to photoshop your face onto this
i decided hacktoberfest have done enough overall harm to OSS repos in the past that i didn't care to nab a t-shirt
oh lol 3 of mine are from my own repo, I made the PRS like on mid oct without realising it.
that's fair
yeah hacktoberfest is interesting lol
the tshirt is all i care about really
I thought it's opt-in for repositories now?
but also i probably owed something to pydis now
Or did they revert that?
its opt-in
it still is opt-in
Update botstrap to be much more userfriendly. This silences noisy logs that we don't want to see or care about when downloading new server.
We also provide a success message when the entire...
Nice repo! I might contrib next week or smth
When does hacktober end in EDT
Would OCR help?
#community-meta message
like very barebones
yeah but there are steps to take before we start running users images through OCR
a simple python OCR lib that checks for keywords in the image and if it matches a banned word it will alert Mods
like?
it subverts user expectations and for the most part I doubt it'd return a very good / consistent result
well, spammers almost always hit the same channels, same named images and even the same links, we need to become better at detecting it without looking at the image contents
I mean the bot is OSS and the server already has logging
ok
all looking at image contents does is add a silly amount of processing onto every image sent
it's not an inexpensive operation to run at scale
example channel: #pyweek-game-jam
5,200 images sent this month, 51,000 sent this year, which is fairly expensive to run on
yea
well
kind of
#pyweek-game-jam gets hit a lot but our filters are picking that up (hence why you are seeing the bot messages)
yeah, i get the concern
yes I saw a mod talking about this
kinda sad
maybe you should just delete the channel and make a new one so ID gets reset and all the spam just does not work, though the spammer probably has logs
meh i mean during actual pyweek it is fine
it's just because the channel sees very little activity outside of pyweek
i was thinking about reducing the time before the bot messages get auto-deleted
Will it happen?
i've not put it in mod-tools yet so hasn't been discussed
probably a 1 line change
yea i wrote the feature
i mean you wrote most of the bot
nah team effort
we crossed 10k commits recently on bot
that's cool
10,000th commit
yeah
I joined github like a few months ago
I was still a kid then
i joined july 2016 seemingly
i almost reviewed this lmao
February 26, 2025 was when I joined
...and i bugged it
damn, I joined GitHub when I was 11
I'm impressed that I didn't somehow forget my account/lose my login at some point
which was?
like year
Im totally not gonna predict your age
1992
i always remember wookie's birthday because he was born 10 days after the fall of the soviet union
cap
you got me for about 10 minutes though
if he was born in 1992 and he made his github when he was 11 he made his acc 2003 but github started in 2008
yeah man, my due date was two weeks earlier but I figured I'd let things settle down a bit before being born
lmfao
I joined at 12 apparently lol
Someone just sold be on uv and I love it
...that was in 1991, no?
lmfao
ah ths why I couldn't find it
good thing you forwarded it instead of linking it

yeah if there's no channel name and timestamp beneath the text it's from a channel you can't access
:P
ah
6k have the badge
do 4k left
I think I can make it
@toxic wren if you're looking for an issue to implement
https://github.com/python-discord/sir-lancebot/issues/1703
thx
removed, but please don't comment on them yourself, all it does is generate more notification spam for people in their email inboxes, we get to them when we can and it's not the end of the day if one stays up whilst I'm asleep or something ๐
Every time I'm bored I do the boring thing of finding an invite bypass on Python
Think I found another one
Well that was easy
wdym?
oh i get it now
Why not use a select menu for roles rather than buttons?
It do be big and fat on mobile and yeah
I would show a select menu example but I can't since I deleted that code in favour of
I...... Don't think we need to do this for commands which don't have any arguments?
It's subscribe. There's nothing special about it
Makes sense for eval but if the ctx.args is falsey then uploading is useless IMO
we have this as well
which is why nothing got changed
seems reasonable, but I don't think it's that harmful
pastes delete after 30 days, so not fussed really
@toxic wren make sure you're not trying to claim a load of issues without actually working the ones you're currently assigned to (e.g. the /docs command)
I am facing hiccups in the implementation of the /docs. I am still working on it though, and sir-lancebot#1703 seems like a simple url change, or maybe a permanent image.
It doesn't have love fest, revival of code, or advent of code though
Stuck message?
#voice-verification message
yea bot restart probably
yeah, but you have commented on bot#3405, bot#3422 and bot#3425 as well asking for those to be assigned
bot#3422 and bot#3425 are pretty simple, considering bot#3425 gets approved
right, I guess I'm just trying to figure out your priorities, I will assign all of them to you though
I'm changing the scope of 3425 though
You should probably not assign bot#3405 though, I should probably work on that after /docs
I think joes concern is mainly don't start a bunch of PRs until you have some experience with the project, aka have a handful of merged pulls where you understand the style, the project, and how everything works together
Eg https://github.com/python-discord/bot/commits?author=DragonSenseiGuy
assigned to both of the former
ok thanks Ill keep what @fallen patrol said in mind.
Though to be clear I speak as myself and my views don't reflect pydis or joe... etcetera
i don't really mean anything at all around style and how things work together, if there's things that aren't understood there it gets solved in the PR review stage and things don't merge until reviewers are happy. I just mean as a matter of time management and trying to help guide people it's easier if they want to work on and commit to 1 thing at a time compared to several.
Hhhhhuh?
@fallen patrol to clarify in bot#3422 you want to change the message that the bot sends to DM's to include where I uploaded the file?
https://github.com/python-discord/bot/blob/2640aaa5665426e5350b3ce81a743a9f4c3898aa/bot/exts/utils/attachment_pastebin_uploader.py#L131 this line needs changing just to include message.jump_url
bot/exts/utils/attachment_pastebin_uploader.py line 131
await message.author.send(content=f"[Click here](<{paste_response.removal}>) to delete your recent paste.")```
yes, using jump_url
that gives you the message link
like [#dev-contrib message](/guild/267624335836053506/channel/635950537262759947/)
"[Click here](<{paste_response.removal}>) to delete the pasted code from [your message](<{message.jump_url}>)."
yes currently testing the changes
why does my local bot say:
Hey @toxic wren!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com/
while @stable mountain says:
Click here to delete your recent paste.
is it because this bot has access to pydis pastebin backend?
bot/exts/filtering/_filter_lists/extension.py lines 18 to 21
PY_EMBED_DESCRIPTION = (
"It looks like you tried to attach a Python file - "
f"please use a code-pasting service such as {PASTE_URL}"
)```
i don't know why that'd necessarily trip differently based on local dev vs prod
I tried in a help post and other channels, still get same response
652. .json
2743. .py
2742. .txt
2744. .js
2764. .sql
2769. .log
It does. Yeah.
Ahhhhh okay
ah
Wonder about a dev cog that doesn't load on prod
btw bot#3432 ready for review
for what purpose
failed linting
spoke too soon ๐
true... that can be fixed with a conributing guide snippet
yea
it does feel we rely on this behaviour a bit
so should probably just have it as a filter list seeded default
pythondiscord.com - A Django and Bulma web application. - python-discord/site
just needs a new migration probably
if we want it to always be there then we add a new migration to add if not exists
yeah, why?
I'm new here
do you want to contribute to pythondiscord?
And I am looking to make new friends
hm
There are three off-topic channels:
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
Yeah but it depends on the kinds contributions
@toxic wren the way you've solved that leaves a newline in the message sent to users
and still fails lint
All contibutions are welcome
you can run all the CI tests locally before you commit using uv run task lint btw
bot#3432 ready for review
f-strings don't work multiline like that
!e ```py
something = "hello!"
print(
f"line 1: {something} "
"line 2: {something} "
)
:white_check_mark: Your 3.14 eval job has completed with return code 0.
line 1: hello! line 2: {something}
that's what you've done
you have to have an f-string on every line where you're using interpolated values
!e ```py
something = "hello!"
print(
f"line 1: {something} "
f"line 2: {something} "
)
:white_check_mark: Your 3.14 eval job has completed with return code 0.
line 1: hello! line 2: hello!
fixed
bot#3432 ready for review
looked to review bot#3434 since it didn't seem to fit existing styles and now.... I have thoughts about python.... https://github.com/python-discord/bot/blob/8fdc3708b28667ce40240dc7221eb1d2194ac6d4/bot/bot.py#L65-L70
Returning within a context manager that suppresses the exception meaning this statement of ```py
with suppress(Exception):
maybe_raise(Exception)
return
will sometimes return there and sometimes will continue past and I just.... python what is this
that above statement is functionally equivalent to the following:
```py
try:
maybe_raise(Exception)
except Exception:
pass
else:
return
Yep, context managers can swallow exceptions
what do you mean by "didn't seem to fit existing styles"
we use except discord.Forbidden: or except Forbidden: in 6 places on bot and 3 of them are what this is, just a logging statement and nothing else
โฏ rg 'except (discord\.)?Forbidden' --after-context=3
bot/decorators.py
185: except discord.Forbidden:
186- log.info(
187- "Failed to DM %s with redirected command paste removal link, user has bot DMs disabled",
188- ctx.author.name
bot/exts/moderation/defcon.py
124: except Forbidden:
125- log.debug(f"Cannot send DEFCON rejection DM to {member}: DMs disabled")
126- except Exception:
127- # Broadly catch exceptions because DM isn't critical, but it's imperative to kick them.
bot/exts/backend/error_handler.py
136: except Forbidden:
137- await self.handle_unexpected_error(ctx, e.original)
138- else:
139- await self.handle_unexpected_error(ctx, e.original)
bot/exts/moderation/infraction/_scheduler.py
125: except discord.Forbidden:
126- log.info(f"Bot lacks permissions to delete message {message_id} in channel {channel_id}.")
127- except discord.HTTPException as e:
128- if e.code == ARCHIVED_THREAD_ERROR:
--
519: except discord.Forbidden:
520- log.warning(f"Failed to deactivate infraction #{id_} ({type_}): bot lacks permissions.")
521- log_text["Failure"] = "The bot lacks permissions to do this (role hierarchy?)"
522- log_content = mod_role.mention
bot/exts/filtering/_settings_types/actions/infraction_and_notification.py
183: except Forbidden:
184- ctx.action_descriptions.append("failed to notify")
185-
186- async def action(self, ctx: FilterContext) -> None:
yeah. I couldn't remember the from import vs import vs contextlib vs try/except styles
There's a mix-match of each style
yea
me and chris were just playing around with copilot seeing whether it can do anything decent with issues on pydis repos
just given it a trickier issue
for fun, give it .monster needs to be migrated to redis
wait why does it need to be migrated to redis
funny
bot/exts/holidays/halloween/monstersurvey.py lines 31 to 34
def json_write(self) -> None:
"""Write voting results to a local JSON file."""
log.info("Saved Monster Survey Results")
self.registry_path.write_text(json.dumps(self.voter_registry, indent=2))```
yea
this gets nuked every deploy
no one changed it when it got copied over from salt i guess
what has organisation#202 got to do with things
This is a draft PR to action the simplification of the SeasonalBot extension system.
As outlined in python-discord/organisation#176 https://github.com/python-discord/organisation/issues/202, the se...
private repo?
interesting
brb finding security bug
actually i need to check if monty is still vulnerable after i rewrote all of the github handling
yeah
finding the other repos internally is more problematic
no exactly
having knowledge of The Organisation means a point that can be tested without finding confidential information
The Organisation
wait a moment
git are you drunk
how did a json file become a python file
the bot doesn't pull issues with a token that can access organisation though anyway iirc
