#dev-contrib

1 messages ยท Page 160 of 1

fallen patrol
#

๐Ÿ‘€ we can, we can

#

and arrow will actually determine that

gritty wind
#

we can what, I gave two options hyperlemon

static canyon
#

Ab, right. I listed most of the ones I was interested in on the issue. There's probably the odd extra one I missed though

#

I do think we shouldn't support dd-mm-yyyy or mm-dd-yyyy though

#

Just because they're potentially ambiguous

fallen patrol
stable mountainBOT
#

@fallen patrol :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'arrow'
fallen patrol
#

i-

gritty wind
#

๐Ÿ‘Œ

#

lol

#

unlucky

fallen patrol
#

when was it removed?

gritty wind
#

I forgot to install any modules, let me fix that

stable mountainBOT
#

deployment.yaml line 36

arrow~=1.2.1```
static canyon
fallen patrol
#

lol

gritty wind
#

That actually happened a week or so ago

#

There was another switch yesterday that dropped it though

fallen patrol
#

I remember now

gritty wind
#

Yeah, I've got it

#

I don't have a volume mounted though, which makes this annoying

fallen patrol
#

smh

#

wait

#

so if snekbox is not on pydis's cluster, how are requests authenticated?

gritty wind
#

They've never been authenticated

#

We have https running obviously, but that's not the point

fallen patrol
gritty wind
#

Yes?

fallen patrol
#

which means anyone can run code with that api if they have the url right? ๐Ÿ‘€

gritty wind
#

Yes

#

It's not really a concern atm though

#

This isn't a permanent solution

#

If it proves to be a problem, we'd just throw some basic auth in front of it

#

traefik for all it's problems does make that trivial

fallen patrol
#

May I use it too? ๐Ÿคก

gritty wind
#

I'm not going to be hosting it much longer, so nah

fallen patrol
#

well, that's a good thing, so

#

anyways

gritty wind
#

btw

#

!e import arrow

stable mountainBOT
#

@gritty wind :warning: Your eval job has completed with return code 0.

[No output]
static canyon
#

!e ```py
import arrow
print(arrow.get('hello arrow, take my extra (2013-09-29) information and parse the timestamp kthx', ['YYYY-MM-DD))

stable mountainBOT
#

@static canyon :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 |   File "/snekbox/user_base/lib/python3.10/site-packages/arrow/api.py", line 91, in get
004 |     return _factory.get(*args, **kwargs)
005 |   File "/snekbox/user_base/lib/python3.10/site-packages/arrow/factory.py", line 254, in get
006 |     dt = parser.DateTimeParser(locale).parse_iso(arg, normalize_whitespace)
007 |   File "/snekbox/user_base/lib/python3.10/site-packages/arrow/parser.py", line 208, in parse_iso
008 |     raise ParserError(
009 | arrow.parser.ParserError: Expected an ISO 8601-like string, but was given 'hello arrow, take my extra (2013-09-29T01:26:43.830580) information and parse the timestamp kthx'. Try passing in a format string to resolve this.
static canyon
#

Smh

fallen patrol
#

๐Ÿ‘€

#

I uh

#

am I tired and shouldn't be coding? yes

static canyon
#

!e ```py
import arrow
print(arrow.get('hello arrow, take my extra (2013-09-29) information and parse the timestamp kthx', ['YYYY-MM-DD']))

gritty wind
#

#bot-commands hyperlemon

static canyon
#

There were go

#

You just need to specify the format you're looking for

fallen patrol
#

hmm i wonder where the default list is

static canyon
#

It probably doesn't have one as such

#

Smh

fallen patrol
#

!d arrow.api.get

stable mountainBOT
#
arrow.api.get(*, ...) โ†’ arrow.arrow.Arrow``````py
arrow.api.get(*args: int, ...) โ†’ arrow.arrow.Arrow``````py
arrow.api.get( ...) โ†’ arrow.arrow.Arrow```
Returns an [`Arrow`](https://arrow.readthedocs.io/en/latest/index.html#arrow.arrow.Arrow "arrow.arrow.Arrow") object based on flexible inputs.
fallen patrol
#

(yeah their sphinx docs are weird)

static canyon
static canyon
fallen patrol
#

arrow.get is arrow.factory.ArrowFactory().get, of when a string as the first param and no second param are supplied, uses a DateTimeParser().parse_iso() which has this list in its body.

static canyon
#

Right

#

Makes sense

#

I suppose really we don't want all of those combinations

fallen patrol
#

yeah, we only want a few

static canyon
#

But at the same time is actually harmful to keep them as extras?

fallen patrol
#

so I'm thinking to defer to the existing iso8601 converter on bot and if that fails, then match on our own definitions with arrow.get

static canyon
#

!e py import arrow print(arrow.get('16:00', ['HH:mm']))

stable mountainBOT
#

@static canyon :white_check_mark: Your eval job has completed with return code 0.

0001-01-01T16:00:00+00:00
static canyon
#

Hmm

#

That's annoying

#

It doesn't do today's date

#

So we'll need to do that ourselves ig

fallen patrol
#

uhhh we can continue to use dateutil for that -- the Duration converter

static canyon
#

I think we can use our own DayDuration or something, no?

#

What ModPings uses

fallen patrol
#

btw not sure if this method is useful but:

#

!d arrow.arrow.Arrow.dehumanize

stable mountainBOT
#

dehumanize(input_string, locale='en_us')```
Returns a new [`Arrow`](https://arrow.readthedocs.io/en/latest/index.html#arrow.arrow.Arrow "arrow.arrow.Arrow") object, that represents the time difference relative to the attrbiutes of the [`Arrow`](https://arrow.readthedocs.io/en/latest/index.html#arrow.arrow.Arrow "arrow.arrow.Arrow") object.
static canyon
#

Yeah, I saw that

fallen patrol
static canyon
#

Not sure how useful it is to be honest

fallen patrol
#
The following formats are excepted:
    - H:M
    - H:M am/pm
    - H am/pm
    - H

well that solves those on their own, kiiinda

fallen patrol
#

since I'd like to be able to support a timezone as well ๐Ÿ™ƒ

static canyon
#

It should be accepted

static canyon
fallen patrol
dusky shoreBOT
static canyon
#

Nice

#

Will do

short snow
#

๐Ÿ‘€

#

its accepted

#

volC already said that in his reviewa

fallen patrol
#

i must have cherrypicked a commit with an older version ๐Ÿ˜“ cc @static canyon

short snow
#

tizzy still review it

static canyon
static canyon
fallen patrol
#

yeah, it was to be able to use it now, I'll rebase after its merged

#

(I would be surprised if this reminder feature gets merged before modpings improvements)

#

I made a list of formats earlier that I'd like to be able to support, although if we can't do all of them I'd like that too
(currently supported conversions)...

  • 09:27
  • "9:27 am"
  • "9:27 pm"
  • 9:27pm
    -? tomorrow (maybe)
  • 24H
  • 19/12/21
  • 19/12/2021
  • 2021/12/19
#

not sure if all of these are useful tho

#

and actually, these are all easy on their own

#

The problem arises when supporting +02 or timezones

static canyon
#

The day/month/year I don't want to support

fallen patrol
#

edited to cross those out

fallen patrol
# fallen patrol The problem arises when supporting +02 or timezones

but yeah, all of these are easy enough on their own, but once we start to mix them (eg date + time) we either need to make a lot of custom strings (can be done programmably) or figure out a better way to parse them or something. Then there's do we also add timezone, or something about that

#

i'm gonna go sleep

static canyon
#

@gritty wind are you free to answer a query I have RE bot#2001?

dusky shoreBOT
fallen patrol
gritty wind
#

Sure, go ahead and ask

fallen patrol
#

I already know I'll be back tonight

static canyon
short snow
static canyon
#

I suppose we should technically check the moderator has the Moderation Team role too (i.e. Akarys)

gritty wind
#

Honestly, either will be fine given how unlikely that situation is in the first place

#

the mod team isn't losing members every other week

static canyon
#

I agree, but I do think it's something we should catch

#

We do get people stepping down every so often, and we should account for that imo

short snow
#

doesn't arl's pr handle ti

#

yeah that one

fallen patrol
#

bad arl

fallen patrol
#

so while its a (very) unlikely situation, its not one to want to be in

gritty wind
#

I think you missed the part where the question was should this be an info log, or a warning

#

not whether we should do it or not

short snow
#

imo, it isn't really a warning, its just they aren't on the server anymore

#

so a info should be fine

fallen patrol
gritty wind
#

If you want, you could always break a couple rules and get muted /s

short snow
#

!mure @fallen patrol 8H lol

fallen patrol
gritty wind
#

We don't hand out mutes for no reason on policy

short snow
#

really?

#

where did tizzy's review request devlog message go pithink

#

the red one

static canyon
#

How do I do a multi-line suggestion on a review?

#

Ah, got it

#

You just drag

static canyon
#

Ah crap I approved

short snow
static canyon
#

It said I had to leave a comment in order to request changes

#

Ah, there we go

static canyon
#

I had to give a reason why I was requesting changes, I didn't have to leave a comment on a changed line

#

if that makes sense

#

i.e. just had to write here

short snow
static canyon
#

yeah

green oriole
#

Right, yeah

severe tangle
#

!ot command broke

stable mountainBOT
#
Did you mean ...

ยป ot
ยป off-topic-names

severe tangle
#

!ot

stable mountainBOT
severe tangle
#

See, both of those worked before, but they don't work now, soo, uhhh

cursive relic
#

I just saw the same thing, also it would be nice if the ot channel was randomized if it makes sense

static canyon
#

The !ot some text here doesn't work since it fuzzymatches but ends up not being able to distinguish between ot and off-topic-names, but there is a PR to fix that

severe tangle
static canyon
static canyon
#

There was a conscious decision to change it

severe tangle
#

Huh?

static canyon
#

!off-topic-names shows them instead

stable mountainBOT
severe tangle
#

Ah

static canyon
#

!ot

stable mountainBOT
severe tangle
#

Any reason for the change?

static canyon
#

It's used to redirect people when they're off-topic and so you only need to list one channel. Listing more just clutters the channel (people will usually just click the first channel anyway)

severe tangle
#

Ah understandable

stable mountainBOT
#
Did you mean ...

ยป ot
ยป off-topic-names

clever wraith
#

we kinda usually used to message like.

!ot you shall question here

brazen charm
#

bot#2023

clever wraith
#

which puts both message and command in one go.

brazen charm
#

That pr should fix it

#

Currently it's not an exact match because it looks it up as a tag with an ot group and then falls back to fuzzying

clever wraith
#

oh i see. alright that would help a lot. thanks for the pr!!

static canyon
static canyon
#

So basically what Numerlor said just now

clever wraith
#

I see. I apologise. Din't read above part.

static canyon
hoary haven
magic arch
#

I can add in another review, but all that's really left is a core dev ๐Ÿ˜‚

patent pivot
#

merged

fallen patrol
static canyon
#

I don't have permissions to that channel anyway

patent pivot
austere hornet
fallen patrol
#

bot#2006 needs one core dev review
bot#2017 is ready for review

sir-lancebot#969 needs two reviews
sir-lancebot#981 is ready for review
sir-lancebot#982 is ready for review and needs two reviews

austere hornet
#

Ig while we're at it, sir-lancebot#901 needs one core-dev review

dusky shoreBOT
fallen patrol
#

@summer garden are you the creator of the sudoku issue?

summer garden
austere hornet
fallen patrol
summer garden
#

that's right

fallen patrol
#

okay, that's what I was trying to figure out lol

austere hornet
#

But isn't it not obvious who is who? Like who created the issue and who commented?

fallen patrol
#

FWIW, if going down to a 4x4 array, I'd suggest doing something with buttons, like the pending tic tac toe enhancements

fallen patrol
austere hornet
summer garden
austere hornet
#

Only 16

fallen patrol
#

you can have up to 25 buttons, arranged in a 5x5 array on a message

summer garden
#

the tic tac toe has 9, and that already looks like a lot to me. It would be good to see before judging though

austere hornet
#

Well 9 is less than 16, I'm not sure why it seems like a lot

fallen patrol
#

(9 already seems like a lot to them, so they want to see 16 before they judge)

fallen patrol
brisk brook
#

You can only have a 5x5 grid with buttons in Discord!

austere hornet
brisk brook
#

You can, but not more

austere hornet
#

Ah

fallen patrol
dusky shoreBOT
fallen patrol
#

I need to update those screenshots, lol

patent pivot
#

streaming me attempting a new method of snekbox deployment

fallen patrol
#

just got on pc and updated screenshots

#

@summer garden

#

so presumably we could do something like this for Sudoku

trail pilot
#

Oh yeah that would work

#

since a max of 5 buttons per row

magic arch
fallen patrol
#

a nice feature, is buttons don't have to be enabled to exist, so we could send 25 disabled buttons and use them as the UI

fallen patrol
#

May I be dragged in?

patent pivot
#

oop

#

fixing

#

fixed

magic arch
#

live: joe fixing perms

patent pivot
#

lol

fallen patrol
#

lol that channel has always been private, hasn't it?

austere hornet
magic arch
patent pivot
#

yea but sometimes I open it when I stream here

fallen patrol
#

ah I can't speak in it, but can join now neat

patent pivot
#

okay let's give this a go

fallen patrol
trail pilot
#

also I heard discord is adding text input fields

fallen patrol
#

this is tic tac toe after a win

#

yeah, they are

#

although not for buttons

#

those will be part of slash commands

trail pilot
#

oh, unfortunate

fallen patrol
#

(old screenshot)

magic arch
#

watching joe slowly read error messages ๐Ÿ‘€

austere hornet
#

Lol

fallen patrol
#

but slash commands & autocomplete is awesome

trail pilot
#

rather than self.bot.wait_for("on_message", ...)

fallen patrol
#

that's a different thing, uhhh lemme find it

hoary haven
#

are we still on scale's thing for snekbox?

fallen patrol
#

can't find it but its a different thing

fallen patrol
thorny obsidian
#

Also goddamn talking while running is hard. My lung capacity was not prepared for that

fallen patrol
#

hm why is there a 99 member limit on this channel?

magic arch
#

Every channel here has a limit (even staff), I assume for raids maybe

austere hornet
magic arch
#

Every non-AFK channel then lol

fallen patrol
#

(ofc that might be an oversight or smth)

#

ah

#

I wonder if its used as a counter on the staff channel, since there's more than 100 staff now

austere hornet
fallen patrol
#

although given staff can have perms that don't count, that's probably what's going on, so its really just a counter

austere hornet
#

At least I've asked that question before and someone (can't remember who) said that in response

#

So yeah

fallen patrol
#

That's a lot of different date and/or time formats that could be used

#

but in the end it makes it a pretty powerful converter lol

#

I can't wait until discord adds that talked about datetime slash command input

#

^ in regard to that, probably easiest to go with a really simple input since hopefully can convert it to a slash command at some point

thorny obsidian
#

It has a cap of 99 so it has the badge of how many people are in it. That's all

vocal wolf
#

what's going on over here

#

in there

#

@patent pivot you better be talking about k8s

fallen patrol
#

๐Ÿ‘€

austere hornet
#

Lmao

fallen patrol
#

also @patent pivot you should optimize your screensharing for text

ashen isle
#

koo burr nuh tees

vocal wolf
#

kyoo brr net ez

austere hornet
#

kyu berr niiites

fallen patrol
#

ty

patent pivot
austere hornet
vocal wolf
fallen patrol
#

bot#2008 is ready for re-review @static canyon @cold island, as you both requested changes

austere hornet
#

Could a core-dev take a look at and maybe approve sir-lancebot#985?

dusky shoreBOT
fallen patrol
austere hornet
fallen patrol
#

re-reviewed #901 @austere hornet, I missed this earlier but not worth not approving. The timeout message is a bit not related, also the user can try again right then, they don't have to wait

Additonally, I'm not sure about the random titles, as its somewhat unprompted. I would make this mention the user, as well

fallen patrol
#

pings don't bother me that much ยฏ_(ใƒ„)_/ยฏ

austere hornet
#

Yeah me neither but I meant to disable it (hence why I have "pings ok" in my nickname for the server)

fallen patrol
#

fixing bot#2022, thinking to export the get tag out of the error handler as well, to be able to fuzzy match the tags when using !src as well pithink

dusky shoreBOT
fallen patrol
#

since it has that fuzzy matcher which is used for commands, since this takes a command argument as well, I feel like it should use the fuzz too

austere hornet
fallen patrol
#

cool

austere hornet
#

Will respond there

fallen patrol
#

@brazen charm honestly the solution is to not be importing objects from other extensions

#

or do something with get_cog...

fallen patrol
#

I left a new comment on bot#2022

dusky shoreBOT
fallen patrol
#

I think the best solution is to move the Tag Identifier class out of the cog

static canyon
stable mountainBOT
#
I'll allow it.

Your reminder will arrive on <t:1639995725:F>!

frigid latch
#

anything that i can contribute to

#

any open issues?

gritty wind
#

We have open issues on all our big projects @stable mountain/@dusky shore/website

#

If you aren't looking for anything in particular, sir-lancebot is the most welcoming for beginners

#

There is more info about all three projects here

#

!contribute

stable mountainBOT
#

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

  1. Read our contributing guidelines
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
stable mountainBOT
static canyon
austere hornet
#

@patent pivot It looks like you approved sir-lancebot#985 but haven't assigned me, could you please assign me?

dusky shoreBOT
austere hornet
austere hornet
austere hornet
fallen patrol
static canyon
#

YYYY-MM-DD HH:mm:SS+00:00 where +00:00 is the UTC offset

#

I think there should be a T there somewhere

fallen patrol
#

and which subsets of that should we support? date, time, timezone, date and time, date and time and timezone

summer garden
#

are you not planning on using a parser? Say dateutil's for example

static canyon
# fallen patrol and which subsets of that should we support? date, time, timezone, date and time...
YYYY-mm-DD HH
YYYY-mm-DD HH:MM
YYYY-mm-DD HH:MMยฑ00:00
HH:MM
HH:MM+00:00

Notes:
- Dates can also have `/` instead of `-`
- Spaces before the time can be replaced with a `T` (as per ISO)
- Times can be 24hr or 12hr
- Timezone assumes UTC when not provided
- When minutes not provided, assume value of 0
- Seconds not permitted
```I guess something like this. We don't want to allow just date since we wouldn't know what time on that date to send the reminder (unless we just use the current time I guess)
fallen patrol
#

so this is basically all of the different format strings I have to generate, and then a different parser for the strings missing a date

static canyon
#

And I suppose all the stuff with a space should allow for a T instead of a space because that's what ISO says

fallen patrol
static canyon
#

The main thing is that just HH:MM isn't supported by ISO

#

And we don't want to support seconds/milliseconds

fallen patrol
#

hm I thought date was part of the original issue, which would send at midnight utc or what timezone they specified

static canyon
#

I don't think so

#

I don't like that idea

#

I think if anything it should be at the current time on that date

#

But I think just date is too ambiguous really

#

So I'd say if date is provided then time needs to be too

#

That's my opinion anyway

#

If you disagree feel free to say so

fallen patrol
#

i liked being able to put just the date in from my testing

#

although i can see the complexity that would add and such, so probably best to not have it

static canyon
#

This entire PR is just me going "I wanted this feature all the times I've used the command"

fallen patrol
#

same tho

static canyon
#

I'm happy to keep that if you'd like it

#

The thing is whether we'd want it to remind at midnight or whether we'd want to remind the same time the command was invoked

fallen patrol
#

either way is fine on the implementation side

#

i personally liked midnight

static canyon
#

I think UX wise I'd expect it to be the same time as me invoking the command though

#

Maybe someone else can give their thoughts? CC @summer garden if you're still here

cold island
static canyon
cold island
#

One approach might make sense to the developer as they're writing the feature, but from a user perspective I'm not sure it makes sense to not provide an hour

static canyon
#

It's just that you don't have to

cold island
#

Yes, I'm saying I'm not sure it makes sense to not have to

fallen patrol
#

yeah that makes sense

static canyon
#

Yeah, okay

#

Let's not do that then

dusky shoreBOT
static canyon
#

There you go :p

fallen patrol
#

(@austere hornet I left comments on those two)

fallen patrol
stable mountainBOT
#
Yeah okay.

Your reminder will arrive on <t:1640041355:F>!

austere hornet
austere hornet
#

@fallen patrol Just to make sure I understood - did you want me to add an author mention inside or outside the embed?

fallen patrol
#

outside the embed, mentions within embeds don't actually ping ppl

austere hornet
#

Yeah ik, but I wasn't sure if you actually wanted to ping the user or not

austere hornet
#

@fallen patrol How does this look?

fallen patrol
#

sure

stable mountainBOT
vale ibex
#

Huh, this is a new one. Anyone seen this before? ```
โ˜ธ pydis (default) in metricity ๐Ÿฃ message-sync-command ๐Ÿ“ฆ ๐Ÿ“ ร—1๐Ÿ›ค๏ธ ร—1via ๐Ÿณ default ๐Ÿ v3.10.0
๐Ÿ•™ 23:08:14 โฏ docker-compose up --build
[+] Building 0.7s (4/4) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 436B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for docker.io/library/python:3.9-slim 0.7s
=> [auth] library/python:pull token for registry-1.docker.io 0.0s

[internal] load metadata for docker.io/library/python:3.9-slim:


failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: unexpected status: 503 Service Unavailable

#

I am assuming desc = failed to fetch oauth token: unexpected status: 503 Service Unavailable is the important part

#

huh, interesting ```
โ˜ธ pydis (default) in metricity ๐Ÿฃ message-sync-command ๐Ÿ“ฆ ๐Ÿ“ ร—1๐Ÿ›ค๏ธ ร—1via ๐Ÿณ default ๐Ÿ v3.10.0 took 26s
๐Ÿ•™ 23:10:21 โฏ docker login
Authenticating with existing credentials...
Login did not succeed, error: Error response from daemon: Get "https://registry-1.docker.io/v2/": received unexpected HTTP status: 503 Service Unavailable
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (chrisjl95):
Password:
Error response from daemon: Get "https://registry-1.docker.io/v2/": received unexpected HTTP status: 503 Service Unavailable

#

getting 503 from docker login

#

Guess I'm not pulling any images this evening haha

fallen patrol
vale ibex
#

heh that'll be it

fallen patrol
#

yeah lol

austere hornet
#

Sounds fun

gritty wind
#

Iโ€™m sorry but are we just ignoring that beautiful terminal

#

So many emojis

#

Dockers back btw

vale ibex
#

colour too ๐Ÿ˜„

clever wraith
#

what is your largest project?

austere hornet
gritty wind
#

By what metric lol

clever wraith
gritty wind
#

Bot is biggest by contributions and code base size

clever wraith
#

this one?

austere hornet
gritty wind
#

Nah we arenโ€™t related to the discordpy project

clever wraith
#

sorry

gritty wind
#

This is our site: https://pythondiscord.com

#

Itโ€™s okay haha

clever wraith
#

yeah, that's what I was looking for :)

austere hornet
gritty wind
#

I did actually collect a bunch of numbers for this year during the staff meeting

#

Fun fact: up until then, weโ€™ve merged/closed 1000 PRs this year

gritty wind
#

999, then I closed one during the meeting

austere hornet
gritty wind
#

I may put out a contrib announcement, sounds like fun

austere hornet
vocal prairie
#

We also hit 2000 issues/prs on bot, which is nice

clever wraith
#

hey. a stupind question: https://pythondiscord.com/ this looks like it could be made without 280k people

austere hornet
gritty wind
#

855 events on bot, 218 on site

gritty wind
#

Naturally, not all people in the community contribute to everything

#

If youโ€™d like to contribute, all our projects are open source

#

!contribute

stable mountainBOT
#

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

  1. Read our contributing guidelines
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
clever wraith
#

I'd like to propose a new project

gritty wind
#

Go ahead, the floor is open

#

May have to redirect you to a different place depending

clever wraith
#

let's build a search engine. without scrapers, with only human input and with federation (trolls get yeeeted)

gritty wind
#

Itโ€™s an interesting idea, but we lack the resources to possibly ever moderate something like that reliably, or build it

clever wraith
#

I tried :)

#

that's my dream

#

won't stop trying :D

gritty wind
#

Well I can respect that, good luck to ya

austere hornet
clever wraith
#

I'm not

austere hornet
#

Ok

clever wraith
#

it seems to have connection with your project

#

only :)

austere hornet
#

Well yes I was just wondering if you were interested to see how many contributors there are to https://pythondiscord.com. That's all.

clever wraith
#

that I am

#

but the number seems obfuscated :/

gritty wind
#

59

clever wraith
#

sorry, I don't see that

#

can give you a screenshot

gritty wind
#

I donโ€™t think it gives you a number, but it sorts everyone on that page. If you scroll to the bottom, the last contrib is number 59

#

The GitHub site is kinda weird on mobile, itโ€™s scrolling up on its own

austere hornet
clever wraith
#

yeah

gritty wind
#

Itโ€™s a bit difficult to take a screenshot

clever wraith
#

true

clever wraith
#

approve it

#

federate it

#

ok, that's naive, I'm sure

gritty wind
#

Unfortunately you significantly underestimate the number of trolls we deal with

#

And when a group of apes get together, thereโ€™s no telling what theyโ€™ll do

#

They might even start riding horses

clever wraith
#

:D

austere hornet
#

Lol

clever wraith
#

no, I understand that

#

but I don't understand how points/weight don't solve that

#

example

gritty wind
#

Because from a legal aspect, we may or may not end up responsible for whatโ€™s on that service. It also wouldnโ€™t be a very good service if enough trolls manage to overturn the odds. Itโ€™s also only part of the reason we arenโ€™t working on a search engine

clever wraith
#

Because from a legal aspect, we may or may not end up responsible for whatโ€™s on that service. 1.

#

ok, so you've thought about it

#

eh

#

the choice is either google and the likes similar swallow us

#

or we start building something of our own

#

so it won't be a search engine

#

but recommendations from my friends

clever wraith
#

:)

gritty wind
#

Itโ€™s easy to say google and big companies suck, letโ€™s build our own. That is a little naive though, because unlike google, we donโ€™t have billions of dollars to fall on if we have problems. Legal problem, lack of work, moderation, the project outright failing, etc.

#

Iโ€™m not saying you shouldnโ€™t try to change the world, Iโ€™m saying pick your battles

clever wraith
#

I agree

#

I suggest that we try :)

#

that's all

gritty wind
#

Alright, thanks for your suggestion, will keep it in mind

#

If you want, you can open an issue on our meta tracker linked in #community-meta

#

But I doubt weโ€™ll take it on

clever wraith
#

I doubt I'll open an issue

#

but thanks :)

