#dev-contrib

1 messages · Page 99 of 1

fallen patrol
#

i do it there in my bot

#

no wait

#

lines 159-160 and 170

gritty wind
#

isn;t that uploaded seperately as well

patent pivot
#

yeah, this is probably worth going upstream

fallen patrol
#

yeah but it becomes the embed

gritty wind
#

as in, uploaded to the thumb

fallen patrol
patent pivot
#

but I think like

fallen patrol
#

but at this point i just wanted to explain it to scale

patent pivot
#

pulling down and uploading the server icon for every thread is a bit of a weird implementation

fallen patrol
#

yes ik its not a big deal this is like the only server that updates it often

gritty wind
#

lol I'd need to look into dpy's embeds, probably easier if I tinker with it haha

patent pivot
#

I'd open an issue with them and see what they say before writing a fix

#

or ask in the server

fallen patrol
gritty wind
#

Anyways, you'd better open that issue soon, from my experience issues don't get addressed for weeks

fallen patrol
#

so a server can set a specific icon to show in the footer

#

and it will always show that icon

#

in that case this server could also make it a static pydis image

#

and a bonus is if it were an icon hosted on the site then 😄 it could actually be updated and not break embeds

#

fwiw, its a minor enough issue and won't affect 99% of servers

#

its just the server that changes their icon 3/week

#

which means that the last thread has broken embeds and even then its just a transparent spot

#

but enough to annoy me

patent pivot
fallen patrol
#

I'll make an issue for the below if even one helper+ says yes

#

.colo[u]r command for @dusky shore to show info about a color

patent pivot
#

didn't we specify that

#

or was that just discussion here

fallen patrol
#

Probably just here

patent pivot
#

alright

#

and uhhh

fallen patrol
#

Ah

#

I wasn't thinking of an api

#

I was thinking generating the color on our own and everything, yeah

patent pivot
#

then yeah, I think that's an issue we could approve

fallen patrol
#

It'd be a fun first pr for me

#

Cool

patent pivot
#

I do like the idea of being able to fetch the nearest identifiable colour thinkingcrew

fallen patrol
#

Sir lancebot is standalone, yeah? Aka no other pydis projects needed

#

Unlike python

patent pivot
#

uhhh

#

yeah

patent pivot
#

it has APIs and stuff and optionally redis (you can use fakeredis locally)

#

no, if it is API only then it's a no go

#

but that site has openly available JavaScript

fallen patrol
#

As of now I can see a way to do everything except get a near named color

fervent sage
#

i have redis and it errored when not using fakeredis Thonk

fallen patrol
#

Also uh

#

does sir Lance use PIL or pillow?

patent pivot
#

pillow iirc

glass pecan
fervent sage
#

PIL is the module pillow provides is it not?

fallen patrol
#

Distance from closest value of what

patent pivot
#

RGB

glass pecan
#

hex and rgb both are the same values, so yeah i don't see much of a difference on what you pick

#

it's just whatever it's stored as, really

patent pivot
fallen patrol
#

Oh

patent pivot
#

1,566 to be precise

glass pecan
#

xkcd have color names too that i find somewhat entertaining to go through

patent pivot
#

949 on that list

glass pecan
#

on xkcd? should be 954

patent pivot
glass pecan
#

odd hm

#

oh well

#

still plenty enough

patent pivot
#

yeah

#

we could combine the two and deduplicate if we really wanted

fallen patrol
#

im uh

#

gonna put myself as wanting to write this

glass pecan
#

there's no stress regardless

fallen patrol
#

yeah fwiw don't expect this done any time soon 😂

patent pivot
#

good place to start is specifying out the issue and tagging on what needs to be done

fallen patrol
#

i've never worked with pillow, never worked with colo[u]rs, never worked with etcetra

glass pecan
#

there's no rush as it's not a priority. just keep up communication/updates as you go so it doesn't look abandoned

fallen patrol
#

ok

#

also uh

#

i want to set the base right here

#

color or colour.
I would perfer color

#

unless pydis specs are british/eu

glass pecan
#

lol

#

color with an alias of colour

#

both are allowed

sleek steppe
#

colour

patent pivot
#

lol

fallen patrol
#

i will make both work

patent pivot
#

most internal spelling is british for pydis

glass pecan
#

true joe

fallen patrol
#

but its which one im gonna use as the base var

patent pivot
#

but I don't think we've set a standard

glass pecan
#

probably because of contrib distrubution

#

not a standard, yeah

fervent sage
#

colour because colour is correct mmLol

fallen patrol
#

how about i write it as color and then when its done i'll just replace everything with colour

patent pivot
#

but we never use all the z's you americans keep putting in words

fallen patrol
#

its amerizans

glass pecan
fallen patrol
#

fwiw my current discord language setting is

glass pecan
#

doubt you'd notice much of a difference on discord ui

fallen patrol
#

DECOUPLE TIMESTAMPS FROM LANGUAGE

glass pecan
#

only with their weird spellcheck thing that i have disabled

patent pivot
#

going by the previous discussion, some ideas are:
– random rgb or hsv color
– color conversions
– color to name
– color generation with pillow

  • complimentary/analogous/triadic/tetradic colors
fallen patrol
#

only timestamps unfortunately

glass pecan
#

no that's a system setting

fallen patrol
#

i like 24 h so i set to UK

glass pecan
#

oh you mean the format

#

lol i thought you meant the time itself

fallen patrol
#

yeah..

#

actually i once tried changing system time and discord was correct to my timezone so

glass pecan
#

it doesn't have to implement everything in one hit though

#

just put out something basic to begin with if you want and progressively update

patent pivot
#

yeah, we can always leave the issue open and mark things off as checkboxes

fallen patrol
glass pecan
#

all the more reason to keep it simple lol

fallen patrol
#

how i typically roll with my own development is i implement one feature and then do other stuff for a week, and then come back to it and implement something else and then repeat

#

i uh, haven't touched my bot code in around 3 days

