#dev-contrib

1 messages · Page 131 of 1

gritty wind
#

I mean, we can if we wanted to. Just throw a translator in front of the compose 🤡

fallen patrol
#

wytf

#

why is this a thing

patent pivot
stable mountainBOT
#

docker-compose.yml lines 15 to 16

read_only: true  # Prod uses a read-only fs, override this locally if it helps with debugging
user: "1000"  # Prod uses a non-root user, override this locally if it helps with debugging```
static canyon
#

hmmmm lol

#

That's very scuffed/cursed

gritty wind
#

That part was more an example, it's just that mypy picked up that stub as the typing for import logging, so whenever you do it, it think's it's importing that stub, not the actual logging file

vale ibex
#

Kompose 🤡

patent pivot
gritty wind
#

Anyways, this was for the fun of playing with the typing system/mypy, not as practical as your solution lol

static canyon
#

yeah lol

#

So for the actual solution I'd need to have a util get_logger and then the actual custom logger itself

gritty wind
#

That sounds about right

patent pivot
#

oh chris already mentioned it lol

#

a terrifying tool

gritty wind
#

You may also be able to use a find-and-replace on logging.getLogger(__name__) to migrate almost the entire code base

#

There are 19 instances of not that

fallen patrol
#

hm, does pydis have S3 buckets from aws?

patent pivot
#

it's smart, but then people use it to deploy apps which is not what it's for

patent pivot
gritty wind
#

Didn't we have some for that quackstack nonsense

patent pivot
#

we uses Linode

fallen patrol
#

kubernetes#53

dusky shoreBOT
fervent sage
#

nonsense
eXcuSe mE

patent pivot
#

yep

fervent sage
#

yeah

gritty wind
#

It's quacky

patent pivot
#

we backup to Frankfurt, Newark and Singapore

#

Redis, PostgreSQL and MongoDB

fallen patrol
#

so how exactly is it a backup if its hosted by the same place wat

patent pivot
#

what

#

it's georedundant

#

we could lose 2/3 of the earth lol

fervent sage
gritty wind
#

More likely linode goes bankrupt before then

#

Or humanity loses electricity and we revert to the stone age

patent pivot
#

yep

#

arthur cj trigger

fervent sage
#

or humanity just goes

radiant merlinBOT
#

:tools: Pick a CronJob to trigger

radiant merlinBOT
patent pivot
#

the only one in the same DC as us is the frankfurt one

#

the other two are completely separate

fallen patrol
#

ah

fallen patrol
gritty wind
#

Default permission maybe?

#

At least that's the case for other interactions

fallen patrol
#

I mean, if y'all have the use application commands perm off in the server that might be why

patent pivot
fallen patrol
#

ah, ty

#

so the bot edited the dropdown to be disabled

#

cool

patent pivot
#

ended up being pretty alright tbqh

fallen patrol
#

arthur source

static canyon
#
# bot/bot/log.py
import logging

TRACE_LEVEL = 5


class CustomLogger:
    def trace(self: logging.Logger, msg: str, *args, **kwargs) -> None:
        """
        Log 'msg % args' with severity 'TRACE'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.trace("Houston, we have an %s", "interesting problem", exc_info=1)
        """
        if self.isEnabledFor(TRACE_LEVEL):
            self._log(TRACE_LEVEL, msg, args, **kwargs)


logging.TRACE = TRACE_LEVEL
logging.addLevelName(logging.TRACE, "TRACE")

logging.setLoggerClass(CustomLogger)

...  # log_file_format_stuff

_set_trace_loggers()
``````py
# bot/bot/utils/log.py
import logging
import typing as t

from bot.log import CustomLogger


def get_logger(name: str = None) -> CustomLogger:
    return t.cast(CustomLogger, logger.getLogger(name))``````py
# bot/bot/exts/moderation/infraction.py
from bot.utils import get_logger

log = get_logger()
...
log.trace(...)
```does this seem right? @gritty wind
fallen patrol
#

arthur help

#

ah, not easily

#

since its a global check if core dev

gritty wind
#

It might not be necessary to set logging.TRACE = TRACE_LEVEL

patent pivot
#

arthur jsk source cj trigger

radiant merlinBOT
gritty wind
#

everything else looks right

patent pivot
#

I would add it but it's way easier if I just have a global devops check

gritty wind
#

perhaps keep it in the setup_loggers function though (the functional stuff)

trim cradle
#

arthur hi

#

arthur help

#

that bastard!

static canyon
#

yeah the logging.TRACE onwards for /log.py would be in setup()

gritty wind
#

lgtm then

static canyon
trim cradle
#

I changed my name because I'm so fucking mad at king arthur.

gritty wind
#

Fair enough

static canyon
#

Ah

#

self._log(...) this will have to change, presumably to logging.Logger._log(...)?

gritty wind
#

self._log = bot.utils.get_logger(...)

#

Replace the dots with whatever is already there

#

The references toself._log don't need to change

patent pivot
#

when they release nice permissions

#

yes but that sucks

static canyon
patent pivot
#

they have stuff in the works

fallen patrol
patent pivot
#

no, it's when

#

lol

fallen patrol
#

they will release them but not soon enough

patent pivot
#

¯_(ツ)_/¯

#

yeah

#

i have a sample of the metrics somewhere

#

uhhh

fallen patrol
#

seriously discord is not that great on their management

fallen patrol
#

githubpreview.dev?

gritty wind
#

It should be fine as is I think

patent pivot
fallen patrol
#

ah, codespaces

#

paid 😔

patent pivot
#

tyty, applied!

#

maybe I should make the changes to the k8s repo now for this

static canyon
#

Well CustomLogger isn't inheriting anything so isEnabledFor doesn't exist

#

@gritty wind ^

gritty wind
#

CustomLogger should be inheriting Logger

static canyon
#

Right

#

class CustomLogger(logging.Logger)?

gritty wind
#

Yeah

#

I have that one from earlier up

#
class Logger(logging.Logger):
    def trace(self: logging.Logger, msg: str, *args, **kwargs) -> None:
        """
        ...
        """
        if self.isEnabledFor(5):
            self._log(5, msg, args, **kwargs)
#

Just needs a renaming, and a new docstring for the class itself

static canyon
#

So I don't need to redefine self._log?

static canyon
gritty wind
#

You do still need to set it to utils.get_logger, but for something like self._log.trace() you can leave that

patent pivot
gritty wind
#

Basically, self._log is the CustomLogger, which is returned by the utils function

patent pivot
#

i can yeah — I was going to implement first and add another PR in which introduces those things

static canyon
gritty wind
#

To rephrase from the begenning, the only thing you need to change is logging.getLogger(T) -> utils.get_logger(T)

#

Which self._log are you referring to

static canyon
#
def _monkeypatch_trace(self: logging.Logger, msg: str, *args, **kwargs) -> None:
    """
    Log 'msg % args' with severity 'TRACE'.

    To pass exception information, use the keyword argument exc_info with
    a true value, e.g.

    logger.trace("Houston, we have an %s", "interesting problem", exc_info=1)
    """
    if self.isEnabledFor(TRACE_LEVEL):
        self._log(TRACE_LEVEL, msg, args, **kwargs)```I'm moving this into `CustomLogger`
gritty wind
#