fallen patrol
#

@vale ibex docker is back up ๐Ÿ™‚

austere hornet
#

@fallen patrol On your last comment on the Sudoku issue you mentioned I could use different codeblock languages to get different colors for the codeblock, right? What languages specifically do you know will give you different colors for the codeblock?

fallen patrol
austere hornet
fallen patrol
#

uhhh not sure

#

well technically they have a grey colour

austere hornet
#

So idk. But as I posted on the issue I'm going to think about this more tomorrow maybe if I have time and will post there when I make a final decision as to how I want it implemented and we'll go from there.

fallen patrol
#

@short snow I'm trying to test bot#2021 but for some reason its not doing anything?

dusky shoreBOT
short snow
#

add print to on_message, see what msg links it gets

fallen patrol
#

just a sec

short snow
#

and check if this is valid for your setup, like the on_message doesn't return early when it shouldn't

hoary haven
austere hornet
fallen patrol
hoary haven
#

no it's plain

#

wasn't this an idea for sudoku though? we have plenty of iOS users

austere hornet
#

Well guess what, it's plain on Android too smhhh

fallen patrol
austere hornet
fallen patrol
#

ugh, PIL might end up being what has to be used ;-;

short snow
#

IMO, there are many websites for solving sudoku online providing a much better ui than discord so not sure if should have sudoku game support

