#dev-contrib

1 messages Β· Page 116 of 1

green oriole
#

I am being dumb

sharp timber
#

To filter out permanent I need to do expires_at__isnull=False

green oriole
#

Sounds about right

sharp timber
#

So, what I have now is those new filters

#

and I'm using them in reschedule_infractions, and then if I get infractions back:

  • I schedule them if they aren't already scheduled
  • I schedule another reschedule_infractions when the longest one would expire
    if I don't, it ends there
#

filters active: True, permanent: False, and matching types

#

I'll commit to a branch in the fork as soon as I figure out how to get tests written for this

green oriole
#

You can work on the upstream

sharp timber
#

It's completely possible to time-limit it too but that felt like a lot

#

Tests successful on site

#

Time to open a PR

#

and learn where I screwed up :P

sleek steppe
#

for https://quackstack.pythondiscord.com/details/{type}, you give an invalid type, shouldn't it give a 400 response code instead of a 200? Also, should /details be a valid endpoint as well?

short snow
#

Yeah that can be done βœ…, I can try to do tomorrow in 12h

fervent sage
#

@mellow hare re: bot#1605 you can right click a user and select the Move To button, then you dont have to drag and scroll

dusky shoreBOT
patent pivot
#

yeah, that works on desktop and mobile

sleek steppe
short snow
#

Sure

#

Anyways I am ahead of vco

sleek steppe
#

haha, nice

fallen patrol
#

why does @stable mountain and @dusky shore not use relative imports for everything?

#

specifically from bot.x.y import z where it could be from .x.y import z

sleek steppe
#

That is used in some places

#

I think that from ...x.y import z looks worse than from bot.x.y import z

vale ibex
#

!zen 1

stable mountainBOT
#
The Zen of Python (line 1):

Explicit is better than implicit.

vale ibex
#

having the extra context that's it's from bot is worth the extra 3 chars

fervent sage
#

@sleek steppe im already working on the details ep

sleek steppe
#

oh blob_pain

fervent sage
#

there's more than just a missing 400 too lol

patent pivot
#

I prefer absolute imports as opposed to relative

patent pivot
#

we don't have a complex packaging layout, and so I think it makes sense to follow flake8 here and use absolute imports

sleek steppe
#

@fervent sage we're in 3.9 now use list instead of List mmLul

#

πŸ€”

