#dev-contrib

1 messages Β· Page 147 of 1

gritty wind
#

We do?

green oriole
#

I think it is part of our test suite actually

#

but yeah I had failing checks because of that

gritty wind
#

@molten perch I'm taking a short dinner break, so I've posted all my comments so far

#

One thing I didn't mention is the newline at the end of files

molten perch
#

Okay, thank you!

gritty wind
#

I've heard rumblings of a pre-commit config soon, so we'd probably need to get those fixed

#

If you have time, you could update them now, otherwise we'll just update them when we add pre-commit

molten perch
#

Actually, it was removed in the past. I don't know the reason though.
(api#18)

dusky shoreBOT
gritty wind
#

Yeah, it was rediscussed here afterwards

molten perch
#

Must have missed it :/

gritty wind
#

When ves has some more time, I'll figure out what happened and we'll go from there

dusky shoreBOT
gritty wind
#

@molten perch I'm running into functionality problems

#

Namely, sqlaclhemy is complaining because some of the tables have dependencies which need to be dropped to recreate the table, but they are not set to cascade

molten perch
#

Hmm.. I set the fields to cascade..

#

Which table(s)?

gritty wind
#

Hmm in that case, it's possible I messed something up while creating the new migration

#

It's uhh

#

I'll get the error in a pastebin

molten perch
#

Sure

#

btw. Did you create the migrations by yourself, or had alembic generate them?

gritty wind
#

Auto generated

#

I can share the change I made

#

constraint api_nominationentry_nomination_id_fkey on table api_nominationentry depends on table api_nomination

molten perch
#

Nomination_entry.. of course. The most problematic one. I'll take a look at it.

molten perch
#

I think, I see what the problem might be.

gritty wind
#

Yeah, so

#

I had to recreate it, I reset my environment lmao

#

(And all the changes that come with doing that)

molten perch
#

I see. Hopefully I fixed the problem, I'll try to delete nomination and generate a migration to check if everything works.

gritty wind
#

Btw I may or may not have discovered this by deleting all the models

#

It ain't pretty, but you'll find stuff like that

molten perch
#

I might have misconfigured the cascading a bit, I'll push a patch in no time. Sorry.

gritty wind
#

Don't apologize haha, it's all good

#

Thanks for sticking with me

molten perch
#

I modified the cascading, everything should be working properly, but I get
sqlalchemy.exc.NoReferencedTableError: Foreign key associated with column 'api_nominationentry.nomination_id' could not find table 'api_nomination' with which to generate a foreign key to target column 'id'
Even with the version you used to test.

gritty wind
#

Well, that’s the non-working migration

#

But yeah, I basically deleted everything

molten perch
gritty wind
#

What did you do?

molten perch
#

Deleted the nomination model, and ran an autogenerated revision πŸ˜„

gritty wind
#

Did you remove all the things that referenced it?

molten perch
#

Like.. what? πŸ˜„ I'm sort of lost here. πŸ˜„

gritty wind
#

If you deleted nomination.py, you'd also need to delete lines 27-31, and and line 37 of nomination_entry.py and line 8 of bot.__init__.py as they all either reference the table as a foreign key, or make imports directly from the python file

molten perch
#

Yeah, I deleted from the bot init

#

But..

#

-_-

#

Got it. Thank you.

#

For some reason, I thought everything will be solved in nomination entry...

molten perch
gritty wind
molten perch
#

It is not SQL actually. And when you generate them there is a comment "please adjust" so it's not a bad thing to modify them πŸ˜„

#

But, how?

gritty wind
#

It's fine to modify them, but I have a feeling if you just modified them in the migrations, they'll be missed in the future

#

Regardless, I'm trying to distill it down to the simplest method to get this running

#

It's a combination of a few things

#

Yeah, okay I give up on this

#

Just push your solution

molten perch
gritty wind
#

Well, don't you have to push those modified migrations to your PR?

#

Or is that on the ones that drop it

#

Because if that's the case, we can also just add the cascade on the creation, and then we won't have to worry about it when dropping in the future

molten perch
#

Well, I don't have to push new migrations. They're fine. Turns out that I did the cascading just fine, so it's OK.(But I'll do a final check on them later today jhust to make sure)

#