austere hornet
thorny obsidian
#

The lack of robust syntax highlighting for mobile is unfortunate

dusky shoreBOT
hoary haven
#

no landscape mode and no syntax highlighting for iOS, imagine what it's like to help on pydis on an iphone lol

thorny obsidian
austere hornet
#

Yeah totally agree with Kat

short snow
#

using PIL would be costly ๐Ÿคทโ€โ™‚๏ธ

fallen patrol
fallen patrol
#

!d asyncio.loop.run_in_executor

stable mountainBOT
#

awaitable loop.run_in_executor(executor, func, *args)```
Arrange for *func* to be called in the specified executor.

The *executor* argument should be an [`concurrent.futures.Executor`](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Executor "concurrent.futures.Executor") instance. The default executor is used if *executor* is `None`.

Example:
fallen patrol
#

which is what the avatar commands use

austere hornet
thorny obsidian
short snow
#

yes but we can't do that sudoku, he added a good "ratelimiter", which can't be done for sudoku when you have to edit the images so muany times

#

for a single game

austere hornet
thorny obsidian
#

Sure, that reasoning may be a blocker. We'll have to fully discuss with core devs. But I do want to be careful that we don't turn down ideas just because it exists elsewhere, because that's not the point of sir lancebot.

short snow
austere hornet
fallen patrol
#

suggestion (to bikeshed): help command support tags, perhaps with fuzzy match

cursive relic
#

if @stable mountain goes down/restarts will the reminders still work after it, I mean the reminds set before restart

short snow
#

reminders are stored in a database, so it doesn't matter if python goes down/restarts, yes

cursive relic
#

hm weird

fallen patrol
#

darned python making me ghost ping, sorry

#

I feel like the help command should support tags if the query isn't found

gritty wind
#

We already do fuzzy matching on tags

#

If the fuzzy matching there didnโ€™t return anything, what will it return exactly in that embed

fallen patrol
#

ot is a tag name now, I'm proposing that running help on a query that matches a tag name should be shown in the help command

static canyon
fallen patrol
#

say its a tag and show the first line as a summary

static canyon
#

First line probably wouldn't make much sense in a lot of tags

#

First sentence would probably work better

#

But then that assumes all tags have proper punctuation etc. which some don't

gritty wind
#

Whatโ€™s the end goal anyway

fallen patrol
#

i've seen uses where it wasn't known that a tag was a tag, so it wasn't too easy to get info about it

fallen patrol
#

bot#2022 is loosely related

dusky shoreBOT
obsidian patio
#

I'm planning to create a .twemoji <codepoint|emoji> command that displays the given emoji and sends a link to the twemoji source file. This will probably come in handy in certain discussions in #dev-branding

#

I presume no core devs have anything against adding this command? I'm thinking of adding it to @dusky shore

patent pivot
#

would like to see an issue opening for it, but I don't have anything against it

obsidian patio
#

There we go sir-lancebot#987

dusky shoreBOT
obsidian patio
#

What interpreter should I select in VSC when running the bot through docker?

#

Without it, VSC doesn't recognize the imported packages

thorny obsidian
#

If it's running through docker compose vsc's interpreter shouldn't matter

cold island
#

You might be able to attach the container with VSC, but for simplicity I'd set up my own environment locally

vale ibex
#

If you want vsc to have code completion, and you want local linting, you need to poetry install all deps locally too

obsidian patio
brazen charm
#

Might as well run it locally

cold island
#

Yeah it's more convenient to run it locally. You can keep the other services like the site in Docker

obsidian patio
#

Yep, that's what I usually do. I just finally have enough storage to use docker, so I'm trying that out

fallen patrol
#

I've been following the snekbox saga mostly, but why exactly is it broken on the cluster, but not on scale's server?

#

IK its something to do with cgroups, but I have no idea what those are or why they're a problem

gritty wind
#

pydis cluster is running cv2, mine is running cv1

#

Since both are managed clusters, we have no control over what is what

#

Mark is working on getting things working again hopefully

fallen patrol
gritty wind
#

cgroups version 2

fallen patrol
gritty wind
#

What's cgroups version 2; well, I don't think the person that wrote the spec could even answer that

gritty wind
patent pivot
#

lmfao

#

the main difference is

#

in cgroups v1 you would write to something like

fallen patrol
gritty wind
#

I wouldn't be surprised if this was forced upon him >.>

patent pivot
#

/sys/fs/cgroups/memory/snekbox.aaa-bbb-ccc/memory.limit_in_bytes

#

and you write to that file and add processes to the cgroup

#

and they get a mem limit applied

#

and then if you want to limit PIDs you write to /sys/fs/cgroups/pids/snekbox.aaa-bbb-ccc/pids.max

#

that filename is wrong but I can't remember it

#

aaa-bbb-ccc is something we generate for each exec

#

anyway, cgroups v2 just changes the filesystem structure

fallen patrol
patent pivot
#

so you write to /sys/fs/cgroups/snekbox.aaa-bbb-ccc/memory.max

fallen patrol
#

I thinkk its memory limits/management?

gritty wind
#

Well, joe basically explained it

patent pivot
#

memory limits, PID limits, CPU limits

#

you set limits and add processes into the cgroup

fallen patrol
#

ahh

#

so what broke in v2?

patent pivot
#

nothing broke

#

it's just a change in the structure of the filesystem which snekbox isn't used to

#

so we need to make code amendments to snekbox to let it handle that

fallen patrol
#

since if its just the filesystem paths, wouldn't that be simple to change?

patent pivot
#

there are also some modifications in how docker exposes the control group to the container which we have to work around

#

in theory yes, but the docker modifications make it a bit harder

patent pivot
#

notably, you can't enable these controllers if there are processes already in a cgroup, which there are (when snekbox boots, docker adds it to a cgroup)

thorny obsidian
#

I feel bad for Mark, having to adapt snekbox for cv2 and docker adjustments

patent pivot
#

we asked around and yesterday we found our answer

gritty wind
#

I always knew Mark was a bot

#

He's just too efficient

thorny obsidian
#

Xith and Mark, the two bots that keep us running

fallen patrol
#

and scale

patent pivot
#

the container will boot and put snekbox in it's own root private cgroup, then we have to move the container into it's own child cgroup, then we can modify which controllers are enabled, then snekbox can be on it's merry way

fallen patrol
#

oh that's fun

patent pivot
#

which we might still use, because we may be able to throw gVisor into the mix for some added security

fallen patrol
#

๐Ÿ‘€

patent pivot
#

but we do now know that it will work inside our k8s

fallen patrol
#

@gritty wind :glare:

patent pivot
fallen patrol
#

yeah, makes sense

patent pivot
#

and most people don't need to know that, because most people don't mess with cgroups on the regular

#

our use case is very unique

fallen patrol
gritty wind
#

Imagine using it and getting nginx banned

fallen patrol
patent pivot
patent pivot
#

in theory, with kubernetes upgrades, the only noticeable change should be in cluster

fallen patrol
#

i mean yeah, afaik, its kubernetes, so the underlying OS shouldn't matter

patent pivot
#

cgroups really is a fairly abstract portion when you're doing container orchestration, this is the stuff that containers are built on and generally only the container engine will mess with cgroups

#

cgroups is the tech that docker+other engines use to do container limits

#

so you're not really expected to play with it yourself

#

it is supported though, so you can do that

gritty wind
#

New idea: spin up a new snekbox pod for each eval

patent pivot
#

it's just that there is a bit of a weird grey area where tools like kubernetes don't expose things that you can configure like docker does

gritty wind
#

It's going to be wonderful during outages

patent pivot
#

lmfao

#

a good read

fallen patrol
#

well, why does snekbox need to use cgroups itself?

#

why can it not use a container engine to manage that itself?

gritty wind
#

Running docker inside docker heh

#

Well, we use cgroups + nsjail to get isolation and resource limits

patent pivot
#

yeah

#

snekbox executions aren't containers, they're jails

#

and keeping them as jails makes it easier for us

#

we don't want to run an engine inside an engine, that leads to a load of unexpected behaviour

fallen patrol
#

right?

patent pivot
#

kind of

#

snekbox is already a privileged container

stable mountainBOT
#

deployment.yaml lines 21 to 22

securityContext:
  privileged: true```
