#dev-contrib

1 messages · Page 115 of 1

clever wraith
#

i think joe is ascending

patent pivot
#

site is deploying™️

clever wraith
#

hold up, do i need to make a separate pull of the site to work on the bot?

#

because i get this: ```
bot_1 | 2021-05-17 19:41:38 | bot | CRITICAL | Could not connect to site API. Is it running?
bot_1 exited with code 69

brazen charm
#

What was the purpose of the windows path tag? Seems like it just explains how to invoke py in a bit verbose way. I recall it being discussed somewhere but I think that was before tags were files on the bot

clever wraith
#

i mean, kudos to you all for choosing code 69

gritty wind
#

you can run the site using the docker-compose

#

docker-compose up -d web postgres

clever wraith
#

yes

gritty wind
#

as a bonus, you could also run redis

#

just add redis to the end of the command up there

#

also check out the contrib guide

#

it'll help

#

a lot

vocal prairie
clever wraith
#

im using fakeredis

brazen charm
#

Have you configured the urls?

clever wraith
#

yes

#

i think

#

shit

#

im so dumb

#

did i seriously type web:8080

vale ibex
#

any errors in the site container?

clever wraith
#

nope

vale ibex
#

So the site container is running now?

#

bot_web_1

clever wraith
#

yes

vale ibex
#

can you show the last few log messages?

clever wraith
#
Deleting 'images/navbar/pydis_banner_no_square.svg'

Deleting 'images/navbar/discord.svg'

Deleting 'images/waves/wave_white.svg'

Deleting 'images/waves/wave_dark.svg'

Deleting 'images/events/100k.png'

Deleting 'images/events/summer_code_jam_2020.png'


236 static files copied to '/var/www/static'.

Creating a superuser.

Admin superuser already exists.

Existing bot token found: badbot13m0n8f570f942013fc818f234916ca531

Starting server.

Watching for file changes with StatReloader

Performing system checks...


System check identified no issues (0 silenced).

May 17, 2021 - 19:57:08

Django version 3.0.14, using settings 'pydis_site.settings'

Starting development server at http://0.0.0.0:8000/

Quit the server with CONTROL-C.
``` in site
vale ibex
#

you're running the site locally?

clever wraith
#

with docker

vale ibex
#

from the site repo?

clever wraith
#

no, from the bot repo

#

i did docker compose up in the bot dir

vale ibex
#

ok, just checking, since those logs should be prepended with bot_web_1

brazen charm
#

Bot's also in docker?

clever wraith
#

i copied them directly from the bot_web_1 logs as the bot_bot_1 is bootlooping

clever wraith
vale ibex
#

can you do docker-compose down and docker-compose up --build

clever wraith
#

aure

#

sure

#

@vale ibex same output

vale ibex
#

Could you paste the full output from the command?

#

from the start

clever wraith
#

sure, but im gonna stop the bot cause its bootlooping again

#

@vale ibex it seems the api is not starting

vale ibex
#

There's a bunch cut off from the start it seems

#

also, this line bot_1 | 2021-05-17 20:01:34 | discord.client | WARNING | PyNaCl is not installed, voice will NOT be supported suggests you might be on an old commit?

#

what branch do you have checked out?

#

The output of git log -1 would be good

clever wraith
vale ibex
#

since we don't have voice extras on d.py anymore

#

huh, I thought that log wouldn't show now that we removed the voice extras for d.py

#

My mistake.

clever wraith
#

i refreshed my fork this morning

brazen charm
#

I assume the log shows up because they were removed and it can't find them

clever wraith
#

what im seeing is the api isnt starting

brazen charm
#

So your urls config looks something like this?

    site:        &DOMAIN       "web:8000"
    site_api:    &API    !JOIN ["api.", *DOMAIN]
    site_paste:  &PASTE  !JOIN ["paste.", *DOMAIN]
    site_staff:  &STAFF  !JOIN ["staff.", *DOMAIN]
    site_schema: &SCHEMA       "http://"
clever wraith
#
urls:
    # PyDis site vars
    connect_max_retries:       3
    connect_cooldown:          5
    site:        &DOMAIN       "web:8000"
    site_api:    &API          "api.web:8000"
    site_api_schema:           "http://"
    site_paste:  &PASTE  !JOIN ["paste.", *DOMAIN]
    site_schema: &SCHEMA       "http://"
    site_staff:  &STAFF  !JOIN ["staff.", *DOMAIN]

    paste_service:                      !JOIN [*SCHEMA, *PASTE, "/{key}"]
    site_logs_view:                     !JOIN [*SCHEMA, *STAFF, "/bot/logs"]

    # Snekbox
    snekbox_eval_api: "http://snekbox.default.svc.cluster.local/eval"

    # Discord API URLs
    discord_api:        &DISCORD_API "https://discordapp.com/api/v7/"
    discord_invite_api: !JOIN [*DISCORD_API, "invites"]

    # Misc URLsw
    bot_avatar:      "https://raw.githubusercontent.com/python-discord/branding/main/logos/logo_circle/logo_circle.png"
    github_bot_repo: "https://github.com/python-discord/bot"
#

oh @vale ibex its working now

#

im on a nightly docker and i was using docker compose instead of docker-compose

vale ibex
#

You'd want to update your snekbox url to http://localhost:8060/eval too

brazen charm
#

If you're running through docker I'd also suggest to configure redis and snekbox normally

brazen charm
vale ibex
#

huh, yeah that'll probably be better, since it's more verbose descriptive

#

but localhost works too

brazen charm
#

iirc localhost will fail if it's not exposed in some way through docker when it's all ran within it, but not sure as I run the bot outside of docker

vale ibex
#

hmmm, I might be wrong then, let me actually run the container

#

No, you are right. I must have updated my config for the test server recently.

#

I remember setting it up, and localhost is what it's currently configured to

#

so I put 2 and 2 together and got 5

stable mountainBOT
#

@fervent sage

It has arrived!

