#dev-contrib

1 messages Ā· Page 94 of 1

patent pivot
#

to sentyr

short snow
#

it will, but it will keep the logging statement "unclosed", otherwise there is no need of logging the error message

patent pivot
#

I think an informational success log is all that is necessary here, the error will be handled through other flows

short snow
#

right, same here.

patent pivot
#

alright

#

cc @tough imp, only a couple of review comments left in that case

short snow
#

ok am computer, will approve it

patent pivot
#

a couple of info level logs in the fetch_directory and fetch_file methods and then the open one about a minor comment wording change

#

both optional to implement, I'm approving now

short snow
#

and pipfile merge conflict

patent pivot
#

ah yeah

short snow
tough imp
#

let me catch up with the conversation

short snow
#

is left to mention

tough imp
#

wait dont merge it the target branch is still set to my fork

patent pivot
#

yeah don't worry, won't merge

short snow
#

and, did you guys have a discussion about the new file preview feature

#

would you run checks on the file content?

patent pivot
#

we've not held discussions, no

#

we'll probably hold them on sunday

short snow
#

oh ok

patent pivot
#

depending on some implementation details we might run checks, we'll see

vocal prairie
short snow
#

Btw, for sir-lancebot#605, the orignal logo is not soo visible so would we want to create a personal logo for it?

dusky shoreBOT
tough imp
#

regarding the fetch utils, a failed fetch looks like this

#

it reaches sentry, but its logged by the caller, such that it can say what it was trying to fetch

#

this way you dont have to look at logging breadcrumbs to figure out exactly what happened

#

i will add a log on success

#

i'll try to address everything tonight, need to finish some work first & have something to eat

patent pivot
#

yeah don't stress on it šŸ™‚

patent pivot
#

@tough imp debug is fine with me šŸ‘

tough imp
patent pivot
#

anddddd

#

morged

tough imp
#

hope it will serve pydis well

patent pivot
#

i'm sure it will, thank you for the contribution!

sleek steppe
#

Will I be changeloged? pogchamp

patent pivot
#

did we ever changelog .github for users?

#

ah that's an old feature isn't it, so probably not

#

changelogged! @sleek steppe

sleek steppe
#

Thanks!

vocal wolf
clever wraith
#

Hello every body i need some help please . I try to create a contact book ( MVC app) with PyQt . I want to create a "search field" someone can help me please ?

vale ibex
fallen patrol
#

~~formatting bug on mobile

#

