#dev-contrib

1 messages · Page 87 of 1

gritty wind
#

I mean it's not a full answer, but yeah technically the bot only uses the API for DB ineraction

#

We also use the API for the site, at least for now

fallen patrol
#

is there a UI on the site for database interaction?

#

since ik there's a sign in on the site for admins 👀

gritty wind
#

So it's a bit complex

#

Yes there is some interaction with the API from the site

#

but most of it is done with the bot

#

For example, one of our most crucial DBs is the infractions one

#

The one with all the warns, notes, bans, etc

#

Now you could technically view that from the site

#

but we mostly use the Python bot

#

Anyways, questions about the new API would best be directed to Sebastiaan whenever he's online

fallen patrol
#

ah

short snow
#

do we have a db on sir-lance?

gritty wind
#

sort of

#

we have redis

#

but part of the sir-lancebot ethos is that it's easy to setup and contribute to

#

so no DB

short snow
#

ah yes redis.

gritty wind
#

Redis is technically a DB, but it's more volatile, so we can't store really important stuff on it

short snow
#

how do u think i should make the wtf python command, just using regex?

gritty wind
#

I'm not sure what you have in mind with regex?

short snow
#

matching the example pattern

#

or maybe just using split, first ssplit for ### :eyes: Example and then so on ...

gritty wind
#

So the comment claims all sections are h3s

#

and each of them has a section ID

short snow
#

yes

gritty wind
#

imo what would be best is to store a mapping of raw text version of the names to IDs

#

then fuzzy match

#

the raw names, and the inputs would be stripped of any formatting, and we'll just match A-Z

#

that should make it easy on the algorithm, and the user

#

all that would leave is fetching the content by IDs

#

I don't know if the document is structured in a way to make that possible?

#

Ah actually

#

we can avoid all that, and just steal it from the table of contents

#

that has a mapping of anchors to names

short snow
gritty wind
#

parsing on startup/when the data is missing from the cache

short snow
#

no need of ids

#

just the table

#

and spliting on the table and the next ###

gritty wind
#

yesh, it has all the anchors, so you can just append to the base URL, and boom, you've got the subsection

short snow
#

that would get us the link, and then we can use regex/splitting to get the content of that section

hardy gorge
#

@short snow instead of building one monolithic application that does everything, the API provides a layer of abstraction, which means that the bot does not also has to handle the database (models, migrations, database connections). Instead, that's split up into a different application that exposes a straightforward API.

short snow
vocal wolf
fallen patrol
hardy gorge
#

@fallen patrol It keeps the complexity of the bot lower and abstract database communication: You don't have to worry about managing a database from with the bot; that's handled by a dedicated application that offers an API to the bot. It's a pretty common design pattern these days: Instead of trying to do all things within one bot, you split up the services into multiple microservices.

fallen patrol
#

Ah that makes sense.

plucky maple
#

how does one request a feature? It might be a feature for the bot, or it might require a change in discord itself; dunno which

brazen charm
plucky maple
#

ya ok

#

so here's my "workflow" around here: I sit around and wait for a help channel to become occupied. I look in at it; and 95% of the time I can't help the guy, or they're already being helped, or whatever, so I mute the channel for an hour. The other 5% of the time, I start responding. I am rarely active in more than three such channels at once.

#

This works pretty well (and I suspect a lot of other helpers are doing something like this)

#

but "one hour" is totally arbitrary; what I really want is: "Mute until someone else claims this channel".

#

Oh and I want to be able to do this from the keyboard, too 🙂

brazen charm
#

What channels are muted can't really be controlled outside of your client (I believe it doesn't even transfer between different clients on the same account), I think the best the bot could do is notify you on new channels but you can just see that from a new channel being added to the bottom

plucky maple
#

yeah I figured it'd be something like that

#

probably requires a change in discord itself

clever wraith
#

wow joe chatting

patent pivot
#

Yeah, not feasible at Discord's side. They most likely won't add APIs for integrations to alter client things like that

patent pivot
clever wraith
#

Are you the founder of python

#

@patent pivot

patent pivot
#

No, I'm just an owner of this server.

clever wraith
#

this is not the official discord server of python

patent pivot
#

We're not official in the sense that we're run by the Python Software Foundation but we are listed at https://python.org/community/ and work closely with the PSF.

clever wraith
#

hmm okey

gritty wind
#

We have an internal issue with possible solutions

#

I could look into reviving it

short snow
#

also scal, there is some problem with the wtf python readme, it doesn't seem to follow the same pattern. I can send you the WIP cog file in DMs if u want it

gritty wind
gritty wind
short snow
#

uhh, i can send you the code, it would be better to understand, since i have numbered them

#

like it logs Sending: {number}, when you do .wtf

gritty wind
#

I don't really understand, but I'd much prefer you put it in the paste bin or push the changes

short snow
#

alright, i will use a pastebin

short snow
#

there u go

#

lemme send the ones which are sent

#
Sending sr.no: 0
Sending sr.no: 1
Sending sr.no: 16
Sending sr.no: 25
Sending sr.no: 26
Sending sr.no: 40
Sending sr.no: 43
Sending sr.no: 55
gritty wind
#

i don't understand what this means

#

What can I do to reproduce the bug?

short snow
#

and watch your terminal

#

first it sends the data as:

- regex
- findall match
gritty wind
#

Why are you using the previous header in the search for the next header?

short snow
#

am using the next header and the current header

#

to get the content between them

short snow
#

( @gritty wind incase u missed it)

gritty wind
#

I don't know

#

this seems like a very strange solution

#

how would it even work on the last entry?

#

I think you should rethink the approach, but I don't have time to look at it right now

#

If it's impossible, then just links are fine

short snow
#

Alright i will try if i can find any other solution

patent pivot
#

Anyone on Windows with Docker?

brazen charm
#

Yep