> poetry run task start-dev
ERROR:    [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
fervent sage
#

where did 3.9 go

sleek steppe
#

lol you have 3.11 but not 3.9?

fervent sage
#

thing is

#

i do have 3.9

sleek steppe
#

maybe it's vscode being vscode

fervent sage
#

shit i didnt pull before committing now my git stuff is gonna look horrid again pensivewobble

#

oh well

fallen patrol
#

Upper right of that dialog

fallen patrol
vale ibex
patent pivot
#

it's probably vcos fork

fallen patrol
#

Right but wouldn't the name be 3.11.0-alpha or smth

fervent sage
#

it's cyeethon yeah

sleek steppe
#

ah yes cyeethon

patent pivot
#

no, when it's installed it'll just take the pythonX.XX path

#

when you boot up it'll give alpha/beta/stable

fervent sage
#

reloaded and it aint there

#

nor is 3.10 which i also have

olive cloak
#

how do i resolve this issue when running Lancelot?

fervent sage
#

looks like you havent pulled the latest updates

olive cloak
#

oh, i just cloned it

fervent sage
#

ignore what i said actually

#

youre definitely in the right folder?

olive cloak
#

yeah

fervent sage
#

i assume you cloned your fork of the bot, if so go to its github page and click the fetch upstream button

fallen patrol
#

Looks like 3.7 might be getting another update

fervent sage
#

πŸ‘€

fallen patrol
#

And 3.6

#

Okay they all are getting an update

#

Ah....

olive cloak
fallen patrol
#

3.6 to 3.9 are all getting a security patch soon

#

Should bot#1605 be closed?

dusky shoreBOT
short snow
#

@sleek steppe which project lead are you know?

sleek steppe
#

.gh repo python-discord/code-jam-management

dusky shoreBOT
#

Management microservice for Python Discord Code Jams

short snow
#

Ooo nice

fallen patrol
#

In just one month toxic has become from nitro booster to project lead.

patent pivot
#

lol

short snow
#

Lol lot of promotions

#

who is quackstack project leader?

patent pivot
#

correlation is not causation

#

vco

#

but it's not got a defined project lead role since it's not core infra

#

same as like

#

olli

short snow
#

Ah

fallen patrol
#

What is olli anyhow?

short snow
#

And stelere?

fallen patrol
#

I read the source but forgot

short snow
fallen patrol
#

what's loki

fallen patrol
patent pivot
#
Grafana Labs

Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. It is designed to be very cost effective and …

fallen patrol
#

Olli uses a pydantic and toml configuration system which is why I was looking at it

patent pivot
fallen patrol
#

Since I'm writing a modmail bot

short snow
#

Oh nice πŸ‘

fallen patrol
#

What happened to the media category?

short snow
#

And Chris’s secret project?

patent pivot
#

it still exists

short snow
patent pivot
patent pivot
fallen patrol
#

But y private

short snow
patent pivot
#

because it didn't have much going on at the moment

short snow
#

Alright it’s 1am cya!

patent pivot
#

the majority of posts were off topic, people posting youtube videos and so on

fallen patrol
#

@short snow Chris's project is almost certainly media related

short snow
#

Yeah to joe

patent pivot
#

lol

fallen patrol
patent pivot
#

that's vesters project

fallen patrol
#

Pretty sure it was that

#

Eh close enough

patent pivot
#

chris' project is not a media project

short snow
#

Lol, too many projects

fallen patrol
patent pivot
#

lol

short snow
#

Chris when are u planning to break it out

fallen patrol
#

πŸ™‚

patent pivot
#

🀫

vale ibex
#

Soon ℒ️

fallen patrol
#

gotta become staff to find out what it is

short snow
#

Last time I asked, it was soon, better reply pls

fallen patrol
#

will never find out what it is

fervent sage
#

could i get a staff review on quackstack#51 please :P

dusky shoreBOT
vale ibex
#

soon is relative, it could be a year away and still soon, compared to other things

patent pivot
#

lol

short snow
fervent sage
#

soon can be any time you like if you append ℒ️

#

thanks joe!

patent pivot
#

yeah

#

here at pydis we are big believers in valve tiime

fallen patrol
#

valve tiime

fallen patrol
#

tiime

vale ibex
#

you need to say the i twice to take your tiime

patent pivot
vale ibex
#

lol

fallen patrol
#

you ediited it and left the typo

patent pivot
#

dude, it's a typo lol

fervent sage
#

i dont actually edit out my typos that often

#

because too commonly i rush and introduce another one

sleek steppe
fervent sage
#

and then someone screenshots my 5th typo in and immortalises it

sleek steppe
#

ah right

fervent sage
#

so it's run by default in poetry's context

#

when running with poetry, ofc

fallen patrol
#

Wait

#

Do u need to run taskipy with poetry run?

#

I've noticed my enviroment is loaded automatically since I put poetry on my path

#

Just being in the directory sets python to my env

fervent sage
#

not necessarily

patent pivot
#

maintenance starting in ~1hr

fallen patrol
#

For?

#

All clusters?

patent pivot
#

db maintenance

fallen patrol
#

Ah

#

So bot will be down?

patent pivot
#

bot will remain up, site functionality of bot will be down

fallen patrol
#

So infractions and stuff?

patent pivot
#

site will switch to maintenance mode

#

yeah, we'll switch to manual infraction mode

fallen patrol
#

Also there's a manual infraction mode?

patent pivot
patent pivot
#

but yeah, 21:00-23:00 UTC is the window, I don't think it'll take the whole time

sleek steppe
#

Can't the tox.inis go in pyproject.toml πŸ€”

olive cloak
#

do we have to create an issue and get it approved before creating a pull request?

#

its not like ive already done the code

fallen patrol
#

Last I checked, anyways.

#

However....

#

!pypi flake9

stable mountainBOT
fallen patrol
#

^fork of Flake8 which supports pyproject.toml

#

Which downloads Flake8 anyhow

#

So it still relies on flake8

sleek steppe
vocal wolf
#

@zenith pecan was bot#1600 discussed at some point in this channel?

dusky shoreBOT
vocal wolf
vale ibex
#

!modmail

stable mountainBOT
#

Contacting the moderation team via ModMail

@slow bone is a bot that will relay your messages to our moderation team, so that you can start a conversation with the moderation team. Your messages will be relayed to the entire moderator team, who will be able to respond to you via the bot.

It supports attachments, codeblocks, and reactions. As communication happens over direct messages, the conversation will stay between you and the mod team.

To use it, simply send a direct message to the bot.

Should there be an urgent and immediate need for a moderator or admin to look at a channel, feel free to ping the <@&267629731250176001> or <@&267628507062992896> role instead.

vale ibex
#

Someone should update this tag to use the new mod role

#

The id is 831776746206265384

fervent sage
vale ibex
#

πŸ‘

fervent sage
#

done, bot#1607

dusky shoreBOT
vale ibex
#

sick

fervent sage
#

le speed

brazen charm
#

Are there any plans to do a larger overhaul to use 3.9 features like the typehints or asyncio.to_thread, or will that just be done around other changes at a smaller scale

fervent sage
#

after spring cleanup i believe the consensus was that we would change those little things in and around things that were being changed for whatever reason, rather than knocking them all out, as that would create another monster pr which is hellish to review

trim cradle
#
(bot) steele@steele-mint:~/projects/pydis/bot$ poetry run task test

  FileNotFoundError

  [Errno 2] No such file or directory: b'/snap/bin/task'

  at /usr/lib/python3.8/os.py:601 in _execvpe
       597β”‚         path_list = map(fsencode, path_list)
       598β”‚     for dir in path_list:
       599β”‚         fullname = path.join(dir, file)
       600β”‚         try:
    β†’  601β”‚             exec_func(fullname, *argrest)
       602β”‚         except (FileNotFoundError, NotADirectoryError) as e:
       603β”‚             last_exc = e
       604β”‚         except OSError as e:
       605β”‚             last_exc = e

help

sleek steppe
#

hmm, is taskipy installed?

trim cradle
#

let's seee

fervent sage
#

did you poetry install?

trim cradle
fervent sage
#

hm

#

that should be fixed lol

trim cradle
#

anyway now it's just a permissions issue

#

I'll figure it out

trim cradle
sleek steppe
trim cradle
#

why would a fundamental instruction be on a different page?

vocal prairie
#

I should open an issue about that

vocal prairie
#

Does anyone know a good way to show and hide text based on if a button is clicked in html/css?

trim cradle
#

now I need to give permission to read the log files

#

sigh

fallen patrol
#

which would do as much as pycharm does but faster

gritty wind
#

When we said no to the large overhaul that was specifically about typehints

#

The benefit of changing those didn’t even come close to the cost

#

It probably would’ve involved a large contributing freeze, updating existing PRs, and generally a lot of painful grunt work for something not worth very much

vocal wolf
#

@fervent sage bot#1594 needs updating

dusky shoreBOT
fervent sage
#

i need to move it to site apparently but idk where lol

vocal wolf
#

oh

sleek steppe
#

Can sir-lancebot#683 get closed? Even if we did need a PR to bump dependencies, it would be faster to make a new PR than to resolve those conflicts

dusky shoreBOT
vocal wolf
#

I've never seen so many conflicts that github has to truncate the listing

sleek steppe
#

haha, that's what happens when there are two huge PRs open at the same time and one gets merged

fervent sage
patent pivot
#

uhhhh

vocal wolf
patent pivot
#

pydis_site/apps/content/resources/guides iirc

#

i sleep now tho

vocal wolf
#

have sleep

fervent sage
#

lol enjoy slep

#

i should also sleep but uh

#

yeah i should

sleek steppe
vocal wolf
#

I don't know

#

oh nevermind I guess there wasn't another large PR besides that one that's currently up

#

but this one yeaaaahh we should prob close

#

For sanity reasons

#

we should really restructure this bot

fervent sage
#

can we uh rename the evergreen folder for the sake of people actually knowing where to look for stuff, especially since its no longer seasonalbot

vocal wolf
#

restructuring wouldn't have seasons anymore

sleek steppe
#

Lancebot rewrite whenℒ️

fervent sage
#

restructuring would mean a total freeze on everything right?

sleek steppe
#

probably

short snow
#

bump

short snow
fervent sage
#

we should just rewrite the whole bot i volunteer as tribute

fallen patrol
fervent sage
#

I think it should keep some stuff like the christmas folder, but as opposed to that being because it's a season it's more because it's a category of cogs

fallen patrol
#

Like April fools and pride and those

fervent sage
#

so while some stuff like that makes sense to stay how it is, the reason isnt because it's a season per se

cold island
#

How do I get a user's associated email on github?

vale ibex
cold island
#

Hmm.. the github UI fetches it when you specify someone as a co-author, but there doesn't seem to be a way to do so from the command line

vale ibex
#

I think the github app does it based from username

#

but I'm not aware of a way to do it via the git cli

#

maybe the gh cli has a way, but I don't use it

#

just doing <username>@users.noreply.github.com might work

short snow
#

I just get it on github UI and copy it down on the commit

cold island
#

How do you get it on the github UI?

brazen charm
fallen patrol
#

They use aliasing for the emails.

#

So every user account has an ID

#

So if you change your username you still actually get the emails :smort:

short snow
cold island
#

Ok, found the email. That was surprisingly convoluted, surprised github doesn't have a more streamlined way to do this.

fallen patrol
cold island
#

?

sleek steppe
#

Hey, I found a couple places in the site contributing guide where they mention using pipenv instead of poetry, can I make a PR to site to change them to poetry?

remote wigeon
#

can anyone explain to me why metaclasses are used for the config of the bot instead of normal inheritance?

#

is there any reason behind it or is it just "because we can"

sleek steppe
#

constants.py uses classes, so in order to have the custom implementation of __getattr__ for the class itself, a metaclass would need to be used

#

It also implements __iter__ and __getitem__

remote wigeon
#

oh, fair that does make sense

#

tho still, its pretty cool, but kinda overkill

gritty wind
#

Kinda like that it's a bit difficult

#

Any particular reason you need them?

gritty wind
#

Actually just go ahead and make that PR

sleek steppe
#

I could link them but I'm on mobile right now

#

Actually was python updated in site? It was

sharp timber
# cold island ?

A little while ago I made an "evolution" video of the bot repo with a script to grab avatars for all the committers in a repo. It hits the GH api a bit, it is really convoluted because they don't reveal the actual email-owner relationship outside of hitting the commit api.

sharp timber
quaint quest
sleek steppe
#

I'll just add that to my pr

fallen patrol
sleek steppe
#

We don't have contributing guides on the site for snekbox

fallen patrol
#

and?

vocal prairie
#

The README explains how to run snekbox, not the site

cold island
fallen patrol
#

!server

stable mountainBOT
#
Server Information

Created: 4 years, 4 months and 14 days ago
Voice region: europe
Features: PREVIEW_ENABLED, MEMBER_VERIFICATION_GATE_ENABLED, COMMUNITY, WELCOME_SCREEN_ENABLED, INVITE_SPLASH, VIP_REGIONS, ANIMATED_ICON, VANITY_URL, RELAY_ENABLED, NEWS, PARTNERED, BANNER, DISCOVERABLE
Roles: 80
Member status: status_online 35770 status_offline 167413

Members: 202434

Helpers: 114
Moderators: 28
Admins: 15
Owners: 3
Contributors: 39

Channels: 215

Category: 26
News: 11
Staff: 62
Text: 108
Voice: 8

fallen patrol
#

Sorry, no other channel that I can access (that I know of) where I can view the guild features

#

Guess I could make an issue to add an optional argument

#

Not unlike raw

vocal wolf
pulsar gorge
#

can i have multiple command proposals at same time πŸ€”

short snow
#

yeah πŸ˜„

pulsar gorge
#

okk

stable mountainBOT
#
Command: server

Returns an embed full of server information.

Source Code
sharp timber
#

Ok, seems reasonable the way it is

sleek steppe
#

!float

stable mountainBOT
#

Floating Point Arithmetic
You may have noticed that when doing arithmetic with floats in Python you sometimes get strange results, like this:

>>> 0.1 + 0.2
0.30000000000000004

Why this happens
Internally your computer stores floats as as binary fractions. Many decimal values cannot be stored as exact binary fractions, which means an approximation has to be used.

How you can avoid this
You can use math.isclose to check if two floats are close, or to get an exact decimal representation, you can use the decimal or fractions module. Here are some examples:

>>> math.isclose(0.1 + 0.2, 0.3)
True
>>> decimal.Decimal('0.1') + decimal.Decimal('0.2')
Decimal('0.3')

Note that with decimal.Decimal we enter the number we want as a string so we don't pass on the imprecision from the float.

For more details on why this happens check out this page in the python docs or this Computerphile video.

sleek steppe
green oriole
#

sigh

#

PR pls? πŸ₯Ί

sleek steppe
#

yes

fallen patrol
#

@sleek steppe while you're at it, add ?t=0 to that YouTube link

sleek steppe
#

Nice tag speedrun

vale ibex
#

Doesn't the link without that tag just pickup where you left off?

fallen patrol
#

Yeah

#

Actually idk what I was thinking lmao

fervent sage
#

if you want a more python specific video https://www.youtube.com/watch?v=Js99ciGwho0

https://anvil.works/mcoding
Support mCoding by visiting this video's sponsor using the link above.

Most programming languages use a shared standard (IEEE 754 floating point numbers) for how to represent floating point numbers like 0.1. In this video, we see how these floats are represented and how this can cause unexpected results like 0.1 + 0....

β–Ά Play video
sleek steppe
#

Is there any reason why we use os.eviron.get instead of os.getenv?

vale ibex
#

os.getenv is basically a shortcut to os.envron.get

#

so there's no reason to use one over the other

pulsar gorge
#

any thoughts on #755? pithink

vocal prairie
#

On which repository?

pulsar gorge
#

lancebot

fallen patrol
#

how do the bots here automatically deploy?

vocal prairie
#

They have a GitHub action that deploys them to the Kubernetes cluster iirc

fallen patrol
#

Well yes

#

But how do you deploy to the cluster or stuff

#

Do you need some sort of public webhook or something to do so?

sharp timber
fallen patrol
#

πŸ€”

fallen patrol
sharp timber
#

Well, yes, for the action to hit. A webhook would as well

fallen patrol
#

Ah

tough imp
#

once the image is in GHCR the deploy workflow checks out the repo with manifests and re-applies the app deployment while injecting the new image tag

#

to authenticate the cluster's kubeconfig is available in the repo's secrets

patent pivot
#

so not the nodes

#

which for us looks like https://<random uuid>.eu-central-2.linodelke.net/

#

so the thing you post to deploy is the left box, the master or more commonly api server

fallen patrol
#

πŸ€”

fallen patrol
patent pivot
#

unique per cluster

#

that's for all clusters on Linode

green oriole
#

!source Antispam

stable mountainBOT
#
Bad argument

Unable to convert 'Antispam' to valid command, tag, or Cog.

#
Command Help

!source [source_item]
Can also use: src

Display information and a GitHub link to the source code of a command, tag, or cog.

green oriole
#

Hmm

fallen patrol
#

huh

#

@patent pivot any sentry issues?

patent pivot
#

lol

#

context please

fallen patrol
#

last update on the 20th

patent pivot
#

ah yeah 21st

#

no

#

one sec unblocking

fallen patrol
#

wtf lol

patent pivot
#

overaggressive tracking firewall

#

no issues in sentry

fallen patrol
#

also missed the 17th

patent pivot
#

I'll pull some logs

#

I see errors on the 21st

#

but nothing since

#

when did we last restart lancebot

#

.uptime

dusky shoreBOT
#

I started up 4 days ago.

patent pivot
#

okay yeah

#

so it's just that the loop got crashed out of on the 21st and it doesn't reschedule if it fails once

#

perms error afaics

#

kubectl rollout restart deploy sir-lancebot

#

wait

#

not a terminal

#

alright, it should post tonight

gritty wind
#

It can be a terminal

#

Just gotta get creative with your imports

fallen patrol
fallen patrol
patent pivot
#

restart the rollout of the sir lancebot deploy

#

restart lancebot, effectively

fallen patrol
#

ah

patent pivot
#

kubernetes doesn't have the concept of restarting, so you restart the deployment

fallen patrol
#

okay

limpid canopy
#

Idk if this is the place but i requiere help with a project. I need to gather a big image data set of pokemons to make a cnn classifier. If any of u wanna help me, pls check google image search python api, and follow the steps. Ping me too to share a script

fallen patrol
#

Uhhh, why only one help channel per user?

thorny obsidian
#

There's no real reason a user should have more than one help channel open at a time. We've only seen it cause issues recently. It's outlined in the issue attached to the PR.

fallen patrol
#

There was a good reason for it previously

#

Two unrelated things a user wants help with

patent pivot
#

It's very infrequently used for that, so a simplification of complexity is a good idea (we do get questions along the lines of "why can't I open a new channel")

thorny obsidian
#

Also, a user should not be juggling two help channels about two issues. It's a bad experience for both them and the people trying to help.

patent pivot
#

anyone wanna add cloudflare to our site sponsors list? if not I can take it shortly, but it's a nice first PR if anyone is up for it πŸ™‚

fallen patrol
#

Or were they a sponsor for a while?

patent pivot
#

cloudflare has for a while

fallen patrol
#

OK cool

patent pivot
#

but they sponsored some more today and it reminded me

fallen patrol
#

Wut

#

What more can you get from cloudflare lmao

remote wigeon
#

a lot

#

like a lot lot

patent pivot
#

workers

remote wigeon
#

also proxying for non standard ports, prioritised traffic, much better analytics, etc. tho idk what pydis gets

patent pivot
#

yeah

#

we get spectrum yeah

#

so we can proxy SSH and uhhh

#

minecraft

#

hahahaha

#

and yeah, we get some private PoPs, if you are in the UK I know we serve from the MAN (Manchester) PoP

#

and yeah, more analytics info πŸ™‚

fallen patrol
#

Hmm

#

Pixels

patent pivot
#

stay tuned

fervent sage
#

h

twilit juniper
#

hmmm

whole forge
spare plaza
twilit juniper
remote wigeon
#

h

fallen patrol
#

pixel token invalidation

twilit juniper
#

lol

fallen patrol
#

i created an api token just before the announcement

limpid canopy
#

Hi guys. I am working on a image dataset of 50+ images per pokemon (898 pokemons) find the google api i am using limits the amount of requests per user per day. If any of u wanna help me grabbing images of some pokemons to group them all together i will appreciate, since time will decrease. DM me if u want.
BTW, i am using https://github.com/arrrlo/Google-Images-Search and there are a few steps u have to do before using it

GitHub

Search for image using Google Custom Search API and resize & crop the image afterwords using Python - arrrlo/Google-Images-Search

short snow
short snow
placid ermine
#

El Espiar Jason

patent pivot
#

yeah we've been working on pixels for a few monthss now

vale ibex
#

Since start of March iirc

neon garnet
#

Quick Q on the workflows for our repositories, I just noticed that everything gets installed into a common directory:
${{ github.workspace }}/.cache/py-user-base

Wouldn't that hurt in case dependencies fail to satisfy constraints?

#

I see how its beneficial in terms of being the "singular source of truth" for caching, but I'm not exactly sure how this works

short snow
#

for some reason, if you add a extension to the unloaded cache and it doesn't get loaded.

Then when you do !c load <ext> it raises that the extension is already loaded

#

basically:

#

this is regarding sir-lancebot#745

dusky shoreBOT
patent pivot
clever wraith
#

I cannot find the issue anywhere on the site repo

patent pivot
#

there isn't one yeah

clever wraith
#

or is it something i need to make

#

oh ok

patent pivot
#

you can open without an issue, I'll approve

clever wraith
#

i opened an issue, site#514

dusky shoreBOT
clever wraith
#

Alright @patent pivot , site#515

tawdry vapor
#

With that in mind, I have no idea why someone decided to add the poetry cache in there.

#

It's useless since cache hits mean poetry never installs anything

green oriole
#

Heyo, can I get a staff/contrib review on site#515 please? lemon_hyperpleased

dusky shoreBOT
patent pivot
#

indeed

green oriole
#

Thank you sir

patent pivot
#

oh yeah that's the actual image

#

cc @clever wraith

clever wraith
#

what

#

um

#

the devil

patent pivot
#

lmfao

clever wraith
#

or a way to make it transparent?

patent pivot
#

hmmm

vocal prairie
#

There's this transparent one

patent pivot
#

something like that

#

resized a bit of course

clever wraith
#

aight

short snow
sleek steppe
short snow
#

Not sure if I understand how it gets affected by the changes I did to add cog, I will look into it and get back!

sleek steppe
short snow
#

it always used bot.load_extension pithink

sleek steppe
#

Not the extension load/unload command

short snow
sleek steppe
#

Yeah, it loads the extension but doesn't add the cog, because it found the extension in the cache

patent pivot
#

has the git hook died

sleek steppe
patent pivot
#

ah yeah

short snow
#

Could you stop spamming that in all channels please πŸ™‚

patent pivot
sleek steppe
#

oh lol

short snow
sleek steppe
#

yeah I think so

#

also @short snow the other thing I was talking about is that let's say I unloaded bot.exts.evergreen.snakes, and it goes in the unload cache, and I reload the bot. In add_cog, it's checking if inspect.get_module(cog).__name__ is in the unloads cache, and inspect.get_module(cog).__name__ for the snake cog is bot.exts.evergreen.snakes._cog, so it doesn't match and the cog gets loaded.

short snow
#

alright will look into it

#

@sleek steppe Alright overwriting load extension works πŸ˜„

short snow
#

oh god, branch got fast forwarded πŸ˜”

#

sounds like cherry picking is the only solution

#

but for that i would need to open a new PR

#

oh shit

short snow
#

ok pr should be ready for review now

#

had to make the changes again, messed up with git haha

sleek steppe
short snow
#

hmm, i think there was some error if i kept it sync, I will have a look again when i get back. Or probably i removed some async code and forgot to change it back

sleek steppe
#

Ok I'll review when that gets changed

sleek steppe
fallen patrol
#

πŸ‘€

#

Buttons

fallen patrol
#

threads

#

πŸ‘€

#

would be cool to migrate help channels to threads ngl

#

when its out, i mean

patent pivot
#

we'll look at it when it comes out, there are several disadvantages that a threads based approach brings

fallen patrol
#

like?

#

just curious at this point

patent pivot
#

inherently less visible than a list of channels, harder to figure out what is active and what is not, just overall it harms discoverability compared to the current system

#

members must join threads as opposed to here where the channels are just there

fallen patrol
#

Hmmm

fallen patrol
fervent sage
#

they are enabled on some servers already

short snow
vocal wolf
#

bot#1297 needs review. Quite a large PR, take as much time as you need.

dusky shoreBOT
green oriole
#

Now we need a PR title hall of fame.
@gritty wind what did I do again >.<

gritty wind
#

I see all hyperlemon

fallen patrol
#

@patent pivot πŸ₯Ί

patent pivot
#

uhhh

#

we'll see, it's currently webhooked to an internal channel, will look at it later today

fervent sage
wicked nova
#

Oh my bad

#

Does the bot have access to the os module?

tawdry vapor
#

You mean the eval command?

wicked nova
#

Can the bot access and modify the file system?

tawdry vapor
#

Yes. But not the eval command, if that's what you mean.

wicked nova
#

Got it, thanks

tawdry vapor
#

However, everything runs in Docker containers. If you wanted to persist some changes you'd have to define a new volume, or save it to an existing volume, if any.

#

Of course, if you commit the file to git then it's fine if you're going to access it as read-only.

wicked nova
#

I wanted to store some info to a JSON file.

#

So that won't work

#

How does the bot normally persist data @tawdry vapor?

fervent sage
#

through the attached Postgres database or Redis instance

#

*although postgres is accessed via the site api

wicked nova
fervent sage
#

hang on which bot are we talking about, bot or sir-lancebot?

#

they use slightly different things

wicked nova
#

Sir Lancebot

#

@fervent sage

fervent sage
stable mountainBOT
#

bot/bot.py line 36

self.redis_session = redis_session```
wicked nova
#

Thanks a lot!

short snow
fallen patrol
#

Well have fun trying to moderate these as well.

#

About Me

fallen patrol
#

Kind of

#

It does stay around after going offline

wicked nova
#

Yeah, but it's not horrible

fervent sage
fallen patrol
#

Moderation. This server has nickname checking (coded bot feature of @stable mountain) and now there's about user statuses (which users can set, just like nicknames) so it's mentioned here because implementing it into @stable mountain might be a possibility?

short snow
#

Statuses ain’t server specific, so we can’t really moderate it I suppose

gritty wind
#

We do moderate some things that are not server specific in very limited cases

#

Like all new features, we’ll discuss the best way to handle it

#

Personally I don’t think it requires much effort

#

Personal status aren’t moderated completely and those are arguably more visible

midnight nimbus
#

@crude gyro here I am πŸ™‚

crude gyro
#

yo. what's up

midnight nimbus
#

sorry I'm a bit lost in this huuuge discord server

#

first of all thank you for django-simple-bulma, it seems it will make my life easier in a project i'm working on

#

but I'm encountering an issue about static files, and even with your informative paragraph I don't quite understand how to solve it

crude gyro
#

yeah, the community can be a bit overwhelming at first

midnight nimbus
#

(so many channels and chats!!)

crude gyro
#

you get used to it. and then you mute and hide half the channels and you're good.

#

anyway

midnight nimbus
#

well, when I say static files it's about custom scss

crude gyro
#

aha, I see.

midnight nimbus
#

I can't make it work.
I have a project called RtpProject, then an app RtpApp

#

in RtpApp directory I have a 'static' directory (RtpApp/static/rtpApp/css/main.scss for instance)

crude gyro
#

right

#

and you've put this file into your BULMA_SETTINGS, right?

midnight nimbus
#

and in bulma settings I've set ```
"custom_scss": [
"rtpApp/css/main.scss"
],

crude gyro
#

okay. that might not be a full enough path

midnight nimbus
#

ok. What shall I do? I'm sorry if there's an obvious answer to this question

crude gyro
#

the full path from the root project folder is usually the right way

midnight nimbus
#

ok. My static root is called static

crude gyro
#

have you set STATICFILES_DIR in the settings?

#

or just STATIC_ROOT

midnight nimbus
#

just STATIC_ROOT

crude gyro
#

do you get an exception?

midnight nimbus
#

I got this exception :

#
ValueError: We couldn't figure out where the static directory for the given SCSS path is: "rtpWebsite/css/main.scss". If the given path does
n't contain "static/", then you may need to add it to your STATICFILES_DIRS setting.
#

with ```
"custom_scss": [
"rtpApp/css/main.scss"
],

crude gyro
#

yeah. so the way I think this works (I'm not 100% sure because I think maybe @velvet ether wrote it) is that we either expect your path to contain static/, e.g. RtpApp/static/rtpApp/css/main.scss, or we expect you to add the folder to STATICFILES_DIR.

#

the first of those two would be easiest to test

midnight nimbus
#

ok

#

I've also tried

"custom_scss": [
        "rtpApp/static/rtpApp/css/main.scss"
    ],
#

but that raised another exception

crude gyro
#

isn't that first r supposed to be capital? I don't know your file structure but you've used a capital R previously

midnight nimbus
#
FileNotFoundError: [WinError 3] Le chemin d’accΓ¨s spΓ©cifiΓ© est introuvable: 'C:\\Users\\thiba\\PycharmProjects\\rtpProject\\venv\\Lib\\site-p
ackages\\django_simple_bulma\\rtpApp\\css'
midnight nimbus
#

so not about capital 😦

crude gyro
#

what are you doing when this exception is raised?

midnight nimbus
#

in both cases these exceptions happen when I do this command

crude gyro
#

okay, that's what you should be doing so that part is good.

#

moment, let me take a look at the code for this

midnight nimbus
#

ok thx

crude gyro
midnight nimbus
#

yup πŸ™‚

crude gyro
#

then try with a path relative to the dir you put in here

#

oh actually it looks like gdude wrote this part, not Jonas. My bad.

midnight nimbus
#

same exception 😦

#

I share what I did :

STATICFILES_DIRS = [
    'rtpWebsite/static'
]

BULMA_SETTINGS = {
    "extensions": [
        "bulma-collapsible",
    ],
    "output_style": "compressed",
    "custom_scss": [
        "rtpWebsite/css/main.scss"
    ],
}
#

rtpWebsite is the actual name of my app

#

I still got the exception "Value error. We couldn't figure out..."

crude gyro
#

include the staticfiles dir in the custom_scss path

midnight nimbus
#

oh ok

crude gyro
#

looks like our finder expects that

#

I have never really used this function myself and it was a pull request from someone quite a long time ago, sorry that I'm a bit unfamiliar with it

midnight nimbus
#
FileNotFoundError: [WinError 3] Le chemin d’accΓ¨s spΓ©cifiΓ© est introuvable: 'C:\\Users\\thiba\\PycharmProjects\\rtpProject\\venv\\Lib\\site-p
ackages\\django_simple_bulma\\rtpWebsite\\css'

#

haha no problem. You are trying to help me, that's already a lot

crude gyro
#

okay, so here it's clearly looking in the wrong place, which may be a bug in our code

midnight nimbus
#

oh. Well x)

crude gyro
#

but I think the fact that you're getting a FileNotFoundError rather than one of our errors indicates that you've input the path correctly

#

is your project on github or something?

midnight nimbus
#

It's weird indeed

#

hum no. Only a local git repo but I can share it with you after upload if you want

crude gyro
#

good habit to start putting your personal projects on github

#

do you have dependency management?

#

like.. pipenv or poetry or a requirements file?

midnight nimbus
#

I usually do pip freeze > requirements.txtbut that's all

crude gyro
#

I think you've found a real bug and I appreciate you bringing it to me, so I think I'll just fix the bug for you, but it'd be useful to have something to test with.

#

I might rewrite that function to support STATIC_ROOT too

midnight nimbus
#

Well thank you πŸ™‚

#

So you want me to share the project with you ?

crude gyro
#

if it isn't sensitive, that'd be useful.

midnight nimbus
#

Can I make it private and share only with you, it's a project I'm working on for a small business (not anything sensitive though)

crude gyro
#

sure.

#

I'm lemonsaurus on github

midnight nimbus
#

thanks πŸ™‚

#

I'll take a few minutes to pull it.
Oh and please don't look at the code too much, it's garbage since I'm doing 10 things at the same time x) And I'm a newbie

stable mountainBOT
midnight nimbus
#

I've invited you as a collaborator on my Github repo πŸ™‚

crude gyro
#

yep, already cloned. having a look now if I can reproduce the bug

#

did you have a requirements file?

midnight nimbus
#

oh crap. I'm uploading it now

crude gyro
#

I highly recommend starting to use something like pipenv or poetry in the future, it makes collaborating super easy.

by running pipenv install in a project with a Pipfile, it will

  • Set up a virtual environment with the right python version
  • Install all the dependencies with the right versions
  • Make it easy to run commands inside the virtual environment, or to open a shell there
midnight nimbus
#

I already use virtualenv. Is it different ?

crude gyro
#

and if you don't have the right Python version, it will even install it automatically as long as you have pyenv

#

well, it's good that you use virtualenv, and these tools also typically use virtualenv internally

midnight nimbus
#

So, using virtualenv with a requirements.txt file is not enough ?

crude gyro
#

it's certainly better than nothing

midnight nimbus
#

Haha. I'll look into pipenv or poetry πŸ™‚

crude gyro
#

but a dependency manager does more than that. It also tracks all your dependencies, and resolves a "dependency map" to ensure there aren't any deeper subdependency conflicts. Once that dependency map is resolved, it's saved as a lockfile. This lockfile can then be committed to your repo, and when someone installs it, it will use that lockfile to ensure that they get exactly the same dependency map as you

#

this might not matter for a smaller personal project, but it's hugely important for larger projects

#

it means that every environment will always run exactly the same versions of everything

#

and that means you don't get surprising runtime errors

midnight nimbus
#

thanks. I guess I'll have to follow the good practices then

crude gyro
#

also, the user experience for poetry and pipenv is really good

#

once you try it, you won't wanna go back

#

they feel great

midnight nimbus
#

ok thank you ! πŸ‘

crude gyro
#

anyway I'll investigate this bug now, be back soon

#

will ping you when I have news

midnight nimbus
#

thank you very much

#

I appreciate your help πŸ™‚

crude gyro
#

no problem. I happened to have an available hour anyway

midnight nimbus
#

I can't believe it was so fast to contact you xD

#

yesterday I was a bit depressed after trying many solutions to this problem and reading the README.MD file ten times. Now I'm super glad.

crude gyro
#

hmm, right, what python version are you using?

midnight nimbus
#

Python 3.8.10 (venv environment)

crude gyro
#

@midnight nimbus I think you forgot to commit your static files to the repo

midnight nimbus
#

ouch

#

I'm gonna check it

#

I don't understand why static files are not committed
I didn't exclude them

crude gyro
#

maybe you just didn't git add them?

#

what does your git status show?

midnight nimbus
#

yeah I git added them
git status tells me that directory staticis not committed, but that's my static root

#

ok it's done. My bad 😩

crude gyro
#

okay, I've reproduced the bug and am making the custom scss file discovery a bit smarter

#

it'll just use the other standard finders to locate the file instead of trying to locate it manually

#

this should be more platform agnostic - I think the problem you're seeing is a bit windowsy.

midnight nimbus
#

oh that's nice

#

yeah I saw that Windows exception

crude gyro
#

you won't need to define STATICFILES_DIRS either then

midnight nimbus
#

nice ! So I don't have to change anything in settings except omitting staticfiles_dirs ?

crude gyro
#

I'll get back to you on that, might need to make relative paths to the files.

midnight nimbus
#

ok! πŸ™‚

midnight nimbus
#

@crude gyro I see you've updated the project πŸ™‚

crude gyro
#

yeah, will do a release soon

#

just need to lint

crude gyro
#

can you try upgrading and testing the new version for me?

midnight nimbus
#

yes I'm gonna try right now!

crude gyro
#

and with this change, don't worry about STATICFILES_DIRS, and just define the file with a relative path

#

e.g. "rtpWebsite/css/main.scss"

#

relative to whatever static folder it is in

#

should work out of the box like that, for any static folder that Django will reasonably interact with

#

the actual root problem was that your custom SCSS was deeply nested, and we didn't support this - I guess we only ever tested it with a single subfolder inside static - but now we support any nested depth.

midnight nimbus
#

very nice! no more exception

crude gyro
#

so the file compiled as expected?

midnight nimbus
#

I'm verifying it though

crude gyro
#

(if you're using pycharm, the compiled css file might be nested under the scss file)

midnight nimbus
#

yes it's compiled πŸ™‚

crude gyro
#

excellent!

midnight nimbus
#

nested indeed

crude gyro
#

sounds like you're good, then

#

thanks for the bug report lemon_cyclops

#

let me know if you run into anything else

midnight nimbus
#

thank you for the new version and work involved!

crude gyro
#

happy to help. stick around, this community is full of helpful people.

midnight nimbus
#

one more question: shouldn't I see main.css appear in source code of a page now?

#

yes I'm learning Python so I think I'll come again here!

crude gyro
#

well, now it's up to your django app to serve that file.

midnight nimbus
#

ah so it compresses the file but I have to serve it manually? It's not done automatically?

crude gyro
#

you've got your STATIC_ROOT set up to point at the right folder, so you should be able to use the {% static %} templatetag to fetch the css file into your templates

midnight nimbus
#

(I think it's even better so I can take a modular approach)

crude gyro
#

I see you have this in your index.html

<link rel="stylesheet" href="{% static 'rtpWebsite/../../static/rtpWebsite/css/index.min.css' %}">

that's a strange path. You should just need to do something like this:

<link rel="stylesheet" href="{% static 'rtpWebsite/css/index.min.css' %}">
midnight nimbus
#

ok thanks! I thought the scss files included in bulma_settings where automatically served, but I was wrong. It's even better this way, I only load what I need

#

yes this was a weird refactor from PyCharm

crude gyro
#

ah, that makes sense, yes :D

#

right, so just use that same technique to serve the compiled css and you should be good

midnight nimbus
#

well
Thank you a lot

crude gyro
#

we didn't wanna inject stuff into the templates because you might not want it in every template

midnight nimbus
#

yes indeed. Thank you a lot for all your help and time spent on fixing this issue!

crude gyro
#

no problem at all.

midnight nimbus
#

ahem
I think I got another issue 😩

#
"custom_scss": [
        "rtpWebsite/css/main.scss",
        "rtpWebsite/css/index.scss",
        "rtpWebsite/css/marque_list.scss"
    ],

makes this exception:

ValueError: list.remove(x): x not in list
#

if I only put one of these scss files, individually, in the list, it's ok though. But all 3 makes exception happen. Am I doing something wrong?

crude gyro
#

interesting.

#

oh fuck I think I know what I did wrong

midnight nimbus
#

ah x)

crude gyro
#

haha, yeah I see it now

#

sorry about that

midnight nimbus
#

hehe

crude gyro
#

I'll patch that out right now.

midnight nimbus
#

thanks! I'm glad I can find bugs lemon_sweat

crude gyro
#

by the way, why do you have the bulma folder inside your static folder

#

from a previous attempt at getting bulma working?

midnight nimbus
#

it was from before using your project

#

I used bulma as downloaded css files

#

If that's your question

crude gyro
#

yeah

#

okay

#

can probably delete that folder now

midnight nimbus
#

I just deleted it

#

I'm sorry, the project was a mess when I pushed it on GitHub

#

I tried many things yesterday and pushed all that in a rush for you ^^

crude gyro
#

no problem

crude gyro
midnight nimbus
#

thanks!

crude gyro
#

hopefully I didn't create some other bug with this release too lemon_sweat

midnight nimbus
#

collectstatic now works without exception when more than 1 scss file is given πŸ™‚

hot niche
#

<@&409416496733880320> I am just curious when you were setting up the kupernites cluster for all you applications such as bots,websites,etc did you have to start setting up the docker container or did you have to start with a linux server

patent pivot
#

We use a managed Kubernetes Cluster on the Linode Kubernetes Engine, so all of the actual server management is handled by them

hot niche
patent pivot
#

Not sure what you mean by Docker container in this context, but the nodes provided by Linode come with the necessary Kubernetes components installed + a working Docker runtime

hot niche
patent pivot
#

Yeah, I know what a Docker container is, but Kubernetes does not run inside a single Docker container

#

It's a set of host applications as well as containerised applications, as well as components not on our infrastructure at all

hot niche
#

ok

patent pivot
#

Linode power the control plane, the provider API and bootstrap all the nodes with kubelet, as well as setting up the Docker runtime and containerised components like the DNS servers

hot niche
patent pivot
#

I'd recommend starting with a managed cluster from Linode/Scaleway/etc, they are dead cheap. After that you can look at kubeadm which bootstraps nodes manually

hot niche
patent pivot
fervent sage
patent pivot
fervent sage
#

ahh

patent pivot
#

It will be removed later this year, at which point an upgrade by Linode will switch to containerd or CRI-O or something

midnight nimbus
#

@crude gyro is it possible that the Bulma css file provided in django-simple-bulma is not as complete as the bulma.css I can download from official site? I can't find classes like is-flex-direction-column in the new bulma.css πŸ€”

crude gyro
#

seems unlikely, we're just submoduling Bulma.

#

so every time I do a release, it grabs the latest version of Bulma straight from their repo

#

and, well, I did two releases today

#

so it should be pretty updated.

midnight nimbus
#

ok. It's weird because I can't find these classes, that worked well yesterday

crude gyro
#

interesting.

midnight nimbus
#

all those classes and more are lost πŸ€”

.is-flex-direction-row {
  flex-direction: row !important;
}

.is-flex-direction-row-reverse {
  flex-direction: row-reverse !important;
}

.is-flex-direction-column {
  flex-direction: column !important;
}

.is-flex-direction-column-reverse {
  flex-direction: column-reverse !important;
}

.is-flex-wrap-nowrap {
  flex-wrap: nowrap !important;
}

.is-flex-wrap-wrap {
  flex-wrap: wrap !important;
}

.is-flex-wrap-wrap-reverse {
  flex-wrap: wrap-reverse !important;
}

.is-justify-content-flex-start {
  justify-content: flex-start !important;
}

.is-justify-content-flex-end {
  justify-content: flex-end !important;
}

.is-justify-content-center {
  justify-content: center !important;
}

.is-justify-content-space-between {
  justify-content: space-between !important;
}

.is-justify-content-space-around {
  justify-content: space-around !important;
}

.is-justify-content-space-evenly {
  justify-content: space-evenly !important;
}

.is-justify-content-start {
  justify-content: start !important;
}

.is-justify-content-end {
  justify-content: end !important;
}

.is-justify-content-left {
  justify-content: left !important;
}

.is-justify-content-right {
  justify-content: right !important;
}

crude gyro
#

when were these added to Bulma? check the blame.

#

it might be that we're using an older version of Bulma than I'm assuming we are.

#

by some mistake

midnight nimbus
#

it seems to date from 9 months ago

crude gyro
#

hm. I'll have to investigate when I'm back at a computer

clever wraith
#

.

dry folio
#

oooo new shiny ping, why would we ping this?

#

also ToxicKidz would you mind re-reviewing? it has been 2 days since i made the change you requested :D

patent pivot
dry folio
short snow
gritty wind
#

I understand a lot of work was put in

#

But we discussed this

#

The version bumps besides 3.9 are a bit meaningless, and 3.9 has already been done

#

We also discussed changing the typing annotations

#

After the spring cleaning PR, that was a hard no

#

I’m sorry, but I’m not sure this PR is worth pursuing anymore

#

Upgrading the annotations as needed seems like a more reasonable option

short snow
#

No problem πŸ™‚, agreed

vocal wolf
#

@sleek steppe I need your re-review on sir-lancebot#756

sleek steppe
#

I can probably leave a review tomorrow

vocal wolf
#

thank

vocal wolf
short snow
#

Would probably be better if someone else can take it, got units in June

vocal wolf
#

alrioght

#

ty

short snow
#

@exotic ember this the reason i did that, i was storign the message id earlier

gritty wind
#

One possibility would be storing all the cogs in redis, with a bool value to indicate them being on/off, and just query each cog

#

Another option would be to store the unloaded cog names as keys, and not worry too much about the value (just set it to something random like 0), then get the items from the namespace

#

Both solutions have their upsides

short snow
#

What i did initially was something like kosa said, it was

{"cog": "message ID"}

Which i still find as the best solution, I could change the message ID to message link so one deosn't need to find their way to the message ID

gritty wind
#

I don’t particularly think storing the message ID will help in anything, but I don’t have a strong opinion on the matter

exotic ember
short snow
#

i mean its better than storing all the cogs/or random thing

#

the message link can help pointing out the reason why the cog was unloaded at the first place

gritty wind
#

Not particularly, it just seemed the most intuitive at first

#

(Replying to kosa)

#

As long as the system works, I don’t mind any of the suggested solutions tbh

#

Would be nice to have that feature

#

The cleanliness is a bonus

short snow
#

umm, so what should I go ahead and do?If i was given the opinion I would choose storing them with msg links

exotic ember
#

I'd go with just storing unloaded cogs

short snow
#

yeah but what should the value contain?

green oriole
#

Any deterministic string for each cog really

#

The class name would probably work just fine

crude gyro
#

@midnight nimbus yep, turns out I was wrong about how submodules behaved and it's running a 10 month old Bulma. I'll update to the latest version now.

midnight nimbus
#

Ok! Very cool, thanks

crude gyro
#

this should have your missing classes

midnight nimbus
#

I'll try it right now!

#

yes new classes are there now! πŸ™‚

#

thank you!

crude gyro
#

yeah, thanks for helping me find these bugs

#

I appreciate it

clever wraith
#

hello, i have a question, i want to contribute to sir-lancebot so i was trying to go over some issues, I wanted start from very easy task so I found that someone wished to make rock paper scissors in sir lancebot however the OP has probably changed mind or something as issue is from March, may i do it?

#

I have set up lancebot in one of my servers and its working. so im done with basic running bot section.

short snow
clever wraith
#

Alright thanks. Also if i may ask, what will be a good file to follow the code style in rps? I'm currently following connect4 however it is a bit complex compared to rps.

short snow
#

Hmm, yeah connect4 is a bit complex, well for RPS, by could quality do you mean like pep8 and stuff or how the code should be made, the implementation part

clever wraith
short snow
clever wraith
#

alright I'll check it out. thanks a lot for your help.

short snow
#

Also i recommend to checkout the contributing guidelines for sir-lancebot before you start contributing to it lemon_pleased

clever wraith
#

great I'll check them out too!

short snow
green oriole
#

It should be unique and deterministic πŸ€·β€β™‚οΈ

short snow
green oriole
#

I don't really understand the issue though

short snow
green oriole
#

Hmm I see

short snow
green oriole
#

You could have a RedisCache["cog name", "jump link"] as described in the issue, no?

short snow
#

yeah, that's what i agreed upon with kosa

green oriole
#

For the value you can either use a jump link as kosa said or even put a dummy value

short snow
#

i would say jump link, since it is more useful than a dummy value, alright i will do that then

green oriole
#

Sounds good

clever wraith
#

how to kinda reload the command thing?(i made some changes but they do not reflect unless i restart lancebot)

exotic ember
#

extensions reload <cog_name>

short snow
trim cradle
#
    try:
        await coro_func(role)
    except discord.NotFound:
        log.debug(f"Failed to change role for {member} ({member.id}): member not found")
    except discord.Forbidden:
        log.debug(
            f"Forbidden to change role for {member} ({member.id}); "
            f"possibly due to role hierarchy"
        )
    except discord.HTTPException as e:
        log.error(f"Failed to change role for {member} ({member.id}): {e.status} {e.code}")

I can see how discord.NotFound could get raised. Would discord.Forbidden be raised if a helper+ opened a help channel? And then the last one is a catch-all?

fallen patrol
#

Why?

fallen patrol
#

And fwiw i know that at minimum @stable mountain can edit all roles that a helper can have. Not sure about moderation team and up, tho.

cold island
#

You can apply roles to someone higher than you in the hierarchy, just not roles that are higher than you

clever wraith
green oriole
#

Hey @clever wraith, it seems like someone else is assigned to that issue

clever wraith
green oriole
#

We can ask the other person if they made any progress, but you still have to be assigned first

#

I'll have to go AFK, I'll let any other core dev take care of it :)

short snow
clever wraith
short snow
#

is there a method to delete a item for redis-cache?

#

@exotic ember should i include the message link in the message sent to dev alerts? re sir-lancebot#745

dusky shoreBOT
short snow
#

sir-lancebot#745 this oen

dusky shoreBOT
short snow
#

this is how it currently looks

short snow
#

alright

short snow
#

looks good?

green oriole
#

Yes

green oriole
short snow
#

oops my role spelling lol

green oriole
#

Cool stuff

gritty wind
#

Are the links in the message going to be placeholders?

#

If so, just remove them

short snow
green oriole
#

It seems like the wrong moderator role (the one that I don’t have currently) is used inside Sir Lance to toggle command correction, can someone look into what is happening please?

green oriole
#

Like

#

.halp

#

^ I am not supposed to get this

sleek steppe
#

ah

#

Yeah that isn't in sir-lancebot at all

stable mountainBOT
#

bot/exts/backend/error_handler.py lines 167 to 168

if not any(role.id in MODERATION_ROLES for role in ctx.author.roles):
    await self.send_command_suggestion(ctx, ctx.invoked_with)```
cold moon
#

And why shouldn't mods get suggestions on @dusky shore ?

trim cradle
#

!embed Ternary if-else

If you've ever written this:

if num_snakes > 1:
    word = 'snakes'
else:
    word = 'snake'

You could instead write:

value = 'snakes' if num_snakes > 1 else 'snake'

This is simply a shorter way of doing if-else logic, though it's only available when the value-if-true, value-if-false, and condition are each one expression.

stable mountainBOT
#

Ternary if-else

If you've ever written this:

if num_snakes > 1:
    word = 'snakes'
else:
    word = 'snake'

You could instead write:

value = 'snakes' if num_snakes > 1 else 'snake'

This is simply a shorter way of doing if-else logic, though it's only available when the value-if-true, value-if-false, and condition are each one expression.

trim cradle
#

How's this for a ternary embed? I'm worried that using "snake" and "snakes" as the two options is too subtle

#

also it should say "word" in the second code example

frozen galleon
#

what about ```py
if age >= 18:
text = 'You can vote.'
else:
text = 'You can not vote.'

text = 'You can vote.' if age >= 18 else 'You can not vote.'

#

probably more distinct than snake vs snakes

eternal owl
#

prolly a boolean value instead of string could look better

vocal wolf
#

@trim cradle very nice work!

trim cradle
#

Because that's an anti-pattern--it's the same as bool(some_condition)

fallen patrol
#

Wow uh

#

@patent pivot said it was fixed but /shrug

#

It's entirely not.

patent pivot
#

lol

#

another publish error i guess

fallen patrol
#

Why?

#

It 100% has permission to publish if it has permissions to send messages

patent pivot
#

well

#

that was the error last time, lololol

fallen patrol
patent pivot
#

I'll check what it was this time

patent pivot
#

lol, it was a forbidden

#

so yeah, it can't for whatever reason

fallen patrol
#

Wow.

#

But can it not send messages in the channel?

patent pivot
#

well, it can send messages

fallen patrol
#

Oh

#

It needs manage message

#

Since its a webhook

#

Lol

patent pivot
#

it has that

#

lol

fallen patrol
#

Hm, are you sure?

patent pivot
dusky shoreBOT
#
True

patent pivot
#

have given it

#

more explicit perms

#

we'll see

#

.int e 1;exit()

fallen patrol
#

you also got errors for the loop before iirc

#

no, uh, token invalidation

patent pivot
#

huh?

#

yeah, the thing before was perms

clever wraith
#

@short snow I'm writing
flake8 in my terminal in project directory

short snow
#

run poetry run task lint, it would run the linters.

clever wraith
#

so if i intentionally do something like putting extra line is it is giving me erorr

#

alright

clever wraith
#

I'm getting this error while running it

$ poetry run task lint

  FileNotFoundError

  [Errno 2] No such file or directory: b'/snap/bin/task'

  at ~/anaconda3/envs/latest-py/lib/python3.9/os.py:607 in _execvpe
       603β”‚         path_list = map(fsencode, path_list)
       604β”‚     for dir in path_list:
       605β”‚         fullname = path.join(dir, file)
       606β”‚         try:
    β†’  607β”‚             exec_func(fullname, *argrest)
       608β”‚         except (FileNotFoundError, NotADirectoryError) as e:
       609β”‚             last_exc = e
       610β”‚         except OSError as e:
       611β”‚             last_exc = e
gritty wind
#

Make sure task is installed first (along with all other dependencies) by running poetry install

clever wraith
#

oh alright, yeah i think that was the issue! thanks a tons scal!

keen valley
#

Which file I should run so that
the sir-lance bot code will start

clever wraith
keen valley
#

poetry run task start

#

by this command which file start to run behind the seen

gritty wind
#

it runs the bot folder as a module

#

(python -m bot)

fallen patrol
#

@short snow just noticed that sending links to github which are embedded by the bot bypass all filters

patent pivot
#

lol

#

that's so so so niche

fallen patrol
#

is it tho?

patent pivot
#

yes

#

if someone wants to PR it, you can, but no one is going to strategically create github repo markdown files to share invites here

#

I don't think it's worth wasting resources in considering how few times this feature is used and that in general discord links on github are trustworthy

fallen patrol
#

oh, i was thinking swear stuff and similar

patent pivot
#

again, it's not going to be that common

short snow
#

people can do that.., we should get a stop that

patent pivot
#

if people do that, we fix the problem

#

but it hasn't happened

#

as I said, a PR is welcome, similar to how we run it on eval outputs, but it's a very very niche vulnerability route and considering that generally github is in order it is not something we should spend a lot of time on