patent pivot
#

which means it's already a fairly powerful container

#

and we need that there to be able to write and control cgroups

#

but using nsjail instead of a container engine gives us the control we need without having to start up some daemon that is doing all sorts of unnecessary things

#

nsjail is a form of container engine

#

it's doing the exact same things that docker and containerd would do

fallen patrol
#

ahhh

clever wraith
#

You should use individual capabilities rather than using privileged fwiw

patent pivot
clever wraith
#

Oh right, I forgot that it isn't running on the cluster lmao

#

I believe NsJail documents the capabilities required somewhere somewhere

patent pivot
#

so I suspect finding the specific caps would be a matter of trial and error

tawdry vapor
#

It needs to basically be a systems test

#

Where it goes through an actual container running the api with gunicorn

fallen patrol
#

how can I run the bot not in docker, but redis in docker?

gritty wind
#

docker-compose up redis snekbox

#

config:

fallen patrol
#

they're up, so my config is bad

gritty wind
#
    host:  "localhost"
    port:  6379
    password: !ENV "REDIS_PASSWORD"
    use_fakeredis: false

or use_fakeredis to true /shrug

fallen patrol
#

odd

#

ohhh

#

yeah it works now

#

host: "localhost"
had this set to 'redis' since I was previously running the bot in docker

