#dev-contrib
1 messages ยท Page 158 of 1
And it's down again
...
arthur deployments redeploy modmail-bot
:white_check_mark: Restarted deployment modmail-bot in namespace default.
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': libcairo.so.2: cannot open shared object file: No such file or directory
cannot load library 'libcairo.2.dylib': libcairo.2.dylib: cannot open shared object file: No such file or directory
cannot load library 'libcairo-2.dll': libcairo-2.dll: cannot open shared object file: No such file or directory
now it does
chris how did you solve this
Alright ERROR: Unable to import cairosvg, report on our support server with your OS details: https://discord.gg/etJNHCQ it was still getting this in the logs
how weird
that error is the above error btw
I modified mine and added a raise statement on bot.py:L1708
the manifest isn't right
which returned the above error
I have master checked out myself and can build it fine
I modified locally and then applied
Went to 6cceb93
don't think you did
so def something then that you have that the image doesn't like the GTK thing or something
why?
kubectl describe deployment modmail-bot still gives me be55
and redeployed
on Linux, youโll have to install the cairo, python3-dev and libffi-dev packages (names may vary for your distribution).
Convert your SVG files to PDF and PNG.
they are in the non slim image
Yea, the way I got it working in slim was to install a bunch of extra packages
The ones listsed here aren't the full list
since debian-bullseye needs a few more
...is my package manager broken?
ghcr.io/python-discord/modmail:6cceb93 does start
or does cairo not exist
(names may vary for your distribution)
can you try to push it to prod again Chris?
ubuntu
google cariosvg+your distro
There is no reason 6cce doesn't work
it starts for me too
but not in prod 
i wonder if its because platform isn't pinned
I'll push it again
i def borked apt
arthur deployments redeploy modmail-bot
:white_check_mark: Restarted deployment modmail-bot in namespace default.
wtf
doesn't work once again
I wonder if there is something borked with the node cache
arthur deployments redeploy modmail-bot
:white_check_mark: Restarted deployment modmail-bot in namespace default.
Yea, that's what it was called on debian too
arthur deployments redeploy modmail-bot
:white_check_mark: Restarted deployment modmail-bot in namespace default.
anyways I'm over trying to put out this dumpster fire, this is why I was reluctant to deploy a dev version
I'm going to bed
cya
(serious comment) I think we need to harmonize our terminology surrounding @stable mountain vs @dusky shore. The term "the community bot" is used inconsistently to refer to either, but the means there's only one.
I think Lance should be the community bot and Python should be "the custodian", or something.
Are you talking about the repo descriptions? Or the "about me"?
#welcome, the repo descriptions, possibly other places as well 
Well under @dusky shore , it already says "***our ***community bot" and under @stable mountain it says "the custodian". So not sure what exactly you want to change?
But in the repo description, it does say "the community bot", but in my opinion it's fine because it's "the community bot for the Python Discord community". You know what I'm saying? There is only one Python Discord, after all ๐
What is missing for sure though is that section (in the screenshot) doesn't include @fading gale and @radiant merlin . Was this done on purpose? (cc @crude gyro )
update: successfully ran @little robin after installing that package
Hahaha wrong bot person
i legit wish someone would kick that account ยฏ_(ใ)_/ยฏ
lol
they just weren't live at the time, yeah.
I can see that.
Gotcha.
you're probably right that we should add a description of them
frankly I don't know how to describe King Arthur, having had minimal involvement
Well it's the DevOps bot for Python Discord I think
It says it in the About Me
Our DevOps bot that helps manage our other deployments, and features. A bit meta.
something like that
maybe our <@&797752289771126784> wants to suggest a good description
happy to add it.
hey, can I make a pr to fix this whitespace in the title?
doesn't feel worthy of an issue
I'd definitely say yes, but can't speak for mods/admins/core devs
yeah, agree, but i don't want to make an issue without prior approval ๐ ยฏ_(ใ)_/ยฏ
bot#1994
Bump once again (sorry)
!remind 1H look at christmasify
Your reminder will arrive on <t:1638754425:F>!
Thanks
probably not gonna help persay, but will try to help
...that makes no sense, I mean, I'll help but not work with you likely, since I'm really busy these next few weeks
Alright, totally fine
could you explain what it is that you need help with about christmasify? ๐
Well it's mainly just that I'm not that good with Pillow
And what I have right now is mostly copy/pasted from the existing .spookify command but I want to make christmasify unique from spookify. Does that make sense?
That reminder has been deleted successfully!
btw where did you get the assets?
@austere hornet
Sorry, saw your message but couldn't respond. I just Googled images
ah gotcha
Also did you delete this comment? #dev-log message
yeah i hit the wrong button
you might need to find different images, if you didn't check the licensing of those images btw
Oh right, it has to be MIT licensed right?
Ok, I can't really look rn, maybe tmmrw
and for what you can do with PIL: this documentation here includes all methods on an image object
I did actually read the docs but it didn't really help
@austere hornet
so if you want some ideas to be able to convert differently than the spooky command:
something to change the image to red and green shades-- a simple implementation may just be to remove all of the blue pixels. Additionally, perhaps making the colours
different assets, maybe a snow look, like a bunch of white specks, or something, tiny snowflakes, littered across the image
maybe a santa hat, or something, too
.bm
lmao did we really do that entire color command
with all of the parsing and everything
pillow will parse multiple string formats and return a result
we already use pillow on lance
๐คฆโโ๏ธ
Well I already have things like santa hats and snowflakes, so you're saying I should just add more? Also what blue pixels? And what red and green shades?
do you know how rgb images work?
Well I know what RGB is but no not really
rgb is red, green, blue
Yeah ik
so each color you see is three different values, one of each red, green, and blue
since chrismas colours are red and green, that makes this somewhat easy
Ahhh ok I see
just remove or take most of the blue channels out of a pfp
...what does pfp mean lol? Sorry if that's a stupid question
pfp == avatar
Ah ok
then, you could flatten the image
this means, take out most of the different colors, or the precision of each pixel's color
that would mean that the image would end up in more specific red and green colors, rather than a possible ugly pfp with blue removed
( removing colors from an image can make it ugly fast, if it has stuff going on, so I recommend flattening the image to remove the precision as that would mean instead of some rainbow gradiant in a color, it would be a red/green area. flattening means that a limited subset of color shades are used in the image)
How would I flatten the image? Is that a Pillow function?
You recognize that ImageColor was used in the color command, right? Being snarky about an assumed implementation of a merged PR, especially one that took quite a bit of effort, isn't really appreciated or fostering the kind of environment we strive for.
Sorry, I didn't mean to come off that way, I remember a lot of work being put into it, but I did not look at the implementation too much. Although I had remembered some of the last notes being how the parsing was working, which is why I pointed it out.
Again, I didn't mean to come off that way.
On the 11th line of that file https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/utilities/colour.py#L11
bot/exts/utilities/colour.py line 11
from PIL import Image, ImageColor```
I think you would use this function, https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.convert to be able to flatten the image-- you should just be able to use it and pass colors as a number much lower than 256
yes, I understood your point and that it was used
Got it
.bm
Thanks for your help @fallen patrol ! I'll try to look at what you sent tomorrow if I get a chance
how exactly does the docs command work?
specifically, where does it parse the information of the bits about each entry?
or does it fetch that every time?
oh, I found it
That sounds like something that can be implemented ๐ค
The output should be dmed? (cuz it's personal stats, you know.) or display as a dismiss message kind of thing where the user posted the command?
It's public info
Hey @last patio for the bot-core docs PR, are you going to review it again, or are we good to push forward?
Hello, sorry i missed that that needs a new review. Iโll try and take a look at it again today, but feel free to merge w/o me
๐๐ป
Your reminder will arrive on <t:1638837729:F>!
It shows 10 when it doesn't show the invoking user. Should just add another row in that case
Ah there we go, thanks
When there is coming the timeout button, if the bot will use it. Will the bot move to new package?
It will be nice to use the native feature if it suits our needs, but it's not very urgent to us
https://github.com/python-discord/bot/blob/main/bot/exts/moderation/defcon.py#L189
Is the .update smth not from dpy?
bot/exts/moderation/defcon.py line 189
permissions.update(```
I see, thank you ๐
Yea, that's from d.py
!d discord.Permissions.update
update(**kwargs)```
Bulk updates this permission object.
Allows you to set multiple attributes by using keyword arguments. The names must be equivalent to the properties listed. Extraneous key/value pairs will be silently ignored.
Hmm then the problem is in server settings I assume
Thank you!
Also I would like to verify, can I ask questions like these if they don't get solved (eg. Docs were not found) in #discord-bots . To be sure the code parts are from docs and not the bots own code
I'm not sure what you mean by "can I ask questions like these if they don't get solved"
This channel is if you have any questions about PyDis projects, so feel free to any questions related to that
Ah then I got it, thx again ๐
Here's your reminder: 1 suggestion) 2048 game on @dusky shore :D
[Jump back to when you created the reminder](#dev-contrib message)
hmmm
looks like we need an NGINX upgrade
oh chat was scrolled lol
wait it came back, how did it come back
given that !branding schedule exists, is there a way to make @dusky shore share the same schedule? As it is right now, it uses the month locks, when those aren't always accurate to the current season, as stated by the branding info
oh cute it automatically triggered a site issue!!
our events don't necessarily follow the branding schedule though, unless I'm misunderstanding
Im focusing mainly on halloween and other events like that, I suppose
then again it feels fine how it is now.
nginx service restored
but I don't want Sir Lancebot to be locked to the branding schedule. It would lock commands only during the duration of the event when I want some active before and after
.
@vale ibex lol I saw the ping on my phone, nice timing

uhhh nothing written up yet, same as we said last week though, won't be continuing to pursue a rewrite to fastapi
maybe
there isn't a whole deal of reasoning, and the discussions we had internally were quite in depth with a lot of reasons over a long period of time
the crux of it was that it's just not something we see a huge benefit investing a significant portion of time into when we're not sure whether the end product is going to meet goals more than the current solution does
like I mentioned last time, we need to bring it to an admin meeting to tie some ends together and make sure we're all in agreement
so that last part implies that it's not concretely dead yet...?
api in terms of fastapi is not going to proceed
but that discussion has been mostly held asynchronously, the project will not continue, but we need to decide whether there are things we want to look into
we had other reasons to migrate to fastapi other than "oh cool fastapi"
so we need to see if we want to prioritise any of those with django
it'll all make sense once we write something up to announce, but again for now just hold on contribution, we'll write something up eventually
what were some of those reasons?
(that question ^ is irrelevant to the shutdown)
observability into django was poor at the time, we've since resolved bits of that, a few internal reasons with core team that have also now been fixed
we originally wanted site to be more static, that's also more solved (scale's static previews work, etc.)
it's why API never got reaaaaally pushed as a public project, we didn't really have capacity for it nor a huge desire for it after we resolved some issues with the current stack
I feel like I recall a reason being making site easier to contribute to
also why we've not pushed out an announcement yet, it's not a project at the forefront of the org
site is easier to contribute to
we killed subdomains
now, it really is just pull site, install the deps + postgres, run
no need to edit /etc/hosts, shouldn't need to modify settings a whole bunch
if you aren't directly working on API, you shouldn't need to touch API
dewiki of the site helps a lot too, writing markdown for certain areas is way easier than wrangling jinja tbh
API + site proper are distinct
yep yep
I think site now is probably the easiest it's ever been to contribute to
ah, neat
- we have more django experienced folks on our core team who are able to assist with things
like volC
abbreviation of volcyy
we've still got work to do to make current site nicer, we're currently battling a load of optimisation problems with the database in relation to the metricity messages table, so that's going to be a fun one to solve
sounds annoying...
but from regular user contribution pov, if you don't work on API, you won't need to do anything API related, if you do it should just be standard DRF, we're working to make content easier to write, and have adjusted review policies so it's easy to get it into prod as well
just one of the issues with large systems
messages table is uhhhh
takes a while to even run the query
users is 516,155 rows
dang it, why am I here again
messages is still running yikes
oh yea I had an idea for a command, now should post it on Lance or bot.... hm
hm
why are !pep and !pypi on @stable mountain? /gen
okay messages is 15,022,839 rows, 2.4GB
think it was because we have the PEP relay stuff on Python, could swing either way
PEP and PyPI are directly related to Python (the language). So it makes sense to include them on the main bot.
yea
so that would be where I should make this issue then, thanks
oh.
Originally posted by Gareth Coles: Originally submitted by Automation to ClickUp and assigned to Nix: bot.pep(20) should return https://www.python.org/dev/peps/pep-0020/
i remember when i wrote that migration script
good shit
what about the github autolinking features? half of those are on lance, half on bot
you mean code snippets vs. issues?
ye
uhhhh, again not sure of the reason for the split, though I don't find it problematic, they're pretty distinct features
true
I kind of want to move them to one bot with my github command enhancements issue
sir-lancebot#968
That's kind of unrelated to the code snippets though, right? The only relation being it deals with github
one sec
well the github code snippets is actually also gitlab, github gists, and bit
bucket, so it makes no sense to merge cogs ๐
er, so given that they predate Lance, would a command related to python itself go on python or lance
i mean depends on the proposal
I'm thinking about a version command, to see current version and features of python and the reference implementation, cpython, and release dates.
(btw, I'm not looking to bikeshed this yet until I write up an issue, just trying to get it on the right repo)
I think this would go on @stable mountain
yeah, that makes sense
@brisk brook Regarding your comment, Though I agree with you there
it hasn't shown progress since Zig wants to take a look at the PR before it gets merged but he hasn't been getting time and there are few other dev work with higher priority on his list (#dev-contrib message)
Ah no, don't let me block it. If it gets to a mergeable state (gets the approvals) I might have a quick look
If there's something in particular that needs to be decided just ping me
@last patio I could possibly make a second continuation PR to this which would include the change to storing the modpings in the PostgreSQL db on the site, also thanks for the review and lovely pfp
you probably need to cancel the other reviews ig
aren't you a coredev
it shows 0/1 coredev approvals
last time I checked I was yes!!!
wait good idea on cancelling
do I re-request it or how can I dismiss it
i am not sure
GH won't let me re-request
You want to dismiss requested changes?
They're outdated
only numerior has requested changes so not suree
Or well, addressed
if thats the issue
You're being ignored by policy bot volC since you committed to the PR ๐
You can't dismiss Numerlor I think because he's not blocking the PR
oh no
he is not part of the org so i don't think dismiss it anyway
chris, zig do the honours
I've been spending my oss time on critical issues, haven't had time to review it just yet.
Any updates on bot#1964 IIRC there was some discussion that discord introduced support for message links on android
Man I wish ephemeral replies were possibly for non-interaction messages, this would have been a perfect candidate for it
Though we could add a small bot message with a button to send it, would help those who don't want the embed
Wdym "introduced support"โฝ It's been there for a long time, just buggy as heck.
Still is for me on 106.1 (and android 12 if that matters)
ah ok, I rarely use discord on android so wasn't aware.
Yea, consider that issue still approved
I've seen no improvement on android, even on beta branch
So I don't want to hold out with bad UX for Discord to maybe one day release a fix
right and about this?
Have it be the same as other trash emojis, limited to original author (of the link) and mods
I'm pretty sure we have a util for that in bot.
Isn't the link for others to see and not the original author?
Yes, but the cases where it's not wanted, can be determined by the author
To reiterate, I'm fine with an embed that includes the content of the linked message everywhere
having the ability to hide it in some circumstances is just extra
Yes I understand that, but not everyone would be fine with it
In what examples?
For example, I am on PC and in a busy channel, and some1 shares a link and suddenly poppoing of a bot message which is medium sizes may not be "nice" for me
The issue states to only do this for staff channels for now
with the ability to add a channel to a whitelist
So we wouldn't put channels like pygen or discord bots in that list for that reason
ah, I thought it was for all channels, will start working on it ๐
Apparently Discord do url validation, and have determined that http://web:8000/pages/rules isn't a valid url for an embed
What if thatโs changed to localhost?
Yeah, I can confirm that web raises the error
I suppose it is technically not a valid url, you can't go to many sites without tlds
Wait can you
I donโt think discord is trying to accommodate those cases haha
http://ai./ sometimes works
Offshore Information Services Ltd
is an Internet provider for people wanting to run an Internet
business offshore. We do domain hosting and co-location.
lol
How does a company match donations to itself ๐ค
still won't work, both localhost and 127.0.0.1 loop back to the container itself afaik
or atleast when I tried them they couldn't connect to the site
It doesnโt actually validate that itโs online, does it?
Just that itโs a valid URL
Localhost:port can be set as an embed url from my testing
that part doesn't, but since that url is used to actually connect ot the site api, using that value means the bot doesn't even start
If itโs in an embed, isnโt this just user facing?
I donโt have much context here lol
the embed was using urls.site_schema and urls.site to dynamically make the url to the site
urls.site == web:8000
If weโre in debug, we can match for web and replace it was the idea
i love it
Or just donโt even check debug and replace
numerlor's fix was to just hardcode to pydis for that embed url
Then itโll also work as intended since the user can click on it and actually go somewhere
since it's just linking to the rules page
Good enough then
!rules 2 3 4
2. Follow the Discord Community Guidelines and Terms Of Service.
3. Respect staff members and listen to their instructions.
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
So with the new tag system, fuzzy-match was changed to not kick in for 2 letter tags. Is it worth adjusting the fuzzy match system or adjust the metadata for those tags? (!or, !if, !ot, !xy)
hey @brazen charm after merging we've noticed a few common shortcuts to tags no longer work, such as !if !xy !ot. I've found this is due to us only fuzzy matching on groups >=3 chars long. Do you expect further issues if we changed this to 2?
The alternative is to add an alt-name key to the meta data, which then gets used in addition to the file name
the only issue with that is dealing with conflicts, which could eb done on cog load
I don't think there should be any issues, no; maybe an occasional additional false positive when some actual groups come in
So, the PR introduces tag groups but doesn't set any up yet, right?
Yes, they can now be created by moving tags to a subdir but the pr didn't do that
ah, okay cool, just wanted to make sure I wasn't going crazy
That sounds like a fun tedious thing to do while I wait for things to run...
I HAD A THOUGHT. What if we provide the AoC join code via ephemeral message somehow instead of DM?
You mean via a message that only the person that invokes the join command can see?
That is what an ephemeral message is yes.
afaik ephemeral messages can only be sent in response to an interaction
So we could change aoc join to send a button and then have an ephemeral message response
(since we don't have slash commands)
Do you think we'll have slash commands in a year?
Because if there's a set of commands that make the most sense for slash commands it's probably AoC
very true
That is pretty cool
Goddamn
How is this done? that is really useful!
Slash commands support auto complete
Someone say autocomplete ๐๏ธ https://raw.githubusercontent.com/vcokltfre/autocomplete-calc-poc/master/example.mp4
hah that's cool and bad at the same time
Here's your reminder: I just asked internally why they don't
[Jump back to when you created the reminder](#dev-contrib message)
Stupid question, but what is this channel about?
Can I seek out fellow beginners here?
The channel is focused on contributing to the open source projects we have
@stable mountain and @dusky shore are the big two, as well as the site
Okay, thanks.
lol, I used disnake in order to make it-- I'm working on moving most of my commands to slash commands because autocomplete features are so much fun
You can try #python-discussion for that I'd say
He got sended here from there lol
Oh really? That shouldn't have happened
Oh haha
Well as Brad said this is the channel for discussing the open source projects here and not for seeking fellow beginners
Bump?
what is the difference between these two deps, why are they both needed?
https://github.com/python-discord/sir-lancebot/blob/532a8d53fca6c06a90d9bcb4862a36062750d359/pyproject.toml#L12
https://github.com/python-discord/sir-lancebot/blob/532a8d53fca6c06a90d9bcb4862a36062750d359/pyproject.toml#L19
pyproject.toml line 12
aioredis = "~1.3"```
`pyproject.toml` line 19
```toml
async-rediscache = {extras = ["fakeredis"], version = "~=0.1.4"}```
The latter depends on the former, so the former might not be needed. Maybe we wanted to specify a higher minimum version of aioredis for some reason.
update: I just took what I had and built it on top of the pydis variation, to see how much work it would be--
so now its got the search suggestions and the pydis output
Uhh, why am I getting https://paste.fuelrats.com/tuzurewagu.sql
You're running the bot on 3.10?
ee yes, ๐คฆ
while that in itself shouldn't really cause an issue, aioredis's version 2.0 completely changed it's api
which I imagine you are now running
iirc they merged in aioredis-py into aioredis to have a single aioredis package & team, so the api is different now
and asyncrediscache doesn't work with it
aioredis version would be 1.3.1 right? the one described in poetry.lock
Ah yea, we pin aioredis in lance, I can't remember what project I was working on where a poetry lock bumped that up too
ah ok, interesting numpy gets installed pretty fast on 3.9.5 but was slow on 3.10
They do
it does, yeah
Maybe the file was already cached for you?
probably, that's what i had guessed (see deleted messages) but then when I tried replicating the situation again it worked, poetry is unpredicatable
sadge
:x: @cold island You can't have the modpings role for more than 16 hours!
Why does it say that?
!src modpings
Allow the removal and re-addition of the pingable moderators role.
https://github.com/python-discord/bot/blob/18695fa098bf2968f2dc294568a33b2397bcddec/bot/exts/moderation/modpings.py#L206 this needs to be done after the time check
bot/exts/moderation/modpings.py line 206
if end < start:```
!modpings schedule 6am 6pm
Sorry, an unexpected error occurred. Please let us know!
TypeError: can't subtract offset-naive and offset-aware datetimes
Another bug we found
it is comparing them after adding one day, but even that would be okay, 8am next day and 22pm is still under 16 hours
Probably caused by the migration to dpy 2
Do you think it's something you can fix?
Also the work limit makes no sense in the first place, it's a max off limit, not a max on limit
ok that's bug with utils/time.py
Yes, a maximum on the off time, not the on time. Maybe that wasn't clear
Does the command make you set your activity times or inactivity times?
activity times, from when to when you want the mod role
Ok. Along with the two issues above it would be nice to have a more verbose help description with a usage example
Also a word on how this interacts with manual on and off would be nice
๐
ok the dateutil parser is acting weirdly, its taking 8 and 22 into days, I am not sure why that happens, it was working perfectly fine when i tested it after bluenix's review
Hmm, that seems to also be the behaviour on my machine. I think it wouldn't be crazy to write a small helper function for parsing times, and add it to util.time. We have one for parsing durations.
Does anyone more actively involved with the bot than me think this a reasonable idea?
yeah that's what i am currently doing, there are two options use 6h13M as the time format (24 h) or write a parser which supports both 24h and 12h
I'd try to be flexible with the input it accepts. How's your regex? ๐
nothing yet, looking into dateutil
Btw, I'm mod but not actually a core developer, so don't take my advice as the last word.
match = re.fullmatch(r"(?P<hour>\d{1,2})(:(?P<minute>\d{1,2}))?(?P<part_of_day>am?|pm?)?", arg)
if not match:
raise BadArgument("...")
hour = int(match.group("hour"))
minute = 0
if match.group("minute"):
minute = int(match.group("minute"))
part_of_day = match.group("part_of_day")
if (part_of_day and not 0 < hour <= 12) or not 0 <= hour < 24:
raise BadArgument("...")
if not 0 <= minute < 60:
raise BadArgument("...")
if part_of_day:
hour %= 12
if part_of_day in ("p", "pm"):
hour += 12
return datetime.now(timezone.utc).replace(hour=hour, minute=minute, second=0, microsecond=0)
Should be something of this sort (untested)
Ok now it's tested
@cold island I hope you don't mind me suggesting a change? 
How about returning a datetime.time object instead? I'm not sure if this is a good idea or not. I just had an interesting discussion in a help channel with Salt and Etrotta about the difference between naive and aware time objects. Here's the code: https://paste.pythondiscord.com/odigodipiv.py
Hmm well you don't have the various arithmetic with time
We also work with aware datetimes across the bot
Ah right yeah. Both good reasons. Although the date portion of the datetime object being arbitrary does bother me slightly.
yeah it's not the most elegant, but it's then used to schedule the role addition/removal, so it's actually relevant
I see ๐
this re is tough
!e
import re
TWELVE = r"^(1[0-2]|0?[1-9])(:?[0-5][0-9])? ?([AaPp][Mm])$"
TWENTY_FOUR = r"^([0-9]|0[0-9]|1[0-9]|2[0-4])(:?[0-5][0-9])?$"
TIME_RE = re.compile(TWELVE + "|" + TWENTY_FOUR)
for message in (
"10:14am",
"24",
"942pm",
"3pm",
):
match TIME_RE.fullmatch(message).groups():
case hour, minute, meridiem, None, None:
print(hour, minute, meridiem)
case hour, None, meridiem, None, None:
print(hour, meridiem)
case None, None, None, hour, None:
print(hour)
case None, None, None, hour, minute:
print(hour, minute)
@light holly :white_check_mark: Your eval job has completed with return code 0.
001 | 10 :14 am
002 | 24
003 | 9 42 pm
004 | 3 None pm
@cold island I have a hotfix ready for the current use, so should i just put the patch here/pr it so it gets merged fast and then i look into the convertor/am-pm thing
I think it can wait however long it will take to do it properly
It can wait another few days and I'd rather end it with one round of reviews instead of two
there is this, which gets support in the discord.py server. a helper for dpy made this, so if you rly want it you can use it.
Because people keep asking, no, rule 14 does not affect this script.
Installation instructions are on the page, if you need help with this, ping Maya#9000
https://gist.github.com/XuaTheGrate/5690a3d9dadb280d3d15f28f940e02d1
.bm
@austere hornet I am not sure but I think you should complete your currently assigned PRs before taking on others since none of them is in a really good state/will be merged very soon, but that's my opinion - depends on you and the core devs
That's why I said, I'd like to work on it, but don't assign me yet. :)
oh i didn't see the second message
Oh no worries
@brisk brook Regarding your comment on global leaderboard PR, I don't understand why we need to add a lock while reading also, it wouldn't matter if they don't run synchronously 
Because you (could and will) have two tasks, that look like this:
A: Reads the score (100)
B: Reads the score (100)
A: Sets the score (100+50)
B: Sets the score (100+50)
Result is that the score is now 150 when it should've been 200
The lock should prevent another task from setting the score while one has already read it and is about to write to it
But aren't they on two separate caches, so how would that cause a problem
What are on two seperate caches?
The games yes?
Hello ๐
I'm working on some breaking changes for the filters, in this case meaning that my changes keep breaking apart ๐
To help me, I'd appreciate some eyes on bot#1889 and bot#1961 to get them merged so that I can account for those features in what I'm writing.
@clever wraith are you able to follow up with the requested changes in the PR?
Hold on I haven't gotten any notifications from GitHub about them hold on
It's pretty old, I mean the comment about it dropping support for subdomains
I added support for subdomains
Which commit? can't see it
Ah, I see, thanks ๐
fwiw it's worth mentioning why you make a certain change and not just that it's made.
Probably yeah lmao
Alright, then it just needs reviews, thanks!
bot_1 | File "/bot/bot/api.py", line 75, in request
bot_1 | async with self.session.request(method.upper(), self._url_for(endpoint), **kwargs) as resp:
bot_1 | File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
bot_1 | self._resp = await self._coro
bot_1 | File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
bot_1 | conn = await self._connector.connect(
bot_1 | File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
bot_1 | proto = await self._create_connection(req, traces, timeout)
bot_1 | File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
bot_1 | _, proto = await self._create_direct_connection(req, traces, timeout)
bot_1 | File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1011, in _create_direct_connection
bot_1 | raise ClientConnectorError(req.connection_key, exc) from exc
bot_1 | aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host pythondiscord.local:8000 ssl:default [None]
bot_1 | 2021-12-09 22:29:50 | bot | CRITICAL | Could not connect to site API. Is it running?
So I'm getting this error with starting the bot repo
do I need to set up the site repo too?
to be able to have bot run
how did you start up the service? you used docker-compose right?
yup, site needs to be running at the same as bot
Turns out I skim too many lines when reading
it was right there in front of me in the contribution guide
we have a note about that at the top of the staff server page
Huh, I'm getting the same error.
Even though I did docker compose up web
and then did docker compose up
does the error still mention pythondiscord.local:8000?
Yep
๐
PR #2000!!!!
also don't worry I used to do that too
๐
๐
pin? Kidding, it's probably not necessary, maybe I got too excited about this lol
per day and total
Yeah, there's a race condition between those two but there is also one between the getters
@short snow you may have already been informed but fyi we've also gotten a 'User' object has no attribute 'add_roles' error from the modpings scheduler (can't look into it atm but the cause is probs relatively obvious)
(I believe you're the person to ping; apologies if you're not)
hmm, I will look into that, is it possible to provide the traceback as i never got this error during my testing
I'm not able to get the exact traceback (only coredevs can) but the info on the alert may help you
ah, it should have been Member, lemme see why that happens
You can see the logs on grafana tizzy
whats the sentry issue number, will close it in my pr
True
Need a core dev to create one 
2021-12-10 06:00:00
AttributeError: 'User' object has no attribute 'add_roles'
2021-12-10 06:00:00
await mod.add_roles(self.moderators_role, reason="Moderator scheduled time started!")
2021-12-10 06:00:00
File "/bot/bot/exts/moderation/modpings.py", line 119, in add_role_schedule
2021-12-10 06:00:00
await asyncio.shield(coroutine)
2021-12-10 06:00:00
File "/bot/bot/utils/scheduling.py", line 117, in _await_later
2021-12-10 06:00:00
Traceback (most recent call last):
2021-12-10 06:00:00
2021-12-10 06:00:00 | bot.utils.scheduling.ModPingsSchedule | ERROR | Error in task #512354988157173763 140600535200432!
2021-12-10 06:00:00
AttributeError: 'User' object has no attribute 'add_roles'
2021-12-10 06:00:00
await mod.add_roles(self.moderators_role, reason="Moderator scheduled time started!")
2021-12-10 06:00:00
File "/bot/bot/exts/moderation/modpings.py", line 119, in add_role_schedule
2021-12-10 06:00:00
await asyncio.shield(coroutine)
2021-12-10 06:00:00
File "/bot/bot/utils/scheduling.py", line 117, in _await_later
2021-12-10 06:00:00
Traceback (most recent call last):
2021-12-10 06:00:00
2021-12-10 06:00:00 | bot.utils.scheduling.ModPingsSchedule | ERROR | Error in task #476543547210858506 140600019803664!
That's the traceback
On phone so I'm not gonna be removing the timestamps lol
ok yeah thats the issue, fixed in my pr
Nice ๐
@short snow out of interest, do you think the new time converter could be used in bot#1924? I guess we'd need to add support for entering day/month/year but could your converter be used as a base (or would that not work)?
yeah it could work (After adding month/day/year support)
Cool 
Would it be better to move the whole thing to a single async lock, or keep them as two separate locks?
Yeah just have one lock that you acquire at the start of that method
Did I promise anyone a review that I never gave?
me ig - modpings but it is already reviewed so the modpings enhancement pr (bot#2001)
would you like to review some unfurling stuff ๐
1961 is still open
bot#1961
I did rewrite a large portion of it, I should probably dismiss chris' review
that's a lot of tests
I will try reviewing it, but you would need to wait sometime as I am not at all familiar with it.
Btw akarys is this good enough (modpings help message)
Not like my opinion will soon matter
lol okay ๐
yes
personal reasons, I don't really want to talk about it right now
ah, well good luck :)
thanks
i was literally thinking for three minutes what you meant... no wonder why
I've opened a new PRs to remove myself from the codeownership: bot#2005 site#631 sir-lancebot#977 snekbox#123
Sorry to hear you're stepping down, Ak, it's truly been super fun working with you. And for those PRs, maybe we should find another owner to assign to the poetry and pyproject files, along with **/migrations/** on the site.
because we lost write perms, we also won't be able to continue on those PRs, CC triage lead @vocal wolf
if you want to assign up for grabs or close them down or whatever
That is not necessary
If you'd like to continue working on any of them, we can figure it out
not me personally, maybe ak will want to continue working on the worker PRs
Sucks to see you gone from the staff, but good luck to both of you (cc @clever wraith)
thank you
Damn it Chris, you commented while I was writing my response smhhhh
lol
sir-lancebot#778
needs one review
and is blocking sir-lancebot#968, additionally may solve sir-lancebot#928
if 778 doesn't solve 928, 968 will
Oh, actually. It's been quite a while. I'm gonna dismiss my review.
(I didn't even notice 928 existed, but I can fix it in 968)
I'll put them up for grabs.
Thanks for letting me know.
bot#1889 has been dormant for a while but I picked it back up, needs reviews
Just to let y'all know, I've been dealing with finals and will be resuming triage activity very soon.
whhaat
how can i remove review requests lol
ah nvm, akarys removed himself from codeowners
so when i pushed new commit it got removed
hastebin filter I can merge yea
Well it is just a file rename from @ to www iirc
I don't exactly know, I didn't really exist when this PR was made
i believe it is that yeah
Yeah pythondiscord.com -> www.pythondiscord.com
That and the typo
You'll have to do it yourself, we don't have write access anymore
yea can do
no, I'm just going to do it in a main push shortly
hmmm
I wonder if this will work
Fair
yeah this won't work
You may want to add more policies while you're at it, like for the paste, merch store and all
The worker should be on *pythondiscord.com/robots.txt
ah yeah
There is no reason it doesn't accept it
I don't remember how the priority is computed though
yea just trying to build it locally
For bot#196, we only want to put the modlog link if it was invoked in a staff channel right?
bot#1964
oops
not sure I follow
Not like it matters, the link won't be accessible anyway. It is probably good to always have it.
it should check if the linking author has permission in a channel before it relays it
hmmm
I wonder if we should do a perm check for all users in the channel
abort if users in channel is >150 or something, need to see how expensive
yeah
it's only enabled in staff categories
Fair
F
It worked last time we tried it
M1 problem perhaps?
not on mac
arch linux
it's a known bug with recent activity https://github.com/rustwasm/wasm-pack/issues/823
someone said downgrading fixed, will give it a shot
I could just use the is_staff_channel utility to see if the invocation was in a staff channel or not, if it was then i link the modlog deletion log message else i just say message deleted (I am talking about the case of linking of deleted messages)
oh... right? was that functionality actually specified somewhere?
It worked in codespaces if you want a fallback
i'm trying the downgrade now, it's got further
yeah, ignore the red lines, ported the function to utils/messages but haven't imported stuff yet
Would it be reasonable for us to get the contrib role since ak has it and we share the same github? Also our account isn't in the bot policy file
Cheers
oh that's annoying
if you want to update the hosts, you've got to retrigger a compilation
how can I force rust to do that
Make sense though
it makes sense, but not when we're using include dir macros
The folder is built into the binary
yeah, but I need to rebuild the binary to get the updates to the folder to show
and rust won't rebuild unless it detects code changes
I can do cargo clean and try again but I have to recompile everything
Huh
this is what it shows even after host updates, because it doesn't factor in that hosts has changed
hmm still not showing on www.pythondiscord.com
w-what...?
What's this https://pythondiscord.com/robots.txt
no idea
Did we leave debug code in
nope
it was working because initially i deployed the one with the unchanged file
and then pythondiscord.com/robots.txt worked
so then I moved the file to www.pythondiscord.com
and after forcing a rebuild www.pythondiscord.com/robots.txt still 404s
and pythondiscord.com/robots.txt just returns "pythondiscord.com"
serve-robots/src/lib.rs line 33
Response::error(host, 404)```
uhhh
that makes even less sense then
that should imply that www.pythondiscord.com/robots.txt should return "www.pythondiscord.com"
I think the route isn't working correctly
whats a discord.GroupChannel, trying to update is_staff_channel to take in a MessageableChannel
Because that 404 is Django, I'm like 95% sure
I guess you could try two routes
for where?
Here's your reminder: these released yet?
[Jump back to when you created the reminder](#dev-contrib message)
That's a DM group I believe
ah ok, thanks ๐
where should I add the on_message handler, I don't think it's worth a separate cog as it is just <10 lines or should I make a cog?
gonna undeploy robots for now so we don't fuck with SEO
I would rather have a separate cog
@green oriole I've had to undeploy the hastebin filter, it was returning a bunch of false positives. This file tripped the filter, not sure why: https://paste.pythondiscord.com/bunixunijo.py
oh, because it's just matching any three words separated by a .
yeah it needs a smarter regex
/(mfa\.[a-z0-9_-]{20,})|([a-z0-9_-]{23,28}\.[a-z0-9_-]{6,7}\.[a-z0-9_-]{27})/i
^ discord token regex
(got it by searching in ddevs for tokens regex and then looking at the results)
apparently this is what the client uses to scan for tokens
workers#22
๐ if someone says I can I'll do that one too, workers is less mainstream so I went ahead with a pr
ah
!remind 6H ask core devs about this, or make issue.
Your reminder will arrive on <t:1639225509:F>!
Hmm I actually wonder where we found that token
I should ask ak but this silly goose hasn't woke up yet
Yeah, seems like what arl PRed should work
!remind 1h30M deploy
Your reminder will arrive on <t:1639216855:F>!
*.pythondiscord.com/robots.txt and without the leading *.
why? it works on domains without a worker
I thought it wasn't working yesterday
That's why you got a django 404 on https://www.pythondiscord.com/robots.txt
yes, that one doesn't work
because there is already a worker it seems
any other domain works
Hmf
When more than one route pattern could match a request URL, the most specific route pattern wins. For example, the pattern
www.example.com/*would take precedence over*.example.com/*when matching a request forhttps://www.example.com/. The patternexample.com/hello/*would take precedence overexample.com/*when matching a request forexample.com/hello/world.
Okay, so you should be able to just add a www.pythondiscord.com/robots.txt route to force it
What does the other worker do?
status page
Hmm how does it work?
In case the website is down?
Hmm
https://www.pythondiscord.com/robots.txt this worked, very nice
It is sad it doesn't have precedence
Cool
Now for the 404, do you want it to be pass-through or straight up 404 Not found
pass through I think, was just gonna change that but also fine if you want to handle that, I'll be around for a PR merge
Still in my bed rn, feel free to change it
Did Xavier ask about the contrib role
I think he did
Yes - it'll get discussed probably at next admin meeting
wow, workers-rs is missing a lot
no way to get request status?
oh wait hm
yea
hmmm
hmmm there is
okay yep got it, works in prod, about to push
also ARL's PR is now deployed and filter is now re-enabled
Good stuff
Just need to add more policies
Interesting, why do I not get redirected by going to https://pythondiscord.com/robots.txt?
What's in charge of the redirect?
Here's your reminder: deploy
[Jump back to when you created the reminder](#dev-contrib message)
well you are hitting the *pythondiscord.com/robots.txt worker
nginx controls the redirect
But if it passes through to the cluster shouldn't nginx redirect?
it's definitely directing
something is going wrong at your end - it's also possible your device omits www prefixes, which a few browsers do nowadays
How weird
If I manually move to www I get the robots file
Otherwise 404
Ak has some things to say about curl ipv6 support I believe haha
He had to manually specify the interface or something
peculiar, haven't ever found curl problematic with v6 before unless the underlying host has misconfigured v6
Weird
!contribute
Contribute to Python Discord's Open Source Projects
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on 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!
Projects to Contribute to
โข Sir Lancebot - our fun, beginner-friendly bot
โข Python - our utility & moderation bot
โข Site - resources, guides, and more
Where to start
- Read our contributing guidelines
- Chat with us in #dev-contrib if you're ready to jump in or have any questions
- Open an issue or ask to be assigned to an issue to work on
Here's your reminder: ask core devs about this, or make issue.
[Jump back to when you created the reminder](#dev-contrib message)
don't make an issue, feel free to PR if you'd like. it'll need code changes though not just regex
so that's where that regex is from
buuuuut the code has additional logic to check whenever it is an actual token
gotcha
What program was used to create the profile pictures for @dusky shore and @fading gale ?
think those were the handiwork of @crude gyro, I would guess Photoshop? unsure though
repo archived
yes
Thank you @green oriole ๐
What is the methodology used for the project
do I just pick up the issues and start working on them?
You can submit a PR for any unassigned issue, if you'd like us to assign it leave a comment on the issue ๐
๐
also if you haven't already it could be worth having a peek at https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/contributing-guidelines/
Guidelines to adhere to when contributing to our projects.
hmm I wonder what's the license is on that. Is there a special one for the site content? I guess I wrote it anyway
under MIT in theory
that isn't ideal, hmm
funnily enough I may have got the legal copyright onto those documents because they were copied by someone else to the repo. Guess it doesn't matter since they are MIT?
GPL contrib guidelines when
especially because i dislike django lol
i was looking forward to contributing but now i cant
FastAPI maintenance is not looking good tbqh
LOL
It's understandable.
The project is almost solely maintained by one guy, Django has a whole foundation
but it is problematic when we rely on it
I mean, Tiangolo shouldn't be going alone anymore
or he is gonna do another Danny
and everyone will be fucked
There's a non zero chance if more stuff I always use like discord.py, fastapi die I'll just quit programming - the stupid drama that happens because of it and my skills becoming useless just leads to me self harming
so for now we'll be sticking with Django, it's what most people know, it's what we've got tooling for, it's what production Python apps use
sticking with django, you guys tried to use something else?
like FastAPI or smthing?
We considered a rewrite to FastAPI, but it wouldn't really solve the problems that we had with the current stack.
We've solved a lot of the problems by making the Django site considerably easier to contribute to, removing the need for /etc/hosts modifications, so on
so it's the simplest it's been in a long while
DRF
gotcha
@patent pivot so is the hastebin filter which checks for tokens live now?
yea
neat
.bm
!otn a gonna do another Danny
I have the bot setup on my discord server. How can I interact with the server? For example, I found a command like this coinflip, how can I test this?
Hmm, that's not a bad idea, but the problem with that I think is not everyone is able to do that due to life-related things, such as work or school. In case you haven't guessed, everyone in this server are only volunteers ๐
Also, I think this conversation should move to #community-meta since this has nothing to do with the PyDis projects which is what this channel is for
Yeah there are, every once in a while. Most recently there was one on django. See #python-events
p
I think #dev-contrib is the correct place to ask for help in setting up our bots in your local testing environment. I don't know for myself but I have heard it can be quite tricky. If someone doesn't chime in right away please give it some time or try again asking later (some days are just slower here).
Have you read any of the contributing-related guides we have? It may be a good starting point
(if my understanding is correct in that you're asking specifically about python discord projects ie @stable mountain @dusky shore?)
Yes, sir lancebot
I read coding style, and quick start. I setup the project and opened my bot. ATM, I'm looking at some PRs
https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/ just in case you've not seen this already (fyi I have no experience with this and am not sure if this guide is 100% up to date, but it should be a good starting point)
A guide to setting up and configuring Sir Lancebot.
You can run the commands by sending a message pinging the bot, followed by the command. Try running help as well
@dusky shore help
yess.
@gritty wind sorry for pinging you specifically but can you add this?
Uhh... no
Here's your reminder: too much going on
[Jump back to when you created the reminder](#dev-contrib message)
!remind 12D here we go again smh
Your reminder will arrive on <t:1640300345:F>!
sir-lancebot#901 needs reviews!
what's that docker command that shows the running containers?
or rather, that command that lets you find out if you have multiple running containers for bot or site or stuff
Docker ps
thanks
.bm might be worth saving
huh
@patent pivot I noticed a few other things, aside from a code change in the token remover, what about the webhook remover? Should they merged?
eh they are okay to be seperate
the webhook file doesn't actually check the token regex at all.....
hmm
it should, since there was a false positive a few days ago
ah, webhook tokens have a different style
no
they're fine as is
kk
hmmm
The regex I found has mfa token support, but the style of that doesn't match the current token regex
Adding support for that is possible, but I've never seen anyone post a user token here which had mfa
found bot#1421
bot#2006
Eyy 2006 my birthyear lol (yes ik it's off topic)
@fallen patrol how did you request review from Joe and Zig? I thought only staff could do that
.github/CODEOWNERS line 12
bot/exts/filters/** @mbaruh @jb3```
On this
codeowners
Ahh
huh @short snow I may have found a bug/security hole in modpings
yeah okay this should be solved
Well, someone can't exactly abuse it so I'll share here
.bm
The tldr if a user was a mod when they ran the !modpings off command, they will be re-granted the role regardless if they have the ModTeam role or not
which is... not ideal
modpins schedule (s off) or just the off?
also, i am not sure what you mean by
re-granted the role regardless if they have the ModTeam role or not
yknow how there's a two role system?
Moderation Team and Moderators
Personally I'd consider that an incredibly far edge case, maybe worth a fix but definitely not a big priority
I mean, its not an edge case that you want to have happen
additionally, mods can remove their role for up to 28 days
which makes it a little more possible
and because joe was talking about trying to reduce attack vectors, this is probably a good case to resolve, IMO
Fair enough, I'd say make an issue for it just so it can be patched then
issue approved, feel free to submit PR ๐
need (or don't) approval on those too
MFA is fine to add yep, timestamp is over the top, we don't need that
cool, will do some refactoring for mfa
ah ok, i see, i will fix that in my pr
You may have better luck implementing it into your file, since I made a few other changes, didn't realise that there was another pr
alright ๐
good to go, thanks
@fallen patrol why are adding a separate listener? and not adding it to the same on_message as the token?
because mfa tokens don't have user ids or datetimes, and if they do, its not obvious how
so I wanted to seperate the code
although
yeah I'll look at that
!remind 12H
Your reminder will arrive on <t:1639332680:F>!
!remind edit duration 3688 6H
That reminder has been edited successfully!
you can possibly two separate functions to handle token and mfas but only have one listener
~~yeah i'm just gonna delete that reminder
033ca532
cool ๐
What do you mean?
like where you like screenshots bits of ur screen and paste it
like tha
Depends on your device, either way not really a topic for this channel. Check the internet for instructions for your platform
!remind 8H fix bot#2006 commit history...
that was supposed to be amend, not a new commit
Your reminder will arrive on <t:1639355587:F>!
Bump
I wish discord were less aggressive about subscribing you to threads and more about unsubscribing you haha
Here's your reminder: fix bot#2006 commit history...
that was supposed to be amend, not a new commit
[Jump back to when you created the reminder](#dev-contrib message)
oh
@molten perch seems like sir-lancebot#743 and sir-lancebot#968 are about the same, I'd like to work on aspects of 968, but some of it can be removed and return back to 743 if you are wanting to do them
If you aren't, I can.
Hey, so I tried to look for the license of the images, but I couldn't find it anywhere. I'm not sure what to do. Could a core dev please tell me how to proceed?
Not a core dev, but if there's no license they're copyrighted and we can't use them. Maybe grab different images from https://pixabay.com/ instead, they have decent clipart with a very permissible license.
Gotcha, thanks!
and i thought discord.py's paginator was bad....
i have 700+ notifications in github and I only found the tab exists today... so i was trying to mark them all as done
could you add the images as i said last time :)
Select all on the first page, then a link pops up to select the rest
ik but I actually looked through most of them to ensure I wasn't missing anything