#dev-contrib
1 messages ยท Page 160 of 1
we can what, I gave two options 
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
!e yespy import arrow print(arrow.get('hello arrow, take my extra (2013-09-29T01:26:43.830580) information and parse the timestamp kthx'))
@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'
i-
when was it removed?
I forgot to install any modules, let me fix that
deployment.yaml line 36
arrow~=1.2.1```
It wasn't. We just swapped to hosting on Scale's server which meant stuff got uninstalled
ohhh, its not, I get it
lol
That actually happened a week or so ago
There was another switch yesterday that dropped it though
smh
wait
so if snekbox is not on pydis's cluster, how are requests authenticated?
They've never been authenticated
We have https running obviously, but that's not the point
yes, but they've been internal before, and now they're going over the network
Yes?
which means anyone can run code with that api if they have the url right? ๐
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
May I use it too? ๐คก
I'm not going to be hosting it much longer, so nah
@gritty wind :warning: Your eval job has completed with return code 0.
[No output]
!e ```py
import arrow
print(arrow.get('hello arrow, take my extra (2013-09-29) information and parse the timestamp kthx', ['YYYY-MM-DD))
@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.
Smh
!e ```py
import arrow
print(arrow.get('hello arrow, take my extra (2013-09-29) information and parse the timestamp kthx', ['YYYY-MM-DD']))
#bot-commands 
hmm i wonder where the default list is
!d arrow.api.get
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.
(yeah their sphinx docs are weird)
Found this btw https://arrow.readthedocs.io/en/latest/#supported-tokens
Thanks lol
got it
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.
yeah, we only want a few
But at the same time is actually harmful to keep them as extras?
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
!e py import arrow print(arrow.get('16:00', ['HH:mm']))
@static canyon :white_check_mark: Your eval job has completed with return code 0.
0001-01-01T16:00:00+00:00
Hmm
That's annoying
It doesn't do today's date
So we'll need to do that ourselves ig
uhhh we can continue to use dateutil for that -- the Duration converter
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.
Yeah, I saw that
*reopens editor*
Not sure how useful it is to be honest
The following formats are excepted: - H:M - H:M am/pm - H am/pm - H
well that solves those on their own, kiiinda
I don't think its useful for this usecase
since I'd like to be able to support a timezone as well ๐
Who put excepted there smfh
It should be accepted
We could use that and then extend to determine whether the next occurrence is today or tomorrow
bot#2001 review comment for jason lol
i must have cherrypicked a commit with an older version ๐ cc @static canyon
tizzy still review it
lmao
To be honest when we merge we're going to remove your commit? i.e. if Jason's merges first (which I think is likely) then your commit adding the converter etc. won't be needed
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/2119/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
The day/month/year I don't want to support
edited to cross those out
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
'Night
@gritty wind are you free to answer a query I have RE bot#2001?
.bm read from here
Sure, go ahead and ask
I already know I'll be back tonight
Do we think this should be a log.warning instead of log.info since it means there's a moderator in the modpings list that shouldn't be there https://github.com/python-discord/bot/pull/2001/files#diff-d82a54c450ea031f87210217bd9b41f10344938751efefdf015f27d9404a9a06R92
imo just add a regex for handling date in front of the day duration in the three ways you mentioned above
I suppose we should technically check the moderator has the Moderation Team role too (i.e. Akarys)
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
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
bot#2008
why'd you have to say i'd return smh
bad arl
imo its more of a security issue, as mods can be on modping leave for up to 28 days iirc.
So if a mod is demoted while on leave, they would have perms again until someone noticed they weren't supposed to and was able to act on it
This is fine in a graceful demotion, but you don't want something who was demoted for not being responsible to have permissions back all of a sudden
so while its a (very) unlikely situation, its not one to want to be in
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
imo, it isn't really a warning, its just they aren't on the server anymore
so a info should be fine
yeah gonna go to bed now & mute the channel for the next eight hours so i stop trying to respond to the wrong thing like i've said 4 times so far and haven't acted on
If you want, you could always break a couple rules and get muted /s
!mure @fallen patrol 8H lol
you could just mute me
We don't hand out mutes for no reason on policy
you can just request changes without comments btw instead of do not merge
Do you?
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
yeah, without comments meant those commetns you give on code separately
yeah
Right, yeah
!ot command broke
ยป ot
ยป off-topic-names
!ot
Off-topic channel: #ot2-never-nesterโs-nightmare
Please read our off-topic etiquette before participating in conversations.
See, both of those worked before, but they don't work now, soo, uhhh
I just saw the same thing, also it would be nice if the ot channel was randomized if it makes sense
The latter still works perfectly fine
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
But it doesn't show all the channels
It's a static file so that's not possible
It's not supposed to
There was a conscious decision to change it
Huh?
!off-topic-names shows them instead
Off-topic channels
There are three off-topic channels:
โข #ot0-psvmโs-eternal-disapproval
โข #ot1-perplexing-regexing
โข #ot2-never-nesterโs-nightmare
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
Ah
!ot
Off-topic channel: #ot2-never-nesterโs-nightmare
Please read our off-topic etiquette before participating in conversations.
Any reason for the change?
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)
Ah understandable
!ot why this does not?
ยป ot
ยป off-topic-names
we kinda usually used to message like.
!ot you shall question here
bot#2023
which puts both message and command in one go.
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
oh i see. alright that would help a lot. thanks for the pr!!
I already explained that above if you read what I said
^
So basically what Numerlor said just now
I see. I apologise. Din't read above part.
No worries lol
any chance we can speedrun reviews/approval for this?
I can add in another review, but all that's really left is a core dev ๐
merged
.. iit might be worth #changelog
Eh, that's something for core-devs to decide
I don't have permissions to that channel anyway
don't think we need that
Yeah me neither
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
Ig while we're at it, sir-lancebot#901 needs one core-dev review
@summer garden are you the creator of the sudoku issue?
that would be @austere hornet
Yep
ahh, is your github sn4u
that's right
okay, that's what I was trying to figure out lol
But isn't it not obvious who is who? Like who created the issue and who commented?
FWIW, if going down to a 4x4 array, I'd suggest doing something with buttons, like the pending tic tac toe enhancements
I thought I saw the author badge on bones
Oh yeah that's a good idea
Ahh
sounds like a lot of buttons
Only 16
you can have up to 25 buttons, arranged in a 5x5 array on a message
the tic tac toe has 9, and that already looks like a lot to me. It would be good to see before judging though
Well 9 is less than 16, I'm not sure why it seems like a lot
(9 already seems like a lot to them, so they want to see 16 before they judge)
have you seen the tic tac toe yet? The pr is waiting for review, so I can show it to you
Ahh gotcha
You can only have a 5x5 grid with buttons in Discord!
Oh, you can't have less than that?
You can, but not more
Ah
i've not seen it no
sir-lancebot#982, I included some screen shots
I need to update those screenshots, lol
streaming me attempting a new method of snekbox deployment
just got on pc and updated screenshots
@summer garden
so presumably we could do something like this for Sudoku
Not sure what I'm seeing but the terminal is pretty so I'm staying
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
๐ I can't join, smh discord
May I be dragged in?
live: joe fixing perms
lol
lol that channel has always been private, hasn't it?
Lol
I think so?
yea but sometimes I open it when I stream here
ah I can't speak in it, but can join now neat
okay let's give this a go
yeah, and it could just be the way to see the board, not necessarily interact with it ๐
also I heard discord is adding text input fields
this is tic tac toe after a win
yeah, they are
although not for buttons
those will be part of slash commands
oh, unfortunate
(old screenshot)
watching joe slowly read error messages ๐
Lol
but slash commands & autocomplete is awesome
oh, I thought they were gonna add like actual fields that you can use
rather than self.bot.wait_for("on_message", ...)
that's a different thing, uhhh lemme find it
are we still on scale's thing for snekbox?
can't find it but its a different thing
so far yes
Also goddamn talking while running is hard. My lung capacity was not prepared for that
hm why is there a 99 member limit on this channel?
Every channel here has a limit (even staff), I assume for raids maybe
#756327105389920306 doesn't lol
That doesn't really count tbh
Every non-AFK channel then lol
(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
Yeah that's another reason for the limit I believe
although given staff can have perms that don't count, that's probably what's going on, so its really just a counter
At least I've asked that question before and someone (can't remember who) said that in response
So yeah
@static canyon so with these formats, how would we support an optional combinations.. either time then date, or date then time, or time, date, timezone, etc?
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
It has a cap of 99 so it has the badge of how many people are in it. That's all
Lmao
also @patent pivot you should optimize your screensharing for text
koo burr nuh tees
kyoo brr net ez
kyu berr niiites
ty
close enough
To whom? Me?
good
@short snow #dev-log message
bot#2008 is ready for re-review @static canyon @cold island, as you both requested changes
Could a core-dev take a look at and maybe approve sir-lancebot#985?
joe just approved it, I left a comment
Oh nice, saw your comment
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
.bm
Whoops sorry for ping
pings don't bother me that much ยฏ_(ใ)_/ยฏ
Yeah me neither but I meant to disable it (hence why I have "pings ok" in my nickname for the server)
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 
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
Btw before I say anything about this, I think you should put this in a review on the PR
cool
Will respond there
@brazen charm honestly the solution is to not be importing objects from other extensions
or do something with get_cog...
I left a new comment on bot#2022
I think the best solution is to move the Tag Identifier class out of the cog
I don't really understand what you're asking
!remind 1h
Your reminder will arrive on <t:1639995725:F>!
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
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: bot#2008 is ready for re-review @static canyon @cold island, as you both requested changes
[Jump back to when you created the reminder](#dev-contrib message)
re-reviewed with one more nitpick
@patent pivot It looks like you approved sir-lancebot#985 but haven't assigned me, could you please assign me?
Also @fallen patrol what do you think about this? https://github.com/python-discord/sir-lancebot/issues/985#issuecomment-997542842
Description I would like to make a Sudoku game command for Lancebot. Here are the rules for playing Sudoku, in case you don't know: https://sudoku.com/how-to-play/sudoku-rules-for-complete-...
done
Thanks!
we can take a time, date, and timezone, but how should we separate that in the converter? what I'm asking is, could we brainstorm a list of all valid input styles?
Just separate the same way as ISO does
YYYY-MM-DD HH:mm:SS+00:00 where +00:00 is the UTC offset
I think there should be a T there somewhere
and which subsets of that should we support? date, time, timezone, date and time, date and time and timezone
are you not planning on using a parser? Say dateutil's for example
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)
it expects the entire format string
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
And I suppose all the stuff with a space should allow for a T instead of a space because that's what ISO says
๐ if we keep this format then we can use the iso8601 converter with some preprocessing
The main thing is that just HH:MM isn't supported by ISO
And we don't want to support seconds/milliseconds
hm I thought date was part of the original issue, which would send at midnight utc or what timezone they specified
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
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
If it's something you found useful, then we can try to keep it
This entire PR is just me going "I wanted this feature all the times I've used the command"
same tho
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
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
I think it might be unintuitive regardless
Yeah, it's kinda ambiguous which is why I was initially against the idea -- but then arl said they've found it useful so ๐คท
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
I mean providing an hour will still work
It's just that you don't have to
Yes, I'm saying I'm not sure it makes sense to not have to
yeah that makes sense
.bm bot#1924
There you go :p
(@austere hornet I left comments on those two)
thanks
!remind 2H work on 1924
Your reminder will arrive on <t:1640041355:F>!
Oh ok, will take a look
@fallen patrol Just to make sure I understood - did you want me to add an author mention inside or outside the embed?
outside the embed, mentions within embeds don't actually ping ppl
Yeah ik, but I wasn't sure if you actually wanted to ping the user or not
yeah
@fallen patrol How does this look?
sure
Here's your reminder: work on 1924
[Jump back to when you created the reminder](#dev-contrib message)
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
Current system status. View active incidents or upcoming maintenances. Subscribe to receive status notifications.
heh that'll be it
yeah lol
Sounds fun
Iโm sorry but are we just ignoring that beautiful terminal
So many emojis
Dockers back btw
colour too ๐
what is your largest project?
Probably the site
By what metric lol
Bot is biggest by contributions and code base size
this one?
No, that is not our project
Nah we arenโt related to the discordpy project
sorry
This is our site: https://pythondiscord.com
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Itโs okay haha
yeah, that's what I was looking for :)
I was thinking bot too but felt like the site was a bigger project idk
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
Oh wow
999, then I closed one during the meeting
Oh lol
I may put out a contrib announcement, sounds like fun
Yeah might be worth it
We also hit 2000 issues/prs on bot, which is nice
hey. a stupind question: https://pythondiscord.com/ this looks like it could be made without 280k people
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Nice
855 events on bot, 218 on site
Contributors to the site are closer to 28 than 280000
Naturally, not all people in the community contribute to everything
If youโd like to contribute, all our projects are open source
!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
I'd like to propose a new project
let's build a search engine. without scrapers, with only human input and with federation (trolls get yeeeted)
Itโs an interesting idea, but we lack the resources to possibly ever moderate something like that reliably, or build it
Well I can respect that, good luck to ya
@clever wraith If you're interested, you can check this out: https://github.com/python-discord/site/graphs/contributors
pythondiscord.com - A Django and Bulma web application. - Contributors to python-discord/site
I'm not
Ok
Well yes I was just wondering if you were interested to see how many contributors there are to https://pythondiscord.com. That's all.
59
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
Was just about to type that exact thing lol
yeah
Itโs a bit difficult to take a screenshot
true
true
Why moderate it?
approve it
federate it
ok, that's naive, I'm sure
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
:D
Lol
no, I understand that
but I don't understand how points/weight don't solve that
example
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
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
and shitposters!
:)
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
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
@vale ibex docker is back up ๐
@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?
this was the specific one I was thinking of, its prolog
A B C D E F G H I
A 1 2 3 4 5 6 7 8 9
B 2
C 3
D 4
E 5
F 6
G 7
H 8
I 9
Ah I see, that looks pretty nice, but would dashes have different colors too or no?
But grey is not really a color that stands out that much tbh
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.
@short snow I'm trying to test bot#2021 but for some reason its not doing anything?
add print to on_message, see what msg links it gets
just a sec
and check if this is valid for your setup, like the on_message doesn't return early when it shouldn't
@austere hornet beware that syntax highlighting varies depending on the device or OS and is absolutely non-existent on iOS
Oh, thanks for the heads up! I actually don't have an iOS and I'm on PC currently so it's fine
def foo():
...
do_thing()
is this coloured on iOS?
no not at all
Well guess what, it's plain on Android too smhhh
this has some colour on android
Yep I see some color
ugh, PIL might end up being what has to be used ;-;
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
Well maybe you're right and I think bones asked about that on the issue (sir-lancebot#985) and they suggested to have a 4x4 grid instead of the traditional 9x9 grid
The lack of robust syntax highlighting for mobile is unfortunate
no landscape mode and no syntax highlighting for iOS, imagine what it's like to help on pydis on an iphone lol
A lot of the games on sir lancebot have better UI elsewhere and that's fine. The goal of Sir Lancebot is to not to make an optimal game playing experience, but as a way for people to strengthen their python and contributing skills. If someone is interested in implementing something and it isn't too costly, then just because it exists elsewhere shouldn't be a blocker
Yeah totally agree with Kat
using PIL would be costly ๐คทโโ๏ธ
I feel like 4x4 would be too easy, and at minimum should have a 6x6 option (ooh imagine if its scalable and the user can input what size, to a point)
the avatar commands exist, and we have...
!d asyncio.loop.run_in_executor
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:
which is what the avatar commands use
Heh, I said the same thing but I wasn't sure what others thought about that but now I know. 6x6 sounds good
We already use PIL for avatar commands and Chris spent a lot of good time fixing that up to run without being costly
what I just said ^.^
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
First of all, who is "he"? Me?
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.
chris
Yeah ๐
Oh
@patent pivot #dev-log message probably worth turning these off
suggestion (to bikeshed): help command support tags, perhaps with fuzzy match
Not sure what that means
if @stable mountain goes down/restarts will the reminders still work after it, I mean the reminds set before restart
reminders are stored in a database, so it doesn't matter if python goes down/restarts, yes
hm weird
darned python making me ghost ping, sorry
I feel like the help command should support tags if the query isn't found
We already do fuzzy matching on tags
If the fuzzy matching there didnโt return anything, what will it return exactly in that embed
wut?
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
What would it say in the help text though?
say its a tag and show the first line as a summary
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
Whatโs the end goal anyway
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
bot#2022 is loosely related
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
would like to see an issue opening for it, but I don't have anything against it
There we go sir-lancebot#987
What interpreter should I select in VSC when running the bot through docker?
Without it, VSC doesn't recognize the imported packages
If it's running through docker compose vsc's interpreter shouldn't matter
You might be able to attach the container with VSC, but for simplicity I'd set up my own environment locally
If you want vsc to have code completion, and you want local linting, you need to poetry install all deps locally too
A guide to setting up and configuring Bot.
I'll do that too then, thanks ๐
Might as well run it locally
Yeah it's more convenient to run it locally. You can keep the other services like the site in Docker
Yep, that's what I usually do. I just finally have enough storage to use docker, so I'm trying that out
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
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
but what is cv2
cgroups version 2
...does that mean that your cluster could be upgraded and stop working too?
What's cgroups version 2; well, I don't think the person that wrote the spec could even answer that
Yes, but I do tend to screen my upgrades lol
ah, unlike joe ๐คก
I wouldn't be surprised if this was forced upon him >.>
/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
well, what is cgroup overall? What's it used for?
so you write to /sys/fs/cgroups/snekbox.aaa-bbb-ccc/memory.max
I thinkk its memory limits/management?
Well, joe basically explained it
cgroup = contorl group
memory limits, PID limits, CPU limits
you set limits and add processes into the cgroup
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
since if its just the filesystem paths, wouldn't that be simple to change?
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
oh that changes things
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)
I feel bad for Mark, having to adapt snekbox for cv2 and docker adjustments
we asked around and yesterday we found our answer
Xith and Mark, the two bots that keep us running
and scale
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
we did draw up some plans to deploy snekbox to it's own host at https://github.com/python-discord/snekbox-deploy
oh that's fun
which we might still use, because we may be able to throw gVisor into the mix for some added security
https://snekbox.pydis.com/, but I tore thta down
but we do now know that it will work inside our k8s
@gritty wind :glare:
(it also has auth)
yeah, makes sense
on this: linode did not tell us that it was a deb 11 upgrade
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
imagine running a snekbox on a publicly accessible domain that anyone can use without auth ahem scale
Imagine using it and getting nginx banned
given that it changes the pre-installed programs, isn't it worth knowing that its being upgraded like that?
for a minor workaround I don't think this is a major problem, as long as no one is irresponsible about using it
kind of
in theory, with kubernetes upgrades, the only noticeable change should be in cluster
i mean yeah, afaik, its kubernetes, so the underlying OS shouldn't matter
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
New idea: spin up a new snekbox pod for each eval
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
It's going to be wonderful during outages
well, why does snekbox need to use cgroups itself?
why can it not use a container engine to manage that itself?
Running docker inside docker heh
Well, we use cgroups + nsjail to get isolation and resource limits
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
wait I think I can answer this, it would need to have a lot of permissions to work, essentially decontainerizing snekbox
right?
deployment.yaml lines 21 to 22
securityContext:
privileged: true```
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
ahhh
You should use individual capabilities rather than using privileged fwiw
yeah, not a bad shout, can't remember which capabilities snekbox specifically needs but once we get things back on-cluster we can look at this
Oh right, I forgot that it isn't running on the cluster lmao
I believe NsJail documents the capabilities required somewhere somewhere
their official guidance on running in docker is to use --privileged
so I suspect finding the specific caps would be a matter of trial and error
Any thoughts on how to write an automated test for this? https://github.com/python-discord/snekbox/issues/83
It needs to basically be a systems test
Where it goes through an actual container running the api with gunicorn
how can I run the bot not in docker, but redis in docker?
they're up, so my config is bad
host: "localhost" port: 6379 password: !ENV "REDIS_PASSWORD" use_fakeredis: false
or use_fakeredis to true /shrug
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
Eyy #2025 that's the year I graduate lol (yes ik that's off topic)
metricity#11 @vale ibex, was automatically redirected to main
!remind 1H review if not already merged
Your reminder will arrive on <t:1640121027:F>!
!remind delete 3782
That reminder has been deleted successfully!
Chris keeps pushing to it ;-;
That push was a rebase lol
Wait so PyDis supports threads now? Now sure what the PR Scale merged was about
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
are you done for the moment?
Done until there are comments
good
and now the question you've all been waiting for.... how do I set up metricity?
The readme should cover it
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
I don't think that's a good idea, but people have been unpinning it without any discussion before so I guess
bot#1727
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
security updates is why I would think we would unpin, but why is the reason to lock it?
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
What do you have in your config
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
You're running --no-deps
so postgres isn't getting started
yeah, because I already have the database running, and I wanted to be able to use the same db for metricity as site
although that doesn't work, so I'm curious why not
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
ah
You could also try docker inspect <container name> and grep for the right one
what's the flag name?
to docker-compose run
--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
ah gotcha
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
I'll just... build a metricity image, and make a container from that without compose
Just point the config at 7777
(canary died again lol)
Join the dark side, come to stable
3rd time's the charm
I sent it once on canary, and once on stable
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
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?
interesting
interesting
prooooobably unnecessary, force pushes aren't super harmful since we already block main pushes for everyone (including admins).
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
The database that we get from site compose comes with pre-existing tables for metricity, which are actually incompatible with metricity if it tried to run on them. This just deletes them. It isn't a problem on bot compose though
i honestly just deleted all of my pydis images and containers lol
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
What are you even doing
getting my docker containers in order and to submit to me
also my development environment too
@fallen patrol Have you seen this? #dev-log message
!remind 2H
Your reminder will arrive on <t:1640127951:F>!
trying to make it so I can use my local bot/site/metricity/etc images instead of docker pulling the latest
how do I do that?
I'll need more details lol
How are you spinning up the dependent images, which project are you working on
hope to review a few pulls on site, so I'm trying to get that working along with corresponding bot pulls
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
ooh i think i got it!
I personally actually modify the site address in the bot's config so I can have each stack separate and consistent
.
yup
version: "3.6"
services:
web:
build:
context: ../site
dockerfile: Dockerfile
my file structure is ~/pydis/bot and ~/pydis/site
@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
I'll take a look when I get home! Thank you so so much for implementing this
there's a util for those in our dependencies, heh
definitely didn't find both of them the past few days
!d dateutil.tz
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.
From what I saw it only accepts a weird format rather than the shortened timezone version
!e ```py
import dateutil.tz
print(dateutil.tz.gettz('CET'))
@fallen patrol :white_check_mark: Your eval job has completed with return code 0.
tzfile('CET')
I'll be damned
No you'll be bones
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]>
```...
(usable as arrow.Arrow().replace, but their docs are weird)
these docs are such a nightmare ๐
I'm good for now. Trying to come up with a game plan
๐
@gritty wind hellllp
I spent 20 minutes on that
as soon as I pinged you I saw the typo
You know you can set that in the config, right?
I did but for some reason it didn't want it nvm
uri = { env = "DATABASE_URI", optional = true }
to
uri = "postgresql://"
What'd you set it to?
no comment, see edit
I'm saying you don't actually need to pass it in as an env var
It makes the image easier to run if you set everything in the config.toml lol
Did you reinstall deps?
odd, something is wrong
are you talking to me
Yeah, but I see the GH issue now
gdude is fast
gotta figure out the exact event fired
But it wouldn't make sense for one event to have to two different sigs
I mean
It would either mean always using variadic args or function overrides
Which aren't a thing in python
!remind 15M sigh
Your reminder will arrive on <t:1640123894:F>!
there
metricity#12
i can't review yet ;-;
i wonder how this got past code reviewing
The same way anything gets past code reviewing
Don't merge yet, I've gotta check something
4 days later
I mean, any change to a thread would have ran into a traceback
Yes, but that wasn't tested
We tested changes on startup mostly
And migration stuff
also please link the issue in the PR
bad reviewer :bonk:
There is no real issue to link
oh right, it was the same
lmfao and my metricity instance still isn't up ;-;
no sentry either, I'm guessing?
(I'm eating rn and will continue resolving in a bit)
grep sentry
0 results
No sentry, but that wouldn't have helped anyway, since this wasn't on pydis's instance
I mean they use way more threads than that
i don't know that ยฏ_(ใ)_/ยฏ
but it does seem unlikely that a state change occurred in a little timeframe like that
they (gdude's server) has a large server with many members and threads enabled which its used on, soooo
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
Trying to repro the last thing from gdude
If I understand correctly:
- Archive thread
- Turn on bot
- Unarchive
- State incorrect
yes
I wonder if the thread was in the table before the first bot start
no
That didn't even fire off an event though hmm
Yeah no event is being fired off at all for this
I'm gonna probably sleep and resolve these docker issues in the morning
for what?
I did this, but on_thread_update was never called
unarchiving sure calls it
Did not in this case
discord dispatches a thread edit event
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
seems like a software bug
uhhh
wdym
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.
discord is supposed to be sending an event
log those see if you get it
^ 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
it me
you'll get there in the end lmao
I'm tiried
I can tell
gdude
ayy
Metricity is being wonderful and refusing to respond to commands, despite me setting the prefix
Now to find out why it's blocked
it has commands now?
it's the owner check since you did a 1:1 copy
GNUdude
it'll be because we overwrite the on_message handler
actually GNU/Linux dude
add a process commands in there
true true
I ported over a statistics command to count stuff
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.
nah, I ran into this with my other PR
I don't see why that'd matter
see my messages above
Ah, right ofc
... that'z annoying why not write anew command or listezner?
it's a simple bot
I'm planning on adding one actually
see my other PR
it'll be a way to force sync messages
nice layout
so it doesn't require process commands
it's a simple bot arl, it doesn't even use cogs
slash commands anyone? ๐
I do love my application commands haha
I am looking forward to when pydis switches to a fork
well, they'd have to choose a fork so
I think forks fixed the caching issue
let's have that discussion rn /s
y'all can have it, I don't write python anymore lmao
I would say it is about time pydis chooses a fork tbf, there is nothing irreversible here
any suggestions of a fork?
I've heard good things about pycord
I'm partial to one of them but want to let opposing views get in first
๐คท my only experience was with disnake, worked fine, but not enough to voice an opinion