#

which means I also have to do the same thing for site

#

fix submitted, bot#2025

dusky shoreBOT
austere hornet
#

Eyy #2025 that's the year I graduate lol (yes ik that's off topic)

fallen patrol
#

metricity#11 @vale ibex, was automatically redirected to main

dusky shoreBOT
vale ibex
#

cool, github smart

#

Rebased it onto main now anyway, since it was missing a fix commit

fallen patrol
#

lint failure ๐Ÿฅฒ

#

imagine not linting before you push

fallen patrol
stable mountainBOT
#
Sure.

Your reminder will arrive on <t:1640121027:F>!

fallen patrol
#

!remind delete 3782

stable mountainBOT
#
Okay.

That reminder has been deleted successfully!

fallen patrol
#

Chris keeps pushing to it ;-;

vale ibex
#

That push was a rebase lol

austere hornet
#

Wait so PyDis supports threads now? Now sure what the PR Scale merged was about

vale ibex
#

We've had threads for a while, just limitted to staff channels

#

The PR that was just merged was to add support for threads in metricity

austere hornet
#

Ohh ok

#

Got it

fallen patrol
vale ibex
#

Done until there are comments

fallen patrol
#

good

#

and now the question you've all been waiting for.... how do I set up metricity?

vale ibex
#

The readme should cover it