Needs to have a \n between both ```

#

So it becomes
```
Fan of Python, Yada Yada yada
```
And not
```Fan of Python```

#

So it becomes

Fan of Python, Yada Yada yada

And not
Fan of Python

vale ibex
vocal wolf
vale ibex
#

Alright I'll give that a quick try and see how it goes

whole forge
#

you would need the github cli installed tho

tough imp
#

I think you can probably just checkout their branch, make a new branch off it, and push it into the upstream

sleek steppe
vale ibex
#

I have an alias setup cpr = "!cd ${GIT_PREFIX:-.} && git fetch origin refs/pull/${1}/head && git checkout FETCH_HEAD #"

tough imp
#

or just continue working on their branch if that's ok

vale ibex
#

I'm going to checkout branch and push it up

#

it'll make a new PR though, so I'll action all of the comments first

gritty wind
vocal prairie
#

Mobile's code blocks are weird.

fallen patrol
#

(right?)

gritty wind
#

Discord is an Android bug

fallen patrol
gritty wind
#

Yeah

vale ibex
vocal prairie
#

I don't even see code blocks on android.

patent pivot
sleek steppe
#

lol

fallen patrol
vocal prairie
#

I just see the ones that are like print("hello"). Everything looks like that.

patent pivot
#

echo abc; echo def; vs echo abc && echo def

fallen patrol
#

Yeah ^^

patent pivot
#

the differencce iss

fallen patrol
#

I was using && for a period and now was using ;

patent pivot
#

; continues ignoring the previous error code

fallen patrol
#

Ohhh

patent pivot
sleek steppe
#

one works on windows one doesn't kekwait

fallen patrol
#

Oof

#

Btw is precommit a pydis specific thing?

#

Like, a tool written and used in the repo?

gritty wind
#

Nah it’s a standalone package

gritty wind
#

Pretty nice tool when it works

sleek steppe
#

I still don't get why pipenv run precommit runs differently than pipenv run pre-commit

vale ibex
#

precommit installs the hook

gritty wind
#

Two different commands

vale ibex
#

pre-commit runs it

gritty wind
#

Precommit is a custom one we defined

#

Which just runs ā€œpre-commit installā€ or something along those lines

sleek steppe
#

oh cool

whole forge
#

doesnt have to be pipenv btw

#

its a executable that lives in your git hooks folder

#

can easily be run manually without pipenv

vale ibex
#

Does a user lose roles when they leave a server?

fallen patrol
#

uh

#

very out of date template

fallen patrol
#

very very out of date and has bad permissions too

vale ibex
patent pivot
#

lol

#

it's up to date

#

that's a 1-to-1 copy of the server we use for testing bot features now

fallen patrol
vestal heath
#

does the....... when ducky logo appears it is shown first in log
or after the time expires ?

fallen patrol
#

btw

#

I have a very simple idea for configuring all of the emojis

whole forge
#

i think the one here was the very first duck, nice

gritty wind
#

It isn’t the same structure as the main server

patent pivot
sleek steppe
gritty wind
#

It’s just enough to get you all the things you need

fallen patrol
#

except for the emojis

#

anyways

gritty wind
#

Can’t add those so

fallen patrol
#

about that

#

idea: make a public bot that fetches all of the emojis in the test server and has one command, to add emojis to the server when invoked by the server owner

gritty wind
#

You can put any emoji, it doesn’t have to be the trash can

fallen patrol
#

then instantly leaves the server

whole forge
#

things are planned for easier setup, will happen sometimeā„¢ļø

gritty wind
#

The main package for that has been in review cycles

#

Probably since I joined staff but still

#

Review cycles

whole forge
#

you mean, review closed loop?

gritty wind
#

At this point, basically lol

fallen patrol
gritty wind
#

I’m pretty sure that’s intentional

#

It was archived before that guide even existed

vale ibex
#

I've raised bot#1493 as a replacement for bot#1303

vale ibex
#

I actioned the comments from @tawdry vapor and gave it a pass myself, then tested it locally.

#

I was planning to give it another read through to make sure there wasn't anything else that I missed, but it's getting late, so I'm going to head to bed for now.

fallen patrol
#

The first one, so that's what that was

sleek steppe
#
already_allowed = any(Roles.video == role.id for role in user.roles)

Could be changed to

already_allowed = user._roles.has(Roles.video)

Maybe? Also I don't know why it's called user when it's a member object

vale ibex
#

Yea that is a huge simplification, I think I remember lines like that in a few places in that cog

#

Could you add a comment against one of them to prompt me when I look tomorrow?

sleek steppe
#

Ok

tawdry vapor
#

I don't know if I agree

#

It seems like a bad idea to rely on private APIs

#

We currently rely on the http client but it has strong advantages and also seems like something that would be more stable.

#

Also discord.py has some attributes/functions that are named like they're public but aren't documented. I remember asking about one and was told that despite being undocumented it was virtually guaranteed to be part of the stable API

#

I don't remember why they said it isn't documented but I do remember that the reason didn't really make sense to me.

fallen patrol
tawdry vapor
#

Yes but I don't see why that is relevant

fallen patrol
#

was a question, because i know that the commands.Bot class has its own bot.http class

#

basically a help question

sleek steppe
#

Client.HTTPClient is responsible for making requests to the discord api

#

and it doesn't belong the commands.Bot it belongs the Client

tawdry vapor
#

It eventually did get documented

sleek steppe
#

I'm pretty sure discord.utils.SnowflakeList is made so that you can do operations like that and it's more efficient. Plus I've seen many people in that server including danny using it so ĀÆ_(惄)_/ĀÆ

fallen patrol
tawdry vapor
#

Many people using it doesn't necessarily imply it's stable or if discord.py would respect that and avoid breaking changes.

#

You're probably right though. It hasn't changed in 3 years.

#

The reason it isn't public is cause it'd require some extra design considerations

#

e.g. the current thing is mutable and a public API shouldn't allow the cache to be mutated.

green oriole
short snow
green oriole
#

Well, by putting a lot of efforts into writing an issue without coordinating with us you are risking to loose a lot of time

#

We have other plans to make duckies, I’m afraid we are not interested in that

short snow
#

okay

#

well, if we have ducky maker on site, why not on the bot?

green oriole
#

Because the UI will be terrible

short snow
#

hmm true

green oriole
#

That said, we could think into integrating the secret project into sir lance

#

Is that something you’d be interested in?

#

Sorry if my github message sounded a bit harsh, I didn’t mean to

short snow
#

no problems, it wasn't harsh šŸ˜„

green oriole
#

Alright, I’ll make sure to assign you once the issue is created

short snow
#

but i need to know the secret project first

green oriole
#

Haha, you’ll know soon

#

I’ll probably take care of it tomorrow

#

Err, next week

short snow
#

cool ok_handbutflipped

#

well @green oriole how about a duckify command which would put the person's pfp instead of the duck on the board, or make a duck pond ish on the bottom, like a layer on the bottom

green oriole
#

Hmm that sounds interesting

#

I believe @thorny obsidian is running this bot, I think that’s something we would want in sir lance at the end of the event

#

we could do some improvements like that

short snow
#

ves is running the bot

#

he said in community meta

green oriole
#

Ves is running @opal ridge

#

Not this one I believe

short snow
#

i thought you were talking about that, this one means sir lance?

green oriole
#

I was talking about integrating @spare tapir in @dusky shore

short snow
#

oh ok

#

i never noticed they were two different bots šŸ¤¦ā€ā™‚ļø

#

is the repo private?

green oriole
#

I thiiik they are private for the time being

#

You can extract the source code of @opal ridge

short snow
green oriole
#

The container is public it seems like

#

Yeah it is

short snow
#

link?

patent pivot
#

We'll probably make the repository public at some point, but the container is open yeah if you really want to poke around

short snow
patent pivot
#

on mobile right now

#

it should just be on the org packages

short snow
#

ok lemme see if i can find it

short snow
#

hahaha done šŸ˜„

thorny obsidian
#

Lmao I don't think I remembered to actually git init or make any commits to the Become a Duck bot

patent pivot
#

lol

thorny obsidian
#

@green oriole I thought we wanted vco's thingy as a potential lancebot command after this event?

#

But the code is real bad. I'd want to properly write it with good commits

patent pivot
#

The issue opened wasn't for random ducks with that API, but instead for a generator (select accessories, colour)

#

so it's whether we can pull off an implementation of that which is a) resource friendly b) has nice UX

thorny obsidian
#

Aaah, okie doke

short snow
short snow
patent pivot
#

it's not a random duck generator

#

that's fine and doable because we have an api for that

short snow
#

we could make an api for that then.

#

(which would take the resources like the dict i said in the issue, and then it would generate the ducky)

patent pivot
#

yeah, if we write an API for the planned site generator then using it on lancebot should be no trouble

#

I'm of the opinion that it's a neat idea, but we should implement it on site and see how that goes and if that scales we look at Lancebot

short snow
#

lemon could update his issue

green oriole
cold moon
#

We could make that this renders image at server using query parameters

short snow
#

that's what i meant, pass in something like the dict i mentioned in the issue

short snow
green oriole
#

Well I mean, if we have to trigger another render every time you click an arrow while going through the equipment list it will probably be too heavy (CC @patent pivot )

short snow
#

i thought just displaying the final image at the end

#

and in the list, add them as emojis

#

like:

thorny obsidian
short snow
#

title: Build Your Own Ducky (hair emoji + skin emoji)

#

or just the name

patent pivot
green oriole
#

Emojis would be too small I think

#

Alright, we can benchmark our aaaaAAAA implementation

short snow
#

looks like there is quakstack project, probably our super secret project

#

i will go through it and then comment on the issues regarding duckies on lance

#

i.e. mine and lemon's

green oriole
#

That isn’t the super secret project either :3

short snow
#

btw can i contribute in the quakstack project, or is restricted to the staff

#

bruhhh, this is getting ...

thorny obsidian
#

haha, our super secret project technically doesn't need to be super secret anymore, but you'll hear more about it closer to May

short snow
#

!remind 8h Look into quackstack and comment on sir lancebot issue 651 652

stable mountainBOT
#
You're the boss!

Your reminder will arrive in 8 hours!

short snow
#

do we really want a separate ducky bot (ves' status), and not put it into sir quaksksalot

thorny obsidian
#

but Chris's thing was originally going to be our April Fools event for this year, but it ended up being really awesome so now it's going to be it's own thing.

green oriole
#

It will be integrated to lance, Seb is probably working on something else

short snow
#

hmmm, and is quakstack a api or a package to generate random duckies?

thorny obsidian
#

I won't spoil it for Chris and the rest of the team working on it~

green oriole
short snow
#

ok, am confused rn, i will be back later

#

gtg cya!

green oriole
#

if I understand the project correctly, it will be a core PyPI package with a microservice and a CLI

#

cya

short snow
#

is it going to be used with our projects?

green oriole
#

Which part with which project?

short snow
#

the quakstack with site and lance

green oriole
#

Yeah sure

short snow
#

so no need to write an api for it?

green oriole
#

I’m not too sure about the structure of the project itself, I’d say let’s see when we get to it

short snow
#

discord.Guild.fetch_member uses an extra API call, instead is using discord.Guild.get_member better?

#

context: chris' stream PR

vale ibex
#

Yea, we are using get_member first

#

if that fails (because the user isn't in the cache) we fall back to fetch

short snow
#

ok.

#

fetch member raises this according to the docs

vale ibex
#

@tawdry vapor hah! I actually thought of the arrow thing before bed last night, so made the changes already. The only difference is that scheduler.schedule_at needs a naive datetime, so I use arrow.utcnow().naive

vale ibex
short snow
#

so you are right on that comment on mark ig

vale ibex
#

yea, those are the ones we're already capturing, so should be good.

#

both forbidden and discordservererror are handled elsewhere, as they wouldn't be limitted to this cog if they start happening

short snow
#

btw is quakstack open for contributions or limited to staff

green oriole
#

Good question

#

Hey @crude gyro are you taking care of quackstack?

short snow
#

oh god, these ducky names, i need to click everytime on the person to see who it is

fallen patrol
#

same

short snow
#

there is our ninjaducky lurker

crude gyro
#

@green oriole I'm not implementing it, no. my contribution was to specify all the issues, the rest is up to you all.

short snow
#

one more thing, instead of putting the whole branding repo, and opening the project time taking, why not just put the ducky assets tehre

green oriole
#

Alrighty

short snow
green oriole
#

I think branding is a good place to centralize all of our content

#

You don’t have to hunt it here and there, it is all in one place

short snow
#

yeah, am just saying to link only the quakstack

#

the branding repo is bigg

green oriole
#

and if we want to share assets between projects we have a common place

green oriole
short snow
fervent sage
#

go for it

short snow
#

cool

green oriole
#

Let’s wait until quackstack is ready and talk about what we can do then

short snow
#

uhh ok, we could possibly keep it open and with defferd label, so even others could share their input

#

as expected, it took quite some time cloning it

green oriole
#

Alright, now that we discussed it I don’t mind leaving it open

#

Hmmmm

#

lemon has another issue

#

Whatever, let’s keep both open

short snow
#

cool

#

is quakstack using 3.8 or 3.9

#

3.8+ ok cool (in pyproject.toml)

green oriole
#

Consider that to be 3.9 (lemon_warpaint @fervent sage)

#

/s

fervent sage
crude gyro
short snow
#

ok cool, i will implement it once quakstack is done

#

uhh cc: @fervent sage

green oriole
#

Alright, if we agree to not have a ducky builder let’s close it then, but I thought some people still wanted to discuss it

fallen patrol
#

and the branch and such

short snow
#

zsh and spaceship

#

another thing, quacken, should I use flakehell or just install them normally?

vale ibex
#

@tawdry vapor Just to double check, since I'm still new to dealing with timezones. Do you think this diff would work for changing schedule_at()? ```diff

  • delay = (time - datetime.utcnow()).total_seconds()
  • delay = (time - datetime.now(time.tzinfo or timezone.utc)).total_seconds()