patent pivot
#

looking at your contrib guides issue on meta, trying to find the best solution

#

host.docker.internal works, but then people still need to add subdomains

gritty wind
#

what are you doing?

patent pivot
#

we refer to a command that doesn't exist

#

On MacOS it seems that localhost works (or at least it does for me)

gritty wind
#

Ah I see

brazen charm
#

Yeah I'm using localhost now, not sure if it didn't work before or I didn't try it

gritty wind
#

it's also localhost on windows

patent pivot
#

huh

#

well

#

that simplifies things lol

gritty wind
#

why don't we just have people access it through localhost? CORS?

patent pivot
#

subdomainss

#

(which we will be deprecating soon, so eventually yeah we will host on localhost)

gritty wind
#

hmm

#

everything else looks fine

green oriole
#

Couldn't we slap a middleware in the config to get rid of subdomains inside docker? I guess that would be quite a bit of work

gritty wind
#

too much work if we're gonna move away from the setup

brazen charm
#

What issues are there with subdomains? seems to work fine for me

green oriole
gritty wind
#

shit you're right

#

lmao the SO answer is wrong

brazen charm
#

Ah, browser works but the bot gets a domain name error

patent pivot
#

I've made most of the changes listed by people on that issue

#

i also captchad myself while submitting an article smh

gritty wind
#

Sweet

#

while you're at it

#

could you just

patent pivot
#

lol, for XSS

gritty wind
#

or make it not an essay

patent pivot
#

lol

#

probably worth discussing with folks like

#

what we need in there

#

@green oriole hello thoughts

brazen charm
#

Yeah its scope is maybe a bit too wide, and doesn't really look like new contribs read it

gritty wind
#

there are also some rules in there that we don't follow at all, or in very limited contexts

brazen charm
#

Broke the first "rule" quite a few times

gritty wind
#

Yeah that one in particular is very over bearing

green oriole
#

It is on the core dev meeting agenda

gritty wind
#

the core dev meeting is a bit of a unicorn atm

green oriole
#

Let me just..

gritty wind
#

2 is very explicit, but most people feel more comfortable not following it, and 5 is meaningless. 7 feels very redundant, when we can simply tell people to comment on issues they want to be assigned to

patent pivot
#

anyway I think that's the meta issue mostly resolved

#

so I'll close that and we'll look at the guides on GH in the meeting

gritty wind
#

One more thing actually

#

docker-compose requirement is only needed on linux

#

it comes included on windows and mac

#

same goes for site

#

it has already been changed by Chris on sir-lance

patent pivot
#

updated

short snow
#

Well @gritty wind I couldn't think of any other way, should I just use links? Or if someone has anything in mind they can just let me know

trim cradle
green oriole
#

That is true

trim cradle
#

how to do

gritty wind
#

Pipenv run test

#

Or is it report

green oriole
#

that

gritty wind
#

One of those things

short snow
#

Can anyone share a article or link on writing unit tests, never worked with them. Thanks

green oriole
#

but it all described on the README in the tests folder

gritty wind
#

Actually if you’re on pycharm they have a much stronger test suite you could use

green oriole
#

@short snow ^ this is a very good resource actually, and they are some additional resources at the bottom of the page

gritty wind
#

Tl;dr for writing tests: input goes into modular component, correct output comes out

green oriole
#

np

gritty wind
#

Unit testing is then finding the input that is likely to go in, and cause problems

short snow
#

And on what type of features do u write tests?

gritty wind
#

If it’s bot

#

All of them

#

Though it isn’t enforced

green oriole
#

Eeehhh

gritty wind
#

We aim for 100% coverage, though that’s like a negative priority at the moment

green oriole
#

We did say that 100% was stupid

short snow
#

Ah alright 👌

gritty wind
#

Otherwise it’s mostly infrastructure to support the bot, which we probably won’t test as much

green oriole
#

Hmm

#

I added a section linking to this document at the bottom of the guide

trim cradle
#

for some reason I get permissions issues if I run pipenv run test but I can't run it with sudo

#

I'll figure it out, I guess

green oriole
#

What do you get?

trim cradle
#

PermissionError: [Errno 13] Permission denied: '/home/steele/projects/pydis/bot/logs/bot.log' this gets raised in every test

vale ibex
#

Did you run pipenv run start under sudo?

#

That could cause permission errors on the log file

#

maybe a chmod chown could solve it

trim cradle
#
(bot) steele@steele-mint:~/projects/pydis/bot$ sudo pipenv run start          
sudo: pipenv: command not found
short snow
#

Uhh try checking the perms of bot.log

green oriole
trim cradle
#

sudo rm -r logs/ && mkdir logs && touch logs/bot.log seems to have fixed it

#

but why didn't I have permissions for that folder...?

gritty wind
#

Because you betrayed windows

green oriole
#

It has been generated inside the container, so it was owned by root with aggressive permissions

trim cradle
#

let's see if I can just run the tests in the infraction directory

gritty wind
#

If only it could fit

#

I think you can pass the module’s name to run it

#

Which might be something like bot.ext.infractions

#

Idk I let pycharm handle it all

green oriole
#

You need slashes, maybe?

trim cradle
gritty wind
#

Yeah it should still be pretty similar

#

You type out the module after the command and it’ll run that

fallen patrol
trim cradle
# fallen patrol Do it 👀

It seems that Microsoft wants to improve their support for Python so I don't want to shit on their efforts

green oriole
#

...lol

#

Can I though?

trim cradle
#

I won't stop you

gritty wind
#

I think it's too long anyways

trim cradle
#

though I added an object is an instance of a class and I have no regrets about that one

fallen patrol
gritty wind
#

> isinstance(object, class)

Syntaxerror

fallen patrol
green oriole
#

Well, MS adding more Python support is just them pointing their user to use broken installs just for the sake of using their services

gritty wind
#