(And actually there's only one, an initial :D)

gritty wind
#

What I meant was if the auto-generated migrations refuse to correctly apply the cascades

#

We can manually add them into the initial migrations

#

That way if we go to drop them in the future, we can easily do so, without running into strange errors

molten perch
#

Okay, I'll reorganise those cascades and add them correctly.

molten perch
#

Okay, I figured out those cascading options, and pushed a new Initial migration! πŸŽ‰

dim pelican
#

RE: sir-lancebot#842, sorry for the messy commit history, had to do some merging. Right now I have the restructure template as a multi line comment to fill out and test with. @elder belfry sorry for the late ping, but if you want to keep chugging along we should all be on the same page thanks to @clever wraith

dusky shoreBOT
short snow
austere hornet
dusky shoreBOT
static canyon
#

@short snow RE sir-lancebot#919 it's resolved locally

#

Hence my comment before I marked as resolved

#

I still need to decide which suggestions I want to implement (only those of migration or also fixing up the commands).

Once I've decided and done everything that I want to I'll push it all.

short snow
#

even i did the same earlier

#

zig told me that's better ^

short snow
static canyon
#

Resolving just makes it easier for me to see what's still left to do 🀷

#

But I can see both sides

short snow
#

Yeah

trail pilot
#

Hey @thorny obsidian! Just a message for the record for a remainder about the review for sir-lancebot#910, you can review it whenever and when you’re free since we have a lot of time, I just figured I’d put this message out FTR

dusky shoreBOT
elder belfry
dim pelican
clever wraith
#

Please review bot#1889

dusky shoreBOT
cold island
#

On my to-do

vale ibex
#

IG one perf improvement could be to move setting message_url out of the inner loop

#

Since it's going to be the same within each match

clever wraith
#

Ty for resolving the conflicts chris

#

I'm at school and doin it from my phone sucks

#

So the goal of this PR is to still trigger filters even if there is a user login or password that is added to the url?

#

No

#

It's to stop URLs that contain blacklisted URLs but aren't necessarily bad from triggering the filter

vale ibex
clever wraith
#

Right

#

does it also support subdomains?

short snow
#

(what happened to your other account?)

clever wraith
#

Shoot

#

haha

vale ibex
#

I think subdomains will be in the path too

clever wraith
#

Yeah they'd be in the netloc or path

clever wraith
vale ibex
#

if we support subdomains properly, we don't need to do the in() hack with www.

short snow
#

ok alizee

clever wraith
#

Alright

vale ibex
#

Could just do an endswith check

clever wraith
#

We do have bot#1276 but I'm not sure that requires a whole new list

clever wraith
vale ibex
#

Yea, we don't need that new filter list

#

we can just do that by default

#

I think we can just do ```diff

  • if message_url in (f"www.{blacklisted_url}", blacklisted_url):
  • if message_url.endswith(blacklisted_url):
clever wraith
#

I believe that will be a boolean on the new filter system, but I may be wrong

clever wraith
vale ibex
#

Would it?

#

hmmm, it could

clever wraith
#

Lemme check

#

yep it will

vale ibex
#

Yea, seems non-trivial to fix properly

green oriole
#

that discussion made me switch back Thonk

clever wraith
green oriole
#

Can't we just strip the subdomain?

vale ibex
#

since there could be mutliple domains either end so we couldn't split on .

clever wraith
#

We'd have to to f".{blacklisted_url}" for endswith iirc

vale ibex
#

Yea, could do that

#

I think we can just do ```diff

  • if message_url in (f"www.{blacklisted_url}", blacklisted_url):
  • if message_url.endswith(f".{blacklisted_url}"):
molten perch
stable mountainBOT
#

bot/exts/filters/filtering.py line 484

# If there is a scheme in the url then `​.netloc`​ has what we want, otherwise its `​.path`​```
vale ibex
#

like this?

#

but then, that wouldn't work if they don't have a .

green oriole
#

individually, that is

vale ibex
#

would that work? since the blacklist could have a url like google.co.uk

#

so there would be 3 frags

clever wraith
#

I've got some stuff to do, I'll be back

vale ibex
#

so we could drop that when parsing the user input

#

but would need to do it for blacklisted_url

#

since a mod could add it with or without a scheme

clever wraith
vale ibex
#

We do it for both atm

#

no need to do it for the second one

clever wraith
#

Don't those sent without a scheme not trigger the regex?

vale ibex
#

No they don't

#
URL_RE = re.compile(r"(https?://[^\s]+)", flags=re.IGNORECASE)
#

there needs to be a http or https included

#

or it doesn't get filtered

clever wraith
#

I don't know anything about regexes

vale ibex
#

This means that it needs to start with https:// or http:// to be filtered

clever wraith
#

So if that needs to change, I won't be much help

green oriole
#

is it even called fragment

#

I think name is the right term

vale ibex
green oriole
#

that's my idea

vale ibex
#

so we'd add python to the blacklist?

green oriole
#

haha

vale ibex
#

πŸ˜‚

#

urls hard

clever wraith
vale ibex
#
#

can extract domains from the tlds

green oriole
#

but then python is still a problem

vale ibex
#

with this we could join hostname and tld

#

and it seperates sub domains

#
>>> ext = tldextract.extract('http://forums.bbc.co.uk')
>>> (ext.subdomain, ext.domain, ext.suffix)
('forums', 'bbc', 'co.uk')
green oriole
#

oh that's nice

#

we could do that

vale ibex
#

it looks like it works by making a sync request to a url to fetch all TLDs on import

green oriole
#

or just ban .co.uk because who thought that was a good idea

clever wraith
#
with open("dump/good.txt", "r") as f:
    Data = f.readlines()
    f.close()

with open("dump/bad.txt", "r") as f:
    content = f.readlines()

with open("dump/good.txt", "r+") as hit:
    d = hit.readlines()
    hit.seek(0)
    for i in d:
        if i != content:
            hit.write(i)
    hit.truncate()
green oriole
clever wraith
#

why does this thing deletes every stuff from the file

#

rather than only the matching content

#

😭

green oriole
clever wraith
#

i want it to delete only the matching content but it erases all the content of file

vale ibex
#

was struggling to follow along, since I'm also in a call

#

I wouldn't be against adding it as a dep

green oriole
#

I think it is used to update the file

vale ibex
#

Ah cool

green oriole
#
# extract callable that falls back to the included TLD snapshot, no live HTTP fetching
no_fetch_extract = tldextract.TLDExtract(suffix_list_urls=None)```
vale ibex
#

Ahh cool

#

Hey @clever wraith just as a summary of what we've talked about, ready for when you're back.

https://pypi.org/project/tldextract/ seems to do what we want with breaking up the domain and stripping the subdomains out, so this might be best to use in your open PR. πŸ˜„

cold island
#

Why do we want it in this PR?

clever wraith
#

Is the BSD license compatible with MIT?

green oriole
#

Please use suffix_list_urls=None so we don't pull a new cache every time

green oriole
clever wraith
#

Alright

vale ibex
#

The current impl wouldn't filter a blacklisted url if it has a subdomain

#

and trying to seperate sub-domains, domains and tlds ourselves would be hard, since we need a list of tlds

#

since tlds can be made up of multiple parts, and so can subdomains

#

maintaining one is

green oriole
#

is anyone even able to start the bot?

vale ibex
#

we're not interested in making a PR each month to update the list

green oriole
#

/healthcheck doesn't seem to be a thing on the latest site container

vale ibex
#

and why implement our own fetch and cache solution if a lib does it for us

green oriole
#

.co.uk isn't in there

vale ibex
#

.co.uk != .uk

green oriole
#

it is only actual first level

#

we want seemingly TLDs

vale ibex
clever wraith
#

@vale ibex where does tldextract get its list

green oriole
#

the official definition?

vale ibex
green oriole
#

something something root servers something something

vale ibex
#

Yea, there's quite a few second-level domains

clever wraith
#

Tldextract should work

fervent sage
clever wraith
#

I'll take a look at home

vale ibex
clever wraith
#

Wait what

fervent sage
green oriole
#

I mean that's what happened

vale ibex
#

ah alr lol

fervent sage
#

I mean someone did buy .co.uk and make it a tld

#

But it will be someone like verisign

vale ibex
#

Yea, that someone was the queen

#

she deals with all uk domains

fervent sage
#

But not verisign

green oriole
clever wraith
#

Lol

green oriole
#

it is actually so much simpler than it sounds

#

anyway, any idea why I cannot start the site?

#

well, start the bot that depends on the site /healthcheck endpoint

brazen charm
#

Did you update your config for the migration from subdomains

fervent sage
vale ibex
#
site_api:    &API    !JOIN [*DOMAIN, "/api"]
site_staff:  &STAFF  !JOIN [*DOMAIN, "/staff"]
green oriole
#

Well, that would probably be why haha

fervent sage
#

.co.uk isn't technically a tld either, it's just a public domain that people can have subdomains on

green oriole
#

pff it is my role to be pedantic like that alec

fervent sage
#

I'm the infrastructure nerd when Joe's away smh

green oriole
#

Dude I don't have 2€/domain to spare

green oriole
#

I can host my own nameservers, easy

vale ibex
#

Cloudflare for SaaS is sick

green oriole
#

guess it zorks

fervent sage
#

Cloudflare for SaaS is sick

green oriole
#

works, not zorks

vale ibex
#

finally managed to convince our devops guys to migrate to cloudflare properly

#

we still use godaddy dns

green oriole
#

hold on do we

vale ibex
#

we being my org

green oriole
#

ah

fervent sage
#

No

#

Lol

vale ibex
#

It's actually cheaper for us to move to cloudflare too

#

since we're being shafted by godaddy on domain renewals

fervent sage
#

I'm in my CF shirt rn dogekek

brisk brook
#

Do you ever change clothes?

fervent sage
#

Yes

patent pivot
#

i don't use their dns, but my organisation uses them to register domains

brisk brook
#

Anytime we talk CF you have it lmaooo

patent pivot
#

we pay a brand agency who registers our trademark under as many TLDs as they can

fervent sage
#

I just happen to be in my CF shirt at most times when people talk about cf

#

By coincidence lol

brisk brook
#

Literally the only thing in your wardrobe

patent pivot
#

i think they've registered about 400 domains in our name using our trademark

#

lol

fervent sage
#

I have 3 tech company shirts and they're all I wear

vale ibex
#

Do you eventually xfer renewals to CF?

patent pivot
#

nah, there isn't a point

vale ibex
#

We've got a few hundred in godaddy atm and renewals are hyper marked up

fervent sage
#

I need to be easily spottable for nerds

patent pivot
#

some of them don't even have DNS records, they literally just sit there and be registered

vale ibex
#

Ah lol

patent pivot
#

our rate hasn't changed with the brand agency so I guess they're footing whatever markup there is lol

vale ibex
#

we use them all, and we can get 2 orders of magnitude cheaper renewals by changing to CF domains

fervent sage
#

Isn't GoDaddy like the mother of toxic domain registrars

patent pivot
#

they're pretty bad

#

but they're enterprise

green oriole
#

How do I make this not awful?

patent pivot
#

they have enough funds to be a CA and operate several TLDs

#

not something feasible

clever wraith
patent pivot
#

we can't do this because we don't have host access

green oriole
#

Even if I do, it is still awful

patent pivot
#

well, we do, but I don't want to install software onto the host

green oriole
#

I kind of want to just slap a txt file

cold island
green oriole
#

because the links are so long you need to use line continuations

patent pivot
#

Note that this container is being run with a lot of privilege -- sharing the host's filesystem, pid and network namespaces, due to portions of the benchmark applying to the running host.
pass

cold island
#

Oh

patent pivot
#

we can't really change much of what it throws up

#

like

#

docker is managed by linode

cold island
#

Yeah I think what you have rn is good enough or separate the links like joe said

#

You can also stop the line before the link

#

So that the entire link is in its own line

patent pivot
#

oh wait

#

this is the wrong cluster

#

lmfoa

#

score is the same for pydis one

#

well, the 68% is, the actual categories are different

#

but i think that

#

posting a chart of vulns in a public channel

#

is not a great idea, lol

#

lol

#

i mean

#

nothing stands out to me looking at the output

dusky shoreBOT
molten perch
#

Actually, I am. It's just halted by another PR

#

However, if the Alembic PR gets merged, I might give more attention to the api. So I guess you can take it πŸ˜„

#

I did! πŸŽ‰

green oriole
#

OH I AM GONNA BE MAD FLAKE8

#

I mean it runs

#

lol

#

Will I really have to noqa this

vale ibex
green oriole
#

but it doesn't fail locally

vale ibex
#

oh wut

green oriole
#

I mean I can try

#

oh, I think I know what it is

#
akarys@mojito ~/P/pybot (filters/autoban) [1]> git merge origin/main --no-commit
Auto-merging bot/exts/moderation/infraction/_scheduler.py
Auto-merging bot/exts/filters/filtering.py
Automatic merge went well; stopped before committing as requested
akarys@mojito ~/P/pybot (filters/autoban|MERGING)> poetry run task lint
Check for merge conflicts................................................Passed
Check Toml...............................................................Passed
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
check blanket noqa.......................................................Passed
isort (python)...........................................................Passed
Flake8...................................................................Failed
- hook id: flake8
- exit code: 1

bot/exts/filters/filtering.py:378:33: F821 undefined name 'datetime'
#

That's a sneaky one

vale ibex
#

lol

green oriole
#

yup

#

haha

vale ibex
#

Mine's very imaginative ```powershell
PS C:\Users\Chris> whoami
desktop-fec9jn0\chris

green oriole
#

Wow

short snow
#

bot#1446 needs another staff/contrib approval, would appreciate a review :D

dusky shoreBOT
cold island
green oriole
gritty wind
#

Why is your branch out of date before the reviewing starts though lemon_pensive

vale ibex
#

@clever wraith what @molten perch is trying to say is that there's no point doing message_url = message_url.netloc or message_url.path

#

since we only match on urls with protocols, the thing we want to compare will always be in message_url.netloc

clever wraith
#

Oh

#

But hold on

vale ibex
#

We need to do blacklisted_url = blacklisted_url.netloc or blacklisted_url.path since blacklisted domains may not have protocols

clever wraith
#

Thats only on blacklisted, right?

vale ibex
#

Yea

#

but if we add tldextract, we won't have this at all anyway

#

since it'll do the splitting for us

austere hornet
green oriole
gritty wind
#

Lol

fallen patrol
#

hey would it be worth making an upstream pr to improve the mocks for dpy?

hoary anvil
#

dpy is unmaintained

#

so I doubt it would be accepted

fallen patrol
#

clarification: upstream is pydis/bot

hoary anvil
#

oops

fallen patrol
#

nah if you didn't understand other ppl would've thought the same

vale ibex
#

wdym upstream?

#

Are you forking our bot for something?

fallen patrol
#

i've taken the mocks for my own project, but improved on them to the point where I think they would be benefical to pydis as well

#

no, i only took the mocks

vale ibex
#

Ah right, then it's not really upstream

#

feel free to open an issue with your suggested improvements though

fallen patrol
#

well, i'm curious if they're worth it to pydis

#

what i've done is made it so eg: MockTextChannel.send() returns a MockMessage

fallen patrol
vale ibex
#

No idea how that impacts personally, as I haven't worked with our tests much

#

That's why I suggested raising an issue with your proposed improvements, so that others can comment

fallen patrol
#

ahhhhh i thought you said pr πŸ˜“

#

Well

#

Will make an issue later regardless

stable mountainBOT
#
Missing required argument

content

#
Command Help

!remind [mentions]... <expiration> <content>
Can also use: reminder, reminders, remindme

*Commands for managing your reminders.

The expiration duration of !remind new supports the following symbols for each unit of time: - years: Y, y, year, years - months: m, month, months - weeks: w, W, week, weeks - days: d, D, day, days - hours: H, h, hour, hours - minutes: M, minute, minutes - seconds: S, s, second, seconds

For example, to set a reminder that expires in 3 days and 1 minute, you can do !remind new 3d1M Do something.*

Subcommands:

!remind delete <id_>
Delete one of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> <content>
Set yourself a simple reminder.

stable mountainBOT
#
Yep.

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

fallen patrol
#

!remind 8H make issue to make content of replies optional and use message reference as content, in addition to replying to that instead

stable mountainBOT
#
No problem.

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

molten perch
#

Hey! Can I get reviews on api#23? πŸ€“ (It's all fixed up, should work fine)

trail bough
#

Hey guys
I want to suggest we daily have a topic to discuss so that we all know and have knowledge from each other

gritty wind
#

Ideas like that are better proposed in #community-meta. We used to have something like that previously, but it didn’t work out and we decommissioned it. Feel free to ask in meta if you want more details

brisk brook
#

I haven't reviewed in a while and I don't think Xithrius has requested my review for many more PRs. So which ones need review?

Other than DOrs3n's PR (I generally dislike ORMs quite a lot so I won't touch on that sorry).

