#dev-contrib

1 messages Β· Page 120 of 1

sleek steppe
#

I think it would make sense to throw an error when you fetch 0 issues. This embed is not very useful

vale ibex
#

just put that at the start

cold island
#

Would that just send an embed to the chat?

vale ibex
#

yea, UserInputError is caught in the error handler afaik

green oriole
#

yes

vale ibex
#

eg

#

.bm 123

dusky shoreBOT
#
Are you trying to kill me?

Your input was invalid: You must either provide a valid message to bookmark, or reply to one.

Usage:.bookmark [target_message] [title=Bookmark]

vale ibex
#

This is what it would look like

cold island
#

Ah

#

This is a bit confusing still, because in Dorsan's example they did provide a number

vale ibex
#

yea, the usage would show how to do it properly

#

and the text can be changed to make sense

#

The text you pass into the error is what is put into the error embed

molten perch
#

Actually I just made an embed like here and put "Invalid Arguments" as an error message. But I guess using that command seems more convenient.

        if len(numbers) > MAXIMUM_ISSUES:
            embed = discord.Embed(
                title=random.choice(ERROR_REPLIES),
                color=Colours.soft_red,
                description=f"Too many issues/PRs! (maximum of {MAXIMUM_ISSUES})"
            )
            await ctx.send(embed=embed)
            await invoke_help_command(ctx)
cold island
#

Yeah the error handler does that for you

vale ibex
#

Yea, I'd rather use the error handler, so all our stuff is handled in a standard way

#

it's easier for you now, and it's easier to change it bot wide in future

molten perch
#

Okay, thank you. So.. does that qualify as an issue?

cold island
#

Uuh.. you can just PR it in this case I think

vale ibex
#

feel free to raise another issue for it if you like, or you can PR it directly

#

or you can include it in what you're working on now,

#

lol yea what Zig said

molten perch
#

Okay, thank you! πŸ˜„

short snow
#

facepalm Now I curious about those 179 child items

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.

vale ibex
#

each with their own deployment manifests

#

EG pixels:

short snow
#

Oh ok πŸ‘

toxic token
#

πŸ‘€

#

k8s

fringe sphinx
#

Is there a designated place for images in sir lancebot?

#

or are they stored some other way?

vale ibex
#

bot/resources usually

fringe sphinx
#

just in that folder, or should I put it in evergreen?

vale ibex
#

preferably they're small images though, since everyone will need to download them if they're in git

fringe sphinx
#

I'm making this command as a joke anyways, so it probably won't matter a whole lot

vale ibex
#

Yea, put it in the same folder as the cog is in in exts/

fringe sphinx
#

okie thanks

fallen patrol
#

!guild

stable mountainBOT
#
Server Information

Created: 4 years, 5 months and 21 days ago
Voice region: europe
Features: PARTNERED, NEWS, RELAY_ENABLED, THREE_DAY_THREAD_ARCHIVE, BANNER, COMMUNITY, WELCOME_SCREEN_ENABLED, ANIMATED_ICON, SEVEN_DAY_THREAD_ARCHIVE, VIP_REGIONS, DISCOVERABLE, INVITE_SPLASH, PRIVATE_THREADS, PREVIEW_ENABLED, MEMBER_VERIFICATION_GATE_ENABLED, VANITY_URL
Roles: 84
Member status: status_online 36496 status_offline 184473

Members: 220969

Helpers: 117
Moderators: 30
Admins: 15
Owners: 3
Contributors: 39

Channels: 234

Category: 29
News: 11
Staff: 65
Stage_Voice: 1
Text: 120
Voice: 8

fallen patrol
#

!remind 2h complete thought related to bot assets

stable mountainBOT
#
I'll allow it.

Your reminder will arrive in 2 hours!

patent pivot
#

how is colour stuff on lancebot @fallen patrol

fallen patrol
#

Coming along

#

I've been working on it this week

#

My Lance enviroment hasn't been able to start

#

Will look into it friday but I've been just getting the basics done on a different bot of mine

fallen patrol
patent pivot
#

πŸ‘, remember other folks are interested in contributing if you want to delegate

fallen patrol
#

Yeah I will

#

Again, once Lance starts

#

πŸ˜” really annoyed it doesn't too

patent pivot
#

If there are errors being spat out, someone can certainly help here

fallen patrol
#

Yeah there are

#

Will send Friday, or maybe later tonight

stable mountainBOT
#

@fallen patrol

It has arrived!