Ah, I see

#

Yeah that one can stay as is

stable mountainBOT
#

bot/utils/scheduling.py line 44

self._log.trace(f"Scheduling task #{task_id}...")```
gritty wind
#

Unrelated to the one in the CustomLogger class

static canyon
#

Ah right

#
def _set_trace_loggers() -> None:
    """
    Set loggers to the trace level according to the value from the BOT_TRACE_LOGGERS env var.

    When the env var is a list of logger names delimited by a comma,
    each of the listed loggers will be set to the trace level.

    If this list is prefixed with a "!", all of the loggers except the listed ones will be set to the trace level.

    Otherwise if the env var begins with a "*",
    the root logger is set to the trace level and other contents are ignored.
    """
    level_filter = constants.Bot.trace_loggers
    if level_filter:
        if level_filter.startswith("*"):
            logging.getLogger().setLevel(logging.TRACE)

    ...
        ...
            logging.getLogger(logger_name).setLevel(logging.DEBUG)

    ...
        ...
            logging.getLogger(logger_name).setLevel(logging.TRACE)
```will I have to change each of these `logging.getLogger()` to `bot.utils.get_logger()`?
celest charm
#

Does sir-lancebot currently accept new commands? Or is in in the process of restructuring?

static canyon
thorny obsidian
#

voice chat shenanigans

celest charm
#

I wanted to propose a command for fetching info about a software license.

#

Like, you type .license mit, and you get an embed similar to this

patent pivot
#

I'm not sure about Lance, we might have some ideas in terms of what we want on there so I'd hang fire for now

celest charm
#

well, I thought way too much about LGPL and this idea came to me, yeah

celest charm
#

yeah

#

but many are missing, that's just 12

#

I'll check the api docs

#

we will not ship the command without WTFPL

patent pivot
gritty wind
#

(mypy can't pick up that getLogger won't return the default Logger argument, that's why we need the second function to tell it we're using CustomLogger)

celest charm
patent pivot
#

because the root is for displaying ones github considers "featured"

#

lol, that's true actually

celest charm
#

ha

#

more like Loser GPL ikr

patent pivot
#

doesn't have agpl either

#

ahhh hold on

#

it does have them

celest charm
#

The Github API is a wrapper around the licensee ruby gem, seems a bit strange to make a wrapper about the api lol

patent pivot
celest charm
#

which is what github uses by proxy

#

and we'll convert it to JSON somehow

fallen patrol
#

looks like github actually uses spdx

celest charm
#

maybe

#

they mentioned licensee somewhere

fallen patrol
celest charm
#

we can also rewrite the bot in Ruby so that it uses licensee

fallen patrol
#

a nearly full list of licenses

celest charm
#

oh, nice

#

but it doesn't have useful info

#

maybe we should hand-pick the most used licenses and just manually decsribe them

fallen patrol
clever wraith
#

Hey quick question, does quackstack let you supply a seed

#

For .quack

fervent sage
#

no

fallen patrol
clever wraith
fervent sage
#

it will soon i hope

fallen patrol
#

its all of the "detailsUrl": keys

clever wraith
#

So I'll have to randomly generate color values for now

fervent sage
#

github isnt loading for me so i cant link the pr

stable mountainBOT
#

src/models.py line 49

variation: int```
fervent sage
#

but im waiting on a pr to be merged before i can add the seed

#

quackstack#52 maybe

dusky shoreBOT
fervent sage
#

ye

fallen patrol
#

these should be merged smh

fervent sage
fallen patrol
fervent sage
#

imo it should all go in the main Python bot, since it's less of a fun community thing and a fairly important server feature

fallen patrol
#

.issue 778

#

asdf

#

also this

#

sir-lancebot#778

dusky shoreBOT
brazen charm
#

my opinion on this last time it was brought up was that most of the things that re not event specific and have to be allowed outside of the normal lancebot channels should be implemented on @stable mountain but I had no idea where to make the issue and forgot about it

fallen patrol
#

speaking of which, I have a large review to make on 778

static canyon
#
bot_1       | Traceback (most recent call last):
bot_1       |   File "/usr/local/lib/python3.9/runpy.py", line 188, in _run_module_as_main
bot_1       |     mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
bot_1       |   File "/usr/local/lib/python3.9/runpy.py", line 147, in _get_module_details
bot_1       |     return _get_module_details(pkg_main_name, error)
bot_1       |   File "/usr/local/lib/python3.9/runpy.py", line 111, in _get_module_details
bot_1       |     __import__(pkg_name)
bot_1       |   File "/bot/bot/__init__.py", line 8, in <module>
bot_1       |     from bot import log
bot_1       |   File "/bot/bot/log.py", line 12, in <module>
bot_1       |     from bot import constants
bot_1       |   File "/bot/bot/constants.py", line 21, in <module>
bot_1       |     from .utils.logging import get_logger
bot_1       |   File "/bot/bot/utils/__init__.py", line 2, in <module>
bot_1       |     from bot.utils.services import send_to_paste_service
bot_1       |   File "/bot/bot/utils/services.py", line 6, in <module>
bot_1       |     from bot.constants import URLs
bot_1       | ImportError: cannot import name 'URLs' from partially initialized module 'bot.constants' (most likely due to a circular import) (/bot/bot/constants.py)```I've now got this error I need to fix
#

A circular import issue

fervent sage
clever wraith
#

Tysm

#

That'll be very helpful

static canyon
#

bot.constants needs bot.utils.logging
bot.utils.logging needs bot.utils.services
bot.utils.services needs bot.constants

static canyon
#

It's just the way the code is structured from before I made my adjustments

#

Actually there's no log.trace in bot.constants so it doesn't truly need bot.utils.logging

#

So I guess I'll just leave it

#

Mypy will detect the wrong thing but it won't matter because it only breaks on log.trace which doesn't appear in the file

fervent sage
#

Okie would appreciate reviews on quackstack#60 it adds suck seeds and also fixes a fuck up I made when not updating the dockerfile Facepalm

dusky shoreBOT
static canyon
#

Eh feck

#

I've fixed the issue but docker is still running the old code

fervent sage
#

look

#

typing is hard

#

at least i didnt do it in the PR name KEKW

static canyon
#

Restarting docker completely cause just the container didn't seem tow rok

clever wraith
#

Ty Alec, reviewed

static canyon
#

It's still running old code @clever wraith

#

Hmm different error nvm

fervent sage
#

ty

static canyon
#

nvm this really just isn't working

patent pivot
static canyon
#

Either docker is running old code or I'm just blind and can't see the difference in the error

patent pivot
static canyon
#

Right I think

#

bot.log imports bot.ext.utils.logging
bot.ext.utils.logging imports bot.log

patent pivot
#

i'll need to PR like

#

a lot of files after

#

every repo that clones k8s as a part of deployment needs a path update

#

@fervent sage 🤨

#

ERROR: Error loading ASGI app. Could not import module "main".

fervent sage
#

see second line of PR lol

static canyon
#

Ugh this is such bs lol

fervent sage
#

its only 33% my fault

#

2 other people approved the PR

patent pivot
#

ah lol

static canyon
#

File "/bot/bot/constants.py", line 21, in <module>
bot_1 | from .utils.logging import get_logger

This line doesn't exist anymore so why is it in the error message? @clever wraith