I do have some PRs waiting in my notifications on GitHub that needs testing before approving but the only free time I have today and tomorrow morning is on my phone and maybe school laptop.. so I can do a code review

#

@austere hornet do you maybe want some pointers along the way on your PR?

austere hornet
brisk brook
#

Well you can send the important part of the code here, if you do want to send me the file give me 10 minutes or so to finish up my math homework and boot up my laptop

trail pilot
dusky shoreBOT
patent pivot
#

yea, we don't need it lol

#

not right now

#

don't see a major use for them

#

would rather filter outbound traffic tbqh

patent pivot
#

monzo style

#

lol

#

trust, as it gets deeper, it is not simple

#

it's simple to describe, hard to build

#

we'll probably go with some sort of egress proxy similar to how istio run it

#

we can get away with only supporting HTTP and SNI, and I don't expect our production traffic to move to ECH anytime soon

#

it's in that blog post

#

they inspect HTTP Host header for HTTP or SNI for HTTPS

#

and allow based on a set of rules

#

I think I'll build a Rust service that can HA on each of our nodes

#

need to figure out how to push traffic towards it though

#

One approach, used by Istio, is to run an egress proxy inside Kubernetes. This egress proxy would inspect the traffic sent to it, figure out the destination, determine whether the destination was allowed (given the source) and then pass it on. To determine destinations for encrypted traffic, it has to use the SNI (Server Name Indication) field for encrypted (TLS) traffic. For unencrypted web traffic β€” which is becoming increasingly rare β€” it can simply inspect the HTTP Host header.