Here's your reminder: this.
[Jump back to when you created the reminder](#dev-contrib message)

fervent sage
#

!remind 2h ^

stable mountainBOT
#
I got you.

Your reminder will arrive in 2 hours!

fallen patrol
#

if you don't have the voice extras, discord py displays that message

dusky shoreBOT
patent pivot
#

yes, pretty much

fallen patrol
#

have fun

#

i'm currently stuck in a repeat loop and unable to use poetry

patent pivot
#

what's up?

vocal prairie
#

That doesn't sound too hard to do after the migrations are over

vale ibex
#

Any idea why we have bs4 listed as a dep in lance?

#

can't see anywhere where it's used

#

Also, pytz isn't needed since we have arrow

brazen charm
vale ibex
#

Ahhh, that makes sense

fallen patrol
patent pivot
#

ah

fallen patrol
#

its partially related since i had to fix it on my sir lancebot as well

gritty wind
#

Whenever an exception is raised in a project

#

The sentry sdk sees it

fallen patrol
gritty wind
#

Where we can see all our exceptions

fallen patrol
#

you can get a paid plan but

#

also get it free

remote wigeon
#

you can always selfhost CatRee

fallen patrol
#

no, not really.

#

sentry isn't really self hostable

remote wigeon
fallen patrol
#

I STAND CORRECTED

remote wigeon
patent pivot
#

yeah sentry is oss

remote wigeon
#

kinda pita

#

but decent enough

stable mountainBOT
#

@fervent sage

It has arrived!

Here's your reminder: ^.
[Jump back to when you created the reminder](#dev-contrib message)

vale ibex
#

@sleek steppe oh no 😦 I didn't realise other commands would reference that const

#

lol

sleek steppe
#

lmao

vale ibex
#

luckily it's easy fix too

sleek steppe
#

yep

clever wraith
#

Woohoo my first bot pr is up

vale ibex
#

😄

vale ibex
sleek steppe
#

Is it fine that I've been ignoring the error in .aoc join lol

#

wait it doesn't error for lancebot for some reason 🤔

vale ibex
#

Is it an empty sequence error?

sleek steppe
#

ye

vale ibex
#

Yea, that's from not having any leaderboards locally

short snow
#

Is America/Chicago EST timezone?

stable mountainBOT
#

@short snow

It has arrived!

Here's your reminder: do now.
[Jump back to when you created the reminder](#dev-contrib message)

sleek steppe
#

lol you reviewed before the reminder came

fervent sage
stable mountainBOT
#
Sure thing!

Your reminder will arrive in 14 hours!

fallen patrol
#

America/Detroit
America/NewYork

thorny obsidian
short snow
#

sure? Chris had set that as EST timezone in the aoc pr

thorny obsidian
#

Silly brit, not knowing our confusing and inconsistent american timezones

fallen patrol
#

yeah

#

i live in the est timezone so i'm 110% sure

stable mountainBOT
#

bot/exts/christmas/advent_of_code/_helpers.py lines 50 to 52

# Create an easy constant for the EST timezone
EST = "America/Chicago"```
fervent sage
sleek steppe
#

EST is UTC-5 though

fallen patrol
thorny obsidian
#

Arizona fucks up everything timezone wise

fallen patrol
fallen patrol
short snow
#

what would be the right EST timezone?

thorny obsidian
#

New York, we're in EDT currently though. But for AOC we should be in EST.

short snow
#

alright

#

its 11pm for you guys, i thought india had a 12 hour game

fallen patrol
#

so est/edt is the proper timezone

short snow
#

bump

exotic ember
#

is this sir-lancebot?

short snow
#

yeah

exotic ember
#

the extensions are loaded in bot/__main__, so there

short snow
exotic ember
#

I have no idea what you want to do actually, I thought you were asking where to run code before extensions are loaded

#

what's this for?

short snow
exotic ember
#

yeah, at first glance I don't see why you couldn't just get the loop and do cog loading/skip loading there

#

while you're at it extensions.py has a module level constant EXTENSIONS, you should probably walk that rather than call walk_extensions() again

short snow
#

alright, just wanted to know if that's the best way to do it

#

Is this fine?

#

for testing, I am injecting them manually just after redis gets connected

green oriole
#

Can you post that to #dev-alerts btw? (Not sure where it is atm)

vale ibex
#

I hate timezones

#

I even spent a good 3 minutes on Google

short snow
#

look at this, how to get cog name from a cog object, before the cog is loaded 🤦‍♂️

#

is there a better way

#

this works for all cases except

#

when you put a object in the file name

placid ermine
short snow
green oriole
#

f"{inspect.getmodule(cog).__name__}.{cog.qualified_name}" maybe?

short snow
#

oops yeah that's what I did, sorry forgot to reply earlier.

short snow
#

Chris 👀

#

@vale ibex pithink is that because of the stuff you did to workflows?

vale ibex
#

lemme take a look

#

huh, it's not even in progress

#

it's stuck starting

#

lemme check other repos

#

🤔

#

@patent pivot Could you take a look at the org level workflow view? Are we hitting concurrency limits?

#

looks like github is having issues with actions atm

vale ibex
patent pivot
#

hmmmmm

vale ibex
#

Update - We have confirmed that run starts are delayed for a number of customers. We have identified the issue and are working on a fix.

#

from an hour ago

#

probably just need to wait it out

green oriole
#

Can always restart it

vale ibex
#

I did restart them

#

didn't fix, just got stuck again

green oriole
#

Maybe the cache

#

Should probably wait it out, yeah

short snow
fervent sage
#

object why did you thumbs up your own issue lmao

placid ermine
#

lol

clever wraith
clever wraith
vocal wolf
sleek steppe
#

!e

async def test():...
print(type(test()))
stable mountainBOT
#

@sleek steppe :white_check_mark: Your eval job has completed with return code 0.

001 | <string>:2: RuntimeWarning: coroutine 'test' was never awaited
002 | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
003 | <class 'coroutine'>
vocal wolf
#

huh

#

I was thinking this was coming from typing.Coroutine

sleek steppe
#

oh lol

vocal wolf
#

in that case, nevermind

fervent sage
#

!reminders

stable mountainBOT
#
Missing required argument

expiration

fervent sage
#

:/

sleek steppe
#

It would be cool is remind list had that root alias 👀

fervent sage
#

im porting it to a site guide soon™️

clever wraith
#

@short snow the cowsay command art is broken on mobile, and beavis was fine on my side

clever wraith
#

I just saw, do you suggest beavis is removed?

#

or should we tighten the character limit on beavis

sleek steppe
#

I feel like it should sent an error message if it gets an HTTPException

clever wraith
#

alright i can do that

#

so i shouldnt use suppress and instead use try except?

sleek steppe
#

yes

gritty wind
#

People that are developing

sleek steppe
#

sir-lancebot#740 and sir-lancebot#741 are both small bug fixes that needs a core dev approval

gritty wind
#

I explained the links here yesterday

#

what are you struggling with?

#

the technical implementation is mostly this

#

the visual part is mostly up to you

#

You'll wanna do it using the path from the URL

vocal prairie
#

You should be able to do it on the page that renders the markdown pages. (the button)

gritty wind
#

The visual design is completely up to you

#

There is an example positioning on the issue itself

#

I like it there, but if you figure another place it works, that's fine too

stable mountainBOT
#

@fervent sage

It has arrived!

Here's your reminder: do now :mmLol:.
[Jump back to when you created the reminder](#dev-contrib message)

vale ibex
vocal prairie
#

You don't need to manually write css

vocal prairie
#

Bulma should have everything you need to make a button.

#

The Bulma button?

vale ibex
sleek steppe
#

oh this isn't gonna get merged any time soon

vocal prairie
#

The Bulma button is what's used across the site, so I'd say you should use that to ensure concistency.

#

You can style the outline to look like what it has in the issue using Bulma too.

#

Is that a custom button?

thorny obsidian
#

the class is what applies the bulma styling, it won't apply via the <button>

vocal prairie
#

is-flex

#

That will also make it so that if a person's screen is too small, it'll go onto two lines.

#

is-inline should work too, but it'll force it all onto one line even if it's a small screen.

#

I wonder why is-flex didn't work.

#

Can you share the html?

#

That should be on the parent element btw.

#

Put is-flex next to content

#

And remove is-inline

#

Oh crap

#

One sec

#

I know what went wrong

#
   <section class="section">
        <div class="container">
            <div class="content">
                <div class="is-flex">
                    <h1 class="title is-inline">{{ page_title }}</h1>
                    <button class="button is-inline">This is a button</button>
                </div>
                {% block page_content %}{% endblock %}
            </div>
        </div>
    </section>```
#

is-inline will force it onto one line, even if they have a small screen.

#

Which looks really messy

#

vertical end?

#

You want it to be at the bottom of it's horizontal container?

#

is-align-content-flex-end maybe?

#

On the button, not the div above

patent pivot
#

maybe it's a good idea to hook it into the ToC area for guides

vocal prairie
#

^ As part of the sidebar it would look good

#

Table of Contents

patent pivot
#

yeah implementation will be different there

sleek steppe
dusky shoreBOT
stable mountainBOT
#

bot/bot.py line 50

await self.unloads_cache.set("unloaded", 'bot.exts.evergreen.catify | bot.exts.evergreen.xkd')```
`bot/exts/evergreen/latex.py` lines 96 to 101
```py
# As we have resource issues on this cog,
# we have it currently disabled while we fix it.
import logging
logging.info("Latex cog is currently disabled. It won't be loaded.")
return
bot.add_cog(Latex())```
gritty wind
#

It seems I was half right about the path

#

Pages that start with pages in the path are in the content app

#

Pages that start with resources are in the resources app

sleek steppe
#

Why do I get this error when running docker-compose up in snekbox?

Creating snekbox_dev ... error

ERROR: for snekbox_dev  Cannot create container for service snekbox: invalid volume specification: '.::rw': invalid mount config for type "volume": field Target must not be empty

ERROR: for snekbox  Cannot create container for service snekbox: invalid volume specification: '.::rw': invalid mount config for type "volume": field 
Target must not be empty
ERROR: Encountered errors while bringing up the project.
sleek steppe
#

Hey @tawdry vapor do you know any fixes for this? Also, I'm not sure how to go about writing the test for nsjail args

gritty wind
#

What OS are you on

sleek steppe
#

windows 10

gritty wind
#

change line 27 in the docker-compose to .:./

sleek steppe
# gritty wind change line 27 in the docker-compose to `.:./`

Now I get

Creating snekbox_snekbox_run ... error

ERROR: for snekbox_snekbox_run  Cannot create container for service snekbox: invalid volume specification: '.../PyDis/snekbox:./:rw': invalid mount config for type "bind": invalid mount path: './' mount path must be absolute

ERROR: for snekbox  Cannot create container for service snekbox: invalid volume specification: '.../PyDis/snekbox:./:rw': invalid mount config for type "bind": invalid mount path: './' mount path must be absolute
gritty wind
#

try .:/

#

actually

#

Try .:/snekbox

sleek steppe
#

I think that worked

#

yep it worked, thanks

tawdry vapor
#

That's wrong

#

I believe coverage results will be incorrect if the same path isn't used

#

It's PWD on both sides for a reason

#

You can't use relative paths on the right

#

And I don't know of a PWD equivalent on Windows

gritty wind
#

PWD isn't a command on windows

tawdry vapor
#

So, basically it will never work on Windows

gritty wind
#

cd

#

that'll print the cwd

tawdry vapor
#

There's no way to make it cross platform

fallen patrol
#

its pwd if on powershell

sleek steppe
#

yep, but on cmd it is cd

vale ibex
#

github actions seem to be good now

#

I'm going to kick off the jobs that failed on main

#

alright that should be all the failed jobs re running now

sleek steppe
#

you missed sir-lancebot though 😔

patent pivot
#

no one cares about sir lancebot

sleek steppe
#

lol true

patent pivot
#

which runs failed

sleek steppe
#

I ran them 😛

thorny obsidian
#

I care about sir lance!!

vale ibex
#

wait, I did run sir-lance?

sleek steppe
#

ah I thought you were talking about the errored lint jobs

vale ibex
#

Ahh nah, those are from when i tried to re-run the same one again

fallen patrol
#

Use flake8, they said. Use poetry, they said. It'll make your life easier, they said.

#

its scanning the site packages ;-;

#

any way to fix this

gritty wind
#

If your venv is in your project’s directory (it really shouldn’t), mark it as ignored

fallen patrol
#

its not

vale ibex
#

insert into messages select generate_series(11,150), 'user_id_here', 'f', NOW() + (random() * (NOW()+'90 days' - NOW())) + '30 days', 1234;

#

a quick sql statement I ran to seed metricity, in case it's useful for anyone

#

the weird time stuff is so that you get enough time blocks to pass voice gate

gritty wind
#

Not really sure what to tell ya

#

Why is flake scanning your venv folder

#

Is that something your IDE is doing

fallen patrol
#

it could be

#

well my lance clone isn't having issues anymore

clever wraith
#

congrats on whoever made the blocking tag

sleek steppe
#

@tawdry vapor for the nsjail args test, how would that work? I'm not sure what are valid nsjail args

tawdry vapor
#

It doesn't matter

#

It's even sufficient to pass "poop" as an argument and just check that it ends up where it's suppose to

sleek steppe
#

ah I see

thorny obsidian
patent pivot
#

pls no one merge that

#

lol

thorny obsidian
#

D:

patent pivot
#

i am just altering some review policy stuff

#

so just hold 60 secs

thorny obsidian
#

god I loathe coveralls

patent pivot
#

lol

#

sasme

thorny obsidian
#

Coveralls has the same energy as fucking clippy

patent pivot
#

okay, review policy altered

fallen patrol
#

just don't use it

#

ez

#

manually merge it lol

#

it took longer than that to upload than it took for joe to merge it smh

patent pivot
#

I've added a review policy item so site content can be shortcutted by 1 admin approval or 2 staff

fallen patrol
#

everything is slower rn since flake8 is scanning my entire hard disk it seems

patent pivot
#

it's probably scanning your venv, if you didn't ignore it

fallen patrol
#

I tried multiple times

patent pivot
#

latter

clever wraith
sleek steppe
#

Is there any reason the !eval command has code as optional but sends the help command when nothing is passed 🤔

tawdry vapor
#

Doesn't it have to be optional so it can show help when nothing is passed?

sleek steppe
#

The error handler catches it and sends the help message

#

and tells you you're missing an argument

#

Snekbox's lint & test is failing 🤔

short snow
sleek steppe
#

Sounds good 👍

fallen patrol
#

why are these on different bots?

#

it seems related enough that it should be on the same bot

tawdry vapor
#

I don't remember if help was always shown with the error.

tawdry vapor
sleek steppe
#

Hmm, wonder why it error'd then

sleek steppe
#

The install git job passed but the pre-commit just fails

tawdry vapor
#

I don't know. You'd have to check the log

sleek steppe
#

How do you do that 🤔

tawdry vapor
#

Edit the workflow to cat the log file

#

Then rerun it

#

Would be a good permanent addition

#

If you can figure out how to make that step run only when precommit fails

sleek steppe
tawdry vapor
#

Do you know what cat means?

sleek steppe
#

It's a command?

tawdry vapor
#

Are you asking how to use the cat command or how to edit the workflow?

sleek steppe
#

How to edit the workflow

tawdry vapor
#

it's in the .github/workflows directory

sleek steppe
#

Oh so you want me to commit the change

tawdry vapor
#

Yes, because you cannot run the workflow any other way.

#

Which is why debugging CI is annoying.

sleek steppe
#

I think I did it wrong

#

because it doesn't show the log file

tawdry vapor
#

Try making it a separate step instead, like I originally suggested

sleek steppe
#

ah

tawdry vapor
#

Feel free to amend and force push so you don't end up with a bunch of commits for debugging CI

#

Keep in mind it normally won't run subsequent steps if a step fails

#

You need to configure it to run even on failure, or ideally, run only on failure of the precommit step.

sleek steppe
#

I think I found a way to do that

#

yeah that didn't work

#

@tawdry vapor I got it

#

and it failed

tawdry vapor
#

The log would be inside the container

sleek steppe
#

ah my bad

#

Alright it worked this time

#

@tawdry vapor is it because it isn't in a git repository?

clever wraith
#

Hey <@&267628507062992896> you might know already but the github actions status embeds are down

tawdry vapor
#

I don't understand why it even wants it though.

#

It's set to run on all files.

#

Might be a recent update that changed the behaviour

stable mountainBOT
#

Pipfile line 26

pre-commit = "~= 2.9.3"```
`pyproject.toml` line 47
```toml
pre-commit = "~=2.1"```
sleek steppe
#

Should I try downgrading and see if that works?

tawdry vapor
#

Maybe we should just copy the git directory over

#

Or git init && git add . might be simpler.

sleek steppe
#

but how do you do that?

#

git clone?

tawdry vapor
#

No you'd have to copy the .git folder over. I actually think initiating a new repo would be easier

sleek steppe
#

Yeah, but it says .pre-commit-config.yaml does not exist

tawdry vapor
#

What the fuck

#

How did this ever work before

#

I don't understand how. My best guess is that the .dockerignore was not being respected in CI.

#

Maybe we should just unignore the config and the git directory?

#

I don't really like putting stuff in the container that's only used for CI, but I suppose it won't make a big difference on size. Plus, tests are already being included anyway.

#

Actually, copying over the git directory may fuck up the ability to cache layers.

#

Oh, I see how it was working. I completely forgot volumes are a thing in Docker.

#

It just relies on docker compose to mount the cwd

#

Since you changed the docker-compose volume, it broke everything

#

And as I said, that mount is wrong for other reasons anyway.

sleek steppe
#

Didn't I only change it locally?

tawdry vapor
#

No. It's checked in.

sleek steppe
#

Ah that's my mistake

tawdry vapor
#

So.... yeah just rebase and drop that commit along with the attempted CI fixes, though I suppose leaving the log cat is okay.

#

Ah it's part of some other commit so you can't just drop it, but you can rebase and edit it.

short snow
#

bot#1120 should be moved to lance

dusky shoreBOT
sleek steppe
#

Ah nice it worked, I can't believe I made a mistake like that lol

sleek steppe
#

yeah it probably is

#

For bot#1597, do we even filter invites?

dusky shoreBOT
tawdry vapor
#

I transferred that issue

fallen patrol
#

@tawdry vapor reddit, I see nothing weird.

#

sir-lancebot#746

dusky shoreBOT
tawdry vapor
#

I don't understand what you are trying to say

hardy gorge
eternal owl
#

haha

#

for the adding Off topic names using post request to the site, why are we passing the ot-name as a query param instead of passing it in the request body?

#

no, but typically with a post request, the data is in the request body

#

we could avoid some code in the backend as the ModelViewSet could handle it if we used request body

#

just don't, pass it with the context

#

you can't xD

exotic ember
#

@clever wraith off the top of my head, custom template tags

eternal owl
#

oh yes, that could work as well

exotic ember
#

we should have a custom template tag implementation in another app in the repo, you can use that for reference

#

pydis_site/apps/home/templatetags

vale ibex
#

Now that we've upgraded to python 3.9, sir-lancebot#610 isn't needed right?

dusky shoreBOT
vale ibex
#

Since those codes were added to http package

#

hmmm, I might need to re-read the PR, since it's removing the package entirely and relying on what the APIs respond with

#

might be something we want regardless

green oriole
#

Depends on how we want to validate codes

vale ibex
#

Using the http module did save on requests out

#

but also it's not a huge worry, since it's not really a highly used command

#

i guess the question now is, are there codes supported by the status cat/dog API that aren't by the http module

short snow
#

i don't think there are any right now

vale ibex
#

!e ```py
from http import HTTPStatus
print(*(h.value for h in HTTPStatus), sep='\n')

stable mountainBOT
#

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

001 | 100
002 | 101
003 | 102
004 | 103
005 | 200
006 | 201
007 | 202
008 | 203
009 | 204
010 | 205
011 | 206
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/mojigoxoxo.txt?noredirect

vale ibex
#

there are 60 codes in httpcat

#

and 59 on status dog

#

62 in http

#

but that's not a real test, since they may not overlap

short snow
#

Its best to request them, or maybe just run a task every x hours to get all the codes from the site

vale ibex
#

I'd rather keep it simple within the bot.

#

I think we should just iter over the codes in http and check if both APIs support them

#

if so, we can close this PR

#

I can do it later after work if someone else hasn't by then.

short snow
#

Hmmm, so to only keep the codes supported by both apis?

vale ibex
#

We want to see if the codes supported by Python 3.9 are a superset of the codes supported by the two APIs

#

if that's the case, then we can use the http package to validate codes, as we are now

short snow
#

Alright, have you tested or should I do it quickly now?

vale ibex
#

I don't have time to write up the script right now

#

So please feel free

short snow
#

alright, time to check now

#

there @vale ibex

vale ibex
#

Ah right, all the unofficial ones

#

I'm surprised about 306 though

#

I guess it's because it's no longer used /s

short snow
#

and
599 is present in cat but not in dog
306 is present in dog but not in cat

vale ibex
#

Yea, 306 isn't used anymore afaik

#

599 isn't official

#

but is used in some places

short snow
#

i don't even know half of them

vale ibex
#

I think we go ahead with this PR and drop the http module

#

it'll be more fun to be able to use the non-official codes

gritty wind
#

You don't know any of them, because there are only like 10 codes ever actually used

short snow
#

yep, chris

wicked inlet
#

Thoughts of ending codeblocks like these when the rest of the content is truncated?

fervent sage
patent pivot
#

lol

#

everyone got mad at twitter for using 420

vale ibex
#

Yea, 429 is too mainstream

wise oriole
wicked inlet
#

yup was definitely not expecting it, prefer to keep it in the actual channel.
But definitely nice to have a log of your previous questions

clever wraith
vale ibex
#

They seem to be working just fine now

short snow
#

aha, there is onething missing in the quackstack API

stable mountainBOT
#

main.py lines 68 to 75

@app.get("/details")
async def get_details() -> Dict[str, Any]:
    """Get details about accessories which can be used to build ducks."""
    return {
        "hats": list(DuckBuilder.hats.keys()),
        "outfits": list(DuckBuilder.outfits.keys()),
        "equipments": list(DuckBuilder.equipments.keys()),
    }```
short snow
#

it doesn't list manducks

#

should add a query parameter for duck and manduck?

#

cc @fervent sage

vale ibex
#

is the call to .keys() there superfluous? Since if you cast a dict to a list, you'll just get the keys anyway

clever wraith
#

They're up again, just not configured for snekbox

sleek steppe
#

yeah, and that return type hint can be Dict[str, list[str?]]

clever wraith
#

Because 3.9

short snow
#

might also give a bump to quackstack to use python3.9?

fervent sage
fervent sage
short snow
#

If we add more features, that would keep on increasing, I had like ?type=duck/manduck

#

or with some other query name

fervent sage
#

/details/{type}

#

before the details endpoint changes I'd also like to restructure the manduck assets so that they are structured the same as normal ducky for consistency

low hound
#

hey, I want to start contributing to open source, someone suggested me to try sir lancebot, can anyone help me out, all the issues are too overwhelming.

short snow
#

umm, well that would be third time we are changing asset structure lol, but i will look into later

#

btw, what happened about the deepmerge lib?

short snow
fervent sage
#

anything customisable that's related to a static asset

short snow
#
{
  "hats":...,
  "outfits":...,
  "equipments":...,
  "gender":...,
}
``` I think that's it
short snow
sleek steppe
#

I'll give it a review

short snow
#

alright, ty!

vocal prairie
#

Does anyone know how to set the minimum width of a box in Bulma?

short snow
#

once that's done I can upgrade it to python3.9, already tested and it works perfectly 😄

sleek steppe
#

does quackstack not give specific return type hints?

patent pivot
#

fastapi doesn't use return annotations

sleek steppe
#

oh I thought it did

patent pivot
sleek steppe
#

ah I see

patent pivot
#

The response model is declared in this parameter instead of as a function return type annotation, because the path function may not actually return that response model but rather return a dict, database object or some other model, and then use the response_model to perform the field limiting and serialization.

sleek steppe
#

Well, I still think we should use the response model

fervent sage
fervent sage
short snow
#

could we swtich to uvicorn? its faster than hypercorn and supports reloads in docker containers

#

the second point is not really a point since we don't use that, but still

#

pushed, alec and toxic.

#

just curious, is it possible to support both path and query parameters for the same parmeter, type in this case

patent pivot
#

uvicorn is good

short snow
#

who is kgolawaski?

short snow
patent pivot
#

lol

#

yes from me, would like to hear from others

short snow
#

toxic and his nitpicks 🙇‍♂️

vocal prairie
#

I don't know about Hypercorn, but my experience with Uvicorn and FastAPI has been good

short snow
#

can we add that kek here 🥺 ?

#

and about upgrading to python3.9 on quackstack, i could do that together

sleek steppe
#

Yeah, I think they can both be changed in that PR

short snow
#

alright, just need to get the approve then now

#

merge merge ducky_party

#

toxic can merge 👀 you got powers boy

fervent sage
#

I dont want to switch to uvicorn because it's not fun dealing with the "why didnt you use hypercorn its better" which is the reason i went with hypercorn to start with, and as for speed im pretty sure quackstack gets all of 1 request a month, and the slow bit is image generation not the asgi stuff anyway

sleek steppe
sleek steppe
fervent sage
#

soon, currently working on smth else

short snow
fervent sage
#

hypercorn starts up faster for me /shrug

short snow
#

👀 alright, lets just leave it then, and python3.9 upgrade?

fervent sage
#

hm

#

after consideration, I'll make a pr for 3.9 and using uvicorn

short snow
#

that's exactly what i said lmao, ok

fervent sage
#

i like uvicorn more just as a general thing, and I can just tell people who get annoyed at me for using it "lol /shrug"

thorny obsidian
#

I hereby give you permission to tell people to "get wrekt" if they ask about hypercron or uvicorn since it.. really doesn't matter

short snow
#

hmm, i saw people moving from hypercorn to uvicorn but never the other way around

green oriole
#

That's one tool I never looked into and I don't plan to

fervent sage
#

I only used hypercorn because i was told by 2 people "ew dont use uvicorn hypercorn is better"

sleek steppe
#

I like uvicorn better ¯_(ツ)_/¯

green oriole
#

It looks so uninteresting

fervent sage
#

so i decided to give it a shot

short snow
#

the tool here is? akarys

fervent sage
#

i have used hc in one project

#

and will never again kek

short snow
green oriole
short snow
#

oh

#

also we can continue the other issues on quackstack now, since we have enough features on the api now

#

and not deffer them, like i commented on the flesh out readme issue

patent pivot
#

I still need to specify S3

#

we should also have a landing page

fervent sage
#

I dont have a way to test s3 stuff locally pensivewobble

patent pivot
#

just project logo and docs

#

lol I'll just provision you creds, but minio is good for self-hosted S3

short snow
#

Minio?

#

Wouldn’t GitHub pages do?

patent pivot
#

not for S3, no

#

minio is a self-hosted S3 server

#

quackstack will eventually send uploaded images to an S3 bucket, since ideally we don't want to serve static files

short snow
#

Basically, making the setup complex lol

patent pivot
#

not really

#

S3 is simple

#

you just plug in your endpoint and it's usually just one call to upload

#

like

#

simple really is in the name

#

S3 stands for Simple Storage Service

short snow
#

Yeah, I am reading his biography right now, but I would need to get Amazon services account.

patent pivot
#

No, you can use minio

#

it's just a single docker container, no config

fervent sage
#

pydis would be using linode's S3 compatible object storage not amazon btw

patent pivot
#

yeah

fervent sage
short snow
sleek steppe
#

need devops daddy approval

short snow
#

Joeeeeeee

#

btw, is ledger still in development didn’t see any progress on it in a while?

patent pivot
patent pivot
sleek steppe
#

quackstack#46

dusky shoreBOT
short snow
patent pivot
#

cheers

#

tomorrow and friday, so, should be able to look at stuff soonish

clever wraith
#

Alright @short snow those changes you asked for have been made

short snow
#

Yeah, I have approved it already

sleek steppe
#

I don't think that was the right change

short snow
#

Which one? Link?

patent pivot
short snow
#

Weeee

short snow
short snow
#

Uh oh, that’s not what I meant

#

Also I think for quackstack#12 , it should be done by someone who contributed to the project or has watched it closely, since only that person would be able to explain it properly

dusky shoreBOT
vocal prairie
#

If quackstack is stable enough, site#465 isn't stalled anymore, right?

dusky shoreBOT
short snow
sleek steppe
#

@clever wraith conflicts still need to be resolved (just pull from upstream/main and run poetry lock). Regarding your comment, if I did

.cowsay abc <three backticks> new stuff

It would place the zero width pace between a and b

clever wraith
#

alright

#

@sleek steppe why dont we just remove backticks alltogether?

sleek steppe
#

I don't see the point of doing that

sour wolf
#

how difficult would it be to have prettyprinted eval output

clever wraith
#

alright, resolved lock

#

wait oops wrong command

#

alright resolved

patent pivot
#

by the time eval output reaches the bot, it's already a string

#

so we'd need to do that inside the sandboxed process

brazen charm
#

I think it's also clearer to the user if they receive the direct output their code generated, can always pprint in your code

fervent sage
#

imo ^

#

took the words right out of my mouth kek

patent pivot
#

yeah

brazen charm
sleek steppe
#

There are role restricted tags?

brazen charm
#

The feature is there, no tags that use it afaik

sleek steppe
#

Ah I see it now

fervent sage
#

@patent pivot do you mind if I implement the S3 thing, I have a couple ideas and I'd love to get more familiar with object storage in general :P

patent pivot
#

lmk if you want an S3 bucket

#

to test prod with

fervent sage
#

i ahve free linode credits so I'm gonna put them to good use before theyre gone

patent pivot
#

👍

#

it's £5/mo for 250GB of obj storage

sleek steppe
#

Is someone implementing the upgrade to python 3.9 on quackstack? If not I could do that 😛

fervent sage
#

feel free, im not 100% on what i actually need to change so im not touching rn kek

eternal owl
#

I think you get 100$ for new linode account for 2months

fervent sage
#

^

short snow
#

Nothing to change, just use python 3.9, everything works

#

Already tested

eternal owl
sleek steppe
#

I just ran lint in quackstack and every single file got changed 🤔

trim cradle
eternal owl
#

the reroll will be followed by the archive

#

we wanna change the channel name and mark the old name as inactive, meaning, it won't be considered to channel names in the future

#

approved by joe

trim cradle
#

@eternal owl I don't think I have the bandwidth to wrap my head around what changes you're moving forward with. Do you think you can leave a comment on the issue in question?

eternal owl
#

you want me to leave a comment about the site issue and updated implementation? not sure what you mean by in question 😓

trim cradle
eternal owl
#

ah right

sleek steppe
#

Since snekbox#108 was merged, can I continue bot#1234 in a seperate PR?

vale ibex
#

they likely won't make it to the actual repo on push

sleek steppe
#

ah I see

sleek steppe
dusky shoreBOT
sleek steppe
#

Oh right

sleek steppe
patent pivot
#

done

sleek steppe
#

ty

tawdry vapor
#

Just delete the venv directory

#

Then run poetry install or whatever to recreate it

tawdry vapor
#

What doesn't let you?

#

Just rm -r .venv assuming the directory is named .venv

#

It shows the full path right there

#

You can use rm -r to delete it

#

You technically don't even have to delete it but it'd just be wasted space

twilit juniper
#

For the helpdm on/off command should we delete the command the user sent and the embed that the command sends?

#

Like after 5 seconds or something like that

vale ibex
#

Is this a global opt in/out?

#

or per help channel?

twilit juniper
#

Global opt in/out

vale ibex
#

ah, then don't worry about deleteing

twilit juniper
#

alright

brazen charm
#

Don't see a reason for it to be allowed outside of #bot-commands where nobody cares about the history

vale ibex
#

agreed

#

similar to !subscribe

#

or is it !announcements

#

one of those

twilit juniper
#

Yeah, just an idea hemlock threw out there just wanted to check before I did it

vale ibex
#

👌

#

yes

twilit juniper
#

@tawdry vapor can give me superuser in the test server? I was told you can do that.

tawdry vapor
#

Yes

twilit juniper
#

Thanks

gritty wind
#

the easiest solution would've been running deactivate first

#

seems you got it resolved in the end

granite plaza
#

@patent pivot If your still evaluating/busy thats fine but just want to make sure you didnt miss the requested re-review of sir-lancebot#733

dusky shoreBOT
patent pivot
#

I saw, but am busy until the end of the week I'm afraid!

granite plaza
#

That is perfectly fine thanks for letting me know!

vale ibex
granite plaza
#

done :)

clever wraith
#

how do y’all host y’all postgres server

short snow
#

sir-lancebot#614 and sir-lancebot#649 need one core dev approval each, both have 2 staff aproval as of now

patent pivot
vale ibex
#

rather than rely on the discord cdn link

short snow
#

it uses the same link used by @stable mountain, i think which is a emoji on the emoji server, since there are few which use the cdn links

vale ibex
#

will allow us to keep it consistant if we use it in future

#

hmm, which command on python uses it?

#

Again, this might not be needed, but could be a good idea to start doing

short snow
#

the error handler, its command suggestions

exotic ember
#

@vale ibex what icon is this?

vale ibex
#

in 649

#

!hep

#

oh, yea mods don't get suggestions

short snow
#

kosa you are doing it? I will scratch out my message in #dev-branding then

exotic ember
#

you can leave it for now incase anyone else wants to do it

short snow
#

Btw it was used as cdn link, since you can't put emojis in set_author.icon_url

vale ibex
#

yea, having a cdn link is fine

#

was just mentioning that we could take this as an opportunity to make and host our own icon

#

but not needed

short snow
#

alright 👍

vale ibex
#

sir-lancebot#649

dusky shoreBOT
short snow
#

done used github itself, 🤞 lint passes

#

oh no as expected 🤦‍♂️

#

@vale ibex merge

sleek steppe
#

nice

short snow
#

free for another one lol 🙃

green oriole
short snow
#

"used github itself" 😛

green oriole
#

Shaking my smh

short snow
vale ibex
#

.elp

#

lul

thorny obsidian
#

.ielp

clever wraith
patent pivot
#

It isn't, no

#

We pay around $120/mo for hosting, there are much cheaper solutions available, but an entirely free DB is probably hard to come by

short snow
#

#bot-commands message for some reason !u doesn't work

#

ok it does, but realllly slow

vale ibex
#

Yea, we're looking into it

patent pivot
#

should be back now

short snow
#

ok yeah, what was the issue?

vale ibex
#

jaegger issue afaik

patent pivot
green oriole
#

GoLang being GoLang

short snow
#

Lol

clever wraith
#

lmao

#

still slow

vale ibex
#

!sf 844950388368998502 844950408933015583

stable mountainBOT
#
Snowflakes

844950388368998502
Created at 2021-05-20 14:51:11.006000 (37 seconds ago).

844950408933015583
Created at 2021-05-20 14:51:15.909000 (32 seconds ago).

vale ibex
#

5 seconds is reasonable

#

!sf 844950630317555713 844950634931421234

stable mountainBOT
#
Snowflakes

844950630317555713
Created at 2021-05-20 14:52:08.691000 (9 seconds ago).

844950634931421234
Created at 2021-05-20 14:52:09.791000 (8 seconds ago).

vale ibex
#

This one took 1 s

#

seems fine now

vocal prairie
#

It's pretty fast now

clever wraith
#

!sf 788119126450765844

stable mountainBOT
#

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

sleek steppe
#

For the !timeit command, it runs the code like 5 million times. So, if you have any print statements, it's 100% going to get terminated because snekbox limits outputs to 1 MB. What should I do about that? (Keep in mind it's possible to limit the amount of time it runs)

#

Limiting the number to like 1000 seems to be fine, but then again, doing !e print("a" * 1_000_000) also gets the process terminated. Maybe it's just enough to put a note in the docstring?

#

I just did python -m timeit and it ran 50 million times

#

that's how it gets a more accurate number

twilit juniper
#

Any reason why ok_handbutflipped isn't in constants if not I just added it and I will push it whenever I finish this issue.

twilit juniper
sleek steppe
#

I don't think the bot uses that emoji

#

It would just use 👌

twilit juniper
vocal prairie
#

What's the url at the time when it fails?

twilit juniper
vocal prairie
#

What's one set?

sleek steppe
#

what link is it bringing you to?

vocal prairie
#

Can you show one PyDis url and the corresponding GitHub url that it takes you to?

#

Okay. But what's one actual example where it fails?

#

Then why don't add .md

#

This is supposed to be /contributing.md, not /contributing/

short snow
#

I think when you are parsing the md files, add a variable to store the file location too from root, I am not familar with the site source

green oriole
sleek steppe
#

Yeah but doesn't timeit need to print

green oriole
#

Oh hmm

#

can probably use contextlib.redirect_stdout then

#

If you do use it, don't forget to delete it from the scope before calling the user code though

brazen charm
#

I'd keep the stdout as is. I don't think anyone really has a reason to time prints and if you intend to do it from invoking the module directly then you're just adding complexity

#

In what way do you plan to implement the command?

green oriole
#

For the workflow to run?

sleek steppe
brazen charm
#

Does timeit adjust the runs and loops depending on the runtime?

sleek steppe
#

Yes, unless you pass the --number | -n argument and it isn't 0

#

It would be cool if timeit redirected the output but ¯_(ツ)_/¯

green oriole
#

oh, okay

#

is your IDE not saving to disk immediately after you stop typing?

#

I think so

#

Well, at least when you tab out

#

It should be fine

vocal prairie
#

Both should work fine. I've been doing the latter, and nothing different happens

sleek steppe
#

I like the first on because the second one doesn't let me put spaces between = in .env

vale ibex
#

It means it wants you to have a docstring like this```py
"""
Attempt to display a tag by interpreting the command name as a tag name.

    The invocation of tags get respects its checks. Any CommandErrors raised will be handled
    by `on_command_error`, but the `invoked_from_error_handler` attribute will be added to
    the context to prevent infinite recursion in the case of a CommandNotFound exception.
    """

not like thispy
"""
Attempt to display a tag by interpreting the command name as a tag name.
The invocation of tags get respects its checks. Any CommandErrors raised will be handled
by on_command_error, but the invoked_from_error_handler attribute will be added to
the context to prevent infinite recursion in the case of a CommandNotFound exception.
"""

dusky shoreBOT
stable mountainBOT
#

pydis_site/apps/content/views/page_category.py line 76

def _get_page_context(path: Path) -> t.Dict[str, t.Any]:```
sleek steppe
stable mountainBOT
#

bot/exts/utils/snekbox.py line 13

from discord.ext.commands.core import Command```
short snow
#

!d django.http.HttpRequest.get_full_path just get the full path and append it at the end of the GitHub, no need to worry about the host, btw yes that looks right

stable mountainBOT
patent pivot
#

lol

sleek steppe
#

You didn't see this?

short snow
#

Umm, so you can get the full path and append it after the GitHub link

sleek steppe
#

but yeah I'm about to force push again 😛

short snow
#

Toxic is not that toxic yet, so be happy 😃

sleek steppe
#

I think I'm ready to PR

short snow
#

I know I am bad at explaining this, haven’t worked with django much, so what you are right now are doing is replacing the host right? That is the path I.e. the url after the host remains the same. So you can just get that full path after the host and add to the GitHub link you were switching the host with.

Example, a.com/a/c/d, say this is the url, so full path is a/c/d. You can just put this after the GitHub link.

You can get the full path like said here, #dev-contrib message

sleek steppe
#

except that you'd replace pages with content IIRC

#

I should've known there were tests for snekbox 😔

#

especially because of bot#1600

dusky shoreBOT
sleek steppe
#

Also tests that I haven't edited are also failing

sleek steppe
#

Should I also write tests for the timeit command?

thorny obsidian
#

@eternal owl feel free to assign yourself on the issue if that's something you want to work on.

eternal owl
#

ty ty

sleek steppe
vale ibex
#

I've cancelled that run for now then

sleek steppe
#

I found the problem though

sleek steppe
#

sir-lancebot#1602 if anyone wants to look at it :P

#

oops

vale ibex
#

That's a very big number 👀

sleek steppe
#

bot#1602

dusky shoreBOT
eternal owl
#

@sleek steppe did you get in contact with the owner of bot#1234 before going ahead with your PR?

dusky shoreBOT
eternal owl
#

cuz he might still wanna continue working on it

brazen charm
#

the pr is marked as up for grabs

eternal owl
#

ah okay, mb did not see that

sleek steppe
#

Yeah it was up for grabs and stalled until snekbox#108 was merged

dusky shoreBOT
vocal wolf
#

@sleek steppe do you think bot#1234 should be closed now that you're working on the other PR?

dusky shoreBOT
vocal wolf
#

oh wait yeah I'm totally closing this, nvm

sleek steppe
#

yes

mint tartan
#

Since there is a #reddit channel you guys should add a python sub Reddit command!

mint tartan
sleek steppe
fervent sage
#

if there any interest from literally anyone other than me in having the ability to run commands inline {!e print("lol inline command")} mmLol

fringe sphinx
#

!e print("lol inline command")

stable mountainBOT
#

@fringe sphinx :white_check_mark: Your eval job has completed with return code 0.

lol inline command
fringe sphinx
#

🤨

sleek steppe
#

He means that a command would be invoked if it's {!e print("in these brackets")}

fringe sphinx
#

oh yeah that would be neat

fervent sage
#

ive made a proof of concept before and the implementation is like 10 lines

sleek steppe
#

Does it check if there's a backslash before it 👀

fervent sage
#

actually yes

sleek steppe
#

oh nice

fervent sage
#

it's not perfect because its regex not an actual handwritten parser

#

but its not awful either

fringe sphinx
#

when it's working you should make a pr or smth cuz I'd use that

fervent sage
#

what for lol

fringe sphinx
#

for message context

#

like 'here's how this will work: !e print("here's how it works")'

fervent sage
#

my main motive i'll be honest - and this would work as a standalone feature - is embedded tags, so for example the message:

Hey, there's actually a brief tag explaining how to do that: {!customcheck}
fringe sphinx
#

that would be useful too

fervent sage
#

meaning i no longer need some weird phrasing like !customcheck this tag explains...

fringe sphinx
#

mhm

fervent sage
#

cause i like to give context when sending a tag rather than just drop it there, but 99.9% of my usage of tags is in discord.py which often has a fair amount of slowmode, so being able to easily explain and invoke in one message is ok_handbutflipped

fringe sphinx
#

yeah the same for me and pygen

fervent sage
#

know what i'mma make an issue for that now

balmy sparrow
#

!e what's wrong with invoking like this?

print("hi")
stable mountainBOT
#

@balmy sparrow :white_check_mark: Your eval job has completed with return code 0.

hi
balmy sparrow
#

!customhelp foo bar baz these words do not matter

stable mountainBOT
#

Custom help commands in discord.py

To learn more about how to create custom help commands in discord.py by subclassing the help command, please see this tutorial by Stella#2000

balmy sparrow
#

huh

#

fair enough I guess

fallen patrol
#

btw there's a regex for that in the eval cog

short snow
patent pivot
#

FYI: Scheduled downtime of PyDis Site from 21:00-23:00 UTC today.

tough imp
#

I noticed that the async-rediscache repo no longer sends github events to #dev-log since the transfer to @hardy gorge's account, is that a conscious decision? It still feels like a project tightly related to the pydis infrastructure and having an event feed may be good to raise awareness of existing issues & generate more interest in contribution

short snow
#

@green oriole I had a question with bot#1588 , for start and stop time, will it be passed as integer or datetime string which is to be parsed.

Like: !modpings schedule 7 20 so from 7am to 8pm

or like: !modpings schedul 7am 3pm?

dusky shoreBOT
green oriole
#

Can we do both with a custom parser?

#

It should be able to handle 7, 7am, 7:30 and 7:30am

vale ibex
#

7 and 7:30 is ambiguous though right

#

I'd expect 7 and 7:30 to convert to the AM equivalent

short snow
#

yeah, by 7 and 20 I meant 24 hour format

vale ibex
#

Yea, that would be my thought too

#

it should allow for both 24hour and 12hour times

short snow
#

sure!

vale ibex
#

So yea, Akarys's point of a custom parser would be good

#

similar to what we have for the duration one now

#

So user could do either of your examples and they'd both work

#

or even mix and match

exotic ember
#

have we considered just using dateutil's parser?

short snow
vale ibex
#

I assume arrow has something similar?

#

unless dateutil is already in the dep list

green oriole
#

Like that

short snow
#

i don't think arrow allows to just parse time, like dateutil does

#

like this

vale ibex
#

there's a dehumanize thing I've seen

#

which might be appropriate

#

but that's from memory, so might serve a different purpose

sharp timber
#

I'm getting Site matching query does not exist trying to log into the admin of a fresh django setup for site

#

I have set up the hosts file, so I'm trying to hit http://pythondiscord.local:8000/admin

vale ibex
#

I think we possibly trashed that with dewikification

#

I might be wrong though

sharp timber
#

I'm just pulling off of main

#

I see

#

my manage.py run did not function as expected

gritty wind
#

admin should still exist

#

It's just

#

Logging in may be tough

sharp timber
#

There we go

#

I need to pass --debug to it

short snow
#

I was looking at the scheduler, it doesn't support repeating events as of now, so i think there are two options right now for scheduling modpings.

  • Allow scheduler to support repeating events.
  • In coroutine which is ran on hiting the event, we can just add that event again by shifting it by 1 day
#

I am not really familiar with how scheduler is implemented, so I think I would go with option 2

sharp timber
#

Does anyone know if there's an easier way to add a custom filter other than using get_queryset? I am very not familiar with DRF

sharp timber
#

...I need a guinea pig on the test server, if anyone's available for that?

short snow
#

||me||

sleek steppe
#

👀

thorny obsidian
sharp timber
#

ok

#

Thanks! ignore the pings

sharp timber
#

I could make this really complex but let's.. not

green oriole
#

If you need a second user, you can have fun on me too

sharp timber
#

So I've added a types filter, a permanent filter, and expires_at_gte and expires_at_lte

short snow
sharp timber
#

At the moment it simply runs the rescheduler until the api informs it that there's none left that it might need to reschedule in the future, then it stops

green oriole
#

Are you using SearchFilter and OrderingFilter from drf @sharp timber ?

sharp timber
#

No

green oriole
#

hmm why not?

sharp timber
#

They wouldn't apply?

green oriole
#

wouldn’t they?

sharp timber
#

Searchfilter is for searching a field, right?

green oriole
#

lol

#

Yeah

sharp timber
#

I'm not searching, I'm applying a filter

green oriole
#

I mean, you can use it to only return infractions that has active=true for example

#

that’s the search filter

sharp timber
#

what

green oriole
#

Oh wait

sharp timber
#

no, that's specified via filter_fields right?

green oriole
#

Yeah yeah