#

Yes

#

This is what's actually L21

#

docker-compose up bot is the command I'm running

patent pivot
#

ping me when quackstack PR is ready for devops sign off

#

i'll rollback the deploy for now

#

this is nice

fervent sage
#

updated

static canyon
#

okay

#

lemme try

patent pivot
#

merged

fervent sage
#

im glad you clicked merge joe

#

now I dont have to feel as bad if it breaks

patent pivot
static canyon
#

Okay that seemed to work, thanks @clever wraith

patent pivot
static canyon
fervent sage
#

lmao

fallen patrol
fervent sage
#

thats awful

patent pivot
fallen patrol
#

Jeez

patent pivot
#

it's 10-20 mins work

#

I don't need to get approvals

fallen patrol
#

Ik but still

celest charm
fallen patrol
patent pivot
#

it won't break, but yeah I guess lol

celest charm
#

thx

fervent sage
#

I think swagger looks ugly as fuck so I made redoc the default

celest charm
patent pivot
fallen patrol
fallen patrol
patent pivot
#

github api can't handle over 250 commits

#

so policy bot got unhappy

fallen patrol
#

So how would that limit policy bot

patent pivot
#

because it can't see the commits, lol

#

so it needs to see all commits

#

it doesn't work lol

#

works with everything but that

celest charm
#

This is my user ID as seed

fervent sage
#

lmao i forgot about this

#

x-powered-by: Joe Banks

patent pivot
#

the best 23 bytes in the whole of python discord infrastructure

celest charm
#

with joe's user ID as seed:

#

hmm weird, that's the SQLite one

patent pivot
#

lmfao

#

hm I wonder why I diddn't get paged that quackstack had keeled over and died

celest charm
#

it's actually really cool that it follows HATEOAS

fervent sage
#

HATEOAS?

celest charm
#

stupid acronym, but still

#

basically, using URLs for referencing other resources

fervent sage
#

ah yeah

#

Im quite happy with it that way

#

it didnt feel right to return a raw image from that endpoint

#

wouldnt make sense

celest charm
#

github does that as well

fervent sage
#

yeah i thought of that when i saw the wikipedia example

#

there's a massive object with stuff like repo_org: url, repo_stars: url, ...

celest charm
#

yep

fervent sage
#

/duck?seed

celest charm
#

read the docs lemon_enraged

fervent sage
#

oh crap im stupid

#

I added seed

#

into the place where seed will be ignored

#

if the duck config is provided the seed is provided

celest charm
#

wait... it's ignored?

fervent sage
#

but if the duck config is provided

#

the random is never used

patent pivot
#

we should move qs to S3

fallen patrol
fervent sage
#

I'd like to just let everyone know that my head right now

patent pivot
#

i will provision creds

fervent sage
#

is just screaming

#

over and over

patent pivot
#

upload to S3 on generation

#

return link

fallen patrol
#

Ah

#

Makes sense

patent pivot
fervent sage
#

time to make another pr...

patent pivot
#

pick a region

#

frankfurt

#

selected thanks

celest charm
fervent sage
#

quackstack#61 blob_pain

dusky shoreBOT
patent pivot
fervent sage
#

S3 is aioboto3 yes?

patent pivot
#

yeah just like

#

any S3 client that you fancy

fervent sage
#

Ok, now it should work correctly

patent pivot
#

quackstack integration test when

fervent sage
#

😅

celest charm
patent pivot
#

we generate ducks in CI and attach them as build artefacts

fervent sage
#

@patent pivot could I have some s3 creds to test with

#

i think you mentioned in the past about that

clever wraith
#

Rick go to bed

patent pivot
#

yea one sec

clever wraith
#

It's like 12am where you are

celest charm
clever wraith
celest charm
#

i like how they both eat in sync

clever wraith
#

Lmao

#

It loops perfectly

celest charm
#

for some reason they autosynchronize on firefox

clever wraith
#

That's hilarious

#

Ew he's eating ruffles

patent pivot
#

nah, django_prometheus is inside django

#

it just adds an endpoint to django

clever wraith
#

Oh boy

#

What's the revelation

patent pivot
#

lol

#

updated exporters list

clever wraith
#

@brisk belfry inb4 dpy 2.0 won't ever be released

#

Also Guinevere wasn't a sir

#

A bit unrelated joe, but when will the code jam roles be taken away

patent pivot
#

it's named after Sir Bedevere

clever wraith
#

Oh

#

I'm an idiot

patent pivot
thorny obsidian
#

Soon ™️ Waiting back on 1 more prize thing

clever wraith
patent pivot
#

lol, sure

#

what are you fixing

#

lol

#

some are

#

I'm considering moving our internal docs onto k8s

#

right now it's notion, but some stuff could be migrated

#

github

#

probably published through jekyll to github pages or something

#

nope

#

yea

fallen patrol
#

test

fervent sage
#

fuck s3 and fuck boto3

#

I will now go back to trying to make it work and screaming into the void

fallen patrol
#

my internet connection

#

lol

#

trying to review a pr and had this channel open ¯_(ツ)_/¯

#

reviewed lance 778

#

left a second review since I missed some things lol

desert vessel
#

sirlance#778

#

sirlancebot#778

vocal wolf
dusky shoreBOT
desert vessel
#

ty <3

vocal wolf
#

np m8

vocal wolf
reef tinsel
#

Working on bot#1765 - completed the first part. Could I have some feedback on the message:

dusky shoreBOT
cold island
#

My personal opinion:

  • Can be made equivalent to the nitro message, i.e <user> just became a tier 1 patron!
  • This can be posted as an embed, and then the second line can become a hyperlink.
#

Possibly with a preceding 🎉 on the first line

stable mountainBOT
cold island
#

"patreaon"

vale ibex
#

lol ofc spelt right tho kek

cold island
#

And with a nice color

#

What's the patreon color

vale ibex
#

Maybe the 🎉 in the content, rather than the embed

#

so it's bigger

vale ibex
cold island
#

seems like a good idea

vale ibex
#

oh, it already is

cold island
#

lol

vale ibex
#

@patent pivot is always a step ahead

stable mountainBOT
cold island
#

And with a capital P

vale ibex
#

!int e ```py
await ctx.send(
embed=discord.Embed(
title=":tada: @vale ibex just became a tier 1 patron!",
descritpion="Support us on Patreon",
colour=0x46e6e8
)
)

stable mountainBOT
#
:tada: <@126811506632294400> just became a tier 1 patron!
vale ibex
#

ah, no mentions in titles

#

that a bit big anyway

#

!int e ```py
await ctx.send(
content=":tada:",
embed=discord.Embed(
description="@vale ibex just became a tier 1 patron!\nSupport us on Patreon",
colour=0x46e6e8
)
)

stable mountainBOT
vale ibex
#

hmm that's a bit big

#

so yea, I think I like your suggestion more zig

reef tinsel
#

ok!

#

also, my alternative message when someone already has a patreon role:

#

maybe something like:

@reef tinsel just changed to a tier 2 patron!

?

vale ibex
#

Hmm, I don't think we need to deal with that

#

X just became a tier 2 patron! still works imo

reef tinsel
#

(the colour is black because that is the colour of my tier 1 role)

vale ibex
#