fallen patrol
#

lets see

#

lol, can I make a pull to unpin the docker *image version to use the latest 3.9 version?

#

I've previously made one for lance, so its something we've done before

gritty wind
#

I don't think that's a good idea, but people have been unpinning it without any discussion before so I guess

fallen patrol
#

bot#1727

dusky shoreBOT
fallen patrol
gritty wind
#

There is no reasoning

#

You realize that right

#

And that's what I'm getting at

#

There is a good reason for locking the version that tight

fallen patrol
gritty wind
#

Security updates won't happen unconsciously, someone has to come in and at the very least rebuild the container

#

The reason is it's 100% clear what version we're using. That means everyone can use the same version, and for updates specifically, it means we have an easy way to know what version we're on, and what to update to

#

Here for instance: tell me what version forms-backend is on

fallen patrol
#

ah. That makes sense

#

๐Ÿ‘€

#

!paste

gritty wind
#

What do you have in your config

fallen patrol
#

I'm running the container generated by the bot's docker compose

#

(ignore the first db that's for a different bot)

#

although maybe that's related

gritty wind
#

It's not bot, it's the other one

#

metricity tries to claim 5432 too

vale ibex
#

You're running --no-deps

vale ibex
#

so postgres isn't getting started

fallen patrol
#

although that doesn't work, so I'm curious why not

gritty wind
#

Network

#

Compose isolates the network for each stack

#

You can pass a network flag to override it, or use the underlaying tunnels that join all containers

fallen patrol
#

ah

gritty wind
#

docker network ls

#

probably something along bot_default or site_default

fallen patrol
#

okay

gritty wind
#

You could also try docker inspect <container name> and grep for the right one

fallen patrol
#

to docker-compose run

gritty wind
#

--project-name

#

It's a bit hacky though

#

Since it'll deploy it to the site other project's stack

#

docker run without compose accepts network

fallen patrol
#

ah gotcha

gritty wind
#

Considering metricity is a single container, that might be your best bet here

#

If you're running the metricity bot locally, you don't actually need the docker stuff for anything

fallen patrol
#

I'll just... build a metricity image, and make a container from that without compose

gritty wind
#

Just point the config at 7777

fallen patrol
#

(canary died again lol)

gritty wind
#

Join the dark side, come to stable

fallen patrol
#

I'm on stable atm

#

...

gritty wind
#

3rd time's the charm

fallen patrol
#

I sent it once on canary, and once on stable

gritty wind
#

I have this, it might help

@REM Update
git fetch
git pull

@REM Build
docker build . -t metricity

@REM Cleanup
docker container stop metricity
docker container rm metricity
docker image prune -f

@REM Run
docker compose -f ../site/docker-compose.yml up -d
docker exec -it site-postgres-1 /bin/bash -c "psql -U pysite -d metricity -c 'DROP SCHEMA public CASCADE; CREATE SCHEMA public;'"

docker run -d --env-file .env --network site_default --name metricity metricity
#

Usually, when I'm using metricity I'm just pulling the latest changes, and having the bot start up in the background

fallen patrol
#

docker exec -it site-postgres-1 /bin/bash -c "psql -U pysite -d metricity -c 'DROP SCHEMA public CASCADE; CREATE SCHEMA public;'
what does this do?

patent pivot
#

and we encourage force pushes on branches/forks

#

and I don't think we're going to go back to the model of allowing contributors to the org

gritty wind
fallen patrol
#

gonna restart from the beginning so I can maybe work on some site issues mayhaps

#

wait...

#

docker-compose.overide.yml is a thing

#

;-;

#

I can just make an override file for bot which instead of pulling web, will build it from the neighbouring folder

gritty wind
#

What are you even doing

fallen patrol
#

getting my docker containers in order and to submit to me

#

also my development environment too

austere hornet
stable mountainBOT
#
No problem.

Your reminder will arrive on <t:1640127951:F>!

fallen patrol
#

how do I do that?

gritty wind
#

I'll need more details lol

#

How are you spinning up the dependent images, which project are you working on

fallen patrol
#

hope to review a few pulls on site, so I'm trying to get that working along with corresponding bot pulls

gritty wind
#

Okay, spin up docker compose on site as normal

#

If you want site running that is

#

Then in bot's docker compose, modify the image to point towards the site image that was just built locally

fallen patrol
#

ooh i think i got it!

gritty wind
#

I personally actually modify the site address in the bot's config so I can have each stack separate and consistent

fallen patrol
gritty wind
#

yup

fallen patrol
#
version: "3.6"
services:
  web:
    build:
      context: ../site
      dockerfile: Dockerfile
#

my file structure is ~/pydis/bot and ~/pydis/site

summer garden
#

@thorny obsidianI'm pretty much finished with the epoch command, although I wasn't able to implement parsing named timezones eg. EST, PST. I would appreciate any comments whenever you are free :p sir-lancebot#983

dusky shoreBOT
thorny obsidian
fallen patrol
#

definitely didn't find both of them the past few days

stable mountainBOT
#

This module offers timezone implementations subclassing the abstract datetime.tzinfo type. There are classes to handle tzfile format files (usually are in /etc/localtime, /usr/share/zoneinfo, etc), TZ environment string (in all known formats), given ranges (with help from relative deltas), local machine timezone, fixed offset timezone, and UTC timezone.

summer garden
#

From what I saw it only accepts a weird format rather than the shortened timezone version

fallen patrol
#

!e ```py
import dateutil.tz
print(dateutil.tz.gettz('CET'))

stable mountainBOT
#

@fallen patrol :white_check_mark: Your eval job has completed with return code 0.

tzfile('CET')
summer garden
#

I'll be damned

dim pelican
#

No you'll be bones

fallen patrol
#

also:

#

!d arrow.arrow.Arrow.replace

stable mountainBOT
#

replace(**kwargs)```
Returns a new [`Arrow`](https://arrow.readthedocs.io/en/latest/index.html#arrow.arrow.Arrow "arrow.arrow.Arrow") object with attributes updated according to inputs.

Use property names to set their value absolutely:

```py
>>> import arrow
>>> arw = arrow.utcnow()
>>> arw
<Arrow [2013-05-11T22:27:34.787885+00:00]>
>>> arw.replace(year=2014, month=6)
<Arrow [2014-06-11T22:27:34.787885+00:00]>
```...
fallen patrol
#

(usable as arrow.Arrow().replace, but their docs are weird)

fallen patrol
#

want me to comment these on the issue or pull?

summer garden
#

these docs are such a nightmare ๐Ÿ™„

summer garden
fallen patrol
#

๐Ÿ‘

#

@gritty wind hellllp

#

I spent 20 minutes on that

#

as soon as I pinged you I saw the typo

gritty wind
#

You know you can set that in the config, right?

fallen patrol
#

I did but for some reason it didn't want it nvm

gritty wind
#

uri = { env = "DATABASE_URI", optional = true }
to
uri = "postgresql://"

#

What'd you set it to?

fallen patrol
#

no comment, see edit

gritty wind
#

I'm saying you don't actually need to pass it in as an env var

clever wraith
gritty wind
#

It makes the image easier to run if you set everything in the config.toml lol

clever wraith
#

metricity broke

#

cc @patent pivot

gritty wind
#

Did you reinstall deps?

fallen patrol
clever wraith
#

are you talking to me

gritty wind
#

Yeah, but I see the GH issue now

clever wraith
#

gdude is fast

gritty wind
#

gotta figure out the exact event fired

#

But it wouldn't make sense for one event to have to two different sigs

clever wraith
#

I mean

gritty wind
#

It would either mean always using variadic args or function overrides

clever wraith
gritty wind
#

Which aren't a thing in python

fallen patrol
#

!remind 15M sigh

stable mountainBOT
#
I'll allow it.

Your reminder will arrive on <t:1640123894:F>!

clever wraith
#

there

vale ibex
#

metricity#12

dusky shoreBOT
fallen patrol
#

i can't review yet ;-;

clever wraith
#

i wonder how this got past code reviewing

gritty wind
#

The same way anything gets past code reviewing

#

Don't merge yet, I've gotta check something

fallen patrol
#

4 days later

clever wraith
#

I mean, any change to a thread would have ran into a traceback

gritty wind
#

Yes, but that wasn't tested

#

We tested changes on startup mostly

#

And migration stuff

clever wraith
#

also please link the issue in the PR

clever wraith
gritty wind
#

There is no real issue to link

clever wraith
#

oh right, it was the same

gritty wind
#

We have one issue on metricity

#

in total

fallen patrol
#

lmfao and my metricity instance still isn't up ;-;

clever wraith
#

no sentry either, I'm guessing?

fallen patrol
#

(I'm eating rn and will continue resolving in a bit)

gritty wind
#

grep sentry

0 results

patent pivot
#

donโ€™t think weโ€™ve for sentry no

#

we should add it one day

vale ibex
#

No sentry, but that wouldn't have helped anyway, since this wasn't on pydis's instance

clever wraith
#

I mean I know haha

#

but pydis could have ran into the same issue

fallen patrol
#

^

#

it would've happened the moment a thread was updated in nominations

clever wraith
#

I mean they use way more threads than that

fallen patrol
#

i don't know that ยฏ_(ใƒ„)_/ยฏ

clever wraith
#

but it does seem unlikely that a state change occurred in a little timeframe like that

fallen patrol
#

they (gdude's server) has a large server with many members and threads enabled which its used on, soooo

clever wraith
#

there were threads in like every single staff channel, it was crazy

#

threads in quilt are very nice

#

quite a nice example of how threads could be used, someone from here should have a tour one day

#

especially on the tooling aspects, because there are many things you don't think about beforehand

gritty wind
#

Trying to repro the last thing from gdude

#

If I understand correctly:

  1. Archive thread
  2. Turn on bot
  3. Unarchive
  4. State incorrect
clever wraith
#

yes

gritty wind
#

I wonder if the thread was in the table before the first bot start

clever wraith
#

no

gritty wind
#

That didn't even fire off an event though hmm

#

Yeah no event is being fired off at all for this

fallen patrol
#

I'm gonna probably sleep and resolve these docker issues in the morning

clever wraith
gritty wind
clever wraith
#

unarchiving sure calls it

gritty wind
#

Did not in this case

clever wraith
#

discord dispatches a thread edit event

gritty wind
#

It really isn't lol

#

I just tested the same break point

#

For unarchiving, if the bot was up when it was archived, it'll work

#

But if you turn the bot off, archive, then bot on, and unarchive, it won't call the event

#

I'm gonna copy the socket stuff from bot

clever wraith
#

seems like a software bug

fallen patrol
#

uhhh

gritty wind
#

wdym

fallen patrol
#

use the gateway even thing

#

!d discord.on_socket_event_type

stable mountainBOT
#

discord.on_socket_event_type(event_type)```
Called whenever a websocket event is received from the WebSocket.

This is mainly useful for logging how many events you are receiving from the Discord gateway.

New in version 2.0.
clever wraith
#

discord is supposed to be sending an event

fallen patrol
#

log those see if you get it

clever wraith
#

d.py could just be dropping it

fallen patrol
#

^ if it's not in the cache that's definitely probable

#

this event above will ensure you can see if you get a THREAD_UPDATE

gritty wind
#

I brought in the big guns

#

Copied the int cog from python

molten bough
#

it me

fallen patrol
#

lol

#

hi gdue

molten bough
#

I suspect d.py making too many caching assumptions

fallen patrol
#

gudue

#

gdue

molten bough
#

you'll get there in the end lmao

fallen patrol
#

I'm tiried

austere hornet
#

I can tell

fallen patrol
#

gdude

molten bough
#

ayy

gritty wind
#

Metricity is being wonderful and refusing to respond to commands, despite me setting the prefix

#

Now to find out why it's blocked

molten bough
#

it has commands now?

fallen patrol
#

it's the owner check since you did a 1:1 copy

clever wraith
#

GNUdude

vale ibex
#

it'll be because we overwrite the on_message handler

fallen patrol
vale ibex
#

add a process commands in there

clever wraith
#

true true

gritty wind
#

I think both issues might have to do with the

#

max_messages being set to None

#
    The maximum number of messages to store in the internal message cache.
    This defaults to ``1000``. Passing in ``None`` disables the message cache.
vale ibex
#

nah, I ran into this with my other PR

molten bough
#

I don't see why that'd matter

vale ibex
#

see my messages above

gritty wind
#

Ah, right ofc

fallen patrol
molten bough
#

it's a simple bot

vale ibex
#

see my other PR

#

it'll be a way to force sync messages

fallen patrol
#

so it doesn't require process commands

molten bough
#

it's a simple bot arl, it doesn't even use cogs

fallen patrol
#

with like, @bot.event or bot.listen

#

rather than overwriting the existing one

clever wraith
#

slash commands anyone? ๐Ÿ˜”

molten bough
#

I do love my application commands haha

fallen patrol
molten bough
#

is this issue not fixed by any of the forks?

#

if so that's probably a drop-in fix

fallen patrol
#

well, they'd have to choose a fork so

clever wraith
#

I think forks fixed the caching issue

fallen patrol
#

let's have that discussion rn /s

molten bough
#

y'all can have it, I don't write python anymore lmao

fallen patrol
#

oh

clever wraith
#

I would say it is about time pydis chooses a fork tbf, there is nothing irreversible here

molten bough
#

I use a framework called KordEx for kotlin

#

wrote it myself

#

whee

molten bough
#

I've heard good things about pycord

fallen patrol
#

I'm partial to one of them but want to let opposing views get in first

clever wraith
#

๐Ÿคท my only experience was with disnake, worked fine, but not enough to voice an opinion