#

yep

#

we'll run one proxy on each node

#

might even run 2 per node

#

with a topology key

#

uhh

#

i mean

#

it can be lol

#

but topology is also very much in computer science, and the word topology just means "how certain things are arranged"

#

so in our case, a topology key tells Kubernetes how to lay out pods on our nodes

#

if I use a topology key that has an antiAffinity to node names, then Kubernetes will try it's best never to run the application on the same node if we mark it for HA

dim pelican
#

sir-lancebot#842 is ready for you! Get some color / colour in your life

dusky shoreBOT
patent pivot
#

example is alertmanager: if we scale alertmanager kubernetes will place the new instance onto the node with the least alertmanager instances

stable mountainBOT
#

namespaces/monitoring/alerts/alertmanager/deployment.yaml lines 17 to 30

affinity:
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - podAffinityTerm:
        labelSelector:
          matchExpressions:
          - key: app
            operator: In
            values:
            - alertmanager
        namespaces:
        - monitoring
        topologyKey: kubernetes.io/hostname
      weight: 100```
patent pivot
#

our alertmanager config is probably the most complex thing we've got in the cluster

#

I think DNS hijack is prooooobably the easiest way to configure the proxies

short snow
trail pilot
stable mountainBOT
stable mountainBOT
fallen patrol
dusky shoreBOT
static canyon
#

I'm very confused as to why the tests on bot#1901 are failing. From running the test it seems I need to change'0.65 0.64 242' to '0.63 0.48 218' but I don't understand why or what these values repressent

dusky shoreBOT
rapid igloo
#

It seems that they are HSL color values, '0.65 0.64 242' looks like the og_blurple color and the other one looks like the rebranded blurple

short snow
#

@static canyon we can use ctx.invoked_command to get the alias/command which was sued

rapid igloo
#

I don't think that would include the subcommand (or the parent command, forgot which)

short snow
#

that's just the parent command IIRC

#

which is what we need

rapid igloo
#

are you talking about hackstats link?

short snow
rapid igloo
#

oh right ok

clever wraith
#

So did the autoban feature work or we broke everything hehe

#

I don't see any fix PR, that's a good first sign

static canyon
clever wraith
#

So sad

static canyon
#

You could always send yourself to test it :p

clever wraith
#

Haha

static canyon
#

Wouldn't recommend though lol

clever wraith
#

I could use our alt, since it won't ping

static canyon
static canyon
#

And I can unban

clever wraith
#

My alt already has like ten infractions, half of them being kicks lol

#

It may be already banned though

static canyon
clever wraith
#

Aw, I don't have access to the test server so I can't give you the ID

#

I need to get that invite

#

The account is named Ishiro with a the weeknd profile picture, could you check it isn't banned?

static canyon
#

What's the account name#discrim and I can get (send in DMs if you don't want to share publicly)

clever wraith
#

No idea what the discrim is

static canyon
#

Ishiro isn't in the test server

clever wraith
#

Guess I yeeted it during my last testing

static canyon
gentle harness
#

Yus

clever wraith
#

So it did work if y'all are curious

rapid igloo
#

:o shouldnt the PR already be tested?

clever wraith
#

Well it has been tested locally but not in prod yet

short snow
#

how many alts do you have akarys πŸ‘€

clever wraith
#

Only one

#

That account is not an alt

short snow
#

hmm

molten perch
#

feel free to break api#23 as well πŸ€“

molten perch
#

I found a way to fix it. πŸ˜„ (partial solution :/ )

clever wraith
#

@clever wraith I guess it would require patching the command rather that the code to ask for a confirmation instead, I don't know which monkey patch is the worse

#

I feel like patching annotations is a bit dodgy though

#

Also yeah I was thinking of a simple ❌/βœ… modal, asking to run ?close 0s sounds unintuivive

#

I would even say we should ask for that confirmation for any close, since it happens we just run close when meaning to run another command

clever wraith
#

man, I discovered that running command.update borks the command when it's a part of a cog, not the most fun

#

Heh

clever wraith
clever wraith
reef tinsel
#

Hi! I just updated my copy of Bot to the latest, which including moving discord.py to v2

It is now having this error (ImportError: cannot import name 'Thread' from 'discord' (/usr/local/lib/python3.9/site-packages/discord/__init__.py)) when starting, and exiting straight away:

https://paste.pythondiscord.com/gusamahata.sql

This is happening in random cogs each time, presumably the first one trying to import this.

Could someone help?

vale ibex
#

Do you run using docker?

reef tinsel
#

yes - running docker-compose up to start

vale ibex
#

great, you'll need to do docker-compose build first

reef tinsel
#

aah

vale ibex
#

this rebuilds the image with the updated dependancies

reef tinsel
#

makes sense

vale ibex
#

Actually, there are also some site changes, so I suggest you do docker-compose pull too

#

then docker-compose up

reef tinsel
#

πŸ‘

short snow
#

@dim pelican You should resolve the requested changes after you push them

vale ibex
#

Also, for those site changes you will need to update your confil.yml file too @reef tinsel

dim pelican
short snow
#

Yeah that's perfectly fine, no hurrries

#

you can take your time

vale ibex
#

Under the urls section, set site_api to site_api: &API !JOIN [*DOMAIN, "/api"] and site_staff to site_staff: &STAFF !JOIN [*DOMAIN, "/staff"]

short snow
#

just remember next time πŸ‘

#

Doesn't the new contrib guide cover this? (chris)

vale ibex
reef tinsel
#

thx chris - bot working now! the patreon additions should come by the end of half term!

vale ibex
#

Nice πŸ˜„

fervent sage
#

scottish half term just ended Kek

reef tinsel
#

regarding bot#1765

with the monthly post, should we send the tier 1 supporters first, or the tier 3 first. (we decided on a seperate message for each one here: #dev-contrib message)

Discord

Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

dusky shoreBOT
reef tinsel
#

half term started at 12:00 last thusday (it actually started 10 mins early lol) and finishes on sunday this term

#

(just for my school, other schools ear here do different things)

short snow
#

Mine finished on this sunday πŸ˜„

static canyon
#

That way it's sequential but also the tier 3 will be the last seen when the messages "move up" from other activity

reef tinsel
#

ok

#

i was defaulting to tier 1 first, just asked to get a sense of what other people wanted πŸ™‚

short snow
#

@clever wraith I just went ahead and tried out the functionality, yours thoughts on this.

Its how the leaderboard will interact the core leaderabord functionality

#

and could i get assigned to the issue

clever wraith
#

That looks good, I'd just rename that function to increment_points rather than change

short snow
#

ah wait, that could isn't fully updated

#

the funciton name is right

#

it would be like this

#

lambda before: before + 10 instead of 10

clever wraith
#

Well, I would say we should have an increment utility function, for clarity sake

#

I don't think we will need to do any other operation anyway

#

Also beware that you have a potential race condition there, I wonder if we could solve this using a Redis transaction

short snow
#

yeah, its not final, i doesn't even check if a cache alrady exists and just forms a new one rn

clever wraith
#

Okay, cool

short snow
#

and that to_dict is just for debug, i am removing it

clever wraith
#

Don't forget to also add a maximum of points earned per (user, game, day)

#

Morning all

#

I'll be doing some work on bot#1889 after school, otherwise Ill be busy today

dusky shoreBOT
short snow
clever wraith
#

Per game I'd say, so you must play different things and cannot just spam .quiz alone

short snow
#

Right, would you like to have another cache for that, or should i merge it with the main one (per day leaderboard)

clever wraith
#

I would say another leaderboard

short snow
#

πŸ‘ kk

rapid igloo
vale ibex
#

Yea, agreed. We're changing direction with that PR anyway, due to sub domains see #dev-contrib message

rapid igloo
vale ibex
#

Yea

rapid igloo
#

πŸ‘ tldextract probably handles the scheme thing so that's good

vale ibex
#

Yup πŸ˜„

rapid igloo
vale ibex
#

you can have sub-sub domains

#

and tlds can have multiple parts

#

so there isn't a reliable way to get the actual domain without a full list of tlds

rapid igloo
#

so if google.com is blacklisted, we want web.www.google.com to match? or is it the other way round like www.google.com blacklisted and wanting google.com to match?

clever wraith
#

I'm sure the BBC is trying to be a pain on purpose

vale ibex
#

Yea, in the blacklist we have domains+tlds

#

and we want to match all sub domains

clever wraith
#

www should be stripped in my opinion, it should be counted as if it was the root domain

rapid igloo
vale ibex
#

Yea

#

but we don't want to block google domain directly, ignoring the tld

#

so we want to make sure the domains match exactly, and the tlds match exactly, and ignore any subdomains when matching

steady junco
#

It's been a week I think when I opened my issue and I got no comment till now
Is this common πŸ€”?

steady junco
#

.src

steady junco
static canyon
#

Have made a request internally for someone to take a look πŸ‘

#

Give it a few more days

rapid igloo
vale ibex
#

It is enough, there just isn't a reliable way to extract hostnames for all cases without a list of tlds

reef tinsel
#

does anyone have any idea as to why this is happenning? (code snippets coming shortly, depending on how my internet/computer play ball πŸ™‚ )

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
    ret = await coro(*args, **kwargs)
  File "/bot/bot/exts/info/patreon.py", line 170, in current_supporters_command
    await self.send_current_supporters(ctx.channel)
  File "/bot/bot/exts/info/patreon.py", line 108, in send_current_supporters
    embed.add_field(actual_tier_1_members[0]) #.mention
TypeError: add_field() takes 1 positional argument but 2 were given
vale ibex
#

add_field() requires you to use named args

#

not positional

#

add_field(name="foo", value="bar")

reef tinsel
#

aah

#

got quite a few to change then, as i Have about 7 of these in this code atm πŸ˜‰

#

good thing is i can copy paste

#

i assume that name is the title of the field

#

having done a quick test, it is

#

and it cannot be an empty string

#

how should I do the lists of members for the patreon (bot#1765) - I was planning on doing basically this: embed.add_field(value = member.mention) @vale ibex ?

dusky shoreBOT
brisk brook
#

Just format something pretty in the description no?

vale ibex
#

You could just do ```py
embed = discord.Embed(
title="Tier 1 patrons",
description="\n".join(tier1_patrons)
)