#

which sucks because it has like 3 total commands

fallen patrol
glass pecan
#

hex to rgb values to blah

fallen patrol
patent pivot
#

RGB to HSV/HSL/CMYK/etc

fallen patrol
#

well that wasn't obvious at all /s

#

i use power toys color pickers smh

patent pivot
#

and vice versa

fallen patrol
#

i like

#

should know what conversions are

glass pecan
#

there's some values that honestly don't need to be included because they wouldn't be used anyway

patent pivot
#

I think it'd be interesting to have some of the more abstract ones as a demo of how they actually convert

glass pecan
#

cmyk and rgb are common. hsl is weird

patent pivot
#

HSV probably

#

HSL is weird

#

hsv prettier

#

though colorsys has both doesn't it

#
>>> colorsys.rgb_to_hls(255, 255, 255)
(0.0, 255.0, 0.0)
>>> colorsys.rgb_to_hls(255, 255, 0)
(0.16666666666666666, 127.5, -1.007905138339921)
fallen patrol
#

wut

sleek steppe
#

stdlib

fallen patrol
#

oh

#

i knew that 😰

sleek steppe
#

!d colorsys

stable mountainBOT
#

Source code: Lib/colorsys.py

The colorsys module defines bidirectional conversions of color values between colors expressed in the RGB (Red Green Blue) color space used in computer monitors and three other coordinate systems: YIQ, HLS (Hue Lightness Saturation) and HSV (Hue Saturation Value). Coordinates in all of these color spaces are floating point values. In the YIQ space, the Y coordinate is between 0 and 1, but the I and Q coordinates can be positive or negative. In all other spaces, the coordinates are all between 0 and 1.

short snow
#

one more core dev approval needed on quackstack#31 if anyone has got some time

fallen patrol
#

@ mods that says colors not colours

#

really had to be an account with the name mod smh

vocal prairie
#

Would it be worth it to allow !clean to skip certain messages, and only clean ones from a certain time? For example, if a mod wants to purge 10 messages and skip the last two that were posted, they can't do that right now. Is that something that could help, or would that be pointless?

fallen patrol
#

!src clean

stable mountainBOT
#
Command: clean

Commands for cleaning messages in channels.

Source Code
#
Bad argument

Unable to convert '!purge' to valid command, tag, or Cog.

fallen patrol
#

!src purge

stable mountainBOT
#
Command: clean

Commands for cleaning messages in channels.

Source Code
fallen patrol
#

are you

#

fucking

#

#

TIL if you click a link, even by accident, on github while writing an issue it just follows the link

#

and if you go back, you've lost all of your progress

#

@patent pivot i'll make that color issue soon i was almost finished too

#

but github was like nope

vocal prairie
#

That's why you constantly keep saving to your clipboard…

short snow
#

go to open issue back, your stuff would be there

fallen patrol
short snow
#

on the new issue editor

fallen patrol
#

ah, that's why its not, I was on preview

#

i clicked it when on preview and not when on create

sleek steppe
#

colo[u]r

fallen patrol
#

w/e i'll remake it later smh

vocal prairie
short snow
fallen patrol
#

that was my issue to sir-lancebot

short snow
#

oh my bad, i thought about the quackstack pr

fallen patrol
fallen patrol
#

bot#1498

fallen patrol
#

is it possible to implement this throughout the entire bot?

#

for all commands

vocal prairie
#

Why not comment on the issue?

#

It might get lost otherwise.

short snow
thorny obsidian
#

I think we specifically don't want to do this for eval, especially with py-gen. Because all it does is have people run !eval on code that could take up quite a bit of room and then go to bot-commands to get the result.

fallen patrol
thorny obsidian
#

But I'll to find previous discussion on it to make sure I understood the consensus correctly

fallen patrol
vocal prairie
#

Uh, does anyone know how long on average it takes to docker-compose the public-stats repo? It's been about 10 minutes, and I'm still waiting.

patent pivot
#

uhhh

#

I didn't set that up

#

any output logs?

vocal prairie
#

Just constantly loading public-stats-graphite stuff.

patent pivot
#

that's fine, that's just the output of graphite

vocal prairie
#

Oh, okay.

patent pivot
#

you should be able to browse to localhost:8898 I thikn

vocal prairie
#

That localhost worked, although the actual graphs are blank. Strange. Probably data still loading.

fallen patrol
patent pivot
vocal prairie
#

Oh, that would make sense.

patent pivot
#

graphite is empty after initial startup, you can fill it by running an instance of the bot or with some dummy scripts

vocal prairie
#

I probably have to set up the bot and site api.

patent pivot
#

I'm not sure of the cleanest way to seed such data

#

are you planning on amending the stats portal?

vocal prairie
#

I was thinking about it. Possibly. I also wanted to see how the graphs are generated so nicely.

patent pivot
#

Ah, there is a nice library I use

#

one sec

vocal prairie
#

The UI is really nice.

patent pivot
vocal prairie
#

Cool, thanks for the link!

#

What do you think of a stat for most used topical channels?

#

Like messages per topical channel.

patent pivot
#

sounds pretty interesting, although we don't track channel categories on the graphite circuit so such a chart is more suited for metricity data, which could probably come with a later iteration of the stats portal

vocal prairie
#

That makes sense. I'll look forward to it!

fallen patrol
#

metricity#3

dusky shoreBOT
fallen patrol
#

still not merged

#

☺️

patent pivot
#

i should uhhh

vocal prairie
fallen patrol
patent pivot
#

it's definitely one on my list for if we ever migrate

vocal prairie
#

Okie.

patent pivot
fallen patrol
#

sunday tho i thought you were gonna give a weeks notice

#

and today is sunday almost monday

patent pivot
#

alright, sunday then

fallen patrol
#

but technically monday because this server goes offa utc

vocal prairie
#

Your goal is to delay this as much as possible, isn't it

fallen patrol
#

a good week

fallen patrol
patent pivot
#