Ehh it's not worth the conflict lol

fallen patrol
#

Mm, python3 in console opens windows store to install python....

#

Even if you already installed it.

green oriole
#

If they really wanted to add more support they'd vendor CPython and call it a day

gritty wind
#

python installs as python not python3

#

so python3 still opens the store

fallen patrol
#

Even if you install python via the store tho

#

Which I did thinking it might stop it when I type python3

#

And it still opens the store 😔

gritty wind
#

The command is just an alias for open store pretty much lol

fallen patrol
gritty wind
#

we're not going to add it

#

anyways I'm more used to python on linux too lol

trim cradle
#

It looks like for the tests for the infraction system, it tests to make sure that the message that would get sent to the user for note infractions looks correct, and doesn't get sent

#

and that's quite a superfluous test.

green oriole
fallen patrol
#

Afaik the limit for channel names is 100 characters, so it is possible

fallen patrol
#

I've used windows subsystem for Linux with vim installed and mounted my c drive instead of using notepad.

fallen patrol
green oriole
#

That's still really long, even if it is under the limit

fallen patrol
#

!ot anyways, I'm now extremely offtopic, if someone wants to go there, I'll be there

#

On topic--

#

!src ot

stable mountainBOT
#
Bad argument

Unable to convert 'ot' 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.

fallen patrol
#

Why does that not bring up the tag?

green oriole
#

Because ot is fuzzymatching the tag offtopic

fallen patrol
#

It's off-topic

#

Which makes it hard to match

green oriole
#

aah

fallen patrol
green oriole
#

yes

fallen patrol
#

!ofto

#

Oh..... Okay

green oriole
#

It is on cooldown

fallen patrol
#

No i just deleted it

#

With the trashcan

fallen patrol
stable mountainBOT
fallen patrol
#

Ah

vale ibex
#

From the staff meeting

gritty wind
#

you're too quick

#

let me uhh

#

take a look

#

@vale ibex I'm looking at it

#

it'll work

#

but I think it may be a bit too unscoped

#

the channels and categories are used in a bunch of places

vale ibex
#

Yea, I purposefully didn't add staff-voice to the global whitelist, in case it becomes too spammy

gritty wind
#

if it's just the issues that we want to whitelist, we can do that pretty easily on its own

vale ibex
#

But it's easy enough to do so

gritty wind
#

I'll let more people chime in, but I don't mind it either way

#

My preference is locking it to the issues

vale ibex
#

Are the channel and category constants used as whitelists in the entirety?

#

I saw the global whitelist just references certain channels/categories, rather than them all

gritty wind
#

The categories are used in certain overrides

#

Not in too many places which is why I don't mind it

#

but also I don't see a harm in limiting the scope

#

Which is why I want others to chime in

vale ibex
#

i tried to look for that, I couldn't see anywhere they were used in their entirety

gritty wind
#

fair enough, I think I initially misunderstood this change

#

yeah this lgtm

#

I thought the whitelist changes were made directly to the global whitelist

#

but your solution is more what I had in mind

vocal wolf
#

I did review thing

vale ibex
#

Should I just alphabetise them? @vocal wolf

#

I tried to follow the order that the channels appear in the server

vocal wolf
#

well I don't think the rest of the constants file is alphabetized iirc

#

@gritty wind didn't you do a PR a very long time ago doing said alphabetization?

gritty wind
#

python

vocal wolf
#

right

gritty wind
#

nightmare it was lol

vocal wolf
#

@vale ibex ye it's fine for now, we'll probably make a PR at some point to attempt to alphabetize @dusky shore

#

just make the order the same

vale ibex
#

Sure

#

Do you want me to change the issues cog to be in the order of the constants? or the other way around?

obsidian patio
#

Hi mr. poker

vale ibex
vocal wolf
obsidian patio
#

@vocal wolf I've added a final request to it. Are you fine with if I commit that suggestion directly and we can merge it?

vocal wolf
#

yes

obsidian patio
#

Perfect—done!

vocal wolf
#

I'll merge when all checks pass

obsidian patio
#

Nice nice

vocal wolf
#

@obsidian patio ah god dammit we probably should've capitalized "the"

#

in the print statement

obsidian patio
#

Oh yes. That was something I was gonna comment earlier today, but I forgot it now. Want me to commit it and we'll call it a day?

vocal wolf
#

ok here's what we'll do

#

commit that and then I squash and force push then merge

obsidian patio
#

Was just thinking the same. Lovely

vocal wolf
#

very cool

#

tell me when it's done

#

alright

#

I see it, doing the thing now.

obsidian patio
#

Nice, the thing

vocal wolf
#

@obsidian patio force push success, I will now merge when checks have passed.

obsidian patio
#

Nicee

vocal wolf
#

@ashen isle thanks for the contribution, the tag has been merged!

ashen isle
#

:3

obsidian patio
#

Touchdown confirmed

vocal wolf
#

Once the bot reconnects, we can then see the change

obsidian patio
#

I've been waiting to say that for 15 minutes

vocal wolf
#

!comparison

stable mountainBOT
#

Assignment vs. Comparison

The assignment operator (=) is used to assign variables.

x = 5
print(x)  # Prints 5

The equality operator (==) is used to compare values.

if x == 5:
    print("The value of x is 5")
vocal wolf
#

@ashen isle it works well

ashen isle
#

yay

#

ugh, wait, that capital P is terrible

obsidian patio
#

Hahah, that's pep 8

vocal wolf
#

yep

#

It had to be done

vale ibex
#

@gritty wind I have a commit in there to match the ordering 😄

gritty wind
#

it doesn't though 🤔

#

devprojects would switch with the other dev one

#

also that's the categories, didn't the channels need to be rearranged too?

vale ibex
#

Oh no, I moved development, but put it in the wrong place facepalm

gritty wind
#

haha consider my approval permanent