#

It works in testing at least, for both naive and aware

tawdry vapor
#

Looks fine and if you say your tests work then go for it

vale ibex
#

Cool, what did we decide on for member._roles.has()

#

Is it too risky to use?

tawdry vapor
#

There's no decision

#

Wait

#

That diff may be wrong

#

Because if you pass a naĆÆve time it will use timezone.utc which makes the other operand aware.

vale ibex
#

So just delay = (time - datetime.now(time.tzinfo)).total_seconds() then, makes sense

#

since tzinfo being none means naive

#

but that doesn't offset to utc

tawdry vapor
#

I believe datetime.now(time.tzinfo) if time.tzinfo else datetime.utcnow()

#

Though at that point it wouldn't look nice in-line

vale ibex
#

yea, I'll expand it to a full if statement

stable mountainBOT
#

@short snow

It has arrived!

Here's your reminder: Look into quackstack and comment on sir lancebot issue 651 652.
[Jump back to when you created the reminder](#dev-contrib message)

whole forge
short snow
patent pivot
#

we're switching back to pyweek branding šŸ˜„

short snow
thorny obsidian
#

lmao that's perfect imo

short snow
#

perfect?

thorny obsidian
#

oh yes, perfect.

sleek steppe
#

Lol

short snow
#

welp, but yeah we could either make some cases which don't match together or edit the assets to make it match

#

like making the beard end smoothly

short snow
#

probably

patent pivot
#

oh I think

#

wait

#

i thinkk it's linting all the code in the venv or something

short snow
#

uhh, idts

#

try using .flake8 and see once

patent pivot
short snow
#

looks like that

gritty wind
#

that would explain the sheer number of warnings

patent pivot
#

hahahah yeah

short snow
#

but annotation works on my pr correctly

patent pivot
#

not sure what it's doing though

#

because uhh

#

it shouldn't have a venv

gritty wind
#

it is

patent pivot
#

ah

#

wait

#

.cache

#

yeah

gritty wind
#

it is not using venvs

#

Yeah the updates

#

more likely

#

it's in the wrong dir

green oriole
#

Two minutes long linting hahaha

gritty wind
#

so the site packages are in the same dir as the project

patent pivot
#

this should do it

#

golden

short snow
#

yeah works

#

hmm, why tox.ini was failing on my pr

patent pivot
#

now I just need a docker image and we shoooooould be good to go to prod

gritty wind
#

Why don't we have a project tempelate

#

most of our stacks are carbon copies

patent pivot
#

yeah

patent pivot
#

apologies for dev log today lol

#

i do bring good news though, olli now deploys successfully

short snow
patent pivot
short snow
#

nope

vale ibex
#

sir-lancebot#577 just needs 1 more review on it, it deals with the bot.exts.evergreen.error_handler ERROR: Unhandled command error: 'User' object has no attribute 'roles' we see in the service logs
~~Its also the last branch on my fork, so I'll finally be able to delete it šŸ˜‚ ~~

gritty wind
#

jealous 😢

#

I can take a look at it tonight

#

!remind 8H review

stable mountainBOT
#
Sure thing!

Your reminder will arrive in 8 hours!

gritty wind
#

If someone gets to it first, delete that please lol

vale ibex
#

!remind 470M 386599446571384843 check review and delete remind if it's done

stable mountainBOT
#
Affirmative!

Your reminder will arrive in 7 hours and 50 minutes!

gritty wind
#

Lmao

vale ibex
#

šŸ˜„

short snow
#

even this lemon_long lol

gritty wind
#

That was a pretty small diff lol

vocal prairie
patent pivot
patent pivot
#

okay moment of truth for olli šŸ˜„

#

let's see if this release actually works

#

need to fix the tagging

#

but otherwise

#

v good!

vale ibex
#

What's Loki?

patent pivot
#

The thing that powers service logs on grafana

vale ibex
#

Huh that's cool

green oriole
patent pivot
#

lmfao

patent pivot
#

did i like my docs here yet

#

everyone go oggle over how great my docs are

gritty wind
#

You don’t have a slim version

#

Which is just rude

green oriole
#

Everybody should have slim version

#

Even if it is the exact same

#

Minus one file

patent pivot
#

lol

#

it's built on python slim how muCH MORE SSLIM DO YOU WANT

gritty wind
#

Unironically, that may be easier, even if it’s an alias haha

#

I want to type slim

patent pivot
#

I get slim for images that people are building off

#

but not for standalone thingss

green oriole
#

Smh

#

That isn't open source friendly

#

I am disappointed

gritty wind
#

I was setting up ghost yesterday

#

They have an alpine and a regular image

green oriole
#

Ung, not alpine

gritty wind
#

And I don’t understand why they don’t just have the alpine

green oriole
#

Whatdidyoujustsay

gritty wind
#

Well look at it this way

green oriole
#

Musl SUCKS

gritty wind
#

How often will you need the bigger image outside of dev

green oriole
#

Get that garbage outta here

#

Get Alpine, Void and similar INTO THE SUN

patent pivot
#

!pep 656

stable mountainBOT
#
**PEP 656 - Platform Tag for Linux Distributions Using Musl**
Status

Draft

Created

17-Mar-2021

Type

Informational

patent pivot
#

we'll have musl wheels soon, which might ease some of the pain

green oriole
#

Don't...

#

Target musl

patent pivot
#

well, I guess it's a draft, but we'll see

green oriole
#

Don't support this

patent pivot
#

I don't think it's like

#

a goal to switch from libc to musl

#

it's just a move to try support both lol

gritty wind
#

Are you actually on pypi yet

green oriole
#

Hahaha

#

Look at musl libc

green oriole
#

But it is NOT

patent pivot
gritty wind
#

Akarys is being paid by big anti musl

patent pivot
gritty wind
#

Ollie

patent pivot
#

!pypi olli

stable mountainBOT
#

Olli searches your Loki logs and relays matching terms to Discord.

gritty wind
#

Near

green oriole
vocal prairie
patent pivot
#

lol

#

open a PR if it's a huge peeve

#

otherwise it doesn't matter

fallen patrol
green oriole
#

Tbh we are already issuing warning for missing channels

fallen patrol
#

seasonal bot not sir-lancebot

#

issue isn't the warning its the reference to the old name

patent pivot
#

that's fine

#

posting a link here is fine and all, but there's no point mobilising someone else for a one line change

#

if it's a huge problem for you we'll accept a PR

stable mountainBOT
#

@vale ibex

It has arrived!

Here's your reminder: 386599446571384843 check review and delete remind if it's done.
[Jump back to when you created the reminder](#dev-contrib message)

vale ibex
#

!remind delete 1845

stable mountainBOT
#
I don't think so.

You can't modify reminders of other users!

vale ibex
#

oh lol, rip @gritty wind

patent pivot
#

!remind delete 1845

stable mountainBOT
#
Affirmative!

That reminder has been deleted successfully!

patent pivot
#

WINNER

#

saving scaleios one reminder at a time

#

wait chris pinged him anyway wow chris

vale ibex
#

gottem

fallen patrol
#

!src something that doesn't exist

stable mountainBOT
#
Bad argument

Unable to convert 'something that doesn't exist' to valid command, tag, or Cog.

fallen patrol
#

so... why do some error messages delete and others don't?

patent pivot
#

lancebot ones do

#

bot ones don't

#

that was from memory so may be wrong

sleek steppe
#

kinda wish the docs command error messages wasn't an auto delete but a trashcan

fallen patrol
#

.src something that doesn't exist pt 2

#

I-

fallen patrol
patent pivot
#

intentionally

fallen patrol
#

Why

#

Is it because of bot vs sir complexity?

patent pivot
#

lancebot has more publicly facing features

#

and larger embeds etc.

fallen patrol
#

Ah

#

Fwiw I was talking about the src command not being allowed in the same channels as bot source

fallen patrol
#

well that's a nice issue

#

sirlancebot#653

dusky shoreBOT
fallen patrol
#

sir-lancebot#653

fallen patrol
vocal prairie
#

Ye, because it only looks for the "bot" part.

#

After it checks for sir-lancebot.

#

Which wasn't there.

sleek steppe
#

Which is why dyi5fsefcsebot#653gy6gfrtt works

dusky shoreBOT
vocal prairie
#

mhm

vale ibex
patent pivot
#

hah

vale ibex
#

slightly different implementation, since it assumes the config is setup right

#

so it only fails in DMs

patent pivot
#

lgtm

#

where are we at on the comment from scale

vale ibex
#

my last commit was to resolve that

patent pivot
#

hmm

#

ahh

#

yeah

#

alright, well then

#

morge

vale ibex
#

šŸŽ‰ Can delete my fork now too šŸ˜‚

short snow
#

@vocal wolf #dev-log message what do you think would be a good explaination here?

#

@fervent sage opened lint and ghcr pull requests on quackstack ducky_wizard

balmy sparrow
#

What's quackstack?

gritty wind
#

It makes ducks

placid ermine
#

naturally

balmy sparrow
#

Neat

patent pivot
#

i will add it now

patent pivot
#

also reviewed your PR

balmy sparrow
patent pivot
balmy sparrow
#

ah interesting

patent pivot
balmy sparrow
#

right thanks

#

i probably don't need to be setting something like that up for myself haha

patent pivot
#

there are other ways to achieve things like that, it's entirely doable through cloudflare or just pure nginx

balmy sparrow
#

i'll look into it, thanks šŸ‘Œ

short snow
wise oriole
#

can I suggest one addition to the .bm or .bookmark command?

patent pivot
#

for sure

wise oriole
#

okay.

tough imp
patent pivot
#

primarily really nice integration with kubernetes

#

we use the traefik CRDs (custom resource definitions) so that we can declare ingress routes into our cluster in the same way we'd declare a deployment or a configuration file

#

like uhhh

short snow
#

what is the con with nginx in kuber?

patent pivot
#

let me find a nice ingress

wise oriole
#

so.. it would be nice if other users get a dm from the bot too when they react with šŸ“Ø on the message that the user sent. Currently you have to resend the .bm message to find out what the bot dm'ed. but reacting with the emoji to make the bot send it to you too would be a nice addition

#

.bm 827886705603772486 by reacting to the emoji below šŸ‘‡

#

oops

patent pivot
#
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: site
spec:
  entryPoints:
    - websecure
  routes:
  - match: Host(`pythondiscord.com`) || Host(`api.pythondiscord.com`)
    kind: Rule
    services:
    - name: site
      port: 80
  - match: Host(`staff.pythondiscord.com`)
    kind: Rule
    services:
    - name: site
      port: 80
    middlewares:
    - name: site-cloudflare-access
  tls:
    certResolver: cfresolver
    domains:
    - main: "*.pythondiscord.com"
      sans: [pythondiscord.com]
#

here is an ingress for traefik

vale ibex
wise oriole
#

ohhh

#

this was already..

#

kk

patent pivot
#

it's in a readable format and is quite easy to follow, but to explain a bit:

entrypoint is the port that traefik is responding on

routes are the route entries that this ingress is responsible for, in this case pythondiscord.com, api.pythondiscord.com and staff.pythondiscord.com, you can see that the last one has a middleware configured which verifies that requests to it are from authenticated users from our SSO provider

tls is just TLS config, traefik will automatically generate and serve SSL certificates (big pro over nginx which needs a separate cert-manager deployment). you can see we use *.pythondiscord.com as the main name and for site we also add in pythondiscord.com as a SAN (subject alternate name)

tough imp
#

mm yeah, the kubernetes integration is probably not that interesting to me right now but the SSL management sounds awesome

patent pivot
#

basically traefik is a lot more bundled together and is a simpler setup process imo

#

what provider are you using for deployment? it has a lot of integrations

short snow
patent pivot
#

traefik can pick stuff up from all those providers

tough imp
#

i'm not even using docker right now, it's nginx -> gunicorn -> flask directly on the host, and I deploy via git pulls 🤔

#

but I'm trying to learn

patent pivot
#

hahaha

#

traefik also has a nice set of middleware

#

we're also doing stuff like client authenticated TLS pulls

#

so when our traefik instance gets a request as well as presenting a certificate for pythondiscord.com it also asks the client to present a certificate so we can verify it comes from either Cloudflare or a member of the DevOps team

tough imp
#

i may try to migrate my app to traefik for the sake of experience

patent pivot
#

if the load balancer is hit directly

tough imp
#

I'd like to containerize everything but last time I was looking into it, I didn't see an obvious way to use certbot in the nginx container

#

and that's what I got stuck on

patent pivot
#

oh yeah, traefik 100% solves that

#

we use the DNS-01 ACME challenge with the Cloudflare integration, entirely transparent with auto-renew

tough imp
#

sounds awesome

#

may look into it later today

patent pivot
#

traefik also has metrics mmLul

thorny obsidian
#

The real reason joe likes traefik: graphs

short snow
#

Also someone needs to clear the mentioned issues on quakstack

#

like adding assets to branding, and poetry setup

patent pivot
#

on it

short snow
#

ok, will have a look

patent pivot
#

lol, I foiled the linting

#

nice

short snow
#

if i approve 17, will u merge it pithink

patent pivot
#

looks like more whitespace fixes are needed

#

one second

#

I'll bundle them into this PR

#

ahh yeah there are loads of linting fixes needed

short snow
#

since it is his code, he knows it th best

gritty wind
#

Linting should be pretty easy to fix without knowing context too much

patent pivot
#

most should be fixable yeah

#

I don't mind doing it

short snow
#

i was talking about doc strings mainly

patent pivot
#

ah, most are self-explanatory through code though, there isn't loads of code

short snow
#

yeah, do it or i can do it in 2-3 hours

patent pivot
#

branding is such a pain to clone jfc

#

I'm 2.5 minutes in and it hasn't got past Cloning into '/Users/joseph/Desktop/Python/quackstack/branding'...

gritty wind
#

Is it the size?

#

If that’s it, we can move the duckies out to another repo, and have quack stack pull only those

patent pivot
#

I think it's the size, but it might also just be because I'm on a slowish connection

#

but yeah, I can't start the app

#

but that's fine, I was only testing a return value but I got it anyway

short snow
#

to just catch a release containing only duck assets

#

or a branch with only duck assets

patent pivot
#

taskipy is cool

short snow
#

it took 2min40 sec for me

patent pivot
#

branch will still have the same problems

#

yeah I was still going at 5 minutes so I killed it

short snow
patent pivot
#

huge clone time

#
  • that's not the intended usage of branches, branches should always be mergeable
short snow
#

yeah

#

what other options do we have, or we have to stay with this

short snow
#

i was just a second too fast

patent pivot
#

okay added a load of pep8 fixes

#

CI passed

vocal prairie
#

Yay!

short snow
#

also update your branch name joe.

sleek steppe
#

pipenv run precommit

gritty wind
#

The instructions for each project are also included in the project’s Readme

short snow
#

the contributing guide has

cold moon
#

I'd say that Duckstack should use API to fetch all ducky assets file paths and then pull these

short snow
#

that is something like what joe suggested

gritty wind
#

Most of the ones that get contributions have the setup guide linked in the readme

short snow
#

pulling of a zip, as a background task

#

i feel ks's idea is better, to fetch all ducky asset in that the quakstack folder on the branding as a background task

patent pivot
short snow
short snow
patent pivot
#

we can download just the quackstack folder

#

but I like the idea of a zip rather than individual assets

short snow
#

yeah, just downloading the quakstack folder

fallen patrol
patent pivot
#

lol

#

you can like

#

move branches

#

but github doesn't pick up on it yet

fallen patrol
#

i renamed the branch

#

and github was like: nah you deleted it and created an identical branch tyvm

patent pivot
#

cc @fervent sage the quackstack docker image does not work

#

it doesn't fetch branding submodule

#
FileNotFoundError: [Errno 2] No such file or directory: 'branding/quackstack/silverduck_templates'
#

from prod

fervent sage
#

hmm, i guess it depends on that already being there

#

sec

patent pivot
#

git will need adding to the build image but otherwise should be good

#

am available to review a PR

#

git submodule update

#

maybe needs a git submodule init as well? I forget

fervent sage
#

im too busy for implementing that rn, but someone will probably take on an issue since its pretty simple

#

git submodule update --init

patent pivot
#

aha

#

I cannnnnnn

#

oh hm

#

hmmm

#

we need to do that after copying the code right

#

yeah

#

that sucks, build times are going to shoot up

#

should just be this right?

#

cc <@&409416496733880320> for approval on that as well, it'll need a devops sign off

#

I can't test it locally because no docker so if someone wants to do that I'd appreciate it, but I think that should be correct

hardy gorge
#

I'd recommend you to create an unprivileged user and run the actual app as that user, but we typically don't do that yet in all of our dockerfiles and it's out of scope for this PR

#

It looks fine, but I'll try to build it locally

patent pivot
hardy gorge
#

Do I need to do anything special to reproduce this bug?

#

I'm really out of the loop on this project

patent pivot
#

you need to ensure you don't have the branding submodule already cloned I think

#

I'm not too knowledgable either

hardy gorge
#

just running the docker-compose should trigger the error in the old situation?

#

Or do I need to make a request?

#

Right

#
api_1  |     for name in self._accessor.listdir(self):
api_1  | FileNotFoundError: [Errno 2] No such file or directory: 'branding/quackstack/silverduck_templates'
#

alright

#

now try the fix

patent pivot
#

looks good, project deployed

vale ibex
#

That's the valid BSD value for a connection error šŸ˜„

#

Also, I'm not ignoring your first question, i just don't know the answer

sleek steppe
#

!exit

stable mountainBOT
#

Exiting Programmatically

If you want to exit your code programmatically, you might think to use the functions exit() or quit(), however this is bad practice. These functions are constants added by the site module as a convenient method for exiting the interactive interpreter shell, and should not be used in programs.

You should use either SystemExit or sys.exit() instead.
There's not much practical difference between these two other than having to import sys for the latter. Both take an optional argument to provide an exit status.

Official documentation with the warning not to use exit() or quit() in source code.

fallen patrol
#

...why did it boot twice if it didn't deploy?

vocal prairie
#

Maybe it was an internal thing?

fallen patrol
#

!ping

stable mountainBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

patent pivot
#

way more than just auto-deploy

fallen patrol
#

smh bad practice

#

well, without any info it is

gritty wind
#

Hm?

fallen patrol
#

anyways im very busy, d.py 1.7 just released and its 2 am

patent pivot
#

if we detect a node is performing suboptimally we transition the pod off it

fallen patrol
#

im def not updating to 1.7 at 2am

patent pivot
#

we also transition to better balance resource usage across the cluster

#

There isn't much to migrate to for d.py 1.7 so it shouldn't be too big of a job

gritty wind
#

do they have wheels published

#

yeah

patent pivot
#

yeah

fallen patrol
#

and oh my

#

the new features

fallen patrol
fallen patrol
#

Specifically

#

Replies have much better support

fallen patrol
#

Ok

fallen patrol
green oriole
#

It may work in a small server such as gurkult, but here it will probably just turn into a moderation mess

short snow
green oriole
short snow
#

Hmm yeah

thorny obsidian
#

I'm of the opinion that lancebot should be a learning experience primarily. Essentially dropping in completed cogs or commands or features from other servers is not something I'm interested in seeing.

short snow
placid ermine
#

can confirm

vale ibex
#

Anyone know if this pesky • can be easily removed? (In embed footers)

patent pivot
#

no way sadly, implemented by Discord

vale ibex
#

šŸ‘

sharp timber
#

You can potentially finagle it by not setting a timestamp for the footer and instead formatting it yourself, but that loses the user-datetime-adaption discord does for you there

balmy sparrow
short snow
balmy sparrow
#

if a User is all you need there, sure

#

that's fetching/getting a Member there though

sleek steppe
#

Converters are for strings so I don't see how that would be better

balmy sparrow
#

i guess the code there becomes 2 lines if you use a converter, not much of a point other than that

magic arch
short snow
#

yeah, you would need to edit the unittests a bit, i will look into it, and comment on the changes required

magic arch
#

Ah thanks a bunch - take your time!

balmy sparrow
sleek steppe
#
-        embed.colour = user.colour if user.colour != Colour.default() else Colour.blurple()
+        embed.colour = user.colour if user.colour.value else Colour.blurple()

Maybe?

short snow
# magic arch Ah thanks a bunch - take your time!

In the test_information file, i.e. https://github.com/python-discord/bot/blob/main/tests/bot/exts/info/test_information.py, you need to introduce a new parameter named colour, currently it mocks a Role and then adds a .colour attribute to it, like shown here: https://github.com/python-discord/bot/blob/main/tests/bot/exts/info/test_information.py#L314.

You can make few constants in the file with the colour codes, and then use it where ever there is a MockMember instance. Well this is the first step, now another thing is required, since it was using top_role.colour earlier, you can remove all of that code, since it is not being right now.

Hopefully this should work, šŸ¤ž

short snow
balmy sparrow
#

or does the value of default color give None?

magic arch
#

Default color is technically 0 I believe, but I felt Colour.default() was more understandable

magic arch
sleek steppe
balmy sparrow
#

yeah my bad

#

so default color's value will be None?

sleek steppe
#

and default colour has a value of zero

balmy sparrow
#

right makes sense

magic arch
#

@short snow Thanks so much again for your help, I was able to get the tests passing! 🄳

short snow
magic arch
#

Sounds good, couldn't have fixed this without you!

short snow
gritty wind
#

it's not the result of the command šŸ‘€

#

The avatar commands do sometimes error out though

#

Espcially if you just updated your PFP

fallen patrol
gritty wind
#

Sounds reasonable, can you open an issue?

fallen patrol
#

*opens issue*

gritty wind
#

lol

fallen patrol
#

bruh

#

minor QoL improvement

#

pls add github links to #dev-log channel topic

gritty wind
#

Wdym?

#

Ah

fallen patrol
gritty wind
#

but to what repo

fallen patrol
gritty wind
#

gotcha

#

I can do that now lol

patent pivot
#

done

gritty wind
#

Too quick

patent pivot
#

flexing my short URLs

vocal prairie
#

@fallen patrol Just wanted to let you know, there are PRs open to the API docs to document stage channels.

fallen patrol
#

yeah

#

that and

#

they're type 13 iirc

#

sir-lancebot#653 what is black knight?

patent pivot
#

discontinued project

fallen patrol
gritty wind
#

Bug report I think

fallen patrol
patent pivot
#

no, it was a closed source security bot

fallen patrol
#

ah

#

does the eval command use textwrap at all?

patent pivot
#

The Black Knight provides a number of security features to our admins. This bot is not open-source, for security reasons.
from #welcome at the time

fallen patrol
#

This bot is not open-source, for security reasons.
ahhh, security by obscurity.

patent pivot
#

the implementation used textwrap

#

lol, that's not security through obscurity

fallen patrol
patent pivot
#

seems it was used in one place

vocal prairie
#

Why was the !f command removed?

patent pivot
#

what was !f again?

vocal prairie
#

The command for free help channels?

gritty wind
#

Isn't that free?

patent pivot
#

!f

gritty wind
#

We don't have free help channels anymore?

fallen patrol
#

okay whew

#

its not like the bot that uses textwrap.indent

gritty wind
#

It was kept for a while during the transition afaik

patent pivot
#

that rings a bell

gritty wind
gritty wind
patent pivot
#

yeah

gritty wind
#

But it's usage went down quite a lot with the new system

vocal prairie
#

Makes sense.

short snow
gritty wind
#

Discord got better at handling things

#

is part of it

patent pivot
#

Yeah, pretty much that.

vocal prairie
#

Does defcon also do it?

patent pivot
#

There were a few reasons, but we didn't need the project in the end.

vocal prairie
#

Or is that different?

gritty wind
#

Defcon limits who can join the server

short snow
#

defcon is pretty useful in cases of raids

gritty wind
#

It's part of it, but not everything that was planned for that project

#

it's only one protection

fallen patrol
gritty wind
#

I can pull one from the logs

#

one sec

fallen patrol
#

ah

#

seems it has a silent response

gritty wind
#

Yup that's the one I pulled haha

fallen patrol
short snow
#

chris's pr should fix this

gritty wind
#

It isn't silent on our end šŸ˜“

fallen patrol
#

guess that's a second bug.…..

gritty wind
#

Does it? Isn't chris' PR about rates

fallen patrol
#

an error handler not outputting anything

short snow
#

it is mostly because of too much resource burning

gritty wind
#

That's unrelated to this bug

short snow
#

or it is because of pfp not found?

gritty wind
#

Yeah cache things

fallen patrol
#

sir-lancebot#649

patent pivot
#

we did have a spike in cpu throttling the other day didn't we

fallen patrol
#

that one?

gritty wind
#

This would be unrelated, but yeah (on the throttling comment)

short snow
#

try running .8bitify a lot of times

fallen patrol
#

sir-lancebot#597

dusky shoreBOT
short snow
#

after some point, it won't reply

#

yes that one

gritty wind
#

Again, not the same error

#

The logs show a 404

short snow
#

yeah ik, i was just telling

fallen patrol
#

ffs i need to change my pfp anyways

gritty wind
#

Ah, okay

fallen patrol
#

@patent pivot are you able to share the eval command for black night?

#

as akarys commented on that pr

#

sir-lancebot#653

gritty wind
#

I don’t know if that was ever written šŸ‘€

short snow
#

ves wrote it

gritty wind
#

Anyways, last time this was discussed, someone said Sebaatian will be handling it

fallen patrol
fallen patrol
gritty wind
#

Can’t open it, in mobile lol

patent pivot
fallen patrol
patent pivot
#

just wait for it to be PR'd, I'm sure someone will take it fairly soon

fallen patrol
#

its really interesting how its always 404s and not 403s

#

sir-lancebot#656

fallen patrol
#

how taxxing would it be to just fetch the new link every time

patent pivot
#

404s is good design

#

prevents accidental information exposure

fallen patrol
patent pivot
#

lol

gritty wind
#

On its own it’s fine

#

Putting it in a command tho

patent pivot
#

hmmmm

#

what's the endpoint

#

get user info?

#

why is the cache not updating

gritty wind
#

Members intent

patent pivot
#

ah

fallen patrol
gritty wind
#

Not sir-lance, no

#

The only intent we get is members on python, everything else is off

patent pivot
#

so

fallen patrol
#

are you sure of that scaleios

#

!src

stable mountainBOT
patent pivot
#

why is this erroring

gritty wind
#

Wdym?

patent pivot
#

we should get the profile information from the message event

#

which includes a user

gritty wind
patent pivot
gritty wind
#

But that’s just a cache object, no?

patent pivot
#

and surely ctx.message.author pulls from that?

fallen patrol
#

seems it gets a lot of users

gritty wind
#

Or is it hmm

gritty wind
#

It’s off for sir-lance

patent pivot
#

members is on for bot, off for lance, yeah

gritty wind
#

Where the image processing is

patent pivot
#

on for metricity

#

on for modmail

gritty wind
#

That’s empty on mobile

#

Ah now it loaded

patent pivot
#

yeah I don't think this is a cache thing

fallen patrol
#

*closes issue*

patent pivot
#

do we have a sentry error for this

fallen patrol
#

its still a bug but something else

gritty wind
#

Why would it be getting the old UrL?

#

Yeah tons

patent pivot
#

lol

gritty wind
#

Look for 404s basically

patent pivot
#

what cache mode does d.py default to

fervent sage
# gritty wind

is there a specific reason this creates an instance of Intents() before calling all()?

gritty wind
#

Idk lol

fervent sage
#

fair enough kek

patent pivot
#

what would happen if we disabled all caching

fallen patrol
#

šŸ’„

patent pivot
#

would it?

gritty wind
#

So it rerequests on every usage of member?

#

Do you know the rates

patent pivot
#

50/s for general routes iirc

fallen patrol
gritty wind
#

Is that lance?

fallen patrol
#

yeah

#

no its a totally random bot

gritty wind
#

I’m p sure default doesn’t include it

#

Lol

patent pivot
#

is it this error?

fallen patrol
gritty wind
#

Yeah

fallen patrol
patent pivot
#

26 occurrences

fervent sage
#

btw is there a problem if i create branches on the main repo?

gritty wind
#

If you have a dummy account, switching pfp should reproduce

patent pivot
gritty wind
fallen patrol
#

at minimum

#

.8bitify

#

well at minimum

#

its still my old pfp

patent pivot
#

right

#

because it's cached

#

hold on one second

fallen patrol
#

you're just gonna turn off the cache on the current bot

#

lol

patent pivot
#

no I'm going to restart it

fallen patrol
#

ah

#

then we know its a cache issue

patent pivot
#

alright it's starting up

#

try now