Sunday at 12 UTC is the date

clever wraith
#

hello

patent pivot
#

announcement made

#

!remind 6d10h6M metricity PR 3 can be merged

stable mountainBOT
#
Sure thing!

Your reminder will arrive in 6 days, 10 hours and 6 minutes!

patent pivot
#

good game

fallen patrol
#

https://pydis.com/privacy
double redirect smh

#

wait no

#

it redirects me through all of that smh

fallen patrol
tawdry vapor
#

What is this change for

fallen patrol
#

no more ability to opt out of metricity

patent pivot
#

remove opt out functionality from metricity

fallen patrol
#

hm

#

for merging it

#

don't people who opt out have to consent to opting back in?

#

yeah

#

the announcement doesn't say that part

patent pivot
#

not really, because it's not an opt out as a measure of compliance, it's just disabling a feature

thorny obsidian
#

Why would they have to consent to opting back in? The announcement is letting people know there won't be opt out functionality and while they remain in server they'll have the metricity data tracked

fallen patrol
#

right

#

it would be as simple to say that's how you agree

#

by sending messages

#

or even remaining in the server

#

that would be considered consent, no?

patent pivot
#

it's not even a matter of "by doing X you consent" really

#

think of it more as a feature toggle

#

people disabled the feature toggle but now we're removing that toggle entirely

#

it's not something people need to consent to

fallen patrol
#

how does one link to a header within markdown

#