Here's your reminder: complete thought related to bot assets.
[Jump back to when you created the reminder](#dev-contrib message)

molten perch
#

Hey! I've been looking at the API code for a couple of hours now, and noticed that the ORM models are still missing, may I ask whether you have any plans on what ORM library you will use?

stable mountainBOT
#

pyproject.toml line 12

SQLAlchemy = "^1.4.18"```
patent pivot
#

Yeah it is

molten perch
vale ibex
fallen patrol
#

Thank god

fallen patrol
#

aha they also fixed the ephermal bug with this as well

#

@sharp timber πŸ˜„

#

yep just got discord developer confirmation

#

it was fixed

gritty wind
#

@green oriole are you planning to keep that PR until they roll out full support for timestamps, or are you looking to get it merged now?

green oriole
#

I would like to merge it when every client can render timestamps

vale ibex
#

!server

stable mountainBOT
#
Server Information

Created: 4 years, 5 months and 23 days ago
Voice region: europe
Features: PRIVATE_THREADS, MEMBER_VERIFICATION_GATE_ENABLED, PARTNERED, SEVEN_DAY_THREAD_ARCHIVE, PREVIEW_ENABLED, COMMUNITY, WELCOME_SCREEN_ENABLED, RELAY_ENABLED, BANNER, NEWS, VANITY_URL, THREE_DAY_THREAD_ARCHIVE, ANIMATED_ICON, DISCOVERABLE, VIP_REGIONS, INVITE_SPLASH
Roles: 84
Member status: status_online 39042 status_offline 182917

Members: 221959

Helpers: 118
Moderators: 30
Admins: 15
Owners: 3
Contributors: 39

Channels: 235

Category: 29
News: 11
Staff: 65
Stage_Voice: 1
Text: 121
Voice: 8

vocal wolf
#

220k holy

vale ibex
#

Should we add another role to the left list, so that it matches up with the right list

#

since we bumped to d.py 1.7 it shows stage voice channels automatically

vale ibex
vocal wolf
#

would would be the role? voice verified?

vale ibex
#

Maybe project leads?

vocal wolf
#

ohhh

vale ibex
#

voice verified could be good too

vocal wolf
#

well I mean

#

anyone can get voice verified

#

hmmmm

vale ibex
#

true

vocal wolf
#

what if we combined project and domain leads

#

to a number just called "leads"

green oriole
#

was about to suggest that ^

vale ibex
#

hmm, that would be a bigger refactor

#

but could be good

green oriole
#

Would it?

vocal wolf
#

I will create issue

vale ibex
#
    @staticmethod
    def get_member_counts(guild: Guild) -> Dict[str, int]:
        """Return the total number of members for certain roles in `guild`."""
        roles = (
            guild.get_role(role_id) for role_id in (
                constants.Roles.helpers, constants.Roles.moderators, constants.Roles.admins,
                constants.Roles.owners, constants.Roles.contributors,
            )
        )
        return {role.name.title(): len(role.members) for role in roles}
#

atm is very much 1 role per line

#

so I say bigger, not too hard though

vocal wolf
#

Here is the issue

#

bot#1667

vale ibex
#

Nice

green oriole
#
    @staticmethod
    def get_member_counts(guild: Guild) -> Dict[str, int]:
        """Return the total number of members for certain roles in `guild`."""
        roles = (
            [guild.get_role(role_id) for role_id in role_group] for role_group in (
                (constants.Roles.helpers), (constants.Roles.moderators), (constants.Roles.admins),
                (constants.Roles.owners), (constants.Roles.contributors), (constants.Roles.project_leads, constants.Roles.domain_leads)
            )
        )
        return {" & ".join(role.name.title() for role in role_list): len(set(role.members for role in role_list)) for role_list in roles}
#

Some like that

#

but clearer

#

probably with an actual for loop instead of a dict-comp

#

Should I add that to the issue? lemon_thinking

#

that won't work actually

vale ibex
#

ehhh maybe pseudo code of it

#

we would definitely want to break that down more, so it's more readable

green oriole
#

Yeah, nah, this is a bad implementation haha

green oriole
#

Am I the only one to get a DataError: integer out of range when trying to sync roles on the test server?

vocal wolf
#

I've never gotten that error

brazen charm
#

Make sure site is up to date

green oriole
#

Riiight, I probably need to pull it

#

T'is working now, thanks

vale ibex
#

had to do a site migration, since the role integer now exceeds the max size of a psql int

green oriole
#

Aha

fallen patrol
#

I don't think it would be terribly difficult for them to do it

#

But all of the broken bots

#

And yes, they would probably bump api version

#

But regardless, bots would need to migrate

fervent sage
#

permissions use strings so they can easily have more bits than they already do

fallen patrol
#

Right, they migrated that in v6 iirc

patent pivot
#

the reason was because of javascript

#

a database schema change is fine, and most languages support large integers, but javascript cannot serialise a JSON integer into a large integer

fallen patrol
#

How did u find out smh Joe always knowing

patent pivot
#

lol

#

common knowledge

#

several platforms have experienced this, have you ever wondered why IDs have always been strings with the Discord API?

#

it's because of this

fallen patrol
#

So it is actually a backend problem?

patent pivot
#

nope, frontend

#

there is no backend problem

#

in fact with ETF, IDs are still sent as integers, because the erlang backend servers, python and clients can understand them

fallen patrol
#

Ah

patent pivot
#

but javascript cannot

fallen patrol
#

Iirc also permission bits are sent as a strings now

patent pivot
#

yep, because of this problem

#

IDs hit it much earlier, perms only hit it recently

fallen patrol
#

So it's not really limited on permission bits anymore?

patent pivot
#

nope, they can add freely now (and have β€” threads have a new permission bit, so did stages)

fallen patrol
#

Or theres probably something else we don't know

patent pivot
#

yeah

#
> Number.MAX_SAFE_INTEGER
9007199254740991
> parseInt("9007199254740992")
9007199254740992
> parseInt("9007199254740993")
9007199254740992
> parseInt("9007199254740994")
9007199254740994
> parseInt("9007199254740995")
9007199254740996
#

you can see how javascript gets a bit iffy with those

#
>>> int("9007199254740992")
9007199254740992
>>> int("9007199254740993")
9007199254740993
>>> int("9007199254740994")
9007199254740994
>>> int("9007199254740995")
9007199254740995
#

whereas Python, handles it

fallen patrol
#

Ah

patent pivot
#

JavaScript does have a type for it BigInt, but you can't deserialise straight from JSON into it

#

so you need to transmit as strings and then convert, so internally the clients still operate as if they are integers, it's just that in transit the client converts them to strings so there is no loss of precision

molten perch
#

Hi! As for this issue: https://github.com/python-discord/bot/issues/1667 , is it an acceptable "solution" to create a helper class that basically "joins" the statistic of the given roles and ofc. set a name for them (in that case that would be: "leads") and later on add the "joined" roles to the list?
(I'm just curious, that was the first thing that came to my mind when I came across this issue, but I'm not sure whether it's acceptable or not)

vale ibex
#

Yea i think that would make sense, maybe a helper function in that class, rather than a class itself though

molten perch
#

Yeah, the reason I said class, was because I wanted to somehow keep this syntax at the end of the code

return {role.name.title(): len(role.members) for role in roles} 
short snow
#

Btw, I am getting back to my PRs, just been busy so haven't got time

daring garnet
#

Im new to web development

molten perch
#

Hey! If someone has a Domain Leads and a Project Leads role, when showing the stats for "Leads" should it count as two? I mean after all, there are two roles regardless of the fact that on one single user.
(https://github.com/python-discord/bot/issues/1667)

thorny obsidian
#

hmmmm, I'm not sure if there'll be a situation where we have one person having both roles. It's feasible, I guess just very unlikely

molten perch
#

Should I use a "unique" function, just to make sure? I've just added "more_itertools" to sir_lancebot's dependencies, it has a really useful function for that.

gritty wind
#

I don't think it really matters, but it should be pretty simple either way without any third party tools: throw them into a set

#

If that's all what you're using more_itertools for, I'd prefer it if you don't add extra dependencies. I feel particularly strongly about the matter as I was in dependency hell for quite a long while trying to bring sir-lance and python up to 3.9 because I had to deal with unmaintained projects. If we can avoid extra dependencies, that would be ideal

molten perch
#

I thought it was the prefered implementation.

brazen charm
#

I'm not sure if it's needed but if it improves the quality of the code in any way I'd say just add it, more_itertools is a tiny dependency that can be useful and practically can't break

gritty wind
#

Oh well. If it's really necessary more_itertools isn't particularly... what Numerlor said at the end

molten perch
#

Okay, then. It won't be needed in the first issue I mentioned, but in case of the sir-lancebot issue, it's quite useful.

vocal wolf
#

@sleek steppe fix tests hyperlemon

sleek steppe
#

yeah I'm trying to do that Sadge

sleek steppe
#

It's kinda hard to test tests because it takes forever to run all of them

gritty wind
#

are you on the latest main branch? We merged xdist which should cut down the time

#

But regardless

#

you shouldn't be running them all

#

Run the suites relevant to your code while you program

#

then run them all as one final check before you push

sleek steppe
green oriole
#

Hey @sleek steppe, I'm currently going off to bed but I'd like to merge the PR tomorrow by the early morning, would you mind if I push changes to your branch if you aren't around, due to the time sensitive nature of this PR?

#

if it isn't merged by then

sleek steppe
#

I was going to ask that too since the PR is high priority

gritty wind
#

How are you running the tests currently?

sleek steppe
#

poetry run task test

gritty wind
#

Alright, you can append the test suite/test name you want to run. For example:
poetry run task test tests.bot.exts.utils.test_jams.JamCreateTeamTests

#

additionally, you can get a smaller speed up by using test-nocov instead of test, but that doesn't matter on this scale

#

If you want to run a specific test, you can use the same format, just add the test name at the end

#

(sidenote: you're better off running these directly from your IDE if it has support for it. Pycharm has a run button on the left bar beside each test suite, and each test. VS has something similar iirc. I don't think editors like VSC have it though)

#

hmm that's interesting. pytest doesn't support specifying tests like that. I wasn't aware of that.

#

You can still invoke unittest though:
poetry run python -m unittest tests.bot.exts.utils.test_jams.JamCreateTeamTests

sleek steppe
gritty wind
#

Alright, I checked it, and pytest does support specifying which tests to collect, you just have to pass in a file path, instead of the module. It's a bit more annoying when it comes to passing in specific tests or suites, but it's fine with files. It also doesn't work with the coverage version because of the order of the arguments πŸ˜”

gritty wind
#

I've opened a PR now to include what I just described in the README. I don't think many people see it honestly, but it's just a more concrete thing to point people towards, and some people might see it

#

Xith fastest triager in the world???

#

Damn y'all are quick

vocal wolf
#

lmfao

#

@gritty wind HEY I THINK YOUR PR WAS MERGED

gritty wind
#

sweet lord

vocal wolf
#

that was uh

#

very fast lol

#

@gritty wind pls review this if you have time: bot#1663

dusky shoreBOT
vocal wolf
#

today is productive day.

gritty wind
#

I'll start at it today, but I may not finish it because it's already 2 in the morning :x

vocal wolf
#

oh lol

sleek steppe
#

finally.

poetry run task test tests.bot.exts.utils.test_jams.JamCreateTeamTests      
........
----------------------------------------------------------------------
Ran 8 tests in 3.696s

OK
gritty wind
#

Hmm this PR implements it's own fuzzy matching instead of using difflib like the error handler. Not sure if I'm more impressed or horrified lol

vocal wolf
#

The tag groups one?

gritty wind
#

ye

vocal wolf
#

oh jeez lol

gritty wind
#

It's a pretty clean solution tho so /shrug

#

interesting, seems difflib doesn't take into account order of the letters

#

Is that the reason?

green oriole
#

Hey @vocal wolf, you around?

green oriole
#

Uh, well, actually technically I didn't do that, sorry 😒
Time to close the PR

timid sentinel
ionic turtle
#

Question, I'd like to add Slash commands to either bot, but I wasn't sure what the process is for opening pull requests. Can someone let me know?

patent pivot
#

I don't know that we're ready to adopt slash commands on any of our bots right now. It'd certainly be Sir Lancebot before Python, but even then I'm not sure the tooling is there and that we've sufficiently discussed it internally.

ionic turtle
#

Hmm

sleek steppe
#

we wouldn't be using slash commands until discord.py 2.0 comes out

ionic turtle
#

Also, what are the season labels on the github

green oriole
#

It is from when sir lancebot was seasonalbot

#

Basically each of our extension is categorized per season

#

Morning sir @vocal wolf, what do you think about renaming season labels to area or category?

ionic turtle
#

How do you know which category to update code into then?

vale ibex
ionic turtle
#

How do you know which categories are which when making a PR? And which command would go in which "season"

vale ibex
#

the evergreen folder is what is used for any code that doesn't fit into a specific season

gritty wind
#

Well most things go into evergreen

#

The other categories are things like "Halloween" and "Christmas", so you'll know when something fits in them

#

But unless told otherwise, assume everything goes into evergreen

ionic turtle
#

So I don't really have to learn that yet? You guys do that for me?

gritty wind
#

I mean, there isn't much to learn, and we're considering doing away with the entire season system. They are just broad groupings like I said. We have a command that creates easter egg images, which then logically goes into the "easter" folder, not much to learn there

#

Having a look at some of the files may give you a better idea of what's going on. You'll see that a large majority of all features go into the "evergreen" folder, while very few, specific things go into the other seasons

ionic turtle
#

Why isn't the pride Avatar in pride folder?

green oriole
#

Because ???

gritty wind
#

The avatar cogs are a bit special in that they are all the same cog with slight modifications

#

It's grouped with all the other avatar commands

green oriole
#

Don't we support defining avatar modification from other cogs?

gritty wind
#

I think it's possible, just copy the code elsewhere, but I think it makes more sense to have them grouped this way. Logically, they are more similar than not

#

But to go back to the original question, there are some exceptions, but usually those follow some discussion between the person making the changes, and the rest of the dev team

#

If you'd like to get yourself familiarized with the bot, I'd recommend you select one of the preexisting issues, or open a new issue with suggestions for what you want to change, instead of diving in head first. We can give you better pointers when we start from a well defined goal

ionic turtle
#

Yeah I'm looking at the code and issues rn

dry folio
#

@ionic turtle why must you do this
fk, now i lost too
I HAD A STREAK OF LIKE A YEAR

ionic turtle
#

LMFAO

molten perch
gritty wind
#

It appears that most of that PR is just moving stuff around, so reviewing it shouldn't take too long. The longest part usually is finding people who want to review it

molten perch
#

I don't really understand how reviewing work(I mean not the process itself) . Can everyone review a PR or it must be either a Contributor or a Sir Lancebot developer, or both?

gritty wind
#

Anyone can, and is encouraged to review if they want to, but, for the PR to be merged it needs a review from one Core Developer, and one Contributor/Staff member (total of two reviewers minimum).

While your review may not count, it'll still help because it can get the PR to a more ready state to make future reviews quicker, and it can give more confidence in a PR the more people approve it. Most contributors started out submitting code and reviews before they got any real permissions, but that led to them getting the role.

molten perch
#

Interesting.. thank you for the clarification.
Now, my next question.. what if I'd like to review this PR?
(I built the change on top of that branch, I'm very well confident that it works)

gritty wind
#

Your review would be much appreciated! Even saying whether something starts or not can still be helpful. Saying that you've played around with it, and know it works goes a long way.

dry folio
#

hello :D it's been almost a month since the last message on sir-lancebot#756, it's a non-code pr and only needs one last core dev's approval. if anyone is available and would like to review it, it'd be amazing. thanks in advance! πŸ˜„

gritty wind
ionic turtle
#

Are we supposed to follow pep8 too? I hear people keep on taking about it so

gritty wind
#

Soooort of. Following PEP8 will get you most of the way there. We also have flake8, with a bunch of plugins which will tell you if you have any mistakes in your formatting. There some rules that we couldn't enforce with flake, you can see a list here:

https://pythondiscord.com/pages/guides/pydis-guides/contributing/style-guide/

Generally, flake will get you most of the way there. The rules in the style guide you can get used to pretty quickly as well. The style guide isn't enforced too strongly (especially on sir-lancebot) unless it fails flake8, or is especially problematic, but someone will help point that out if that's the case.

#

If you haven't seen it, this page contains basically all the resources you'll ever need:

https://pythondiscord.com/pages/guides/pydis-guides/contributing/

From the two guides I've linked so far, to guides for setting up each of the major projects (you'll really want to read these!), to general info about contributing to these projects.

#

@dry folio I squash merged your PR because 15 commits fixing typos is a bit absurd haha. Should be good to go now

#

Yup, we're live

hasty totem
#

tΓΌrk yokmu bana yardΔ±m edecek

gritty wind
#

Hey @hasty totem I'm sorry, but this is a strictly English speaking server. Please use English to the best of your ability.

#

That's okay, but you have to use English as best as you can. If you can't write English at all, you can use something like https://translate.google.com.

Check out #β“ο½œhow-to-get-help to get a channel where you can ask your question. Please don't post it in multiple channels, or other people's channels.

#

Uhh, hey @vale ibex you're the one to talk to about the permission sync error, yeah?

#

What value am I meant to set lol

vale ibex
#

huh?

#

perms sync error?

gritty wind
#

When starting the bot, it threw an error when trying to sync roles. The API returned a 400

vale ibex
#

ahhhh

gritty wind
#

{'permissions': ['Ensure this value is less than or equal to 8589934592.']}

vale ibex
#

you need to delete your site image and rebuild it

gritty wind
#

Ah okay

#

Thanks!

vale ibex
#

theres a migration to convert that column to a bigint

gritty wind
#

I've not been very active recently, so trying to catch up on some things

vale ibex
#

no worries πŸ˜„

#

We bumped the bot to d.py 1.7.X

#

which came with the new permission bits, which pushed it over the edge of a psql int

gritty wind
#

Do I follow the 12-13 migration guide in announcements?

vale ibex
#

sir-lancebot#781 tiny PR to fix an error being raised on startup since we deleted the hacktoberfest channel

dusky shoreBOT
vale ibex
#

if you dont, then you can trash it and rebuild

gritty wind
#

Sweet, thanks

dry folio
ionic turtle
#

I want to help contribute but idk what to suggest lmao

vocal prairie
#

Check out the available issues! There are a bunch of great ideas there

ionic turtle
#

They all say that the author wants to do them

#

And many of them are old

brazen charm
#

Doesn't really matter if it's old, just need to make sure it's still relevant and you're fine

ionic turtle
#

They're still the ones that the author wants to do

#

Should i just ask if the author is still up for them in the issues I'm interested in contributing to?

vocal prairie
#

That's fine if there's hasn't been activity on the issue for a while.

gritty wind
#

I forgot how long it takes to build metricity :P. Pulling latest python, and installing gcc and git takes ages

#

I'm testing without them now, as I don't see where they are necessary

#

Everything seems to be working currently

#

if that turns out to be the case, I'll push fixes for these issues

#

Hey @patent pivot would you happen to know why we do ^

#

also it seems it doesn't want to start up because the table already exists

#

Ah I see

cold island
#

Yeah the site DB has metricity tables for testing. Just drop them

gritty wind
#

cool cool cool, things seem to be running smooth without git

#

gonna

#

push that I guess

#

Going to wait for an answer from joe before PRing. My best guess is it was added to help install packages that didn't have versions released for 3.9 yet, since the change was made end of 2020

patent pivot
#

hello yes

patent pivot
#

d.py version bump iirc

vocal wolf
#

let me check what it is now

gritty wind
#

Well, I guess that means we'll still need them for future proofing, but I was going to suggest locking to 3.9 as well

#

Thoughts? (we could also do <=3.9)

#

Probably start it from 6 to 9

patent pivot
#

lock to 3.9 is fine by me

vocal wolf
#

@green oriole we should do category since area would conflict with labels such as area: backend

#

I'm just going to change that now

gritty wind
#

Hmm I'm trying to bump the version. Technically this is a breaking change since versions prior to this supported 3.8+, while now we support 3.8,3.9. Technically no other versions currently exist, so the support bracket hasn't changed, but even more technically, we dropped support for future versions.

Alternatively, we could always ignore semvar :x

patent pivot
#

lol

#

do whatever feels appropriate, but yeah you can ignore

gritty wind
#

The evils of running update. I really only changed 3 lines :P

patent pivot
#

@gritty wind version bump needed in the init.py file

gritty wind
#

oh

#

whoops

#

That has been

#

fixed

patent pivot
#

in thaaaaat case

#

lgtm

gritty wind
#

Hey joe

#

You're pretty damn cool

patent pivot
vocal wolf
#

lol

#

Alright I changed season to category labels in @dusky shore. Example: season: evergreen to category: evergreen.

#

cc @green oriole

clever wraith
#

That seems like a good idea

ionic turtle
#

Kek

#

What's duck-pond?

#

There is a command in the main bot for it and I'm so confused

vocal prairie
ionic turtle
#

Oh

vocal prairie
#

But with ducks

ionic turtle
#

Kinda wanna see it now

green oriole
#

Are they folks on Android and iOS stable who can tell me of they see this timestamp correctly? <t:0:R>

tawdry vapor
#

I'm on android beta but if it helps, I see 31 Dec. 1969

green oriole
#

Wait, what

#

Oh, because it is localized

#

Makes sense haha

#

I just would like to make sure it is rolled on every stable platform before incorporating them to our bots

#

Thanks though!

tough imp
#

doesnt look right on iphone πŸ˜”

green oriole
#

cheers

vocal wolf
short snow
#

github changed the skin color of emojis pithink is there a way i can change it to skin tone

#

Hmm, maybe quackstack can generate duck ponds for you containing x ducks in a pond which could be similar by colour/accessories or not same at all PE_PandaThinkv2

#

@fervent sage

green oriole
#

FYI I'm looking through our deps to see if we have more GPL deps

gritty wind
#

Hey @glacial veldt @green oriole do either of you have a windows systems without build tools? The rapidfuzz page lists it as a requirement, since most of their code is C. They have wheels, so it hopefully shouldn't be a problem, but I'm also concerned about not having wheels for future versions slowing down upgrade processes

vale ibex
#

I can remove it from my path temporarily to test soemthing if you need scale

gritty wind
#

pip install rapidfuzz

I highly doubt it'll error out since I'm staring right at the wheels, but a sanity check would be appreciated

glacial veldt
#

I use rapidfuzz at work and there's windows users

#

I've not tested it personally

#

they use cibuildwheel so it should be nice wheels

vale ibex
#

yea, pip found rapidfuzz-1.4.1-cp39-cp39-win_amd64.whl (430 kB)

gritty wind
#

Perf, thanks!

glacial veldt
#

if you like windows

green oriole
#

this page is so useful

gritty wind
#

It seems pretty well maintained, I don't think we'll run into problems
... don't quote me on that if we run into problems πŸ˜›

thorny obsidian
#

I stumbled on it yesterday, quickest bookmark of my life

glacial veldt
#

yeah and the person that runs came and fixed my pypi wheels for me

gritty wind
#

lmao that's amazing

#

What did you have in mind with anyio graingert?

glacial veldt
fervent sage
#

If downloads fail, reload this page, enable JavaScript, disable download managers, disable proxies, clear cache, use Firefox, reduce number and frequency of downloads.

lmao

placid ermine
#

lol

gritty wind
#

Oh I thought it was in context of the ping command haha

glacial veldt
#

it would be super cool if you could have a !mypy command too

#

I just want to use discord as a shared jupyter notebook really

gritty wind
#

lol

glacial veldt
#

you might want to load those deps in with pip-compile or something so dependabot can update them

brazen charm
#

We could expose snekbox's -m interface through a shared command on the bot with some universal parsing of the args to get mypy and others without a separate command for everything

glacial veldt
#

btw there's liccheck

#

you might want to run that in CI

#

I wish poetry did it for you

#

like it could refuse to install stuff if your licence was incompatible

gritty wind
#

tfw all the projects that use aioping are pydis. (for reference, all but one of those bots is @stable mountain)

#

Hey @green oriole did you manage to check all the other dependencies?

green oriole
#

I checked a few, I didn't see any other GPL dep

gritty wind
#

Using a library that uses LGPL wouldn't fall under the same problems, would it?

glacial veldt
#

it's not so bad

#

it's got some problems with vendoring and making a docker image

#

but it's not been tested anywhere

green oriole
#

Eh, I doubt we would get into issues for that

#

Our containers are public and their source code is available

#

Also Sir Lance will also need to have fuzzy removed

wild prism
#

should I open an issue for a minor non-code correction for the site?

vale ibex
#

It's it's small, then feel free to describe it here and a core dev can give approval in place of an issue

#

Just make sure to mention it in the PR though, in case another core dev sees the PR with no approval

wild prism
vale ibex
#

Hmm Yea, maybe we should change that to say all staff can nominate, but only mods and admins have voting power

wild prism
#

I guess it's correct for certain formalizations of "only", but it's at least misleading

vale ibex
#

Yea it's vaguely correct, but we can be more explicit for sure

wild prism
vale ibex
#

Yea :+1:

ionic turtle
#

I don't want to force you guys to rush or anything, but just wondering if anyone has looked at sir-lancebot#783

dusky shoreBOT
sacred fossil
#

@green oriole So, sir-lancebot#784 is a WONTFIX?

dusky shoreBOT
vale ibex
#

Describe how you plan the command to work, and how you expect to produce the gif, you don't need to write the full code there.

#

I'm also not sure where we sit legally with that, since I believe the video is copyrighted

wild prism
vale ibex
# dusky shore

Hey @patent pivot, one for when you're free.

Are we able to do this without worry of copyright?

#

(shoving a snippet of Rick Astley's video after a user's avatar)

ionic turtle
#

I'll wait for Joe though

patent pivot
vale ibex
#

Yea I'm not sure either, it seems like it should be covered under fair use

green oriole
ionic turtle
obsidian patio
#

I would at least not expect any legal issues with it

ionic turtle
#

I'm trying to stop an ongoing quiz, bit it didn't stop

vocal prairie
#

Were you the one who made the quiz?

ionic turtle
#

Yes

vocal prairie
#

If not, it won't work

ionic turtle
#

So it's a bug?

vocal prairie
#

Oh, the command is .quiz stop

#

Not .stop

ionic turtle
#

Loll

#

I didn't know that oops

ionic turtle
cold island
#

Hmm.. I invoked poetry run task test and now it's stuck with no output

#

(on the bot)

green oriole
#

Are you up to date?

cold island
#

I just pulled

green oriole
#

And poetry install?

cold island
#

hmm I created an env via pycharm, but that might be it

#

Right, that was it, thanks

#

Oh wow, it runs much faster than with pipenv

cold island
#

I have a question about mocking:
I'm calling a function a from function b in module c. From inside module c, I just call a(...). I then mock the function c.a and am trying to check if it was called after calling c.b. It's telling me that it wasn't, because the function that was invoked in the code is a, and not the mocked c.a. Any way around this?

#

Wait.. do I like.. mock a instead?

#

That would make sense

green oriole
#

That, or you use the same mock for both

ionic turtle
#

What is mocking in programming lmao?

green oriole
#

it is basically a fake function that won't do anything and will allow you to see if the function has been used correctly

cold island
#

It's also when you get frustrated with your code and you start calling it names /s

ionic turtle
#

So it's used with pass??

cold island
gritty wind
#

We have a section in the testing guide on mocking

#

Quite a large one

ionic turtle
#

I think I got it now

cold island
green oriole
#

can you use the same mock for both module?

cold island
#

wdym

#

there's only one module

ionic turtle
#

One module: c right?

cold island
#

yeah

ionic turtle
#

Wait, can you give a small sample code?

green oriole
#

oh

#

yeah, sample please

ionic turtle
#

Mcve

gritty wind
#
import unittest
from unittest import mock
import c

class Tests(unittest.TestCase):
    def test_b(self):
        with mock.patch.object(c, "a") as a_mock:
            a_mock.return_value = "yeah"
            c.b()
            
cold island
#

In c.py:

def b():
    a()
gritty wind
#

that's my test file, and my c file:

def a():
    raise Exception("O fuck")

def b():
    print(a())
green oriole
#

Scale Zig's alt confirmed?

gritty wind
#

lmao

green oriole
#

looks like you wanna patch c.a, yeah

cold island
#

Hmm what does that do?

gritty wind
#

It mocks the a function of main for that scope

#

I wonder if there's a more dynamic way of passing in the name. main.a.__name__ would probably work, but it's so much more ugly than just taking main.a as the only argument

green oriole
#

tbf

my_a = Mock()
c.a = my_a```works as well
gritty wind
#

The key here is scoping

#

Doing that will make a a mock for all your unrelated tests

#

Which can cause unexpected behavior if you're not paying attention

green oriole
#

isn't the context getting reset between each test

gritty wind
#

nah

#
class Tests(unittest.TestCase):
    def test_1(self):
        my_a = mock.Mock()
        c.a = my_a
        c.b()

    def test_2(self):
        c.a()
#

This won't throw an error

gritty wind
#

(to clarify, we want it to throw the error)

cold island
#

Hmm how do I make it run a specific test? it seems to be ignoring the path I give it

gritty wind
#

how are you running tests right now?

cold island
#

poetry run task test <path>

gritty wind
#

ah yeah. I updated the docs yesterday, make sure to use test-nocov instead of test

#

you can pass it the path to the file. To run a specific test in a suite, use the k option

cold island
#

The k option?

gritty wind
#
poetry run task test-nocov <optional/path/to/file.py> (-k "test_name or test_some_other_name")

Usually you won't need K since a file on it's own will only take a few seconds max

cold island
#

aha, I see

gritty wind
#

I won't paste the help message since it's quite long, but it's the first option in pytest --help

cold island
#

The test unfortunately still doesn't work

gritty wind
#

if you'd like, throw it in a pastebin and I can give it a look

cold island
gritty wind
#

Hmm

#

are they inside or outside the class/cog

cold island
#

outside

#

The test in the main branch works, as it uses self.cog and the functions are under the class

gritty wind
#

I'm not quite sure what's happening here. I've moved the functions outside the class, and added unimplemented ones for the other functions, but the mock seems to be set up correctly.

#

Is your branch pushed?

cold island
#

It isn't, as I'm trying to solve the tests before committing the changes

#

I can send you a copy of the folder

short snow
#

Working with docker just doing docker-compose up

#

Want to test modpings schedule redis cache scheduler

green oriole
#

Tried down then up?

short snow
#

Yep, samething

green oriole
#

Weird, I never got that

#

Have you overwrite your compose project name?

short snow
#

nope

vale ibex
#

Could you compose down and then just compose up site

#

And see if the output looks correct

#

Maybe a --build too, to grab a new image

brazen charm
#

if you have everything else set up you could also just run redis in docker alone and connect to that

short snow
#

smart i will do that, I will figure the docker issue later

glacial veldt
stable mountainBOT
#

config/snekbox.cfg line 110

cgroup_pids_max: 1```
stable mountainBOT
#

config/snekbox.cfg lines 12 to 16

envar: "OMP_NUM_THREADS=1"
envar: "OPENBLAS_NUM_THREADS=1"
envar: "MKL_NUM_THREADS=1"
envar: "VECLIB_MAXIMUM_THREADS=1"
envar: "NUMEXPR_NUM_THREADS=1"```
green oriole
#

I don't think we should, being able to spawn new thread comes with major security concerns

short snow
#

If i have questions about contributing to the api, like about one issue specifcally then whom should i ask or jsut put it here?

green oriole
#

You can ask here

#

But Sebastiaan is the lead of this project, so more important decisions should get his approval

short snow
#

So basically I am not really sure about how django works just basic knowledge, I am guessing that the main implementation of serializer is basically to check if the off topic name is valid, if it is then save else raise exception and send the same to the user right?

So in fastapi we can completely ignore that and just put a regex validator on the Query parameter right? similarly for maxkey and helptext which are the part of model

#

Secondly, fastapi doesn't support DRF view set, so should i just make the 4 query options optional and check which are not None. Butt fastapi_contrib another dep supports DRF based views so should I use that instead?

#

Also should make CRUD functions and then use them when communicating with the DB, or just use plainly in the route function

#

oh i forgot to tell that this is regarding api#11

dusky shoreBOT
patent pivot
#

It's a conscious decision not to allow process spawning, iirc it's because we can't guarantee death, but I don't think we've looked into it

#

@tawdry vapor might know more on it, but now that we SIGTERM nsjail instead of SIGKILL allowing for nsjail to clean up it might be more reliable

patent pivot
#

iirc we're adding a compatibility layer to pass through unsupported endpoints, then we can cut over to that and gradually build in new endpoint support at fastapi

green oriole
#

I believe sir Volcyy is working on it

patent pivot
#

yeah

cold island
#

What are the rate limits on channel deletions? should I add some sleeps in-between?

patent pivot
#

we don't have any commonplace features that delete channels, so we won't block other functionality by using our delete channel quota

short snow
green oriole
#

There are a lot of concerns to take care of when dealing with kernel limits and many processes

glacial veldt
#

Hmm could you try with a max of 3? So I can make a main thread and 2 concurrent workers?

#

I think multiprocessing.Pool needs a bunch more eg a pid for each worker and a tx/rx pair of threads to drive the stdio

patent pivot
#

we should check how deals with child procs of the proc it's wrapping

#

okay so

stable mountainBOT
#

subproc.cc lines 389 to 398

void killAndReapAll(nsjconf_t* nsjconf) {
	while (!nsjconf->pids.empty()) {
		pid_t pid = nsjconf->pids.begin()->first;
		if (kill(pid, SIGKILL) == 0) {
			reapProc(nsjconf, pid, true);
		} else {
			removeProc(nsjconf, pid);
		}
	}
}```
patent pivot
#

as per this we should be fine, since it'll SIGKILL all procs it's wrapping

#

hmm wait

stable mountainBOT
#

nsjail.h line 167

std::map<pid_t, pids_t> pids;```
patent pivot
#

why is pids in the config struct

#

does it actually get populated?

stable mountainBOT
#

subproc.cc line 484

addProc(nsjconf, pid, netfd);```
patent pivot
#

so, what this seems to suggest is that when we SIGTERM nsjail the children will not die and will be reparented to init

#

is init in this context nsjail? probably not, nsjail doesn't reap by default

#

actually, that's what kilAndReapAll is for right? but that only kills the procs in the nsjconf struct

#

I'll give stuff a test after I'm back from the gym, need to get a docker install for testing

cold island
#

How do I make this look not terrible

if isinstance(channel, discord.TextChannel):
    if (
        (
            isinstance(criterion, str)
            and (criterion == channel.name or criterion == CodeJams.team_name(channel))
        )
        or criterion in channel.overwrites
    ):
        return channel
#

I went with

if isinstance(channel, discord.TextChannel):
    if isinstance(criterion, str):
        found = criterion == channel.name or criterion == CodeJams.team_name(channel)
    else:
        found = criterion in channel.overwrites
    
    if found:
        return channel
brazen charm
#

do you need the str isinstance?

cold island
#

Won't it yell at me if I try to compare between a string and a discord channel?

#

Sorry, between a member and a string

#

And if it silently converts the member it'll be a bug

brazen charm
#

In the overwrites mapping?

cold island
#

In the comparison

brazen charm
#

you're checking containment so it shouldn't matter afaik

cold island
#

I mean in found = criterion == channel.name or criterion == CodeJams.team_name(channel)

#

criterion can be a member

brazen charm
#

ah right, that should just return false if the behaviour is not implemented as it should delegate to its parent's eq

cold island
#

Ah alr

#

thanks

brazen charm
stable mountainBOT
#

discord/member.py lines 235 to 236

def __eq__(self, other):
    return isinstance(other, _BaseUser) and other.id == self.id```
cold island
#

yeah seems to work

glacial veldt
#

Is there a reason you didn't go for hypervisor based sandboxing?

cold island
#

I remember there was a conversation about it here several months ago

#

Hm weird, can't find it

thorny obsidian
#

There was definitely a lengthy convo from Mark in here

#

oh wait, I'm getting it mixed up with gvisor

cold island
#

Yeah same, just found the convo

patent pivot
#

it's super low resource

tawdry vapor
#

I don't remember exactly anymore, but I think nsjail can handle killing children.

#

I'm not a security expert, but it doesn't sound so alarming to me to allow a few extra pids.

#

Worst case someone breaks the container and we have to restart it

tawdry vapor
#

Well, the actual worst case is someone finding a way to break out of both nsjail and docker, but that doesn't seem realistic by just adding more pids

#

We should confirm that children inherit the cgroup, and that there is no way to circumvent that.

patent pivot
#

yeah, that's what I'm going to try confirm tonight

#

just checking children inherit the groups and that we don't leave zombie procs

#

I'll be interested to see how child processes affects memory limits

#

do child procs get allocated their own memory limit? I forget if same cgroup is combined limits

vocal wolf
gritty wind
#

I'm trying to reproduce that now

#

Do you have any other changes locally?

vocal wolf
#

nay

gritty wind
#

hmm

#

is your bot running? I'd like to try somethings out with int e

vocal wolf
#

it is currently running yes

gritty wind
#

sweet, do you mind?

vocal wolf
#

do what you must

gritty wind
#

Well, that's strange

#

Now it started happening

vocal wolf
gritty wind
#

Yeah I've got a patch

#

It seems to only affect subcommands

#

Now to write a test

vocal wolf
#

interesting

#

glad it was found tho lol

gritty wind
#

Yeah no idea how you found that. Glad you did

#

ah, just my luck. Ran the same exact thing twice without restarting my bot for two different outcomes

vocal wolf
#

oh dear

gritty wind
#

I realize I snipped off the first command, but it's the same lol

civic bone
#

hi guys

wild prism
#

I'm looking at bot/constants.py in Sir-Lancebot right now and it's got:
MODERATION_ROLES = Roles.moderator, Roles.admin, Roles.owner
Should Moderation Team be included there?

slow steppe
#

Yeah probably

gritty wind
#

Moderation team is Roles.moderator

wild prism
#

ohh that makes sense

gritty wind
#

To explain the naming, that was the original name before the new system

slow steppe
gritty wind
#

it wasn't updated, because there wasn't a need for it

#

That doesn't exist in sir-lance's constants

#

It doesn't really need to know it

wild prism
#

that'll teach me to rely on names

gritty wind
#

It's definitely confusing, but it hasn't been updated since 2018 so...

#

lol

celest charm
hardy gorge
# short snow So basically I am not really sure about how django works just basic knowledge, I...

First, let me provide some context. Nearly everything in our current API (django) is built using a package called Django REST Framework (DRF). Things like serializers are features that are part of DRF. This also means that if you want to look up something about the API, your best bet is are the DRF docs (e.g., https://www.django-rest-framework.org/api-guide/serializers/.

In DRF, serializers take care of serializing complex data (e.g., ORM model instances) into simpler native Python datatypes (such as dictionaries that map strings to strings) that can be easily rendered into JSON. They also work in the opposite direction: If you get some unvalidated date (e.g., from a request made to the API), they can take care of deserializing that data into a validated dictionary and/or "saving" it to an ORM model instance.

In your serializer, you specify the fields that the serializer expects either based on explicitly declared fields (like in a Django Form) or use a ModelSerializer that automatically determines the fields based on a Django ORM model (much like Django's ModelForm).

FastAPI works a little differently in that you typically use a pydantic model to specify the schema of an endpoint. You can use a pydantic model to define which "fields" (quoted to avoid confusion with DRF fields) an endpoint expects and FastAPI will use this pydantic model to deserialize the request data into a Python object (an instance of that pydantic model) (see https://fastapi.tiangolo.com/tutorial/body/). You can also return a Pydantic model instance in FastAPI, and FastAPI will automatically serialize it into data that can be sent along with the API response (see https://fastapi.tiangolo.com/tutorial/response-model/).

Pydantic provides features that allow you to add validators to your pydantic model (see <https://pydantic-docs.helpmanual.io/usage/validators/), although there is also some default data coercion and validation going on, as Pydantic will try to coerce the input data into the type specified for a field, raising an error when that fails. Depending on what kind of validation you need, this annotation-based coercion/validation may be enough.

For regex validation of a string, you can use a contrained string, which is a type provided by pydantic. There's an example here: https://pydantic-docs.helpmanual.io/usage/types/#constrained-types, which looks like this:

from pydantic import constr

class Model(BaseModel):
    # other fields removed
    regex_str: constr(regex=r'^apple (pie|tart|sandwich)$')

However, FastAPI/Pydantic does not take care of serializing such a model into a SQLAlchemy ORM model.

short snow
#

Yeah i understood the fastapi part (had a similar implementation in a personal proejct) had confusiong about the django implementation, but since we can add regex on the query parameter we get through post request do we really need to add regex to the model too?

hardy gorge
#

We're not sending the data as query parameters, right?

#

We're sending them as part of the request body

#

(except for look-ups)

short snow
stable mountainBOT
#

pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py lines 84 to 86

serializer = OffTopicChannelNameSerializer(data=create_data)
serializer.is_valid(raise_exception=True)
serializer.save()```
hardy gorge
#

Most of our API interactions are POST requests that send a request body

#

query parameters are things like url?a=b

#

We use that for getting off-topic names, probably

#

but probably not for creating new ones

#

oh, we do

#

alright, this is an exception then

short snow
#

Yeah, so lemme explain again, if we want to make a new off topic name then we make it like ?name=lemons-lemonade-shop right? and once the API gets it we use the serializer to validate it with the regex. But now in fastapi we can add the regex when getting the query parameter with Query() class. So i don't see a need to add the regex validator to model since we can already validate it when getting the query parameter

hardy gorge
#

Yeah, I figured that we were using the same kind of POST flow as we use for nearly all other API endpoints, but I was mistaken

#

Normally, send along JSON-formatted data in the request body (and params for things like searches/lookup parameters)

short snow
#

Yep, but my question is whether we should validate it in the model too or not?

hardy gorge
#

Probably not, since it's a param

short snow
#

Yep, and about the viewset in the original question

hardy gorge
#

I'm not in favour of introducing DRF viewsets into our FastAPI project using some kind of tool

#

I don't think they bring us much

#

We were using them because we were using DRF, but we're migrating to FastAPI now

short snow
#

yeah, same here. Thanks i will go ahead and do it that way πŸ˜„

vocal wolf
short snow
#

lol

green oriole
#

Why is there a Bible up there

tawdry vapor
#

Because he is good at explaining things

green oriole
#

he sure is

glacial veldt
#

Seems like it handles sqlalchemy models from pydantic models

#

Although totally separate from sa.orm.declarative_base it's built on sa core with encode/databases

analog pollen
#

Hey !

short snow
#

Yeah I have worked with ormar before, but didn't really need it I mostly keep my fastapi project similar to tiangolo's postgres template

short snow
#

https://pythondiscord.com/events/ we need to change the UPCOMING EVENT to ONGOING EVENT

#

https://pythondiscord.com/ same here, you can't sign up now shrug

green oriole
#

Yep yep

trim cradle
#

Would it be possible for !docs to be able to get numpy and pandas docs with np and pd as well?

green oriole
#

hmmmmmm

#

lemme have a look

green oriole
trim cradle
#

!docs np.ndarray

stable mountainBOT
trim cradle
#

woah

#

(angrysad lemon in reference to a failed !docs pd.DataFrame call)

green oriole
#

lol, I did say with np

#

Okay, I'll add pd

#

!docs refreshdoc

stable mountainBOT
#
Inventories refreshed
green oriole
#

should work now

trim cradle
#

how did you do it

brazen charm
#

Did you just add them as an another inventory?

green oriole
#

yes

brazen charm
#

That won't really work as the module names are in most symbols parsed from the inventory itself, the ndarray probably worked because ndarray alone was a thing and the bot added the np name prefix to resolve the conflict

#

!d numpy.array

stable mountainBOT
#

numpy.array(object, dtype=None, *, copy=True, order='K', subok=False, ndmin=0, like=None)```
Create an array.
brazen charm
#

it'll always be numpy.array, with a second symbol that'll either be np... or numpy... depending on which was loaded first.
We could try replacing numpy with np etc. if a lookup fails to accommodate this though

toxic token
#

mhm how did you guys rename your k8s nodes

patent pivot
#

we did that? 🀨

gritty wind
#

They aren't, they're just using the node names set by linode, with a set prefix

#

What are you referencing?

patent pivot
#

yea

toxic token
patent pivot
toxic token
#

i saw an image which had pydis-1, pydis-2, pydis-3 was that something else? hmm

patent pivot
#

if you show me the image I can tell you lol

toxic token
#

let me check hmm

#

found it

patent pivot
#

ah, that's just a monitoring service that pings set hosts, a b & c correspond to the 3 hosts above, arbitrarily assigned

toxic token
#

oh ok, thanks smilecat

#

another question, what is that service? smileydog

patent pivot
toxic token
#

thanks Love

slow steppe
#

Idea: make the user command (!u) display how many total points you have from .quiz

#

Wait nvm I just realized those are from different bots

gritty wind
#

We do have an issue for a global leaderboard for sir-lance games

#

let me uhh

#

sir-lancebot#627

dusky shoreBOT
gritty wind
#

It's approved, someone just needs to claim it it seems

wide elm
#

hm

#

is the bot supposed to be down

patent pivot
#

looking into it, blip at linode I think

wide elm
#

oh ok

fervent sage
#

!remind 2h bot#1643

stable mountainBOT
#
Sure thing!

Your reminder will arrive in 2 hours!

dusky shoreBOT
stable mountainBOT
#

@fervent sage

It has arrived!

Here's your reminder: bot#1643.
[Jump back to when you created the reminder](#dev-contrib message)

vocal wolf
rotund light
#

Can we contribute to the bot?

green oriole
#

You sure can! How familiar are you with contributing to open source projects?

rotund light
#

But ik git and github fairly well

short snow
#

The bot use discord.py framework, if you know them pretty well then you should be good to go

weary pumice
#

i see

green oriole
# rotund light It's my first time..

Cool! I'd recommend you to start with @dusky shore, I assume you know discord.py, right? (it would be a good learning opportunity either way)

In those issues, are they any that you'd like to work on? https://github.com/python-discord/sir-lancebot/issues

GitHub

A Discord bot started as a community project for Hacktoberfest 2018, later evolved to an introductory project for aspiring new developers starting out with open source development. - python-discord...

weary pumice
#

do you guys make use of azure devops?

#

or is it entirely on github?

cold moon
#

We used Azure Devops for CI/CD before, but after GitHub Actions release we use this instead.

weary pumice
#

ah

#

its actually amazing to see how little files are used in these projects

#

and the folder structure isnt massive either

short snow
#

Do we use azure? I thought the hsoting was on linode and GH actions

#

ah ok yeah

rotund light
green oriole
#

Cool! Tell me if you find any!

rotund light
#

Oki dokie ^^

cold island
#

You can look at issues on the bot of course, if it's more interesting to you

rotund light
#

I havent used the bot but yeah will look into it thank u so much

patent pivot
#

@weary pumice @short snow @cold moon azure devops and github actions are basically the same thing

#

so most of the actions stuff look quite similar to devops

#

but yeah now we're fully on github actions for CI and Linode for hosting

#

we have used Azure in a couple of minor places though

weary pumice
#

i see

last patio
#

remember azure joe

#

volcyy remembers

patent pivot
#

under the hood they work quite similarly

vocal prairie
#

For site#494, could I use custom CSS or should I stick to Bulma? I think using some CSS grid with media queries would make it a lot more accessible (its practically unreadable more) then how I have it now

dusky shoreBOT
thorny obsidian
sleek steppe
#

No green check πŸ˜”

rotund light
#

which branch should i push my code to in @dusky shore

brazen charm
#

a new one on the forked repo

rotund light
#

ah okay thanks

short snow
#

And you need to get assigned to a issue before you work on one/ get a core dev approval on the issue befroe you start working on it

viscid coral
#

There is a problem with the bot?

fallen patrol
#

sure its not the same thing but its still azure underneath

cold moon
#

Wait, what? GHA is using Azure?

short snow
#

No, they are two different services but they work similarly

rotund light
#

guys can i remove the time limit of the reactions in the help command embed cause its like we have so many commands and its like really frustating everytime we have to write help command when the time ends ?

patent pivot
vale ibex
rotund light
gritty wind
#

It has to expire eventually, we can’t wait forever

#

The timer is set so you can actively get to whatever you want while using it, afterwards it’ll expire

rotund light
cold island
#

For which bot?

#

!help

stable mountainBOT
#
Command Help

CodeJams
!codejam
A Group of commands for managing Code Jams.

DMRelay
!dmrelay <user> [limit=100]
Relays the direct message history between the bot and given user.

Defcon
!defcon
Check the DEFCON status or run a subcommand.

DocCog
!docs [symbol_name]
Look up documentation for Python symbols.

DuckPond
!duckify <message>
Relay a message to the duckpond, no ducks required!

Extensions
!extensions
Load, unload, reload, and list loaded extensions.
!extensions reload [extensions...]
Reload extensions given their fully qualified or unqualified names.

cold island
#

.help

dusky shoreBOT
#
Command Help

AdventOfCode
.adventofcode
All of the Advent of Code commands.

AprilFoolVideos
.fool
Get a random April Fools' video from Youtube.

AvatarModify
.8bitify
Pixelates your avatar and changes the palette to an 8bit one.
.avatar_modify
Groups all of the pfp modifying commands to allow a single concurrency limit.
.avatareasterify [colours...]
This "Easterifies" the user's avatar.
.mosaic [squares=16]
Splits your avatar into x squares, randomizes them and stitches them back into a new image!
.prideavatar [option=lgbt] [pixels=64]
This surrounds an avatar with a border of a specified LGBT flag.
.spookyavatar [member]
Spookify an user's avatar.

cold island
#

lol how long are we waiting in the bot for?

gritty wind
#

5 minutes on python

#

30 seconds on lance

#

5 minutes is way too long

#

30 seconds should be enough to read a page

#

I’m not sure why you’d need more, what were you doing where you found this to be a problem?

cold moon
#

Let's do 1 minute in both bots?

gritty wind
#

Ehh I don’t think it really matters

#

5 mins is long, but it’s whatever, it doesn’t pose a problem

#

If 30s is too short, we can raise it, but I’m not convinced there’s a need for it

rotund light
#

instead of that just making it little longer

#

so we dont have to constantly type .helps

cold island
#

but 5 minutes is too much

green oriole
#

We could make it 24h if we wished, it doesn't cost us anything

somber iris
#

wouldn't it be easier to assign people their help channel role?

#

is there a limit on roles?

vale ibex
#

The role list can get slow when there are many roles

#

we currently have quite a lot, so adding another ~50 could make it a lot worse

rotund light
#

Can we implement a ai bot in discord? (I did make one)

vale ibex
#

What would you have it do?

last patio
#

who's this jchristgit guy and why does he write half a book as his pull request description?

green oriole
#

I'll find himand cyber bully him for making me feel bad with my two lines pull requests

last patio
#

excellent idea, get the heretic πŸ”ͺ πŸ—‘οΈ

rotund light
fallen patrol
wind roost
#

what is dis channel for

short snow
#

@brazen charm Sorry for the delay, mentioned the changes in bot#1634

dusky shoreBOT
terse carbon
#

Hi

shut aspen
#

are yall using statuspage by atlassian for your status page?

#

and if so how has that experience been

vocal prairie
patent pivot
shut aspen
#

if you can divulge that

patent pivot
#

free

shut aspen
#

ohhdamn

#

self hosted ?

patent pivot
#

nah

shut aspen
#

well now im intrigued

patent pivot
#

Freshworks has more components in their stack that are paid for

shut aspen
#

ya i only need barebones stuff, preferably embeddable

patent pivot
#

you can embed stuff yeah

#

one sec

shut aspen
#

this looks very promising ty, id prefer to save the time and not roll my own 😁

patent pivot
#

when pydis has an incident the home page will have

#

but there are a few styles, I didn't want anything too invasive

shut aspen
#

ya that looks nice

#

appreciate it

fallen patrol
#

(ex pydis isn't paying and isn't sponsored by then)

sleek steppe
#

I was thinking about how someone suggested a !black command so I thought of something similar. Some people want to disassemble their code to see what instructions it is giving python, so I think a !dis command could be cool. python -m dis expects a file, but I think you can do something like echo {code} | python -m dis -

brazen charm
#

I don't think that'd be more useful than just running !e and doing it in there

cold island
#

I think for any of those things, showing people how they can do it themselves outside of this server has its value

#

Creating dedicated commands obscures that somewhat

patent pivot
#

follow up on post-mortem, linode have replied and explained a bit, dropped their response in the post-mortem

short snow
#

In which place of the code on pixels do you check for the bearer token, I couldn't find it in the code, like how do you validate the user

stable mountainBOT
#

pixels/utils/auth.py line 30

token_data = jwt.decode(credentials, Server.JWT_SECRET)```
stable mountainBOT
#

pixels/endpoints/general.py line 10

router = APIRouter(tags=["Canvas Endpoints"], dependencies=[Depends(auth.JWTBearer())])```
rotund light
#

Should there be a leveling system ?

gritty wind
#

In what way?

thorny obsidian
#

So the docs directory link here is broken: https://github.com/python-discord/site
Also, I want to make updates to the README to explain the structure of the site and where which changes should be made. Right now it's the opposite on intuitive

patent pivot
#

ah yeah we removed docs with uhh

#

dewikification maybe?

#

yeah

sleek steppe
patent pivot
#

Ahh

rotund light
gritty wind
#

My question is progress through what?

#

Is it based on message count, amount of help given, etc

rotund light
gritty wind
#

We’ve looked at both those systems in the past

#

The thing is, they don’t incentivize the right type of engagement

#

You don’t want people just sending messages to reach some meaningless count, that leads to spam. We can see that with #voice-verification

#

The same goes for help in a slightly different way. You’re incentivizing shorter questions only getting answers, and spoon feeding instead of taking time to explain.

rotund light
#

well we can do like if the msg sent by first person != second person like we cant send two msges at a time

gritty wind
#

It isn’t a question of implementation

#

It’s a question of why would we reward people sending messages in that fashion

#

What is gained by doing that

rotund light
#

ah i get it now

#

havent thought about that just was a vague idea of mine

gritty wind
#

That’s fine, thanks for suggesting it. I think I can dig up some previous discussion of the matter in #community-meta if you’re interested

rotund light
#

u have been in the server since the start ?

gritty wind
#

#community-meta message

I managed to dig this up, which is probably the most relevant, but there have been more discussions about this, and other leveling systems in that channel

#

Uhh

#

!user

#

2 years

rotund light
rotund light
rotund light
#

btw where did u guys host sir lancebot?

gritty wind
#

Everything is hosted on a Linode Kubernetes cluster

#

We have an affiliate link at the bottom of our website

#

The manifest is publicly available, but it requires some knowledge of kubernetes

#

If you’re interested, I’d start by looking at what docker is, and how it works

rotund light
#

404 error

rotund light
gritty wind
#

Hmm I thought we made it public

gritty wind
rotund light
gritty wind
#

Yeah, that’s a better starting point, and you’ll probably find docker skills more useful than kubernetes, at least early on

#

I can share our docker config though, that’s definitely in the sir-lance repo

rotund light
rotund light
gritty wind
#

Yeah, sure. How familiar are you with docker in general?

rotund light
#

nvm i got it

gritty wind
#

Oh, okay

#

Feel free to ask here about any of our infrastructure/projects, there are usually people around to answer

rotund light
#

okay thank u so much for ur help 😊 ..if i get any ideas i will share here before implementing it

#

btw the bot token must be in a environment variable right as per the code?

#

@gritty wind

gritty wind
#

Yeah, environment variable, or you can use the .env file

#

Have you had a look at the setup guides?

rotund light
gritty wind
rotund light
#

Okay I will check it out thanks again

rotund light
gritty wind
#

The link moved at some point, which broke it a bit

#

I'll push a fix for it

rotund light
#

Cool

fallen patrol
#

ok i'm looking into this since I'm trying to tie up my unfinished projects

fallen patrol
#

πŸ€”

#

i got @dusky shore 99% up and running

#

however i've come across an issue

#
future: <Task finished name='Task-49' coro=<Message.add_reaction() done, defined at /home/aru/.cache/pypoetry/virtualenvs/sir-lancebot-i7Z5VpzE-py3.9/lib/python3.9/site-packages/discord/message.py:1192> exception=HTTPException('400 Bad Request (error code: 10014): Unknown Emoji')>
Traceback (most recent call last):
  File "/home/aru/.cache/pypoetry/virtualenvs/sir-lancebot-i7Z5VpzE-py3.9/lib/python3.9/site-packages/discord/message.py", line 1221, in add_reaction
    await self._state.http.add_reaction(self.channel.id, self.id, emoji)
  File "/home/aru/.cache/pypoetry/virtualenvs/sir-lancebot-i7Z5VpzE-py3.9/lib/python3.9/site-packages/discord/http.py", line 254, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji
#

obviously, i'm missing the trashcan emote

#

TRASHCAN_EMOJI"834197531663007814"

#

…i fixed that typo but i still the error

#

o

gritty wind
#

It's usually not just the ID

fallen patrol
#

yeah

#

looking to make a pr to the site since it needs the entire emoji

#

also,

#

@vocal wolf unrelated to the above but i noticed you're signing your commits, however your public key is not uploaded to github so they actually look as if you didn't sign them lol

vocal wolf
#

oh yeah

#

so what happened

#

I nuked my computer and lost the key, so I removed it from my profile

fallen patrol
#

πŸ€¦β€β™€οΈ

vocal wolf
#

my recent commits are verified.

fallen patrol
gritty wind
#

I don't follow, are you adding the emoji to the site itself?

fallen patrol
#

no

gritty wind
#

Can you explain what you're doing then

fallen patrol
gritty wind
#

Ah

#

I'd personally say no

fallen patrol
#

new env var, TRASHCAN_EMOJI in the form of <>

gritty wind
#

It was a very deliberate decision not to include it in the "required" list

#

It's in the extended list

#

but the bot works fine without it, even if it raises an error

fallen patrol
#

because if its not there, there's errors for half of the pagination commands

#

ok

gritty wind
#

I don't think that's really all that important

#

Others may disagree, but I think the env list is already long and arduous enough

fallen patrol
#

then

#

could i update the one at the bottom here to say "in the format :name:"

#

but without discord parsing that

gritty wind
#

That sounds fine

fallen patrol
#

like this

gritty wind
#

Though, I'd probably actually say: "Output of \:emoji:"

fallen patrol
#

man

#

i forgot that was why

#

i am tiiiiiired

#

i legit copied the emoji opened it in the browser saw the url copied the id and paired it with the name

gritty wind
#

oof

fallen patrol
#

ikr

#

@gritty wind how's this

#

i think there's a few places where the trash can isn't just for the embeds but i'm not sure

#

might be confusing that for @stable mountain

rotund light
#

@fallen patrol does the bot run without the emoji ?

short snow
#

it does but errors out during pagination

fallen patrol
#

to note, it already exists in the code and everything

#

but i had a bigger issue with the emoji not being saved in the right format lol

#

just wanna fix that lol

fallen patrol
rotund light
#

Lol cool

rotund light
#

we can ignore this right

short snow
#

Yeah

rotund light
#

cool

fallen patrol
rotund light
#

idk whats this error?

#

it says path isnt specified but where ?

brazen charm
#

iirc that's the error you get when docker isn't running

gritty wind
#

Just finished doing quote normalization on bot for the plugin

#

But then I committed all my changes to the wrong branch like a derp :P

#

Once I get them moved, I'll leave a comment on the issue

rotund light
#

My docker just messed up

short snow
#

reinstall it

#

Mark is on πŸ”₯

rotund light
slow steppe
#

We need a .define command in sir lance hot