#

Since we're going with 3 embeds

reef tinsel
#

that could work, guess i'd still overflow into a second emebd if limits got hit?

static canyon
vale ibex
#

I don't think we need to worry about that, since we're having each tier in it's own embed

#

and each embed description can support 4096 chars

#

!e print(4096//37)

stable mountainBOT
#

@vale ibex :white_check_mark: Your eval job has completed with return code 0.

110
vale ibex
#

so we could support ~100 patrons in each tier with just 1 embed

reef tinsel
#

were those messages referring to me or tizzy chris?

vale ibex
#

you

reef tinsel
#

ok

#

so i include handling for over 110 patrons or assume that it will never happen?

vale ibex
#

nah I wouldn't bother for now

reef tinsel
#

ok

vale ibex
#

since it's not over 110 patrons, it's over 110 in a single tier

reef tinsel
#

so if it does get to that point (or close) we can upgrade from there πŸ™‚

#

yes

#

i agree it is unlikely that it will happen πŸ™‚

static canyon
# vale ibex nah I wouldn't bother for now

Would it be worth just doingpy if len(tier_members) > 110: log.warning("Tier {x} has more than 110 members. May fail to generate embed due to character length.")or something?

vale ibex
#

ehh it's technically not 110

#

@vale ibex

#

!raw 902579684552871947

stable mountainBOT
#
== Raw message ==

@vale ibex
vale ibex
#

so it's an id(20 chars) +4

#

so 24 per name, plus one for a new line

#

!e print(4096//25)

stable mountainBOT
#

@vale ibex :white_check_mark: Your eval job has completed with return code 0.

163
vale ibex
#

20 is worst case too

#

we're at 18/19 atm

brisk brook
#

Don't we want to include the name?

vale ibex
#

we're gonna do a mention

brisk brook
#

That doesn't actually ping the user or send a mentions objects, meaning that for mobile client they will all render as "invalid-user"

reef tinsel
#

goood point

vale ibex
#

we don't want it to ping

reef tinsel
#

but the rendering point is a problem

vale ibex
#

and for the latter we don't have a better solution unless we do both

#

which isn't great either

reef tinsel
#

we could do the mention, and if we get too many complaints change it?

brisk brook
vale ibex
#

I meant on a pure looks point of view, including both the name and mention would look overkill for anyone who isn't on mobile, and may have a similar number of questions raised about it

#

but I guess I'm also biased since I never use mobile Discord, due to these issues and more

reef tinsel
#

i will do the mentions only for now, send screenshots of it on desktop, ipad and android phone (the 3 devices I have :-)), and we can decide

#

whats best

#

sorry for the cut off

brisk brook
#

Chrisjl#2655 (@vale ibex)

#

That looks alright- no?

reef tinsel
#

id say it looks fine, even without having had the mobile problems

#

does anyone have any idea as to why guild.get_role(ROLE).members is returning [], even though it clearly has a member (me)?

#

i can confirm that ROLE is a valid role, as the exact same variable is working elsewhere

cold island
#

Uuuh I think it's an intent thing

#

You're working on sir lance?

reef tinsel
#

nope, bot

cold island
#

Did you turn on intents for your bot?

reef tinsel
#

bot has the members intent enable in the portal

cold island
#

hmm

#

Is this called inside some command?

reef tinsel
#

i also assume that they are enabled in the mains script

cold island
#

Or while a cog is initializing

reef tinsel
#

it is inside a function called by a command function (currently useless, but for a reason)

cold island
#

What do you get when you do guild.members?

reef tinsel
#

it is returning an empty list (it should be 2 members - myself and my copy of bot)

thorny obsidian
brisk brook
#

Oh?

#

It's too duplicated- or?

thorny obsidian
#

The name#disc just doesn't look that nice and the (mention) doesn't either. Either it should be the mention or just the name.

cold island
#

We do the opposite in other parts of the bot, like @cold island (mbaruh#0278)

reef tinsel
green oriole
#

Mention in embeds make mobile users feel very bad about themselves

cold island
fallen patrol
#

bot#1911 @vale ibex πŸ™ƒ

dusky shoreBOT
fallen patrol
#

Ye the point was I made it and I think I linked to the correct discussion

static canyon
#

And then we'd need to figure out what the worst-case for reaching embed description char limit for the warning

molten perch
#

Wow. Would love to see them on api#23 lemon_fingerguns_shades

green oriole
#

Huh, interesting choice with purple closed

#

I guess we should start to use those tags more often CC @vocal wolf

reef tinsel
reef tinsel
brisk brook
#

But that's because you're testing with yourself and bot

reef tinsel
#

Aah, does it work well with myself?

brisk brook
#

Well that's you, and the bot should also be in cache

reef tinsel
#

Aah, so if I’m not in cache thats when the problems happen?

reef tinsel
#

How do I remove myself from cache lol

#

(Ik i can’t)

#

(Probably)

static canyon
#

I suppose this also means the icons for @dusky shore linking github issues/prs should be updated

green oriole
vocal wolf
green oriole
#

I think we should be using them more though, especially won't fix

#

They have relevance now

vocal wolf
#

Alright, but they already don't happen that often. Usually there's something to fix, and duplicates are very rare.

green oriole
#

I was thinking about issues we do close without submitting a PR, I think that's how the new branding is designed, you want the icon to be purple if you have a PR that fixed it, otherwise just gray?

vocal wolf
#

I guess

green oriole
#

Oh, it isn't a thing right now

#

That was just an example they need to figure out the details of those different closed states

#

Cool

green oriole
#

@vale ibex we said we didn't want to store that in Redis lul

reef tinsel
#

bot#1765

dusky shoreBOT
reef tinsel
#

does this look good?

green oriole
#

I think that looks decent, although I would add some wording on why Patreon is relevant for us and stuff like that

dim pelican
#

Ahhhh light mode! My eyes! ||\s|| But I agree that it looks pretty good

reef tinsel
green oriole
vale ibex
#

That's not what I've stored in redis

#

I used redis to store the IDs of the messages you have bookmarked

#

so you can't bookmark the same message twice accidentally

green oriole
vale ibex
#

sir-lancebot#826

dusky shoreBOT
green oriole
#

Aah

reef tinsel
vale ibex
#

This is what we say on our actual patreon page ```
We'd like to be able to offer excellent prizes for all of our events. Stuff like t-shirts, stickers, microcontrollers that support CircuitPython, or maybe even a mechanical keyboard. We believe that this would help motivate more people to participate in our events, and we believe these events are a great way to learn how to work in teams with strangers, learn about source control, and just generally get out of your comfort zone and learn something new.

While we rely on sponsorships to cover things like hosting, we will need actual hard cash if we're going to be able to pay for these prizes. But let me make this clear: We are non-profit. 100% of our earnings will be put towards improving the community in one way or another.

stable mountainBOT
#

Patreon supporters
Here is a full list of this months Python Discord patrons!

We use the money from Patreon to offer excellent prizes for all of our events. Stuff like t-shirts, stickers, microcontrollers that support CircuitPython, or maybe even a mechanical keyboard. We believe these events are a great way to learn how to work in teams with strangers, learn about source control, and just generally get out of your comfort zone and learn something new.

You can also support us on Patreon here!

vale ibex
#

seems a bit too wordy

reef tinsel
#

yeah

green oriole
#

That text could 100% use an update

vale ibex
#

!embed Patreon supporters
Here is a full list of this months Python Discord patrons!

We use the money from Patreon to offer excellent prizes for all of our events. Stuff like t-shirts, stickers, microcontrollers that support CircuitPython, or maybe even a mechanical keyboard.

You can read more about how Patreon supports us, or even support us yourself, on our Patreon page here!

stable mountainBOT
#

Patreon supporters
Here is a full list of this months Python Discord patrons!

We use the money from Patreon to offer excellent prizes for all of our events. Stuff like t-shirts, stickers, microcontrollers that support CircuitPython, or maybe even a mechanical keyboard.

You can read more about how Patreon supports us, or even support us yourself, on our Patreon page here!

vale ibex
#

That seems a bit better

reef tinsel
#

πŸ‘

#

hmmm, now to fit that into the line length limit πŸ™‚

green oriole
#

Did we ever buy someone a keyboard lol

austere hornet
#

Lol

reef tinsel
#

lol

vale ibex
#

I think a laptop at one point too

green oriole
#

Wow

vocal wolf
# vale ibex I think a laptop at one point too

Someone did a codejam entirely on their phone and won 2nd or 3rd place, so we asked the other winners if they wanted to accumulate their prizes into a laptop for the guy, eventually sent one out.

vale ibex
#

Yup πŸ˜„

#

iirc lemon put a decent amount of his own money down on it too

green oriole
#

haha, that's awesome

#

didn't hear about that one anywhere

austere hornet
#

Was it this year or in previous years?

vocal wolf
austere hornet
cold island
#

Do we have a datetime -> Discord timestamp command? should I just make one?

#

I see there's an issue

austere hornet
#

Hi, I'm having some weird issue with isort. I pip installed it and ran isort . in the project root (sir-lancebot\bot) but I'm still getting this error? What should I do?

cold island
#

I'd just use a full path rather than relative

#

Although it's an interesting problem

austere hornet
#

Still getting same error

cold island
#

Well it looks like you still have a relative import

austere hornet
#

Wdym by "relative import"?

green oriole
#

you need to run poetry install --remove-untracked @austere hornet

austere hornet
#

Ohh

#

Ok

#

Finally

#

Tysm

#

@green oriole and @cold island

short snow
#

How do you clear the buttons of a discord ui View once the interaction is complete?

patent pivot
#

I have some code in KA which does that

#

uhhh

stable mountainBOT
#

arthur/exts/cloudflare/zones.py lines 22 to 24

def disable_select(self) -> None:
    """Disable the select button."""
    self.children[0].disabled = True```
patent pivot
stable mountainBOT
#

arthur/exts/cloudflare/zones.py lines 52 to 54

self.disable_select()

await interaction.message.edit(view=self)```
short snow
#

πŸ‘ Thanks

short snow
#

πŸŽ‰

#

Could I get hacktoberfest accepted label on that PR?

patent pivot
stable barn
#

how can i dev contribute?

rapid igloo
#

!contribute

stable mountainBOT
#

Contribute to Python Discord's Open Source Projects
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!

Projects to Contribute to
β€’ Sir Lancebot - our fun, beginner-friendly bot
β€’ Python - our utility & moderation bot
β€’ Site - resources, guides, and more

Where to start

  1. Read our contributing guidelines
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
fallen patrol
#

@static canyon which project had coveralls cut?

short snow
#

Looks like GitHub changed their icons again

#

someone is doing a lot of ducky_bike

fallen patrol
#

when coveralls was down it was removed from a project

#

which project was that

static canyon
#

Oh wait you mean that

#

I know what you mean

#

If you look at git history of the file it'll show

#

bot#1838

dusky shoreBOT
fallen patrol
#

thanks!

#

!close

#

...

rapid igloo
#

lmao

fallen patrol
#

im gonna go sleep now cya

static canyon
#

lol

stable mountainBOT
#
Absolutely!

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

short snow
fallen patrol
#

shh

vale ibex
#

There's a synchronous .stop() method on the view of you are worried about hanging callback listeners

short snow
#

#bot-commands message why isn't this working?

vale ibex
#

There's a 2000 char and 15 line limit

short snow
#

Oh, it should post a message then ig

vale ibex
stable mountainBOT
#

bot/exts/info/code_snippets.py line 252

if 0 < len(message_to_send) <= 2000 and message_to_send.count('\n') <= 15:```
short snow
#

Ok, want me to open a quick PR?

static canyon
#

I wouldn't want it to stay

short snow
#

yeah

static canyon
#

3 seconds should be enough for the message author to understand why it didn't link

#

Maybe 5 tops depending on the length of the message

short snow
#

Is it possible to send those ephemeral messages without views? Like those system messages

static canyon
#

I'd also invert the if statement

short snow
#

yeah reduce one indentation

static canyon
#

Mhm

short snow
#

lemme see how its implemented in views

static canyon
gritty wind
#

You can send it as a regular user message

#

but not a system message

#

Would undermine the whole system part of that

short snow
#

Yeah even I don;t think, but just now i got those invite people notification in the channel list and saw the ephemeral message. So thought about that

vale ibex
#

afaik ephemeral messages can only be sent in response to an interaction

gritty wind
#

Yeah

static canyon
short snow
#

Hmm yeah, interactions without any UI component could be used though?

fervent sage
#

the point of an interaction is that its user generated by interacting (hence the name) with a ui component

short snow
#

Ah yeah

clever wraith
#

@gritty wind how long were the reminders you talked about?

gritty wind
#

7D1M

#

That's the latest one

#

But it varies

#

I also had one that was a year

#

let me look

clever wraith
#

That's interesting

#

!source remind

stable mountainBOT
#
Command: remind

Commands for managing your reminders.

Source Code
gritty wind
#

24H

#

And one that was 10H but literally disappeared as soon as I made it

#

I tried to cancel it right after

clever wraith
#

Huh, how weird

#

Did you check those two reminders got actually inserted?

gritty wind
#

How would I do that though

clever wraith
#

Metabase

#

Lemme check something

gritty wind
#

Not sure what you mean

#

I can check the DB itself, but the object is deleted

#

By the time I know a problem exists, it's too late

clever wraith
#

I mean after you created the reminders, did you checked they got inserted?

gritty wind
#

No, it doesn't seem reasonable to check after all my reminders πŸ˜…

#

It's why I'm making these changes

vale ibex
#

I propose we make use of the active flag

gritty wind
#

So we can check later on

#

yeah see

clever wraith
#

Because we do not check the return code when performing a POST on the site, so for all we know the site may be erroring and we are dropping that silently

gritty wind
#

bot#1915

dusky shoreBOT
gritty wind
#

16 not 15

#

I'm testing it and then pushing

vale ibex
#

cool

gritty wind
#

Well, doesn't the api wrapper throw an error on bot if the api errors

#

Yeah, it does

#

I know as much because I'm currently erroring on my test bot

#

For unrelated reasons

clever wraith
#

Don't you have to pass raise_for_error=True or something like that?

stable mountainBOT
#

bot/api.py line 79

async def get(self, endpoint: str, *, raise_for_status: bool = True, **kwargs) -> dict:```
clever wraith
#

Oh cool

gritty wind
#

I suppose I haven't checked for that error

#

I only looked at logs for the delivery time

#

Maybe it's being swallowed up by sentry

#

Hmm no, the command error handler would handle this I think

#

And also I got confirmation receipts

clever wraith
#

Maybe check the site sentry too?

gritty wind
#

Nothing there

gritty wind
#

Still haven't managed to test things because it took ages to get metricity running

clever wraith
#

What PR is this for, out of curiosity?

gritty wind
#

bot#1916

dusky shoreBOT
gritty wind
#

It's not directly related, I just need to have metricity running to make reminders work

#

That's my local build script because building metricity is honestly a PITA

#

At least if I want to use my API's DB, which... why would I want anything else

#

yet still, it refuses to coperate

#

Why is metricity not adding my user to the DB

#

Misconfigured guild it would seem

clever wraith
#

You need metricity for that, huh

gritty wind
#

The API request has a user FK, the bot will try to set it to my actual user ID

#

It's why I wanted metricity in bot, you do actually need it if you're working with bot directly

#

I mean, the API is still complaining, but at least the user exists now

vale ibex
#

Do you run everything in docker scale?

#

or some stuff locally

gritty wind
#

Yeah

#

Well, just the bot locally

vale ibex
#

you can set USE_METRICTY=true in your .env

#

and it will run metricity

gritty wind
#

Right, I'm running metricity from a separate docker container, because I do mess around with metricity as well

#

It's why I have site in a separate compose too

#

It's not the "normal" workflow, so it's just me complaining. If it was, I would've gotten it fixed 🀑

vale ibex
#

because you don't want to pull latest, but locally build?

gritty wind
#

The build script does pull latest, just sometimes I want to make modifications to metricity directly, which means running it manually as well

#

Right now I don't have any changes

vale ibex
#

you cna just change the image name to the name of the local image in the bot's compose

#

rather than messing with different compose files

gritty wind
#

I see

#

Does the API use a different non-metricity user DB

#

If so, why, and WHYYYYYY

#

and why is my user not in it yet

#

Yeah, no data in that DB

#

Now how do I populaet it

#

sync?

vale ibex
#

yea, there are two DBs pysite and metricity

#

Yea

#

!help sync

stable mountainBOT
#
Command Help

!sync
Run synchronizations between the bot and site manually.

Subcommands:

!sync roles
Manually synchronise the guild's roles with the roles on the site.
!sync users
Manually synchronise the guild's users with the users on the site.

gritty wind
#

Why do we have two user DBs

vale ibex
#

since this is the name of my site image

vale ibex
gritty wind
#

not DBs, tables bleh

vale ibex
#

in metricity?

gritty wind
#

Like we could definitely just have metricity and site write to the same DB when it comes to users

cold island
#

One in metricity and one in site

vale ibex
#

Ah right, yea

gritty wind
#

Right, there is nothing stopping us from accessing one from both apps and halve the size of the DB(s)

vale ibex
#

You can't do queries across dbs

gritty wind
#

We can connect multiple DBs

#

Also funny thing

#

Sync passed and there are 0 users in table :)

vale ibex
#

so if the users table was in pysite, metricity wouldn't have access to it sql side

gritty wind
#

I mean like we can query either DB from either app

#

So two conns

cold island
#

Wdym

gritty wind
#

Joining user table on metricity, and on site

cold island
#

Metricity doesn't query pysite

vale ibex
#

what scale is suggesting is that we only have 1 users table right?

gritty wind
#

Right, I know, but there is nothing stopping us from making it do that

cold island
#

There is

gritty wind
#

It's a table with > like a million entries at this point 🀑

cold island
#

Metricity isn't used just here

vale ibex
#

If the users table was in pysite, you couldn't run a query for all metricity messages from a user sql side

#

you'd need to pull all messages, then all users from the two db and then do the filter in python

gritty wind
#

METRICITY_URI
USERS_URI

Set them to the same thing if you want to use it for your own purposes lol

gritty wind
vale ibex
#

That's just one example, but yea there's more use cases that would block it

vale ibex
cold island
gritty wind
#

It is, but the metricity DB is unrelated apaprently

#

It's the site DB

#

Metricity one is populated fine

cold island
#

oh

gritty wind
#

Site is connected to postgres

vale ibex
#

oh, site api isn't populated on sync

#

that's populated when users get infracted iirc

cold island
#

Hmm that doesn't sound right

vale ibex
#

oh wait now, there's two syncers

#

the sync cog does talk to pysite

#

metricity has it's own sync

gritty wind
#

I ran !sync roles and !sync users after

#

It worked after syncing users again

#

And finally, reminders are working 🀑

#

When deleting reminders (!remind delete) do we want to keep them in DB but deactivate, or do we want to remove them

cold island
dim pelican
#

sir-lancebot#842 is ready for testing and reviews

dusky shoreBOT
dim pelican
#

Yeah, I was using ctx.invoked_subcommand instead of ctx.invoked_with trying to get the "mode" that it used

#

Now it shows in the embed what the user called it with

dim pelican
trail pilot
# dim pelican

This looks really cool! One thing - could you capitalize Rgb to RGB and maybe add some sort of emphasization for the color name, like RGB information for Storm Dust or RGB information for Storm Dust

dim pelican
#

Sure thing, won't be able to test until the end of the day though (unless someone has sir-lance set up and can use gh pr checkout 842)

austere hornet
dim pelican
#

Its been a wild ride for sure. My first try was a mess lol

austere hornet
austere hornet
#

I've messed up a bunch too so

#

We're all in this together lol

dim pelican
#

Oh the best part is that the color command will be like my 3rd (?) contrib to sir-lance

vocal prairie
# dim pelican

Out of curiosity, why do you have the NAME in a code block? I feel like since it's just plain text, it doesn't need to be that way.

#

But if it looks better, of course

dim pelican
#

I could add an if to exclude the name value

#

Now I'm trying to remember what I've done for sir-lance...
Realpython, Teapot, WTF Python and I guess Color now

short snow
#

go to Pull requests tab on github

#

and seee

dim pelican
#

Yeah that's where I remembered Teapot lol. Just gotta set is:closed author:brad90four

short snow
#

I have got 149 total PRs πŸ‘€ - though some are test PRs

clever wraith
#

Heh, 185

short snow
#

Ok someone has 300, guess

clever wraith
#

My guess would be Sebastiaan

short snow
#

I didn't see his, it was joe

vale ibex
#

my public ones are at 234

reef tinsel