its [text](#Proposed%20Implementation) right?

#

I'm trying to link to a header within my issue yes

vocal prairie
#

[text](#Proposed-Implementation) if I remember correctly.

fallen patrol
#

welp it doesn't work anyways oh well

#

sir-lancebot#677

dusky shoreBOT
fallen patrol
#

someone please assign me

#

😛

magic arch
fallen patrol
#

This was talked about in server with Joe and scragley

short snow
#

you could link to the context, in reasoning section

fallen patrol
#

Can't/won't add it to the issue rn because I'm laying in bed at 1am but

#

Will add it tomorrow if I remember

dusky shoreBOT
stable mountainBOT
#
Yep.

Your reminder will arrive in 5 hours!

stable mountainBOT
#

@fallen patrol

It has arrived!

Here's your reminder: add [this context]([#dev-contrib message](/guild/267624335836053506/channel/635950537262759947/)) to [sir-lancebot#677](https://github.com/python-discord/sir-lancebot/issues/677).
[Jump back to when you created the reminder](#dev-contrib message)

placid ermine
#

bump sir-lancebot#668

dusky shoreBOT
fallen patrol
#

why did you ruin my embeds

short snow
fallen patrol
fervent sage
#

hey @ashen isle dont wanna step on your toes, mind if i upload a screenshot of what the tag for bot#1517 looks like for people :P

dusky shoreBOT
ashen isle
#

eh, can't people use the preview thing

fervent sage
#

preview thing?

ashen isle
#

oh that's not a thing

#

yeah pls do that

#

oh it is a thing

vale ibex
#

Yea, there's the md previewer in github, but it'll look slightly different as an embed

fervent sage
#

i mean like

ashen isle
#

oh, yeah sure

fervent sage
#

random side note i really appreciate how github handles images

vocal prairie
#

Yeah.

#

It's nice how they upload it too.

sleek steppe
#

pasting an image in comments in github uploads it and formats it to be an image automatically

fallen patrol
#

ah

#

yeah

#

even better

#

![image](put any link here to an image)

fallen patrol
#

uh

#

where is the token code

sleek steppe
#

?

#

the filter?

fallen patrol
#

that

#

….

#

help_channels is a loaded cog, ya?

#

or maybe its HelpChannels

sleek steppe
#

yes

fallen patrol
#

well then

#

guess im opening an issue for a bug

#

i-

patent pivot
#

Issue for what?

fallen patrol
#

!src HelpChannels

stable mountainBOT
#
Help Command

An interactive instance for the bot help command.

Source Code
fallen patrol
#

should be the help channel cog, ya?

#

because

#
        if argument.lower().startswith("help"):
            return ctx.bot.help_command
#

should be

#

is / ==

#

instead

#

!src helpnomatterwhatiputhere

stable mountainBOT
#
Help Command

An interactive instance for the bot help command.

Source Code
patent pivot
#

ah, yeah

fallen patrol
#

even though the fix is like

#

one line

sleek steppe
fallen patrol
#

im not gonna be the one to commit it

#

if someone wants to just make the fix right now i'll skip the issue

#

i mean

#

if someone is present and wants to do it

sleek steppe
#

I mean I can do it

fallen patrol
#

if you have a bot instance that runs lol

sleek steppe
#

all my commits on bot are so small lol

fallen patrol
#

lol

placid ermine
#

(i am once again bumping sir-lancebot#668)

dusky shoreBOT
vale ibex
fallen patrol
#

so that's why i like the first one more

#

btw could someone assign me to sir-lancebot#677

dusky shoreBOT
vale ibex
fallen patrol
#

well

#

joe did approve it just not in github

vale ibex
#

Yea, sure, but as joe said we still need to think about your proposed solution

vale ibex
#

The fact that it's in the list of open PRs means that we will take a look at it at some point

placid ermine
#

sure thing

placid ermine
#

sorry if i appeared a bit pushy

vale ibex
fallen patrol
#

bot#1519

fallen patrol
#

good first issue 😛

sleek steppe
#

not sure if we needed the issue lol

fallen patrol
#

since i'm not the one who's going to submit a fix, i made an issue

#

if i was going to make the fix, i wouldn't have made the issue

#

but

#

i don't/won't set up @stable mountain

ashen isle
#

@fervent sage can you do it again 🥺 i don't have the bot setup

sleek steppe
#

How do you install packages on docker? I keep on getting ModelNotFound errors lol

vale ibex
#

docker-compose up --build

sleek steppe
#

ah

vocal prairie
#

Oh, i thought it was pipenv

sleek steppe
#

I feel like there's no need to test this change tho

fallen patrol
#

there is

#

because

#

there's a default help command and that's why that code exists

#

in the issue i noted that i think it could be removed entirely

#

because that code isn't on sir-lancebot

#

.src src

#

i hate u

sleek steppe
fallen patrol
#
sleek steppe
#

Because sir-lancebot doesn't use commands.HelpCommand

#

The type of the command itself is discord.ext.commands.help._HelpCommandImpl

#

which of course isn't on the repository

green oriole
#

It is a custom command, yes

#

Well, I think?

sleek steppe
green oriole
#

hmm interesting

fallen patrol
ashen isle
#

lul

fallen patrol
#

y'know

#

before i used git

sleek steppe
fallen patrol
#

commiting was scarier than writing the code

sleek steppe
#

Ehh I'm just gonna push because docker is taking too long

fallen patrol
# ashen isle lul

I used to commit by copying the file, pasting my changes into it, running it, and then copying the file back to github and pasting it

ashen isle
#

bruh

vocal prairie
#

Until I learned version control.

fallen patrol
vocal prairie
#

So I had 7 commits instead of 1.

green oriole
#

@ashen isle I added a screenshot to yar Pr

fallen patrol
#

note: they didn't squash merge

sleek steppe
#

yay docker started after 8 minutes

fallen patrol
#

this should've been 3 commits but i uh

sleek steppe
#

I'm gonna make convert a staticmethod too VeryCool

fallen patrol
#

hey you should wait until the issue is approved zoomeyes

fallen patrol
sleek steppe
fallen patrol
#

holy shit

sleek steppe
#

wait it got merged?

fallen patrol
#

no idea

patent pivot
#

yeah

#

it did

fallen patrol
#

256 commits got merged

#

what got merged

patent pivot
#

it's in dev log

vale ibex
#

!d str.join

stable mountainBOT
#
str.join(iterable)```
Return a string which is the concatenation of the strings in *iterable*. A [`TypeError`](exceptions.html#TypeError "TypeError") will be raised if there are any non-string values in *iterable*, including [`bytes`](#bytes "bytes") objects. The separator between elements is the string providing this method.
patent pivot
#

bot#1014

dusky shoreBOT
sleek steppe
#

nice

fallen patrol
#

but what is it

patent pivot
#

read the PR body

sleek steppe
patent pivot
#

I can't summarise all changes on mobile

vale ibex
#

It's an improvement to the docs command, read the PR 😄

green oriole
#

🎉 🎉 🎉 🎉 🎉 🎉 🎉 Thaaaannnnkksss @brazen charm, the doc PR is merged! 🎉 🎉 🎉 🎉 🎉 🎉 🎉

patent pivot
#

yeah, huge shout out to Numerlor

fallen patrol
green oriole
#

was about to ask that haha

patent pivot
#

we don't have a requirement to changelog within 5 minutes of PR merge lol

green oriole
#

I guess the person who merged it 👀

patent pivot
#

I'll happily write a changelog later today

fallen patrol
green oriole
#

I don't mind writing one either, but I don't know much about the PR

thorny obsidian
#

Hot damn that's a beefy PR

patent pivot
#

ya

vale ibex
#

Hah yea, hit the limit of github for review bot too 😅

patent pivot
#

lul

fallen patrol
#

and it does stuff

green oriole
#

That may be one of the largest, yeah

sleek steppe
#

numelor's third in commits now 😄

fallen patrol
#

waiting for it to deploy

#

!d str.join

stable mountainBOT
#

str.join(iterable)```
Return a string which is the concatenation of the strings in *iterable*. A [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") will be raised if there are any non-string values in *iterable*, including [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "bytes") objects. The separator between elements is the string providing this method.
patent pivot
#

!d aiohttp.ClientSession

stable mountainBOT
#
class aiohttp.ClientSession(*, connector=None, loop=None, cookies=None, headers=None, skip_auto_headers=None, auth=None, json_serialize=json.dumps, version=aiohttp.HttpVersion11, ...)```
The class for creating client sessions and making requests.
patent pivot
#

nice

sleek steppe
#

Wait you can link to discord now

fallen patrol
#

first one was the new one already lol

sleek steppe
#

!d discord

fallen patrol
#

AYYYYY THAT'S NEW

patent pivot
#

!remind 5h changelog

stable mountainBOT
#
Yeah okay.

Your reminder will arrive in 5 hours!

fallen patrol
#

not that you can link but that

#

!d discord works

stable mountainBOT
#

In order to work with the library and the Discord API in general, we must first create a Discord Bot account.

Creating a Bot account is a pretty straightforward process.

fallen patrol
#

it used to say generic page n shit

sleek steppe
#

It used to not find it 😔

fallen patrol
#

ikr

#

!d aiohttp

stable mountainBOT
#

Common data structures used by aiohttp internally.

fallen patrol
#

ok done spamming

sleek steppe
#

I'll write my pr now

vocal prairie
#

@brazen charm Wonderful job! 🎉

sleek steppe
#

I can fix this issue too...

#

Or should I just leave it?

#

Yeah I don't think the help extension will be unloaded

fallen patrol
#

fuzzy matching didn't catch this?

#

cc @tranquil topaz @vale ibex

vale ibex
#

nah, they're different enough that difflib didn't pick it up

fallen patrol
#

wait

#

is that a lib

#

dope

vale ibex
#

It's a built-in

#

!d difflib.get_close_matches

stable mountainBOT
#

difflib.get_close_matches(word, possibilities, n=3, cutoff=0.6)```
Return a list of the best “good enough” matches. *word* is a sequence for which close matches are desired (typically a string), and *possibilities* is a list of sequences against which to match *word* (typically a list of strings).

Optional argument *n* (default `3`) is the maximum number of close matches to return; *n* must be greater than `0`.

Optional argument *cutoff* (default `0.6`) is a float in the range [0, 1]. Possibilities that don’t score at least that similar to *word* are ignored.

The best (no more than *n*) matches among the possibilities are returned in a list, sorted by similarity score, most similar first.
cold moon
#

bot#836 and bot#954 need review

fallen patrol
#

i uh

cold moon
#

One of them have been open over a year, another little bit less

fallen patrol
#

why did sir-lance allow this riddle?

#

messages between the dialogs have been removed for clarity

vale ibex
#

Yea, we should remove that

fallen patrol
#

also

#

its a bad riddle anyhow

sleek steppe
#

Nice the bot removes those random trashcan reactions now

vale ibex
#

sir-lancebot#678

dusky shoreBOT
fallen patrol
#

uh

#

@vale ibex these riddles are just

#

lemme perhaps find a better list and jsonify it

#

Why was the little girl sad after the race?

Because an egg beater

timid sentinel
#

That's.... no.... it was a race between the little girl and an egg, and the egg won the race

fallen patrol
#

oh

#

the other one tho was bad

sleek steppe
#

bot#1521

sleek steppe
#

I made it a staticmethod because I didn't like the unused variable

fallen patrol
placid ermine
fallen patrol
#

chris made a pr to remove it

placid ermine
#

lesgoooooooo

cold moon
#

And latex is here!

vocal wolf
#

While y'all are here, please give a review to sir-lancebot#642

patent pivot
#

.latex j^{oe}_{mama}

#

uhh

vale ibex
#

.latex j^{oe}_{mama}

dusky shoreBOT
vale ibex
patent pivot
#

.latex $j^{oe}_{mama}$

dusky shoreBOT
vale ibex
#

Nice

placid ermine
#

interesting

vale ibex
#

$ is for math things, like this

vocal wolf
#

.latex $\lnot (p \land q)$

dusky shoreBOT
#
You have to stop.

Your input was invalid:
\lnot (p \land q)
^
Unknown symbol: \land, found '' (at char 9), (line:1, col:10)

Usage:
.latex <text>

vocal wolf
#

wat

placid ermine
#

interesting

vocal wolf
#

this means I can't do truth tables

#

literally unusable /s

#

@green oriole automatic linking has been merged. Thank you, @cold moon!

sleek steppe
#

bot#1521 needs reviews 😀

dusky shoreBOT
sleek steppe
#

Huh

fallen patrol
#

….wait

fallen patrol
#

why does it not show the repo and name anymore 😔

#

sir-lancebot#1 bot#1

dusky shoreBOT
fallen patrol
#

uh

#

seems it might be buggy

fervent sage
#

quackstack#12

dusky shoreBOT
fallen patrol
#

bot#1
sir-lancebot#2

fervent sage
#

beautiful

sleek steppe
fallen patrol
#

wait

#

what

vocal wolf
#

hmmmmmmmmm

fallen patrol
#

its buggy lol

#

blunt af

sleek steppe
#

bot#1521

dusky shoreBOT
fallen patrol
#

sir-lancebot#200

sleek steppe
dusky shoreBOT
fallen patrol
#

ohhhhh

vocal wolf
#

something to do with this

fallen patrol
#

without looking at the code, the regex is fucky

#

its not getting anything after the first number

vocal wolf
#

(maybe)

fallen patrol
#

sir-lancebot#200 is not 2

dusky shoreBOT
fallen patrol
#

but it is showing 2

#

sir-lancebot#123

dusky shoreBOT
fallen patrol
#

then that's issue 1 for sir-lancebot

#

@green oriole this was your commit, sir-lancebot#642

vocal wolf
#

that ain't good

fallen patrol
#

oh and now it doesn't even link at all

#

sir-lancebot#642

dusky shoreBOT
fallen patrol
#

ahhh, pr 6, exactly what i wanted

surreal venture
#

its just using the first digit of the number

sleek steppe
#

Why was the number .+ anyways

fallen patrol
sleek steppe
#

Ahh I see

#

Wait nvm

vocal wolf
#

it's PR time

fallen patrol
#

there's more to the regex than that

fallen patrol
#

because its matching the entire message

vocal wolf
#

I'm a little rusty on regex but I'll see what I can do

surreal venture
#

How would I add the reddit emojis to my server?

#

I need them for the stackoverflow command

sleek steppe
#

Copy image addresses & download VeryCool

fallen patrol
#

for those who wanna help with the regex for linking

#

AUTOMATIC_REGEX = re.compile(r"((?P<org>.+?)\/)?(?P<repo>.+?)#(?P<number>.+?)")

#

that's the regex that matches issues

sleek steppe
#

Ahh

#

It's matching the entire mesaage

#

Right?

surreal venture
fallen patrol
whole forge
#

oh hey

#

i just found the regex bug

#

already have a fix too @vocal wolf

vocal wolf
#

oh sick

sleek steppe
#

#123

fallen patrol
#

paste it so we can test it 🥺

vocal wolf
#

@green oriole your regex broke

green oriole
#

Wait, the PR is merged?

fallen patrol
fallen patrol
sleek steppe
whole forge
#

the regex is actually quite bad on the first look

green oriole
#

Oh cool

whole forge
#

im gonna extend my fix to exactly represent gihub naming rules/limits

fallen patrol
#

was it not supposed to be merged? say yes

green oriole
#

I forgot the word boundaries didn't I

green oriole
sleek steppe
#

.+ is never usually good lol thonk

fallen patrol
green oriole
#

I was still making sure that everything worked correctly

vocal wolf
#

@whole forge yeah please do it, my regex experience isn't very good

whole forge
#

np

fallen patrol
whole forge
fallen patrol
#

preventing it from being merged at all

sharp timber
#

\w+? seems more appropriate

green oriole
#

. should be [\w-] most probably

fallen patrol
sleek steppe
#

I mean how many people approved lol

fallen patrol
vocal wolf
sleek steppe
#

More than two

vocal wolf
#

it's fiiiiiiiine

#

we'll fix it up

sharp timber
#

anyway, I'll get something working in regexr

sleek steppe
#

+? is the same thing as * right

green oriole
#

Nah

sharp timber
#
((?P<org>[\w\-]+?)\/)?(?P<repo>[\w\-]+?)#(?P<number>[\w-]+?)
green oriole
#

It is between 1 and infinite but lazy

whole forge
#

bast youre missing numbers and +? is bad practice

#

heres mine

sharp timber
#

\w does numbers

whole forge
#

wait does it

#

oh it does

sharp timber
#

!e ```py
import re
print(re.match("\w+", "abcd123").group(0))

stable mountainBOT
#

@sharp timber :white_check_mark: Your eval job has completed with return code 0.

abcd123
vocal wolf
#

@surreal venture replying to your comment on the stackoverflow command, I hope you're able to finish it off this week :D

sharp timber
#

Why is +? bad practice?

whole forge
#

becasue that matches really long thins like shfisdahfkjdsafhnsadjfsakdfhkdasjhahskdf\askdfjvasdjvasdjfvsjdafvjsdavfjasdvfjsdfvj#1 too which arent even valid repo names

sharp timber
#

I mean, if we have a length limit we should use that

whole forge
#

should always try to match as exactly as posinle

sharp timber
#

I just didn't think there was one

whole forge
#

length limit is 39 and 39

#

wait

#

no

#

100 for repo

#

39 for user

sleek steppe
#

Wow 100

sharp timber
#

Yeah that could be.. interesting

vocal prairie
#

Yeah, it's 100.

#

Just tested it.

whole forge
#

^

vale ibex
#

So ((?P<org>[a-zA-Z0-9]{1,39}?)\/)?(?P<repo>[a-zA-Z0-9\-\.]{1,100}?)#(?P<number>[0-9]+)?

whole forge
sharp timber
#

I don't think we need the ? lazy specifier at all

#

Since we always have hard match edges, there's no reason to "match as little" because we should always match a given amount

whole forge
#

yea nope

#

no need

#

also @vale ibex my regex101 link has \w since apparently as bast proved that does numbers

#

tho i wonder

sharp timber
#

The only place it makes a difference is when the terminating characters can be within the original match sequence, and that's not the case here, / is not valid in usernames or repo names I believe

whole forge
#

nope, alphanumeric and - for user, alphanumeric and - and . for repo

tawdry vapor
#

If you want a very accurate regex for github org/repo then this is it:

(?P<org>(?!-)(?:[^\W_]|-(?!-))+(?<!-))/(?P<repo>[\w.-]+)
#

It has some strange rules about where hyphens can go for org names

sharp timber
#

Are _ not valid for org names?

whole forge
tawdry vapor
#

No apparently. I researched this a while ago so feel free to confirm

vocal prairie
#

It isn't for usernames either.

tawdry vapor
vocal prairie
sharp timber
#

It'd be clearer to use [A-Za-z0-9\-] I think, rather than the double negative

tawdry vapor
#

The regex is complicated to account for the hyphen rules

whole forge
tawdry vapor
#

That being said, I don't think you really need to obey the hyphen rules

#

It's good enough without them

vale ibex
#

Well, we have the regex to deal with them now anyway, so no harm in obeying them

tawdry vapor
#

If you can come up with a better regex for that then go for it

fallen patrol
sharp timber
#

lol

tawdry vapor
#

No not quite

#

It doesn't allow consecutive hyphens too

whole forge
#

actualyl @tawdry vapor yours doesnt obey the - rules eitehr

tawdry vapor
#

Even though the error message they give doesn't say that

vocal prairie
#

Yeah it does.

#

It says single hyphens only.

sharp timber
#

can't start with one though

tawdry vapor
#

Oh sorry

sharp timber
#

honestly this is regex torture

fallen patrol
tawdry vapor
vocal prairie
#

Can't start or end with one either with org/usernames

sharp timber
#

If we are going to enforce these reqs, we should enforce them in the surrounding python

sharp timber
#

if match and not org.startswith("-") or org.endswith("-") and "--" not in org

#

or something like that

green oriole
#

I don't think it is worth enforcing edge cases here as the API will just return 404 of the user doesn't exist

fallen patrol
green oriole
#

We can afford a failed request

fallen patrol
#

so if someone is spamming stuff it won't end up making a bunch of requests

tawdry vapor
fallen patrol
#

like

whole forge
#

i think we should just ignore leading dashes

#

that way if someone writes
-python/cpython#123 it still works

fallen patrol
whole forge
#

nah

#

just

#

this one does it

vale ibex
#

Cannot include consecutive hyphens

fallen patrol
#

why is it unreadable

whole forge
#

because you have a custom dark theme?

vale ibex
fallen patrol
#

uhm, yes

vale ibex
#

that's why 😄

fallen patrol
#

and the website has a darkmode too

tawdry vapor
whole forge
#

wait are they, lemme check

tawdry vapor
fallen patrol
#

it matches

#

wut/sd--f#1

tawdry vapor
#

the hyphens are only enforced for org names

#

repo names dont care about hyphens

gritty wind
#

We can have multiple regexes for different parts

fallen patrol
#

wait so repos can have double --?

#

well then

#

okay then ye

#

((?P<org>[a-zA-Z0-9][a-zA-Z0-9\-]{1,39})\/)?(?P<repo>[a-zA-Z0-9\-\.]{1,100})#(?P<number>[0-9]+) works, its what @whole forge sent

whole forge
#

not quite

#

its missing the underscore

#

in repo name

#

one sec, let me try to get the double dash thing figured out

green oriole
whole forge
#

in that case lets ignore the double dash

green oriole
#

They'd get automuted before they can do anything meaningful

whole forge
tawdry vapor
#

I can't think of a better way in regex than [^\W_]|-(?!-)

sharp timber
#

enforce the non-double dash in python

fallen patrol
#

GOT IT

sharp timber
#

the reason to use regex here is for processing speed, so we don't need to interact with it through python exactly. A for loop over every message is unclear, and so is parsing out every little part

fallen patrol
#
((?P<org>(?!-)(?:[^\W_]|-(?!-))+(?<!-){1,39})\/)?(?P<repo>[a-zA-Z0-9\-\.\_]{1,100})#(?P<number>[0-9]+)
whole forge
fallen patrol
whole forge
#

i think at this point its better to just let the API error out

sharp timber
#

but applying some validation in python on top of that doesn't sound like a problem and sounds like the right way to do it if there's some difficulty doing it in regex

whole forge
#

wait hm

#

do we assume that someone with a double dash made a typo, or that a double dash is part of the rest of the message

#

i would assume typo, then it shouldn't match anything

fallen patrol
#

part of the rest of the message

whole forge
#

right but whats more likely, that someone has a message that goes--repo/name#1 or that someone typos hello--world\name#1

tawdry vapor
#

You're matching on a word boundary anyway, right?

sharp timber
#

I don't think we are at the moment

tawdry vapor
#

You probably should since this could very well match part of some arbitrary URL

whole forge
#

good point

vocal prairie
#

Wait, you can have #s in urls?

whole forge
#

yea

tawdry vapor
#

Yes they're called fragments

vocal prairie
#

I thought that could only be after a /

whole forge
#

lol

fervent sage
vocal prairie
sharp timber
#

Yeah, that's a problem

whole forge
#

wait no im dumb

#

issues are slash separated

tawdry vapor
#

If you match by a word boundary then it'd be better to have the entire match fail when a hyphen issue is detected. That seems easier to do in Python rather than in regex.

#

Having the regex partially match to skip the hyphen issues would be a bad idea

sharp timber
#

Eventually I'll figure out why this isn't matching

fallen patrol
#

it shouldn't be

tawdry vapor
#

Cause you're using match rather than search

whole forge
#

could you not jsut use sth like regex101 isntead of evaling?

sharp timber
#

I could

#

I wanted it to be a clear example though. That ship has sailed.

#

matches on the site, so why doesn't it match here..

tawdry vapor
#

Why are you using [\w.-]+ for the number

#

\d+

sharp timber
#

matches com/test.html#15

tawdry vapor
#

Also you aren't excluding the underscore from org name

sharp timber
#

Yeah, this was an earlier one I grabbed because the ones after I couldn't make work

#

I think we should match cases with -- preceding because people will want to do that sometimes

tawdry vapor
#

What do you mean

sharp timber
#

You might be running into an issue with regex--python-discord/bot#15--or it might be something else

#

if we want to put in the effort to match that, imo, we should. It doesn't match at the moment for some reason

tawdry vapor
#

I think there'd be no reason to type it in any way other than exactly like python-discord/bot#15

#

Anything else should fail

vocal prairie
#

What about in parentheses?

whole forge
#

at this point regex is not sufficient as a parser

tawdry vapor
#

Well the hyphen checks can easily be done in Python after the regex has a match

tawdry vapor
whole forge
vocal prairie
#

I was talking about what Mark said.

#

That anything but it exactly should be ignored.

whole forge
#

well i definitely not anything, precedding dot, slash or the word being too long should be ignored imo

#

because urls

tawdry vapor
#

It may be easier to make exceptions for certain characters like brackets rather than trying to blacklist

vocal prairie
#

That would probably be best.

whole forge
#

well if you want to do that, knock yourself out

tawdry vapor
#

Like (?:$|\s+)[([{]?

#

Anyway, I'm done tinkering with it

fallen patrol
#

hm

#

another thing the command needs is

#

a check, if there is a command invoked in the message

#

oh my god

fallen patrol
#

why was this okayed

#

.issue sir-lancebot#55

patent pivot
#

lol

fallen patrol
#

why was this authorized

patent pivot
#

?

#

I don't think we need the snarky attitude.

fallen patrol
#

i mean

fervent sage
#

mistakes happen

fallen patrol
#

we just talked about the regex for a while

#

but yeah

fervent sage
#

thats just the way things are

fallen patrol
#

sorry

vocal wolf
#

@vale ibex ty for pr

vale ibex
#

NP 😄

#

Do our containers support simd instructions?

#

I'm just wondering if it's worth swapping lancebot to pillow-simd in this image PR

patent pivot
#

you raise a good question

#

I think so

sleek steppe
#

bot#1521 needs one more review from a staff/contributor.

dusky shoreBOT
sleek steppe
#

ahhh lol

patent pivot
#

lmfao

vale ibex
patent pivot
#

we have uhh

#

12 AMD EPYC 7601 32-Core

#

no, we don't

#

wait

#

what do we have lol

#

uhh maybe we do? trying to interpret /proc/cpuinfo

vale ibex
#

Could you throw cat /proc/cpuinfo in here?

#

oh lol

patent pivot
#

either way, /proc/cpuinfo suggests we have several of the required instruction sets for SIMD

#

yeah one sec

#

I initially thought 4 cores but the core ID on each processor doesn't increment

vale ibex
#

yea, avx is in the flags

#

we should be good

patent pivot
#

nice

vocal wolf
fervent sage
#

oop, not my code originally but sure i'll fix that

vocal wolf
#

Thanks!

fallen patrol
fervent sage
#

hm that's a good point

#

initially i was going to do this

#

but hmmm

sleek steppe
#

😩

fallen patrol
#

imo i would reformat the entire json

sleek steppe
#

list(self.yt_vids) please

fervent sage
#

i think i will

fallen patrol
#

that would make almost more sense if the json was formatted better

fervent sage
#

imo it'd be better to have a list of

{
  "url": "",
  "channel": ""
}
``` since video name is never used anyway
fallen patrol
#

one way to do it would be

#

weight each channel

fervent sage
#

that's just needlessly complex imo

fallen patrol
#

in order to not reformat the json

#

well, sorting the json by who, makes it a bit nicer to read

#

👏

#

@sleek steppe vn

#

!source HelpChannels

stable mountainBOT
#
Cog: HelpChannels

Manage the help channel system of the guild.

Source Code
sleek steppe
#

yes

fervent sage
#

wow RNG doesn't like me today

#

i tested the command almost 100 times before it chose one other than google

#

was beginning to think it was somehow broken, but alas randomness sucks lol

sleek steppe
#

are you just picking randomly from all of the videos?

fervent sage
#

yes

#

see latest commit

#

hm while im here i'm tempted to alias it as fools too

sleek steppe
#

ah

#

not sure about that one

fervent sage
#

which one

#

picking randomly or fools alias?

sleek steppe
#

fools

fervent sage
#

also is this a better name for the PR by now?

vale ibex
#

ugggh fighting pipenv to install pillowsimd

#

can't find the right version to install which has wheels available

vocal wolf
#
diff --git a/bot/exts/easter/april_fools_vids.py b/bot/exts/easter/april_fools_vids.py
index efe7e67..1882fd7 100644
--- a/bot/exts/easter/april_fools_vids.py
+++ b/bot/exts/easter/april_fools_vids.py
@@ -8,28 +8,22 @@ from discord.ext import commands
 log = logging.getLogger(__name__)
 
 
+with open("bot/resources/easter/april_fools_vids.json", encoding="utf-8") as f:
+    ALL_VIDS = load(f)
+
+
 class AprilFoolVideos(commands.Cog):
     """A cog for April Fools' that gets a random April Fools' video from Youtube."""
 
     def __init__(self, bot: commands.Bot):
         self.bot = bot
-        self.yt_vids = self.load_json()
         self.youtubers = ['google']  # will add more in future
 
-    @staticmethod
-    def load_json() -> dict:
-        """A function to load JSON data."""
-        p = Path('bot/resources/easter/april_fools_vids.json')
-        with p.open(encoding="utf-8") as json_file:
-            all_vids = load(json_file)
-        return all_vids
-
     @commands.command(name='fool')
     async def april_fools(self, ctx: commands.Context) -> None:
         """Get a random April Fools' video from Youtube."""
-        random_youtuber = random.choice(self.youtubers)
-        category = self.yt_vids[random_youtuber]
-        random_vid = random.choice(category)
+        random_youtuber = random.choice(ALL_VIDS)
+        random_vid = random.choice(ALL_VIDS[random_youtuber])
         await ctx.send(f"Check out this April Fools' video by {random_youtuber}.\n\n{random_vid['link']}")
#

static func ehhhh

fervent sage
#

i can yeet the static funtion if you want

#

it seems a bit... overcomplicated

vocal wolf
#

static func is just unnecessary

fervent sage
#

yea

vale ibex
#

!paste

stable mountainBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

fervent sage
#

which removes a ton of needless bloat

vale ibex
#

Anyone fancy helping out here, been stuck for like 10 mins

#

upgrading and downgrading my pip and pipenv

#

trying different versions of pillow-simd

fallen patrol
#

!pypi pillow-simd

stable mountainBOT
fallen patrol
#

what

#

why not use Pillow

#

what is the simd

sleek steppe
#
channel, url = video["channel"], video["url"]

Do we allow this here lol

vale ibex
#

Pillow simd uses simd instructions, among other speed improvements, which makes it considerably faster than regular pillow

fallen patrol
#

nvm ^

patent pivot
#

answered in meta this

#

(answer was we have it)

fallen patrol
#

wait is it issued?

#

!src d

stable mountainBOT
#
Command: docs

Look up documentation for Python symbols.

Source Code
patent pivot
#

issued?

fallen patrol
#

how do you add them?

patent pivot
#

there is a bot command

#

or

fallen patrol
#

dang

patent pivot
fallen patrol
#

so never an issue

sleek steppe
#

!d PIL

stable mountainBOT
#
PIL
patent pivot
#

takes an integer like 0.3234234 and truncates it to a set length

#

!e ```py
integer = 0.1234123

print(f"{integer:.3f}")

stable mountainBOT
#

@patent pivot :white_check_mark: Your eval job has completed with return code 0.

0.123
patent pivot
#

yep, so the outputs in !ping are to 3 decimal places

fallen patrol
#

python can do anything

#

except run fast

vale ibex
stable mountainBOT
#
You're the boss!

Your reminder will arrive in 2 hours!

fallen patrol
#

although if you use cython you can run faster than cpython

sleek steppe
#

pypy

fervent sage
#

on the subject of this sorta thing, something else that might interest you is this

sleek steppe
#

You can combine them together too

>>> format(123123123.123123, ',.3f') # Does the same thing as f"{123123123.123123:,.3f}"
'123,123,123.123'
patent pivot
#

alright what is ooming lol

fervent sage
#

lmao

patent pivot
#

lol is it the latex command

fervent sage
#

so thats why lancebot is dying repeatedly

patent pivot
#

yeah

#

lol

gritty wind
#

do we not

patent pivot
gritty wind
#

have like

#

ouch

fervent sage
#

just give it more ram and pretend everything is fine :)

patent pivot
#

200Mi limit on lancebot

#

so

#

yeah

#

i could just give it more

#

probably the latex command

gritty wind
#

Can you

fervent sage
#

is it a problem with constantly gaining ram or just that something (likely latex) needs more than it can give during one op

gritty wind
#

pull eexact crash timestamps

patent pivot
#

uhhh

#

yea

#

2021-04-12T19:44:19Z
2021-04-12T20:16:01Z
2021-04-12T22024Z

#

great

#

brilliant emote

gritty wind
#

lol

#

let's see if I know how to logs

patent pivot
#
2021-04-12T19:44:19Z
2021-04-12T20:16:01Z
2021-04-12T20:20:24Z
gritty wind
#

is the int e patched added yet

fervent sage
#

im curious why for int e jishaku isnt used? is it just because the bot is meant to be do-it-yourself-y or is there another reason idk about?