could you try it with the 🎉 on the same line as the next?

vale ibex
reef tinsel
#

as in without the \n before the mention?

vale ibex
#

ye

#

(with a space tho)

#

yes

#

along with a monthly update too

#

which shows all of our current patrons

#

bot#1765 for reference

dusky shoreBOT
reef tinsel
#

(I am sorting out something for school next week, so will do the on the next line now, but may take some time again for any other adjsutments

#

a comparison to the 2 locations for the 🎉

static canyon
#

I think it looks better inline

stable mountainBOT
static canyon
#

And yeah it looks better with the emoji before

#

Maybe make the tier {tier} bold

stable mountainBOT
static canyon
# stable mountain

I think this one looks the best (2 messages up if the reply isn't loading for you)

#

CC @reef tinsel

vale ibex
reef tinsel
#

the last 3 revisions

#

I agree with tizzy that the last one looks the best

vale ibex
#

yup, agreed

reef tinsel
#

I am happy with this for now then, and will start working on the monthly post after going to the dentist!

vale ibex
#

nice 😄

fervent sage
#

its open to everyone

gritty wind
#

Only contribs+ can speak

vale ibex
#

I'm a little lost with why this test is failing, I'm not too familiar with django testing site#577

dusky shoreBOT
vale ibex
#

Is this because the timeout const doesn't exist during testing?

#

or is there something I need to do to the requests mock

#

it's easier to read in the list of 100s of branches lol

molten perch
#

Maybe it’s coverage? I can’t check the exact error, just the tasks, so I’m just guessing by reading the code.

vale ibex
#

It's a failed test due to not returning the meta data

#

it seems to be hitting the except block and returning {}

vale ibex
#

Ah, I've sorted the tests

dim pelican
#

What was the issue?

vale ibex
#

The requests mock was expecting the url to be arg[0]

#

but I was explicitly passing it as the url kwarg

dim pelican
#

Ahh you made it too easy to test

#

"here is this keyword arg that is what you want"
"I'd rather the 0th index of a list please"

vale ibex
#

yea, this mock is very specific to the particular part I edited, so I'm just going to put it back as arg[0]

dim pelican
#

For little guys like me, what are the most helpful things to tackle? I've done two things for sir-lance but haven't touched on the bot or site yet

vale ibex
#

setting up the bot is a bit of a chore right now, so expect to spend a bit of time on that

#

We provide a template server in the contrib guides, but even then setting up all the channel, role and webhook ids in the config can take a while

#

but there are a bunch of issues on the repos if you're looking for something to do

austere hornet
#

You can talk cuz you are a contributor

reef tinsel
#

Hi! Does anyone have any good ideas for testing bot#1765 part 2 (monthly message)?

By this I mean, I cannot test how it will handle going over embed limits in my guild of 2 members?

dusky shoreBOT
vale ibex
#

make 3 lists of names and output those, instead of role.members

#

If you just want to test it looks right

#

Right now, we also have no tier 3 patrons, so that list shouldn't appear at all

#

rather than showing a title with no one under it

reef tinsel
#

ok

#

i will probably start by just having a title with no-one under it, to simplify the code to make it easier to debug

vale ibex
#

sure

#

fwiw, I would use Embed.add_field

#

to add the lists

#

and then just not add the field if there is no one with that role

#

like ```py
embed = discord.Embed(
title="Mothly Patreon update!",
description="Big thank you to this months patrons!\nSupport us on Patreon",
colour=some_colour
)
if patreon_role_1.members:
embed.add_field(name, value)
if patreon_role_2.members:
embed.add_field(name, value)
if patreon_role_3.members:
embed.add_field(name, value)
await ctx.send(embed=embed)

#

ofc this is super simplified

brisk brook
#

Plus- this may exhaust the embed limits

vale ibex
#

possibly, the limit is 4k right?

fervent sage
#

4096 in description, 6k overall

#

1024 in fields

reef tinsel
#

is a mention worth the number of chars in id + 3 (<, @, >) or another number of chars?

#

ie, is it worth 19 chars or another number

gritty wind
#

I feel like it’d be easier to just swallow the bullet now and add splitting

#

I’d like the mentions personally

vale ibex
#

we could send 3 embeds

#

one for each tier

reef tinsel
#

we could

vale ibex
#

When we bump to 2.0 we can send them all in one msg too

brisk brook
#

How?

reef tinsel
#

i was going to do some calcs to work out the columns, but it would be a lot easier on the code to do separate embeds!

reef tinsel
vale ibex
#

yea, api v9 (maybe added in v8 shrugR ) supports up to 10 embeds per msg

#

discord.py 2.0 exposes this with an embeds kwarg on Messageable.send

#

which is a list of embeds

reef tinsel
#

for this line continuation, how should I do the indentation/brackets? like this, or something else?

vale ibex
#
message = (
    f"some content "
    f"some other content"
)
#

that's how I usually do it

reef tinsel
#

ok

slim widget
#

Any PRs/issues I can work on? Need something to do.

vale ibex
#

uhhh possibly

#

since there might be some useful things to be done there

brazen charm
#

Could also use a third opinion on some of the unresolved conversations in bot#1663

dusky shoreBOT
elder belfry
#

Hey @dim pelican Can I partner with you on sir-lancebot#677 pithink

dusky shoreBOT
dim pelican
elder belfry
gritty wind
#

Chris you’ve gotta add the reactions for us😔

#

I can never find that confetti cannon one

vale ibex
#

lol

dim pelican
#

Lol right? I was going crazy for a second :\tada:\

#

So there are a total of 10 contributors?

gritty wind
#

There are ~10 non helper contributors

#

!role Contributor

stable mountainBOT
#
Contributors info
ID

295488872404484098

Colour (RGB)

#55cc6c

Colour (HSV)

0.37 0.58 204

Member count

43

Position

12

Permission code

6442450944

gritty wind
#

43 in total

dim pelican
#

Ahh I see, dang that seems like a rare role to get

vale ibex
#

There's definitely rarer ones lol

#

There's a bunch with just 1 member

#

some with 0 too lol

#

super rare

gritty wind
#

Aren’t those all patreon colors 🤡

vale ibex
#

lol, out of the 3 with 0, tier 3 patreon is one of them

gritty wind
#

Ohh no some pretty cool ones

fervent sage
#

I should totally be given a role called 'Too Many Sideprojects' KEKW

dim pelican
#

One day maybe I will have a colorful username

thorny obsidian
#

Smh Chris, copying my badly phrased "what I think a core dev is" =P

vale ibex
#

lol yup

#

none of the work, all the credit

#

😄

thorny obsidian
#

Also congrats to the new contribs! Very well deserved :D

short snow
#

congrats new contribs

thorny obsidian
#

If someone wants something to work on that I can guarantee will be used this year and will be greatly appreciated by me if this is implemented: sir-lancebot#321

dusky shoreBOT
short snow
molten perch
thorny obsidian
brisk brook
clever wraith
#

Thanks everyone! Congratulations Wookie and the others lemon_pleased

clever wraith
thorny obsidian
#

Qwerty you're the mod QoL fixer.
You: Why does this interface suck for mods?
Mods: I dunno, it's always been like that. Would be nice if it wasn't.
You: Well I fixed it!
Mods: :O

short snow
slim widget
thorny obsidian
#

@molten perch So I'm going to go ahead and explain, broadly, AoC and specifically how we implement multiple leaderboards.
Advent of Code is a a Programming Challenge Advent Calendar. Each day, starting on Dec 1, for 25 (I think) days, a challenge is released. People are given input data, they must solve the challenge, and then submit their result. It starts off pretty alright and then quickly gets more difficult. There are also 2 parts to each challenge. So a total of 48 or 50 challenges to solve.

There is a global AoC leaderboard, which ranks people based on how many Stars (challenges completed) and how quickly they get the stars. The global leaderboard is very, very competitive.

The community can also create their own private leaderboards to compete against friends and coworkers. These are limited to 200 people per leaderboard. This is what we use. But, because of our community's size, we actually need to have multiple leaderboards. So last year, Seb had to rewrite our whole codebase for AoC to accommodate multiple leaderboards. We query each leaderboard, record in Redis the user ID, which days they completed, and how many stars they got on that day, and how quickly they got those stars.

From there, we re-rank the whole dataset and rescore to create our own PyDis Mega Leaderboard. So for the per-day AoC stats, this is actually the data you want to use. It just requires from thinking and shuffling and scoring, per-day to do so. It's also probably smart to store the day's results in some sort of cache so the computation doesn't have to be continually re-run.

... so that's my thoughts on it.

#

To help test the feature I can get you access to last year's multiple leaderboards with the cookie session tokens so you can query it directly yourself

molten perch
dim pelican
elder belfry
dim pelican
thorny obsidian
#

I'll assign y'all now~

#

@elder belfry can you also comment on the issue so I can assign you to it as well?

thorny obsidian
#

happy coding y'all~

#

... I should stop procrastinating and actually work >_>

dim pelican
#

Woo! Fastest assignor in the west

thorny obsidian
#

Also, I'm going to do a major restructure of lance's ext tomorrow evening. So either aim to have the PR merged by then or plan to have a gnarly conflict to resolve

dim pelican
thorny obsidian
#

@patent pivot (and also others who know reviewbot well, fuck it @vale ibex you too)
Can we have wookie's core dev vote count retro-actively for like... the past 3 days or nah?

vale ibex
#

you can click the details button next to policy bot for it to reevaluate

thorny obsidian
#

I don't think I have that power anymore

#

looking specifically at sir-lancebot/833

vale ibex
#

uhhhh, it's github oauth so I think any staff can

#

sir-lancebot#833

dusky shoreBOT
vale ibex
#

ah, joe hasn't added wookie to core dev team yet

#

(joe/owners I mean)

#

The act of opening this page reevaluates

thorny obsidian
#

ooooh

#

okay, I wasn't sure if there was something else I was supposed to do

austere hornet
#

Wait he is a core dev now

thorny obsidian
#

My aim is to help merge as many open lance PRs as I can before I do the exts/ restructure

vale ibex
#

yea, there's a team in github that deals with the policy bot stuff

austere hornet
#

@vale ibex He is already added

vale ibex
#

I added that

fervent sage
#

discord roles != github

austere hornet
#

Ohhh sorry I didn't know mb

dim pelican
#

General question: should I open a PR with an empty file and then build it out in collaboration or wait until there is a full file ready to go?

vale ibex
#

feel free to open a draft PR

#

whatever works best for your collab

dim pelican
#

Thanks!

thorny obsidian
#

Okay, PRs I'm going to try to help move along this weekend:

  • Teapot
  • Wikiguess
  • unloaded cogs preservation (I'll try my best for this one but no promises)
vale ibex
#

fwiw a draft PR is a special type of PR, it marks it as not ready for review, it's useful for people to see it's not ready

#

when you're creating a PR, there is an arrow next to the create PR button, you can click that to select draft PR instead

short snow
#

both my PRs on lance, akarys_heart

vale ibex
#

or you can click this button to convert an open PR into a draft

thorny obsidian
#

I'd appreciate a core dev review on sir-lancebot#745 since I think kosa is still busy with hella life stuff

dusky shoreBOT
dim pelican
short snow
#

Also kat I won't be able to mention the changes as of now due to school stuff atleast for 2 weeks, after that I can

#

so you could review some other PRs too if ou want

#

(unless they are a approval) lol

thorny obsidian
#

That's fine~ If they're ready though without major changes I'll do my best to get them merged to avoid an annoying conflict

short snow
#

👍

austere hornet
brazen charm
#

the bot reconnected after it was deployed

austere hornet
thorny obsidian
#

When we merge PRs, we re-deploy the bot so it has those new features. That's just letting us know when it's back online

clever wraith
keen valley
#

I am getting a Error, while configuring sir-lance

(sir-lancebot-e4XN2zlu-py3.9) PS M:\ADMIN\Critical Data\Python-discord\sir-lancebot> poetry run task start
Found .env file, loading environment variables from it.
09/03/21 21:10:03 - root INFO: Logging initialization complete
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "M:\ADMIN\Critical Data\Python-discord\sir-lancebot\bot\__main__.py", line 7, in <module>
    from bot.bot import bot
  File "M:\ADMIN\Critical Data\Python-discord\sir-lancebot\bot\bot.py", line 202, in <module>
    loop.run_until_complete(redis_session.connect())
  File "c:\python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "C:\Users\ADMIN\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-e4XN2zlu-py3.9\lib\site-packages\async_rediscache\session.py", line 138, in connect
    self._pool = await pool_constructor
  File "C:\Users\ADMIN\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-e4XN2zlu-py3.9\lib\site-packages\aioredis\commands\__init__.py", line 188, in create_redis_pool
    pool = await create_pool(address, db=db,
  File "C:\Users\ADMIN\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-e4XN2zlu-py3.9\lib\site-packages\aioredis\pool.py", line 58, in create_pool    
    await pool._fill_free(override_min=False)
  File "C:\Users\ADMIN\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-e4XN2zlu-py3.9\lib\site-packages\aioredis\pool.py", line 383, in _fill_free    
    conn = await self._create_new_connection(self._address)
  File "C:\Users\ADMIN\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-e4XN2zlu-py3.9\lib\site-packages\aioredis\connection.py", line 111, in create_connection
    reader, writer = await asyncio.wait_for(open_connection(
  File "c:\python39\lib\asyncio\tasks.py", line 442, in wait_for
    return await fut
  File "C:\Users\ADMIN\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-e4XN2zlu-py3.9\lib\site-packages\aioredis\stream.py", line 23, in open_connection
    transport, _ = await get_event_loop().create_connection(
  File "c:\python39\lib\asyncio\base_events.py", line 1017, in create_connection
    infos = await self._ensure_resolved(
  File "c:\python39\lib\asyncio\base_events.py", line 1396, in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
  File "c:\python39\lib\asyncio\base_events.py", line 856, in getaddrinfo
    return await self.run_in_executor(
  File "c:\python39\lib\concurrent\futures\thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\python39\lib\socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
#

What should I do?

brazen charm
#

Either run redis or set the env var (name should be somewhere in the contributing guide) to false

keen valley
#

In this
which one should I keep False?

brazen charm
#

set USE_FAKEREDIS to true

keen valley
brazen charm
#

I believe the viewset will need to be changed

vale ibex
#

site#577 is a nice simple one to test if someone wants to review it

dusky shoreBOT
vale ibex
#

this fixes an issue that causes a worker to go unresponsive and abort

viscid coral
#

Maybe enable it for help channles?

trail pilot
#

Could I get assigned this issue sir-lancebot#599

It’s been up for grabs and I don’t think anyone has interest in getting assigned that issue

dusky shoreBOT
static canyon
#

bot.bot.Bot inherits commands.Bot
commands.Bot inherits discord.Client
discord.Client has a http attribute.

Mypy raises an error when you do bot.http, stating error: "Bot" has no attribute "http" even though it exists (in the superclass' superclass). Does anyone know how to fix this?

static canyon
austere hornet
#

Don't think this is the right channel for that

hazy niche
static canyon
hazy niche
#

oh, thanks i got it, will take it down for sure

#

thanks for the advice

static canyon
#

That's not strictly true actually, you can still share in an off-topic channel as long as the project doesn't violate any of our rules (namely rule 5) and you're not just "advertising" it, but asking for feedback etc.

clever wraith
# cold island Hmm yeah I don't see anything in https://github.com/python-discord/site/blob/mai...

I'll open an issue for it then, it seems like there's no way to fetch that info from a username currently and we'd need to add something like this:

    @action(
        detail=False,
        methods=["GET"],
        url_path=r"username/(?P<name>[^#]{,32})#(?P<discriminator>[0-9]{4})"
    )
    def get_by_username(self, request, name, discriminator):
        user = get_object_or_404(User, name=name, discriminator=discriminator)
        return Response(UserSerializer(user).data, status=status.HTTP_200_OK)

This allows for GET bot/users/username/Qwerty#0001 but this is just what I came up with an hour of tinkering around and having no prior experience in Django, so there's probably a better way

static canyon
#
class Spam():
    x = 1

class Foo(Spam):
    pass

class Bar(Foo):
    pass


b = Bar()
print(b.x)```this code works just fine with mypy (and Pycharm) but for some reason `bot.http` gives an error saying `"Bot" has no attribute "http"`, where:
`bot.bot.Bot` inherits `commands.Bot`
`commands.Bot` inherits `discord.Client`
`discord.Client` has a `http` attribute.

Does anyone have any idea as to how to fix this?.
#

So it seems to stem down to the fact that neither Pycharm nor mypy recognises that discord.Client has a http attribute.

#
class Client:
    r"""
    ...
    Attributes
    -----------
    ws
        The websocket gateway the client is currently connected to. Could be ``None``.
    loop: :class:`asyncio.AbstractEventLoop`
        The event loop that the client uses for HTTP requests and websocket operations.
    """
    def __init__(self, *, loop=None, **options):
        ...
        self.http = HTTPClient(connector, proxy=proxy, proxy_auth=proxy_auth, unsync_clock=unsync_clock, loop=self.loop)
        ...```why doesn't mypy/pycharm recognise that `Client().http` is valid?
#

So apparently the stubs are missing it

#

Which is why it doesn't work

brazen charm
#

Doesn't seem like a good idea to rely on stubs that don't properly reflect the current interface of the library

static canyon
#

I added to the stubs and now it works perfectly

#

Tbf the stubs are still updated, I guess they just missed one?

#

I've made a PR to the library so maybe it'll get merged 🤷

fallen patrol
#

which library

brazen charm
#

How active is the development on what you're using? My main concern here is that if there's a larger mistake like that then I'd expect more smaller for example from changing signatures

static canyon
#

It's just anything that's already missing, such as discord.Client().http

fallen patrol
static canyon
#

You can't actually edit site-packages for the bots (files aren't tracked)

fallen patrol
#

ah, for bot

#

so, v2 is supposed to be entirely type hinted

static canyon
#

v2 is never coming though

fallen patrol
#

which means if wait until bot is updated to v2 99% of the typing stubs for bot shall be gone

fallen patrol
static canyon
#

Well, it's not v2

#

It's a beta v2

fallen patrol
#

semantics... not like I'm always gonna call it beta v2

brazen charm
#

is the non stable fully typed or only partially as it was being written?

vale ibex
#

I haven't encountered anything missing type hints while I've been using it

fallen patrol
fallen patrol
# static canyon v2 is never coming though

When bot is upgraded to the currently workable state of discord.py v2.0.0a (which while it is discontinued, has no major notable bugs), the library is almost entirely typehinted, which means that you don't have to worry about client.http being typed and needing stubs. If you wait, it will be less work to add whatever you're adding to bot.

static canyon
#

Hmm I mean it just removes the need for a single dependency

#

And I don't need to add this stub

vale ibex
#

for context, we're planning to upgrade the bot this weekend/next

#

since lancebot hasn't had any issues so far

static canyon
#

Yeah

#

I suppose I'll just have it locally

fallen patrol
#

because discord.Object has a converter in 2.0

vale ibex
#

Nice

#

I imagine in the PR that we upgrade we will just fix the breaking changes

#

but there is going to be plenty to upgrade over time 😄

fallen patrol
#

yeah

#

I have a personal bot which translated: is sir-lance and bot melded together with the best usable commands between the two of them

vale ibex
#

but yea, hadn't seen that converter yet, it's good to know 😄

fallen patrol
#

No, I'm not hiding where the sources of this bot are 😄

vale ibex
#

lol

fallen patrol
#

but its extremely useful to have a meld of bot and lance

#

specifically pypi, pep, and the github commands

vale ibex
#

Ah cool 😄

fallen patrol
#

yeppp

clever wraith
#

@fervent sage thanks for seeding ducks! Tested, works great

#

I'll get to .quack soon

stable mountainBOT
#

Quack quack

clever wraith
#

Lol Ty python

dim pelican
#

Question, is it possible to temporarily ignore the pre-commit checks while working on a draft file? I am assuming I will be committing a bunch while the file is worked on between me and another, and I like to use # TODO tags which the flake8 catches.

austere hornet
dim pelican
#

*Once the file is more workable I would probably squash the commits prior to review

brisk brook
#

The answer is no,

#

You'll have to do # TODO: XYZ # noqa

dim pelican
#

Just add # noqa at the end?

vale ibex
#

you can add --no-verify to your commit

#

pretty sure that skips pre-commit too

dim pelican
vale ibex
#

you can do poetry run task lint to lint everything

#

since pre-commit won't pick up the things you skipped now

clever wraith
brisk brook
#

Oh right, you need to specify a specific error too?

clever wraith
#

Yeah

#

It'll fail the blanket noqa

dim pelican
#

I get the T000 and F401 errors
(Todo note found and imported but not used)
Would I then do #noqa: T000 on the lines with the Todo note?

brazen charm
#

why are todos checked

dim pelican
#

¯_(ツ)_/¯
Also, the #noqa: T000 at the end of the comment does not suppress the error

clever wraith
#

Hey @fervent sage, noticed a visual bug with some quackstack duck I generated

fallen patrol
#

don't do that

#

do not do that 🥺

#

SKIP=flake8 git commit

dim pelican
fallen patrol
#

setting the SKIP variable will skip that hook

#

meaning that you don't need to skip all of the hooks, just that hook in particular

vale ibex
#

not in windows 😦

dim pelican
fallen patrol
#

sets up venv on windows

#

sigh, this is gonna take some time to test pre-commit

vale ibex
#
PS C:\Users\Chris\src\sir-lancebot> SKIP=flake8 git commit
SKIP=flake8: The term 'SKIP=flake8' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
fallen patrol
#

yeah that's a you problem i think

#

I've gotten it to work b4

vale ibex
#

you'd ned to do ```
$env:SKIP='flake8'; git commit

fallen patrol
#

hurm...

vale ibex
#

at least on powershell

fallen patrol
#

what's your ps version

vale ibex
#

7.1.4

fallen patrol
#

oh good, not a 5 user

vale ibex
#

hah ye

fallen patrol
#

I've configured 5 to look like this

#

old and outdated, so I know instantly if I'm using it

#

huh, oops

#

and aside

#

this just helped me find a problem with my pre-commit config

#

tldr Mixed line ending on windows goes boom

vale ibex
#

lol yup

fallen patrol
#

pretty sure on windows tho git actually saves them as one and converts them b4 commiting but idr

vale ibex
#

I just have autocrlf = input in my global git conf

#

it just works

fallen patrol
#

where

#

what's the cmd

vale ibex
#

git config --global core.autoclrf "input"

#

from memory

#

so yea if it doesn't work, don't blame me

austere hornet
#

@vale ibex Would you mind taking a look at #dev-contrib message ? I am planning to work with Frontogenesis on that issue but nobody has assigned it to him yet. Could you please assign the issue to him? Thanks so much! (His username is Shom770)

vale ibex
#

Done 👌

austere hornet
fallen patrol
#

hm, chris, can I report an easy way to get around filters to your dms?

vale ibex
#

probably best to @slow bone

fallen patrol
#

eh.. it involves the 2.0 update

#

so not terribly important, but will be easy in the future

vale ibex
#

Sure, it likely won't be me who does the update, but the mods can relay the concerns to the core devs

trail pilot
#

Are you allowed to make a PR if you already have an issue assigned to you when your ready for it

#

You’re*

static canyon
#

If it's been approved then just PR whenever it's ready

trail pilot
#

Sounds good

#

Pretty nervous for the code reviews for when my PR rolls around

#

My code is a bit messy

static canyon
#

It's fine, we're here to help 👍

#

We also have linting which should help out

#

And any concerns you have you can ask here

elder belfry
#

While making a JSON file to store the combined data about common colour names and their hex values from https://xkcd.com/color/rgb/ and https://github.com/ryanzec/name-that-color/blob/master/lib/ntc.js#L116-L1681 , for the issue sir-lancebot#677, I found out that there's already 2 JSON files, xkcd_colours.json and html_colours.json in bot/resources/evergreen/ for the .decorateegg command.

What I propose is, we should combine all of them and also retain the fact it's from html or xkcd or ryanzec colour list, probably by making an object in JSON file with fields for html, xkcd, & ryanzec , so that we no longer require separate files for similar data and also make a helper function (probably at bots/utils/helpers.py) to find the best hex colour code for a colour name given by the user. As I believe it maybe used for other commands in the future.

dusky shoreBOT
dim pelican
elder belfry
dim pelican
#

You can try to do a test commit and add that JSON file to the branch

elder belfry
elder belfry
dim pelican
#

Sorry in advance for anyone watching #dev-log , sir-lancebot#842 will be failing the flake8/lint workflow for a little while

dusky shoreBOT
vale ibex
#

will be useful while you're still developing

static canyon
#
from discord import Embed, Emoji, Member, Message, NoMoreItems, PartialMessage, TextChannel

from bot.constants import Guild

...
    @staticmethod
    def _random_ducky(guild: Guild) -> Union[Emoji, str]:
        """Picks a random ducky emoji. If no duckies found returns :eyes:."""
        duckies = [emoji for emoji in guild.emojis if emoji.name.startswith("ducky")]
        ...
```this gives an error because `bot.constants.Guild` doesn't have a `.emojis` attribute. What's the best way to solve this? I'm guessing doing something like```py
from discord import Embed, Emoji, Guild, Member, Message, NoMoreItems, PartialMessage, TextChannel  # add `Guild` import

from bot.constants import Guild as PydisGuild  # rename to `PydisGuild` so it doesn't override discord.Guild import```but want to know what others think
brazen charm
#

both of those feel like they'd benefit from being namespaced

static canyon
#

namespaced?

#

As in ```py
import discord
from discord import ...

import bot.constants
from bot.constants import ...

discord.Guild
bot.constants.Guild```?

brazen charm
#

from bot import constants would probably be enough but yes

static canyon
#

Right, yeah

trim cradle
#

or here if you can't see that channel.

green oriole
#

It is super recent

fallen patrol
green oriole
#

Well, then they changed something recently about it

static canyon
stable mountainBOT
#

bot/exts/moderation/modpings.py line 116

if mod in self.moderators_role.members:```
static canyon
stable mountainBOT
#

bot/exts/moderation/modpings.py line 38

self.moderators_role = self.guild.get_role(Roles.moderators)```
vale ibex
#

Is there await until guild available call before it?

brazen charm
#

it's an on_command

vocal wolf
#

@vale ibex wookie approved of talent pool, should we merge?

vale ibex
#

Ah, then yes

vocal wolf
#

very cool

brazen charm
#

I'm not very knowledgeable with how discord.py works but that sounds like the guild should be available together with the role if the bot is accepting commands

vale ibex
#

Yea, on_messages don't fire until guild is ready

static canyon
#

👍

green oriole
#

Do we yeet whatever the talent pool is named right now?

vocal wolf
#

merging now

green oriole
#

Cool

vocal wolf
#

I'm gonna go get food, hopefully it doesn't explode

green oriole
#

Watch the github datacenter actually explode

vocal wolf
#

lol

#

merged

green oriole
#

Seems to be fine

#

Talent pool has almost 800k messages, kind of crazy

#

Now we need to write a mod announcement and archive the channel

gritty wind
#

That's finally gone?

#

Nice

green oriole
#

Yep

#

Despite almost never looking at that channel, it feels weird knowing it is gone now

#

Like this channel has been here loooooong before I joined the staff, which will be almost a year ago now

gritty wind
#

Like

#

You're right but

#

I always found it kinda useless 👀

green oriole
#

Oh I know

vocal prairie
#

Congrats Qwerty, Dorsan, Rick, and wookie! 🎉

static canyon
stable mountainBOT
#

bot/utils/time.py line 66

raise ValueError(f"Format can only be one of {', '.join(TimestampFormats.args)}, not {format}.")```
stable mountainBOT
#

bot/utils/time.py lines 26 to 39

class TimestampFormats(Enum):
    """
    Represents the different formats possible for Discord timestamps.

    Examples are given in epoch time.
    """

    DATE_TIME = "f"  # January 1, 1970 1:00 AM
    DAY_TIME = "F"  # Thursday, January 1, 1970 1:00 AM
    DATE_SHORT = "d"  # 01/01/1970
    DATE = "D"  # January 1, 1970
    TIME = "t"  # 1:00 AM
    TIME_SECONDS = "T"  # 1:00:00 AM
    RELATIVE = "R"  # 52 years ago```
green oriole
#

It is an attribute auto-generated by the enum metaclass

gritty wind
#

I thought so too but

#

!e ```py
import enum

class Test(enum.Enum):
...

Test.args

stable mountainBOT
#

@gritty wind :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 6, in <module>
003 |   File "/usr/local/lib/python3.9/enum.py", line 429, in __getattr__
004 |     raise AttributeError(name) from None
005 | AttributeError: args
green oriole
#

Uuhh idk it seemed to work haha

#

!e
import enum

class Test(enum.Enum):
abc = 42

Test.args

stable mountainBOT
#

@green oriole :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 6, in <module>
003 |   File "/usr/local/lib/python3.9/enum.py", line 429, in __getattr__
004 |     raise AttributeError(name) from None
005 | AttributeError: args
gritty wind
#

I'm so confused right now

green oriole
gritty wind
#

How did this even make it into main

#

Tests are failing

#

Oh no, that's just github funkiness

#

Alright, tests are not failing

green oriole
#

Seems like __members__.values() is what we would want

gritty wind
#

I mean, I don't see any function that feeds user input into that

#

Why do we even need the check

tawdry vapor
#

It's a bogus check and I removed it

#

There were several problems with that function

gritty wind
#

Oh?

green oriole
#

Because uuuhhh better checking than not checking?

static canyon
#

@vale ibex fwiw I've gotten the bot down from 1.6k errors with mypy to 1,073

green oriole
#

I don't know, I am really sorry for all the time related code I wrote it is hot garbage

gritty wind
#

Ah

#

I don't think I've seen a PR before with that few lines changed have that many files changed

green oriole
#

The only thing I am still happy about is the use of the enum

fallen patrol
static canyon
green oriole
#

I don't think we are adding mypy

static canyon
#

bot#1773

dusky shoreBOT
green oriole
#

At least I am strongly opposed to it

#

Just the amount of type changes and additional checks would be pain

#

Maybe if we do a rewrite one day

#

!remind 10h Wrote your thoughts on the issue

stable mountainBOT
#
Alright.

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

trail pilot
#

Am I allowed to make a PR if I was assigned to an issue already?

trail pilot
#

And does the issue need to be fully done or can it just be at a playable stage (i'm doing a hangman issue and it is mainly complete)

static canyon
#

If it's not fully complete you can do a "Draft PR"

green oriole
#

Opening before being done is even better, using a draft PR

trail pilot
#

I think it is doing everything it should be doing, so I'll just send it as a PR

green oriole
#

You have to click the little drop-down next to the create pull request button

trail pilot
#

Though I didn't add the executioner version because I feel like that should be its own issue and separate from the overall game, it adds a bit too much

#

Not sure if I should though

#

The original issue creator wanted there to be a guesser/executioner, though executioner feels a bit too wide of a scope, so I don't know if I should add it

fallen patrol
#

you cannot make a pr without having at least one commit

#

if its not ready to be merged, mark the pr as a draft upon creation

fallen patrol
clever wraith
trail pilot
trail pilot
#

Flake8 is failing because of this, weird

gritty wind
#

Are you using poetry?

#

And do you have it installed globally (I.E somewhere on your path)

trail pilot
gritty wind
#

Yeah

#

You may be better off starting with the getting started guide

#

It’ll walk you through all the things you need to do

trail pilot
#

I used Docker though

#

So I presumed I didn't need poetry

gritty wind
#

Docker is fine for running

#

But for tests, or linting

#

You’ll kind of need to have poetry

#

You could do it on docker

#

But you’ll have to put in extra work

#

(Either install poetry inside docker, or run pre-commit skipping flake, and run flake manually)

#

You can use ‘SKIP=flake8 pre-commit’ to do the second approach

trail pilot
#

Thank you!

#

Yeah this keeps failing

#

Which is weird because flake8 locally does not show any errors

#

it just errors out from github actions

gritty wind
#

This isn’t flake

#

It’s precommit

trail pilot
#

Oh is it cause the fixing end of files failed

brazen charm
#

you're missing a newline at the end

gritty wind
trail pilot
#

That's it

gritty wind
#

No scrolling up?

trail pilot
gritty wind
#

The screenshot I replied to from earlier

brazen charm
trail pilot
#

Sorry for the stupid questions

dim pelican
#

Just to make sure, did you check out that setup and contributing guide? I followed it without understanding and eventually got poetry and pre-commit working

trail pilot
#

I just never installed poetry... oops

#

I thought it was a separate thing haha

#

Also what would you all think of a possible challenge command on sir lancebot that gets a random kata from codewars?

dim pelican
#

Maybe just to send a link to a specific Kyu level

fallen patrol
#

why do I not do that

fallen patrol
austere hornet
fallen patrol
#

yepppppp

#

found like 3 from this

#

it takes about 1 second longer to run flake8 with poetry run flake8

#

even if I'm already in the venv

brazen charm
#

You must have write perms to the repository

#

which would at least have to be a staff contrib

fallen patrol
clever wraith
#

So that's your dream rick?

fallen patrol
#

I presume only core devs get on the codeowners file

#

no, no it is not

#

thinking of disabling it for my repo

#

currently blocks too many of prs since it was added hastly

brazen charm
#

from the prs I open it just seems to make auto reviews and then mostly people out of those that were auto requested review

clever wraith
#

A dream come true

fallen patrol
#

I didn't say it was bad lol

#

i.. didn't say that either

#

I said no, in response to you saying "Being in CODEOWNERS is legendary"

trail pilot
fallen patrol
#

I have a question about the guild command

#

!guild

stable mountainBOT
#
Server Information

Created: <t:1483877013:R>
Voice region: europe
Features: PARTNERED, NEWS, VANITY_URL, PREVIEW_ENABLED, ANIMATED_ICON, BANNER, DISCOVERABLE, SEVEN_DAY_THREAD_ARCHIVE, RELAY_ENABLED, ROLE_ICONS, COMMUNITY, PRIVATE_THREADS, VIP_REGIONS, INVITE_SPLASH, THREE_DAY_THREAD_ARCHIVE, THREADS_ENABLED, WELCOME_SCREEN_ENABLED, MEMBER_VERIFICATION_GATE_ENABLED, NEW_THREAD_PERMISSIONS
Roles: 90
Member status: status_online 37,123 status_offline 211,457

Members: 248,580

Helpers: 124
Moderation Team: 32
Admins: 14
Owners: 3
Contributors: 43
Leads: 14

Channels: 237

Category: 32
News: 9
Staff: 59
Stage_Voice: 1
Text: 127
Voice: 9

fallen patrol
#

Channels: 237
can @stable mountain see all of the channels in the server?

sullen phoenix
#

yes, @stable mountain has administrative powers

#

@fallen patrol

fallen patrol
#

Huh, didn't know that

green oriole
#

You don't need admin to count every channel either way

fallen patrol
green oriole
#

Well I wish you'd need to read the channel to receive it, but I doubt it is changing anytime soon

fallen patrol
#

perhaps....

stable mountainBOT
green oriole
#

Eh

#

!remind 7h thusky

stable mountainBOT
#
Sure thing!

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

green oriole
#

I meant this but sure

patent pivot
#

hello, all deploys are off for now while I do a bunch of CI job migrations, expect a flurry of PRs

patent pivot
#

all the repo paths

#

yeah I'm on the train now