vale ibex
gritty wind
#

I think the confusion was probably because it isn't in alphabetical order

#

it looks fine yeah

vale ibex
#

want me to commit the fix and squash ?

#

so its just 1 reorder fix

gritty wind
#

can we squash merge on sir-lance

vale ibex
#

Sure

gritty wind
#

nope

#

please force push then

vale ibex
#

I mean we can squash before merging, but not on merge

vocal wolf
#

disabled on repos, you have to do cli stuff

gritty wind
#

ye

vocal wolf
#

If it was ordered, then nevermind my comment lol

gritty wind
#

eh I thought you'll merge the whole PR into one commit

#

but this is fine

vale ibex
#

Mistakes have been forgotten

gritty wind
#

xith apprrrrrove

vale ibex
#

Yea, could have done that 😂

#

I guess the ordering issue was there before me, so having a separate commit to fix it isn't so bad

gritty wind
#

(or request changes, I'm not your boss)

vocal wolf
#

@vale ibex @gritty wind merged

#

@obsidian patio congrats!

gritty wind
#

Imagine not having push notifications

obsidian patio
#

Thanks Xith

short snow
#

@obsidian patio Congrats for Project Lead, which projwct lead are you btw?

#

Even scal and fire got it

#

and xith and lemon got new domain lead nice

obsidian patio
#

Thanks

#

It's called "Hidden Gems," which is a YouTube series where we'll be showcasing different features of the python standard library, that most people don't know about already

short snow
#

Oh cool logo_hidden_gems logo_hidden_gems gem_red gem_red

deft patrol
#

In future you'll the mod one day 😄

#

@obsidian patio

fallen patrol
#

Afaict, he's the only non mod or admin lead.

thorny obsidian
#

I was just the Event Lead before I was asked to join the Admin team. So it's not unprecedented.

fallen patrol
#

O

clever wraith
#

whats a preferred way to learn sir lanbot?
directly fall into code or there are some good .md files?

gritty wind
#

Hmm so

#

but after that, its mostly just normal d.py cogs with your code

#

what issue are you looking to work on?

clever wraith
#

i'm not exactly looking for any specific right now as i've got exams but i'll look for something simple once, and once i got an accepted pull, i can work for game like issues.

#

there's hangman one i think.

gritty wind
#

So there may or may not be a recommended implementation on certain issues, which could help you when starting out

#

but if you've worked with discord.py cogs, you'll be fine

#

a good reference game could be the connect 4 game

clever wraith
#

its in our repo?

gritty wind
#

it should be yeah

#

.source connect4

dusky shoreBOT
#
Command: connect_four

Play the classic game of Connect Four with someone!

Source Code
clever wraith
#

makes sense. okay i'll play around with game to see how stuff works, and will check first-issue label for a simple start.

gritty wind
#

sounds good, when you're ready to start working, just leave a comment on an issue

clever wraith
#

like before starting?

gritty wind
#

yes

#

that way you can get assinged to it

#

so we don't have multiple people working on one issue

clever wraith
#

okay great. will do once i get my schedule clear.

#

thanks for help!

obsidian patio
#

Many of you probably know about https://carbon.now.sh already, which lets you generate these nice images of your code

#

One idea that hit me is to make a .carbon command for @dusky shore, where you can post your code and get back the formatted result (as an image). Do you have any thoughts on this?

#

.carbon ```py
for i in range(5):
print(f"Hello number {i}")

#

^ This is an example of how it would be used

gritty wind
#

yeah one major concern

#

does it have any form of API

obsidian patio
#

I did some research, but couldn't find a very conclusive answer

gritty wind
#

one thing I see is that you can load in github gists by appending to the URl

obsidian patio
#

Yeah

gritty wind
#

but the output seems much more difficult

#

and looks like it requires scrapping of some sort

obsidian patio
#

Did you see Ben's VSCode tinder thing? That used carbon iirc

#

Reading through an issue on the repo, it also seems like a few people have made APIs for it and that they might be working on an official one

gritty wind
#

Yup, was looking at that now

#

But that would be an additional service we have to host

#

which is something we try and avoid on sir-lance

obsidian patio
#

Hmm, yeah

#

Do you think scraping the image would be too bad? A lot of people want to learn scraping, so this could be a legitimate use case for it

gritty wind
#

I honestly don't even know if it's allowed

#

this is their robots

#
User-agent: *
Disallow: /*?*
Allow: /*
#

Ah yeah the ToS forbids it

obsidian patio
#

Ah, alright

gritty wind
#

hmm carbon-api does provide an online api it seems

#

I don't know why that link broke so hard

obsidian patio
#

Spaces, I think

#

That's nice though. Means we might have a chance to do this

#

What do you think of the actual idea of a command like this?

gritty wind
#

It seems cool, so thumbs up from me.

#

The implementation needs some thinking

obsidian patio
#

Yeah, definitely. I personally don't have time to implement it, but I'm fairly confident that someone will want to do it

#

I'll open an issue for it

gritty wind
#

hmm let me see if anyone has ideas about the implementation first

#

The API is fine, but I don't want to strain the service if it can be avoided

obsidian patio
#

Yeah, understandable

#

!remind 48h Progress?

stable mountainBOT
#
Yep.

Your reminder will arrive in 2 days!

short snow
#

wait, pycharm and vscode has a plugin for this

#

and if they have a plugin, means they are somehow interacting with the website

#

that means even we can do it

gritty wind
#

I think its probably generated in VSCode

short snow
#

I will see if i can find anything on the net

gritty wind
#

the ToS is explicitly against scrapping

#

and automation

short snow
#

hmmm, and it is pretty fast, so maybe even we can implement it

#

Uhh, maybe after tomorrow's exam I can look into it

patent pivot
#

The API above is also a ToS violation fwiw this

#

It uses Pyppeteer which is just headless chrome

#

all the APIs I see listed are just headless browser instances

#

the carbon devs seem open to adding an API, but no progress updates in a while

gritty wind
#

ok so

#

I'm looking at the readme

#

they have a CLI

#

I wonder if that would violate ToS

#

I assume not because they list it in their readme

obsidian patio
#

An official CLI?

gritty wind
#

not official

#

but it's listed there

#

so its endorsed

patent pivot
#

interesting

#

all of these solutions use a headless browser

#

which i am very eh on

#

I'd rather not run an instance of chrome just to have lancebot run

short snow
#

oh scal already posted it

patent pivot
#

yeah

#

i'm going to say

#

the conditions for this to be implemented

short snow
#

hmmm, what if we install the cli on the machine and call bash commands?

patent pivot
#

that's still a headless chrome instance

gritty wind
#

if you can't easily install it from code, no

short snow
#

store the image locally, and delete it after every run

patent pivot
#

nah

#

it's not about that

#

it's about the fact that the bot has to start up a browser

gritty wind
#

An alternative

#

is to shelf this idea until an API is available

patent pivot
#

My conditions:
– We can't run an instance of chrome locally for Lancebot just to generate code snippets, I have no idea if that would even work in Docker
– We can't violate the ToS, any solution must be made by/officially endorsed by the Carbon team
– We use an API, we can't expect users to install a suite of terminal commands for certain features, it should be implemented in Python

#

Yeah, that's my thoughts

gritty wind
#

Or to host a pydis instance, but that's really ehhhhhh

patent pivot
#

nah

green oriole
#

Resources go brrr

green oriole
#

That doesn't sound like a wise use of our limited resources

#

Sounds like a lot of security concerns

patent pivot
#

the CLI is just a browser instance

#

it starts up a browser and opens the carbon page

short snow
#

oh yeah

#

my bad

patent pivot
#

and also see the third point, we shouldn't use a command for this

short snow
#

right

patent pivot
#

I'm with Scale here that we should keep the idea at the back of our heads until there is some official API available

obsidian patio
#

Unless they release the API, it doesn't sound too positive

short snow
#

if we implement it on our like we do for image commands?

#

but only python code

patent pivot
#

yes, we probably could write an implementation of it fairly easily

#

pygments would probably help with the highlightnig

gritty wind
#

It would have to be very stripped down feature wise

patent pivot
#

yeah

short snow
#

alright, i will see if i can implement it. Maybe next week, once this school stuff gets over

#

or anyone else can

short snow
#

sir-lancebot#600 and sir-lancebot#595 can anyone review these two?

fallen patrol
#

@patent pivot that update 👀

#

I just don't see it

patent pivot
#

uhhhhh

gritty wind
#

hmm why is forms not signed

#

ssl error on my end

fallen patrol
#

Ye, when I refresh, that happens

gritty wind
#

but damn thats a cool screen lmao

patent pivot
#

lol

#

i have an idea

gritty wind
#

too many redirects

#

wat

#

oh yeah it's spamming requests

patent pivot
#

hmmmmmm

fallen patrol
#

Mmm yes I like permanent loading

#

Reminds me of everything I've coded

gritty wind
#

hey the app works, blame joe

patent pivot
#

why is it only our forms subdomains

gritty wind
#

are we serving anything else from a webpack bundle?

fallen patrol
#

There's an app??

gritty wind
#

app as in

#

web app

fallen patrol
#

O

#

Also, not sure if this is supposed to happen

patent pivot
#

that's intentional lol

#

it's not a real domain

fallen patrol
#

Oh okay

patent pivot
#

but uhhhhh yeah seems forms is returning a bad certificate

#

oh wait no it's not that was just me forgetting to send my client cert ignore lol

#

well it might be i'll need to debug something

gritty wind
#

would that explain the too many redirects?

cold moon
#

I get Invalid SSL certificate

#

If I click refresh

patent pivot
#

yeah the cert is invalid

#

becauseeeeee uhhh

#

ah netlify is refusing to generate one

#

one second

gritty wind
#

I get the ssl error too, but the too many redirects if I have console loaded

cold moon
#

Sometimes with SSL error there is such redirect errors

gritty wind
#

actually

#

I don't think this is netlify

#

forms-api is down too

#

unless that's netlify as well?

cold moon
#

No, this is Kubernetes

gritty wind
#

well the backend itself is, but there is a frontend component to it

#

with the swagger stuff and what not

patent pivot
#

okay so

#

that should be fixed now but will take some time to propagate

cold moon
#

Is this reason for backend SSL error also?

patent pivot
#

as for the forms-api i'm looking into it

#

no

fallen patrol
#

Now forms is just entirely dead

patent pivot
#

lol

#

nah that's from netlify

fallen patrol
patent pivot
#

yeah

#

lol

#

I know why

#

backend is out

gritty wind
#

hmmmmmm

#

why isn't it that lol

#

it should be

patent pivot
#

uhhh

#

can only have one level of TLS with CF on the free plan iirc

gritty wind
#

aww

#

oh well

fallen patrol
#

Smh its down because you are on a free plan but TIL there's a free plan??

patent pivot
#

it's not down because of that

gritty wind
#

no its down because joe is bad at typing

patent pivot
#

it's down because i forgot to change a parameter lul

#

okay backend is back up

fallen patrol
#

👁️

gritty wind
#

so the frontend is no longer unsigned but

#

still spamming requests

patent pivot
#

lol

#

can't reproduce

#

frontend is back here

#

no spam

gritty wind
#

Time to uninstall chrome ig

#

Fine on my phone too, I’ll check back in a few

patent pivot
#

lol

fallen patrol
#

Same issue for forms here tho

patent pivot
#

certs all fine here

#

you might have a cached DNS entry

cold moon
#

I had to force reload

fallen patrol
#

Okay it loaded

#

I take it forms still don't work tho

#

Still submitting

gritty wind
#

No that’s just a broke part of the app

#

Still waiting on a review to fix it 👀

fallen patrol
#

Is the broken part it didn't make me sign in first?

gritty wind
#

Yesh

patent pivot
#

okay things all look healthy now

fallen patrol
#

Aside from the app just being broken 👀

#

It's new, yeah?

gritty wind
#

Well it’s unfinished not really broken

#

But yeah

patent pivot
#

yeah it's not in prod by any means

short snow
#

is forms backend open for contribution?

patent pivot
#

as of now we're keeping it staff-only & the issue tracker is internal, when we go into production we may revisit that though

short snow
#

(are contributors allowed?)

gritty wind
#

it's only staff at the moment

#

partially because of the internal tracker

fallen patrol
#

is the internal tracker internal code?

gritty wind
#

internal issue tracker, where we put all the tasks that need to be done

cold moon
#

We can't open this page to public because this contain private information.

patent pivot
#

Not at the moment, anyway

short snow
#

ah alright

fallen patrol
gritty wind
fallen patrol
#

closed or open source code, basically

gritty wind
#

The issue tracker is hosted on notion, so I guess closed source?

#

We don't run the tracker

#

we just use it lol

fallen patrol
#

ah

obsidian patio
#

How would I set the site to debug mode?

short snow
#

in config.yml just put DEBUG=True ig, lemme have a look

#

you are running the bot or the site?

obsidian patio
#

Site

short snow
#

alright

obsidian patio
#

It seems like environment variables would be the way to go, but I can't seem to get it working correctly

gritty wind
#

Are you using the docker-compose, and if not, what are you putting in your env vars?

obsidian patio
#

I'm using docker-dompose, yeah

gritty wind
#

It should be on by default

obsidian patio
#

I'm trying to disable it

gritty wind
#

Ah right

#

set it to 0

obsidian patio
#

The question is where

gritty wind
#

Docker compose

#

or if you can

short snow
#

open docker-compose.yml

gritty wind
#

your terminal's environment

#

it won't load an .env though

obsidian patio
#

Aah, alright

short snow
#
      DEBUG: 0 # set this to ), it is 1 as default
#

in web/environment:

obsidian patio
#

Should I also remove the debug flag?

short snow
#

and while using pipenv, just in .env in your root

short snow
obsidian patio
#

Yep

gritty wind
#

You shouldn't have to 🤷‍♂️

#

It's running without debug when I just change the 0 for me

short snow
#

we have to, have a look at the manage.py

#

but it does normally too ig

#

it is over written

gritty wind
#

or you can just test it and see that it'll literally work 😛

obsidian patio
#

With the flag, it runs debug in the terminal

#

Without it, it runs it like production

#

But the site is the same, it seems

short snow
#

debug only manages the errors

#

it will show you the errors with debug true otherwise it will show the error page

#

are u trying to test the pydis wallpaper for errors?

obsidian patio
#

@gritty wind The Django documentation says that I should be able to just put a 404.html file in the root of templates/ and that it should then be used automatically as the 404 page. That's not what I'm experiencing though.

This is what I currently have

#

But this is what I get when requesting a page that doesn't exist

#

Oh wait... that's not a 404

gritty wind
#

What page are you trying to visit

obsidian patio
#

Just something random that shouldn't exist. I've tried other URLs as well

gritty wind
#

hmm that should 404

#

it does for me

obsidian patio
#

Same for that one. It gives me 400

gritty wind
#

I wonder if it's unique to the no debug

#

one sec

obsidian patio
#

Oh, you know what. I just checked the logs (should've done that earlier tbh)

gritty wind
#

yeaaaah that's why we need debug lol

short snow
#

lol

obsidian patio
gritty wind
#

shweet

short snow
#

niceee

#

u are writing the error pages?

obsidian patio
#

Making a 404 page

#

Possibly 500 as well

patent pivot
short snow
#

look up on code pen for some sweet designs, and you can then use those designs for the error pages, but with your own taste

patent pivot
#

We've already rolled those designs out upstream at cloudflare but want to tie them into Django as well

short snow
#

arghh, postegres started late than site, and site existed we need to fix this too ig

patent pivot
#

Interesting

gritty wind
#

site does actually wait for db

#

and retries like a million times

#

so if it failed all retries

#

well your DB isn't coming up

short snow
#

it came up

patent pivot
#

It waits for Postgres to start

#

But maybe not actually be ready

fallen patrol
gritty wind
patent pivot
#

hmmmmm

short snow
#

i need to run docker-compose up web again

patent pivot
#

we can check that the TCP port is open

obsidian patio
#

Also, I need to confess something

patent pivot
#

lol

vale ibex
#

pg_isready exists, not sure if its present on the docker image though

obsidian patio
#

This is the fine art of bodging

patent pivot
#

hmm that's true chris

short snow
#

how many migrations do we have lol

gritty wind
#

all of them

obsidian patio
#

Is there a better way to add it as an allowed host, without modifying the defaults?

patent pivot
#

!remind 20M is Postgres alive?????????????!?!?? Is it????? Are you sure?????? Does donker know!??????

stable mountainBOT
#
Okay.

Your reminder will arrive in 20 minutes!

gritty wind
#

staying in debug lol

fallen patrol
#

really thought that was 20 months

thorny obsidian
#

donker

short snow
#

lol

patent pivot
#

donker and koobernoots

thorny obsidian
#

(that's my helpful contribution of the day, you're welcome)

obsidian patio
#

I tried env vars, but with little luck here. Eh, I'll just bodge it since it's just for my local testing

short snow
#

!otn koobernoots-powered-pydis

thorny obsidian
#

!otn a koobernoots

stable mountainBOT
#

:ok_hand: Added koobernoots to the names list.

short snow
#

on running docker-compose up the site is running on http://pythondiscord.local:8000 right?

gritty wind
#

it's on localhost

#

You have to set the pythondiscord.local in your hosts

cold moon
#

This is used because you can't do api.localhost:8000

obsidian patio
#

Hmmmmm

#

A truly terrible Monty Python pun

fallen patrol
#

👁️

#

please, I beg you, don't commit that

#

👀 also why is there not a robots.txt file? 🤔

green oriole
#

Ah

#

Wasn't Scott working on this?

#

Like, ages ago

obsidian patio
#

The 404 page?

brazen charm
#

robots

short snow
#

scott meaning ela?

obsidian patio
#

Ah

green oriole
#

Nah, that was another staffer who left

#

Alright, we definitely should have one

short snow
#

always open a issue on it before you work
or is already opened vester

stable mountainBOT
#

@patent pivot

It has arrived!

Here's your reminder: is Postgres alive?????????????!?!?? Is it????? Are you sure?????? Does donker know!??????.
[Jump back to when you created the reminder](#dev-contrib message)

thorny obsidian
#

!otn a does-donker-know

stable mountainBOT
#

:ok_hand: Added does-donker-know to the names list.

obsidian patio
#

Is there a way to get the server invite in a Django template, instead of hardcoding the value?

gritty wind
#

discord.gg/python?

obsidian patio
#

I meant more if we had a constant for it, so it's not hardcoded

#

Looking through the source code, it seems like it's hardcoded in other places as well though

gritty wind
#

yeah that's probably fine

#

it will be painful if we lose our vanity url, but its fine for now

obsidian patio
#

Yeah

fallen patrol
#

who runs @tropic flowerbot and where is the source?

gritty wind
#

Joeee made it

fallen patrol
#

clearly the right user

#

@lusty lantern

patent pivot
#

wait the source is pinned? Lol

gritty wind
#

Maybe

#

There is one that specifically mentions steakbot

fallen patrol
#

yeah but no source

patent pivot
#

good lol

#

source is horrible

fallen patrol
#

@patent pivot 👀

patent pivot
#

lol

fallen patrol
#

why is this bot so old when it uses late 2020 features?

#

what did it use to doooo

#

oh jeez I regret looking at joe's github

patent pivot
#

why regret lol

patent pivot
obsidian patio
#

Any idea what's up?

patent pivot
#

that's an implementation of slash commands with azure

obsidian patio
#

This is the thing I added the stylesheet to, instead of embedding it into the HTML

patent pivot
#

hmmmm

#

not sure

#

Any other details in console?

#

that should be accompanied by an error

fallen patrol
#

what server framework is it using?

patent pivot
#

steakbot?

obsidian patio
#

This is all I see. Where do you want me to look?

fallen patrol
#

no, gurkan

patent pivot
#

Django

patent pivot
fallen patrol
patent pivot
fallen patrol
#

@obsidian patio 👀 didn't you turn off debug mode

eager fable
#

Hi Joe :)

obsidian patio
#

Was actually just writing about that. The site isn't running in debug mode, but the terminal runs in debug mode, if that makes sense

patent pivot
#

hm

fallen patrol
# patent pivot do I? lol

yeah, and another several discord related repos, including one that allows you to use the api from command line :sus:

obsidian patio
#

This is where I have the css file, and I'm trying to access it via ```html
<link rel="stylesheet" href="{% static "css/error_pages.css" %}">

patent pivot
#

it doesn't use any tokens

fallen patrol
#

i mean, how do you authenicate it

#

ohhhhh

patent pivot
#

it doesn't lol

fallen patrol
#

wat the f*ck

patent pivot
#

right now it just uses the invite API

fallen patrol
#

:squints:

patent pivot
#

lol

#

invite api is unauthenticated

#

so if you have an invite you can fetch new details

fallen patrol
#

ah

#

yeah, @stable mountain uses that for invite whitelisting

#

surprised more bots don't do that

#

!shrug

patent pivot
#

yeah

fallen patrol
#

smh dead bots

#

anyways, time to attempt to git

obsidian patio
#

Aah, got it

#

I needed to {% load static %}

harsh path
#

ugh why does flake8 pass locally but not on the repo, is there something extra i need to do to check import order?

gritty wind
#

It may not be using the plugins

#

how are you running it?

harsh path
#

i'm just running pre-commit

gritty wind
#

that should only install it I think?

#

Do you see passed in the output

#

pipenv run lint

harsh path
#

it says everything passed

#

i figured it out

gritty wind
#

It really shouldn't have passed

#

it may not be using the config

#

but that would highly depend on the way you're running things

short snow
obsidian patio
#

Yep

gritty wind
#

eee that looks awesome

#

It looks like wallpaper

#

pertty cool

short snow
#

True

obsidian patio
#

Hahah thanks scale

short snow
#

Can we use constants for bg and discord invite?

subtle kraken
#

@short snow I imagine you have tested wiki?

short snow
#

Yes

#

check the screenshots

subtle kraken
#

ah yes per usual I disregard the convo and just look at the code

#

sorry

short snow
#

no problem, even i do that sometimes

short snow
subtle kraken
#

@short snow 🎉

#

I sure hope I didn't miss some breaking thing that'll break the bot

short snow
#

U didn’t 😛

subtle kraken
#

very nice improvements btw

#

looks really clean

short snow
green oriole
#

@obsidian patio it should be 2018-2021 IMO

#

Not just 2021

obsidian patio
#

That was fast

green oriole
#

I am always watching the dev log haha

obsidian patio
#

Ahahah

#

But yeah, I’ll make it a span

gritty wind
#

I don't think we do license bumps

#

Joe explained the legality behind it

#

but I'm too dumb to explain it

obsidian patio
#

Hmmm, okay

gritty wind
#

keep it up until he chimes in though

green oriole
#

DEVOOOOPPSSS DAAAADDYYY

patent pivot
#

@obsidian patio license bumps are not necessary

#

there is an implicit copyright on code from the minute it is conceived as an idea

obsidian patio
#

Hmm

#

Yeah

patent pivot
#

though i will do some research

#

and ask my lawyer

gritty wind
#

lol so fancy

obsidian patio
#

That is only a flex

green oriole
#

"I'll ask my lawyer"

#

I am calling the flex police, sir

rapid swallow
#

"I'll consult my lawyers"

patent pivot
#

lol

obsidian patio
#

But yeah, sure thing. I’ll let you close/merge the PR when you decide

patent pivot
#

the top tip for doing your own legal research

#

is don't do your own legal research

#

okay lawyer is typing

gritty wind
#

is that legal advice

patent pivot
#

lol

#

okay so

#

– copyright registration is a US thing because US copyright law is "fucking abysmal", but it's useful elsewhere for reference
– changing the copyright date is actually pretty harmful in some cases, because if you update the date you are no longer claiming copyright for the time period before that, therefore if someone else publishes the work then you making a claim on it is difficult

  • if we really do want to update the date we should instead add a new date so like ©️ 2020, 2022 if we make substantial modification
thorny obsidian
#

copyright and trademarks is a hell spawn of a legal field

patent pivot
#

yes

#

that

#

I guess we like

#

could do 2020-2021

#

but even then that's stupid

#

because we have 95 years of copyright already under US copyright law

#

so why even bother capping it lol

#

though

#

hm

#

okay more legal research needed lol

#

there is some guidance from the FSF which says yes you should include the year as a comma separated item in the license file providing that you have made copyrightable changes in that year (so you can't just bump as the first change in the year)

#

okay, I don't think it's necessary

fallen patrol
#

👀

fallen patrol
#

asking for a friend, clearly

green oriole
#

By being Joe, of course

#

Isn't your day a lawyer actually?

patent pivot
patent pivot
fallen patrol
#

👁️

green oriole
#

Aha, that's the catch

fallen patrol
#

^ i don't have that 😔

#

does anyone here aside from joe have it, lol

green oriole
#

Nah

#

Joe is like an edge router

#

He has kind of little relations with everyone

clever wraith
#

is the .pyfacts PR good? it's sir-lancebot#596

dusky shoreBOT
slender grove
#

Wow github

short snow
#

Are u trying to get voice verified?

ember cloud
#

should there be a !environment-variables command?

#

it'd be really really useful

vocal prairie
ember cloud
#

either channel seems fine

fallen patrol
#

add !resources to the cooldown like !ot and others are

short snow
#

@vocal wolf , the feature is already done

#

it is waiting for review

#

i did one approval.

vocal wolf
#

oh really?

#

oops

#

comment removed

#

ah I didn't see the PR linked

#

rip

short snow
#

lol

#

review it

vocal wolf
#

you don't tell me what to do I already am xd

short snow
#

😛 nice

#

sir-lancebot#595 and this too if u have time, a very shoort pr

dusky shoreBOT
eternal owl
#

Hey @vocal wolf , regarding the pride event calendar, can we just make an all year round calendar rather than for pride only

vocal wolf
#

I suggest making an issue and seeing what other people think, I'm not too sure myself.

eternal owl
#

Okay

vocal wolf
#

Thanks!

#

❤️

eternal owl
#

I will make one when I reach home, current in uni 😬

short snow
#

Go study!

eternal owl
eternal owl
green oriole
#

If it is a year around calendar I don't think we should restrict it to the pride season

eternal owl
short snow
#

Which uni?

eternal owl
#

PESU, Bangalore

short snow
#

Oh

eternal owl
green oriole
#

Interesting idea

eternal owl
#

That discussion was 2 years ago

#

In the prev Dev contrib channel

green oriole
#

Haha, man that's old

eternal owl
#

Ye

green oriole
#

I probably wasn't even here

eternal owl
#

@green oriole

green oriole
#

Hmm, it sounds like a lot of work

#

I don't think we want to host any web page for now as we are trying to simplify the site as much as possible

eternal owl
#

Alright

vocal wolf
#

damn 2 years ago lol

eternal owl
#

We can talk about this during staff meet I guess if we want a pydis calendar too

green oriole
#

Yeah, that could work

deft patrol
vocal wolf
#

needs reviews

vocal wolf
#

@obsidian patio how close are you to finishing sir-lancebot#436?? This is the best feature lol

vocal wolf
#

Just make sure you have a cooldown and all so we don't break the CPU

obsidian patio
#

Hahahah, that is one of my favorite features as well

#

I had a working implementation, but it wasn't pythonic enough and required way too much I/O (don't think it would work with the new setup)

#

Right now, it's a bit on hold

vocal wolf
#

alright

#

thanks for the update!

short snow
vocal wolf
short snow
#

Uhh ok

#

lol

vocal wolf
#

ak and ks went over it

timid sentinel
#

Would allowing snekbox, say, a 10 PID limit instead of 1 still offer a similar level of security?

gritty wind
#

well it would make certain things much more difficult to secure against I would imagine

#

right now you can't do bash commands, do network requests, etc, etc

#

why do you want to raise it?

timid sentinel
#

It was more of a theoretical question than thinking of any use cases in particular, although my thinking was that theoretically you should be able to do anything you could do from creating another process, in the python process, so the PID limit is mainly to stop people spam-creating a bunch of processes? I'm not sure if that's right though

patent pivot
#

hmmm

#

the PID limit is how we lock things to Python yeah

gritty wind
#

Hmm here's something interesting

#

the http_connecter is breaking for me

#

I can't use snekbox at all from the bot

brazen charm
#

Could the thread limit be raised? Or is the creation of those limited in some other way

patent pivot
#

hmmm

#

I don't think we restrict threads at all

short snow
#

How is this scal?