#dev-contrib

1 messages ยท Page 125 of 1

vale ibex
#

~2.8 is the same as >=2.8.0 <2.9

brazen charm
#

is ~ just poetry's version of ~= with a bit different semantics on the allowed versions? Seems easy to confuse things when both will be used in the same file

vale ibex
#

So poetry's ~= is pep 440 ~=

#

but it also has ~

#

where ~2.8 is >=2.8.0 <2.9

#

for here, it's probably clearer to use ~=2.8.0

#

rather than mix ~ and ~= in the same file

brazen charm
#

I think just the tilde requirements to lock in the minor version would make more sense for most of the deps? We can always run poetry update or watever so things don't break like this on unrelated changes

surreal veldt
#

How does python get the docs for the docs command?

stable mountainBOT
#
Command: docs

Look up documentation for Python symbols.

Source Code
vale ibex
#

I think that is what would make sense

#

That also seems to be what numerlor is suggesting too

#

that is what you mean by tilda lock the minor version right?

#

~ is tilde

#

~=2.8.0 will mean the minor version is locked and we will just get the latest patch version on update

brazen charm
#

I was thinking of just ~x.y which would also lock the minor, and applying that for all of the deps (or most if we can rely on the versioning on some)

vale ibex
#

~x.y == ~=x.y.z as far as I can tell

#

and the current poetry file has all ~=

brazen charm
#

the file has a mix of locking to major and minor with ~= which just makes things like this likely to come up in the future

vale ibex
#

yea

brazen charm
#

I'd say use ~= but I think it should be looked into in the projects, I recall flake8 also had a bump in an unrelated PR because of it which then needed to fix linting errors

#

looks like pep8-naming also got bumped, could be a new error

#

then force push

#

It's your own branch on a draft pr, if there's ever a good time to do a force push that is it

celest charm
#

That's a terrible warning, Error/Exception at the end is often unnecessary noise

brazen charm
#

It's better than leaving some typo in and having to introduce a new commit to fix it and things like that

celest charm
#
raise EverythingIsOnFire
``` Hmm I wonder if `EverythingIsOnFire` is a string, list, socket, generic type alias or a Lark parser. ```py
raise EverythingIsOnFireError
``` oh dear, it's an exception, so clear now
celest charm
#

I think we discuss flake 8 ignores with the core devs, not sure...

timid sentinel
#

in sir-lancebot and bot we just chucked Error on the end when updating

green oriole
#

Well

#

That's what we have been doing so far

#

I don't know if it would require a discussion among the core devs or not. I personally don't agree with this but not enough to go and discuss it.

#

Also do you know about precommit @clever wraith?

static canyon
#

Can I get another review on bot#1742 please?

surreal veldt
#

the info for the docs command is stored in a database right

brazen charm
#

Yes, the inventories are stored through the site api

short snow
#

Tizzy you need to have patience, I have prs waiting from 2-3 months

mint nebula
#

is bot#1540 reviewed?

vocal prairie
#

Doesn't seem to have been approved/denied by a core dev yet, no.

green oriole
mint nebula
#

great.

#

thanks for answering.

surreal veldt
#

for bot#447 , does anyone know the most efficient and reliable way to get the closest matches?

dusky shoreBOT
viscid coral
#

Yeah I think difflib is also better

surreal veldt
#

i dont find it reliable

#

i got one, nvm

celest charm
#

fuzzywuzzy is GPL

#

which is viral, and unfortunately bots don't wear masks

vocal prairie
brazen charm
#

not that it's needed, but would the bot being gpl affect anything in a meaningful way?

celest charm
#

if I'm not mistaken

#

and if we make changes to these parts while we're GPLd, the libraries would have to be GPL, right?

#

but, well, it's not been tested in court โ„ข๏ธ

brazen charm
#

ah wasn't aware of that, that'd probably have to be gpl yes; although considering there aren't that many contribs if everyone okayed it, the extracted lib could use an another license

steel isle
vale ibex
#

Yea, we're aware of the issue, working on a fix

patent pivot
brisk brook
#

๐Ÿ˜” lemon_pensive lemon_angrysad ๐Ÿ˜ข

viscid coral
#

I have a question

#

The source command

#

The docs command*

#

Where does it get the info from?

#

I think someone said a website or some API, can I interact with that API for my bot?

fervent sage
stable mountainBOT
#
Command: docs

Look up documentation for Python symbols.

Source Code
viscid coral
#

I am not good enough with python and discord.py to understand this

#

It's like:
functions that leads to a functions that leads to a context manager that leads to another function that leads to a class and it's hard lol

dusty bay
# fervent sage `textdistance.JaroWinkler()`

+1, Jaro Winkler is most likely the best option. Should be able to do XXk+/s easily.

It really depends on what youโ€™re trying to match also. 5+ words is a lot different than 1-4 words. You can average the scores of something like JW and smith waterman if you want, it really depends on the goal though

short snow
#

There is surely lot of magic in there ๐Ÿ™ƒ simply put it gets the markdown from the objects source of a particular documentation, for example , https://docs.python.org/3/objects.inv for python, and then parses the markdown

#

Thatโ€™s what I got right now, I am not familiar with that section

patent pivot
brazen charm
#

the tldr of docs would be that the inventory file maps the names you use for the command to the urls where they are located, and then the html in there is converted to discord markdown

surreal veldt
fervent sage
#

textdistance

surreal veldt
#

Is it better than rapidfuzzy

fervent sage
#

I havent played with rapidfuzz, but if its a fork of fuzzywuzzy then yes

timid sentinel
#

I think rapidfuzz is quite a bit faster than fuzzywuzzy. Haven't used textdistance before but it seems to focus on giving choices between a lot of different algorithms

gritty wind
#

@echo narwhal please review my comments on your last two PRs before opening more

surreal veldt
#

Yeah ill stay with rapid fuzzy then

#

Anyone got a good value or ideal one for the score_cutoff kwarg of rapidfuzzy process.extract function

timid sentinel
#

depends what you want, i'd just play around with a few different values and see how they work out for you.

surreal veldt
#

range -1 to 0 right

timid sentinel
#

uhh, I thought it was 0 to 100

#

-1 to 0 seems like a weird range

surreal veldt
#

Not sure too, though I'm looking at the docs and it says
score_cutoff (Any, optional) โ€“ Optional argument for a score threshold. When an edit distance is used this represents the maximum edit distance and matches with a distance <= score_cutoff are ignored. When a normalized edit distance is used this represents the minimal similarity and matches with a similarity >= score_cutoff are ignored. For edit distances this defaults to -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.
https://maxbachmann.github.io/RapidFuzz/process.html#extract

#

okay maybe it's 0 to hundred

#

For bot#447 if it were to get implemented can I get to which form it would be in? Like how the output of the feature would be? I was thinking if there is more than one result, it will add reactions and according to which one you react to it will edit the message accordingly.

dusky shoreBOT
brazen charm
#

I think that'd be better to ask on the issue so it can be discussed properly

surreal veldt
#

Alright, done thank you

sturdy barn
#

It would be nice to have some kind of indicator or countdown to when the channel will be closed due to inactivity

patent pivot
#

hey

#

anyone want to test soemthing for me

brazen charm
#

Access denied
This website is using a security service to protect itself from online attacks.

patent pivot
#

okay neat

#

maybe I should move our tooling to another domain some day

#

hmmmm I don't like mtls

#

not for this anyway

#

firefox seems inconsitent

#

mtls rules

#

under firewall/ssl (client certs)

#

can someone see what it says now

#

epic

fervent sage
#

Please contact @patent pivot if you experience any problems logging in.

I'm experiencing problems logging in, it wont let me log in angree

patent pivot
patent pivot
#

ok AM works

thorny obsidian
patent pivot
#

shrekt

#

I can grant admins access though one sec

thorny obsidian
#

lol it's fine. I can't even see stuff on sentry, so I'm used to devops being a blackbox

patent pivot
#

but devops should be OPEN AND BEAUTIFUL

#

lol no open prom access

#

that's a bad idea

patent pivot
#

lifecycle endpoint

#

lol

vale ibex
#

that's how we do an hour with joe, we just ship him in his black box

thorny obsidian
vale ibex
patent pivot
#

chris hi join my team?

vale ibex
#

k

patent pivot
#

ty

#

pleasure doing usinesss with you sir

vale ibex
#

u 2

#

see you in 2 weeks for our 1 to 1

thorny obsidian
#

yessss, now I can bother Chris when shit breaks

vale ibex
#

as if you don't already

#

lmfao

thorny obsidian
#

Sometimes joe decides to "sleep" or "have a life" which is really rather rude. Now I can bother Chris and continue to not feel bad about it :D

vale ibex
#

not without logging into github

patent pivot
#

with logging in

thorny obsidian
#

no access

patent pivot
#

you'll be able to chriss because you're in the team now

#

wtf

#

.......

vale ibex
#

I'm having problems

#

it needs my password

patent pivot
#

oh wait. i didn't click save i didn't click save

vale ibex
#

(I'm in btw

#

lol

patent pivot
#

try now @thorny obsidian

thorny obsidian
#

rooHacker I'm in

patent pivot
#

they call me mr webscale

#

it's just a graph of disk reads

#

I'm doing alerts as code now so I don't have to deal with Grafana's hell

vale ibex
patent pivot
#

thanks chris

#

great to know gmail spam reports are used correctly

vale ibex
#

lol

patent pivot
fervent sage
#

yes its in all your git commits

patent pivot
#

yeah you tried to sign in lol

vale ibex
#

arthur bow to me

#

oof

#

i fix btw @timid sentinel

radiant merlinBOT
#
arthur ed [-GVhs] [-p string] [file]

Ed is the standard text editor.

fervent sage
radiant merlinBOT
#

?

fervent sage
#

arthur ed -GV -p "aaaaaa?" test.txt

radiant merlinBOT
#

?

fervent sage
#

understandable

#

have a great day you strange man

patent pivot
#

Ed is the standard text editor.

#

I don't have any reference other than how kubectl does it

#

which just seems to be copying the jobspec from the cron and throwing it into a job

green oriole
#

Time to buy an hour with Joe!

patent pivot
#

lmfao

#

lol

#

no

green oriole
#

I mean isn't one hour of training from devops daddy kind of makes you devops son

patent pivot
#

lmfao

green oriole
#

Also @patent pivot please rename <@&797752289771126784> to Kubernetes Daddy thank you Joe

patent pivot
#

lol i intentionally avoided that bbecause then i get randos calling me it and I do a lil ๐Ÿคจ

green oriole
#

Right

#

No, Chris warmed me

#

Let's move to ot ๐Ÿฅบ

vale ibex
#

@timid sentinel just FYI since you've already approved the PR. I've reworded the error from "Both members must have the lovefest role! You can get this by running the `{Client.prefix}lovefest sub` command." to ```
"This command can only be ran against members with the lovefest role! This role be can assigned by running {Client.prefix}lovefest sub in <#{Channels.community_bot_commands}>."

timid sentinel
#

cool cool sounds good, do I need to press approve again for my review to count then?

vale ibex
#

nah it's still good

timid sentinel
#

idk how it works

#

ah cool

vale ibex
#

Once you've approved the only way to remove the approval is if someone manually dismisses your review

#

We looked into automatically doing that if enough lines change, but don't think we turned it on

vale ibex
#

that didn't remove the approval

vale ibex
green oriole
vale ibex
#

hotkey is proving useful

brisk brook
vale ibex
#

interesting

#

didn't do it for the one just now

green oriole
#

Huh

#

I never seen that

fervent sage
#

yes

green oriole
#

!rule 69 42

stable mountainBOT
#

:x: Invalid rule indices: 42, 69

green oriole
#

Yeah, I guess

#

If you want to open a PR I won't stop you

timid sentinel
#

Hm I think it's correct both ways, it's a list of invalid rule indices with one item

short snow
#

don't expect someone to review it then

thorny obsidian
#

this is going to be my only response

patent pivot
#

โœจ devops wins again
joe has added alerting
chugging in the wind โœจ

#

lol

#

no promisses

#

I''ll put up manifests for this when i've written more alerts

#

no

#

lol

#

we are never having a "cleanup" PR like that again

#

it was a pretty awful experience for all involved

#

merge and reviewing

#

it was just not worth the effort whatsoever

#

yes, but not a flurry of 500 PRs lol

vocal wolf
#

oh no not another cleanup

#

let's not do that

#

merge two branches and make a new PR?

thorny obsidian
#

Again, I will refer you to the pins for our attitude on those mega "clean up" PRs

#

The grammar isn't such a huge deal and it'll be easier to fix as we naturally update/revisit those code portions

vocal wolf
#

pypi belongs to the python bot because it's more of a utility for the language

gritty wind
#

Currently not open to external contributions, but the repos are open source under
python-discord/forms-frontend
python-discord/forms-backend

patent pivot
#

okay i'm gonna push my alertmanager stuff

gritty wind
#

Soonโ„ข๏ธ

#

Not now though

patent pivot
#

lol no i'm going to merge it now anyway

#

jut waiting for lint to run

#

okay

#

so

#

these are our alerts now

brisk brook
gritty wind
#

Yeah, itโ€™s on my agenda for when I get my proper setup back

brisk brook
#

Thank you ๐Ÿ˜…

patent pivot
#

off topic

#

i'm joking i'm joking thank you thankk you

celest charm
short snow
#

cool thanks

vocal wolf
#

np

tawdry vapor
vocal wolf
#

I thought the PR that I labeled would be internal functionality since there's a difference between if the user could or could not get DM'd

#

But I can also see how that may also not relate to internal functionality, since it's surface-level type stuff.

tawdry vapor
#

Yeah it's technically internal, but by such a broad definition, we'd end up using that tag everywhere and it wouldn't have much meaning. It's not a particularly useful distinction here.

vocal wolf
#

Agreed

tawdry vapor
#

I like to use it in a more general sense of pertaining to something that's not user-facing at all or that is a very generic utility used by many things.

#

With a few exceptions, like I think the sync stuff is backend and we have some commands to control it, but that's not the main interface for it.

vocal wolf
#

It wouldn't be frontend either, more just help channels and that's it

tawdry vapor
#

I have mixed feelings about the frontend tag since it's kind of arbitrary what qualifies

vocal wolf
#

I think it's usually for editing of messages/embeds, that's what I've mostly saw it for

tawdry vapor
#

Same

vocal wolf
#

not as in the bot editing an embed, but having a format of an embed be modified in the code so it continues to look different

tawdry vapor
#

While you're here

#

Should I transfer all the tag issues to meta, since we agreed on that?

vocal wolf
#

Yep, I don't see why not

tawdry vapor
#

In retrospect this is much nicer than it first seems

#

Cause issues won't get lost in the 100s of bot issues

vocal wolf
#

indeedingly

tawdry vapor
vocal wolf
#

Yes

#

@tough imp If you haven't seen the ping, bot#836 is ready for your review.

dusky shoreBOT
tawdry vapor
#

@vocal wolf How do you think we should structure the issue templates considering a request can be to either add, remove, or revise something?

#

I think if there's a separate template for each action then it would be overwhelming

vocal wolf
tawdry vapor
#

Though I was thinking of breaking off a new "policy" label from "area: features"

#

I'm just gonna do that before I forget. Not like we have any open issues for it anyway.

surreal veldt
#

Anyone on bo#447 ? The most recent comment

#

bot#447 *

dusky shoreBOT
green oriole
#

That sounds a bit like spring cleanup haha. I'll discuss it with the rest of the core devs and get back to you!

surreal veldt
#

For Python bot, how is the documentations for the docs command stored? It is like there is a column for name and then content?

#

meaning if a symobl were to be indexed to one, would it just give the name and if it were to be indexed to two it would get the content? or how could it be split like that

viscid coral
#

Maybe check the source?

#

!source docs

stable mountainBOT
#
Command: docs

Look up documentation for Python symbols.

Source Code
surreal veldt
#

uhhhh

#

i can't lol

#

on mobile

steel isle
#

!d

surreal veldt
#

okay so from what i saw,

self.base_urls
``` this is for the URL links of the docs
#

And py self.doc_symbols is for the content, is is correct?

steel isle
#

where is DocCog Invoked

brazen charm
#

you should only need self.doc_symbols for the parial search, it's a mapping of the names used to fetch the docs to their urls

green oriole
steel isle
green oriole
#

No he rejected that yesterday

steel isle
#

you asked him to do a chore on the eve of his birthday lol

green oriole
#

I didn't ask him anything

#

okay maybe I did

#

But still

patent pivot
#

lol

surreal veldt
#

can i ask a dpy question here regarding bot#477

dusky shoreBOT
surreal veldt
#

Wait sorry, bot#447

dusky shoreBOT
fervent sage
surreal veldt
#
@bot.command()
async def py(ctx):
    buttons = {}
    for i in range(1, 3):
        buttons[f"{i}\N{COMBINING ENCLOSING KEYCAP}"] = i
    the_previous_page_number = 1
    the_current_page_number = 2
    embed = discord.Embed(title=f"Documentations found", description="", colour=discord.Colour.blurple())
    msg = await ctx.send(embed=embed)
    for button in buttons:
        await msg.add_reaction(button)
    while True:
        if the_current_page_number != the_previous_page_number:
            embed.title = f"Page {the_current_page_number}"
            embed.description=""
            #await msg.edit(embed=embed)
        try:
            reaction, user = await bot.wait_for("reaction_add", check=lambda reaction, user: user == ctx.author and reaction.emoji in buttons, timeout=10.0)
            await msg.edit(embed=embed)
        except asyncio.TimeoutError:
            return
        else:
            the_previous_page_number = the_current_page_number
            await msg.remove_reaction(reaction.emoji, ctx.author)
            the_current_page_number = buttons[reaction.emoji]

I have this right now, when I run the command it gives the embed and on the first reaction, it switches pages and changes the number but if i react the second time, i need to press the reaction twice for it to switch for some reason which I cannot figure out

fervent sage
#

Hm, i'm sure there's already something in the bot that lets you do pagination

surreal veldt
#

only the first one switches with one reaction press, and the 2nd 3rd forth etc take more than once

fervent sage
#

ill see if i can find it

surreal veldt
#

that seems long lol

#

and yeah that's one thing, in the one you sent

if reaction.emoji == LAST_EMOJI:

it checks each one individually where as when compared to mine i do not check each reaction indivudally

#

example

fervent sage
#

well anyways, you should be importing that paginator for consistency and code reuse

surreal veldt
#

alright

static canyon
#

Can I just confirm that I responded to the review comments correctly here? I'm not sure why it created a separate review from me without the context of Mark's messages as well as the responses https://github.com/python-discord/bot/pull/1742

green oriole
static canyon
#

Right okay, thanks ๐Ÿ‘

green oriole
#

I actually blame the spell checker here, but thanks

fervent sage
#

yooo github is gonna be secure-er

#

tbh i dont understand why people still use password auth for pushing with the convenience of having an rsa key

vale ibex
#
 {% if thing %}
 ...
 {% elif other_thing %}
 ...
 {% else %}
 ...
 {% endif %}
vale ibex
short snow
#

use gh cli for auth, simplest

#

and make git import the secrets from it

vale ibex
#

I imagine so, since the if elif block evaluates before sending

surreal veldt
vale ibex
#

buttons would be preferred over emojis, yes

#

They just haven't been released yet

surreal veldt
#

yeah i would, but v2 isn't stable yet

#

would buttons be implemented to @stable mountain in the future?

#

alright i guess i'll stick with menus instead of paginator for now

#

Should i just wait for buttons and then start development of bot#447 pikathink

dusky shoreBOT
vale ibex
#

you should implement it using the paginatior in the bot

#

when we update the bot to use buttons, we will change the paginator

#

So it'll just work

surreal veldt
vale ibex
#

when you say menus what are you referring to?

#

context menus or buttons?

#

or something else?

surreal veldt
vale ibex
#

oh right, this

#

as far as I know on the menus ext, our paginator implements it

#

@fervent sage have you had interaction with this menu ext?

#

would you agree that our paginator does the same thing?

fervent sage
#

yep

vale ibex
#

Cool

#

So yea, @surreal veldt use our paginator class

#

it does the same thing, and will eventually be updated to use buttons (which are better than emojis)

surreal veldt
#

Could I have the github source please

surreal veldt
#

oh that's what you use, okay thank you

vale ibex
#

yea

#

check out this cog for a simple implementation

#

!src sf

stable mountainBOT
#
Command: snowflake

Get Discord snowflake creation time.

Source Code
short snow
#

the pagination class is itself well dcoumented

surreal veldt
#

okay welp that is a long pagination

short snow
#

itertools.grouper

#

more itertools.grouper*

surreal veldt
short snow
#

did u go through the contribution guide? it says how to setup the bot (forking and cloning)

surreal veldt
#

oh, no I haven't gone through it yet

short snow
#

Just go through it once, would def help you out with working with bot

#

You would need site for working with docs command, so either setup the site locally or via docker

#

i had say docker since it is simpler and faster

surreal veldt
#

Yeah....im not familiar with github tbh lol

vale ibex
short snow
#

he was copying bits of the bot code into his and then running it if i understand correctly

vale ibex
#

that's not gonna work very well lol

surreal veldt
#

Well i was thinking to test it first

vale ibex
#

I'd suggest you follow our contributing guide and get the bot setup

#

we can help you if you have any issues while doing so

surreal veldt
#

Okay, I'll take a look at the guide when i have time

fervent sage
#

well, assign sorted(...) to a variable, you use it 4 times

short snow
#

are you splitting it into two?

fervent sage
#

can you paste it here :P

vale ibex
#

why do you need to sort the list when calcing the length?

#

yea, that looks better

#

you could also make a half_length var too

#

which does len(..)//2

short snow
#
topics[::2], topics[1::2]
#

alternative

green oriole
#

Do you have a GPG key at least, with gnupg started ?

short snow
#

you need to add it to git also

#

see .gitconfig

#

do you see it

#

nope

#

not a secret

#

it was short

#

and secrets are stored in gitconfig

#

as far as i know

green oriole
#

GPG is totally different from SSH

#

What are you trying to do?

#

SSH isn't for signing your commits

#

It is used to access the Git server

#

Try echo hello | gpg --sign

#

lol, is your shell broken

#

What if you try to start bash, do you get any warning?

patent pivot
#

welcome Chris and Volcyy to devops team epic win

fervent sage
#

joe teach me devops KEKW

#

oh that remind me im gonna set up minikube on a couple old PCs at my house and play with kubernetes

patent pivot
#

hell yeah

cold moon
#

Joe you should make paid DevOps course.

dim pelican
vale ibex
#

The blog post in the announcement explains it better than I did

#

it has photos and everything

dim pelican
surreal veldt
#

uh could someone help with "getting the bot setup" to write some code for it, I'm not really familiar with github and I can't seem to find this on the contributin guide

dim pelican
#

One sec, I started sir-lancebot last week for the first time as well

surreal veldt
#

oh oops i was apparently reading the wrong one Sadge

#

okay i forked it and for the development environment i'm kinda lost on what to do, I'm using visual studio code and have copied the HTTPS link

brazen charm
#

do you have git installed?

surreal veldt
#

yeah i just did that, also it asked Launch git bash, should this be selected?

brazen charm
#

any of your terminals should work for the clone if you added git to path

surreal veldt
#

I download git and then do git clone (https link) right?

fervent sage
#

since github is apparently removing password auth for that kinda stuff, I'd set up ssh and then you clone with git clone git@github.com:author/repo.git

#

(ik public repos dont need auth to http clone, but good practice)

surreal veldt
#

so now using https link is bad?

brazen charm
#

you can use it

brazen charm
#

yes

surreal veldt
#

so once i clone it, i can open it on visual studio code?

#

okay nvm i got it

#

okay i'm a little confused i cloned the bot and opened it on visual studio code but there are going to be import errors ofc, and not so sure what to do now

gritty wind
#

The getting started guide should walk you through setting up dependencies using poetry

#

Youโ€™ve done the โ€œfork the project stepโ€, keep going through the rest

#

(Youโ€™ll seriously struggle to get this done if you donโ€™t follow the guide)

surreal veldt
#

could someone help with the "install dependencies" part please (I'm not using pycharm)

short snow
#

just do poetry install in your shell

surreal veldt
#

the part i don't get is

Make sure you are in the root project directory. This directory will always have a file titled README.md.
Install project and development dependencies. Remember to also set up pre-commit hooks to ensure your pushed commits will never fail linting.

gritty wind
#

The commands below that text are what you need to run basically

#

poetry install will do most of the work

#

It will also create a new virtual environment for your project

tough imp
#

oh it's the tags tests

#

ye I'll try

clever wraith
#

add a translator in python bot ๐Ÿค”

gritty wind
#

What do you have in mind with that?

celest charm
#

Who even uses password auth, isn't it, like, super inconvenient?

#

it also means you don't have 2FA on your account, right?

green oriole
#

It doesn't work with 2FA, yes

#

You can use a PAT instead of your password though, and still use http auth

molten perch
stable mountainBOT
#

bot/exts/utils/reminders.py line 186

if reminder.get("jump_url"):  # keep backward compatibility```
`bot/exts/utils/reminders.py` line 197
```py
mentionable.mention for mentionable in self.get_mentionables(reminder["mentions"])```
vale ibex
#

Not in the current db at least

#

it might have been backwards compatibility with an old version of site, that didn't return a jump_url, or for the period after that key was added

molten perch
#

So, it wouldn't be a problem if I removed it, would it?

vale ibex
#

I don't think so

#

@green oriole is on the git blame, so maybe he can remember 2 years ago as to why it was needed

molten perch
#

Alright, I can somehow keep it in but it wouldn't be so consistent, I'm trying to reply to the original message instead of using a jump url.

vale ibex
#

I don't think it would be an issue

#

It sounds like your change should include a change to the site api

#

probably add a new column called 'original message id' or similar

#

to store the message to reply to

celest charm
molten perch
#

bot#1741

vale ibex
#

sounds good ๐Ÿ‘

green oriole
#

@vale ibex @molten perch yes, we still had this if case since when we added jump links we still had some reminders in the DB that didn't had any url.

I guess sir @vale ibex can now use his newly found power to check if we still have such a reminder :P

#

SELECT * FROM site_reminders WHERE jump_url = NULL or something

vale ibex
#

I did lol

#

Look at the screenshot

green oriole
#

Oh nice

#

Then we can safely remove it

molten perch
#

Alright, then. Iโ€™ll remove it then, and push a pr ๐Ÿ™‚

viscid coral
#

@molten perch If you want me to review I am happy to help!

green oriole
molten perch
#

Yes.

#

I guess? ๐Ÿ˜‚

#

It should work just fine without it.

green oriole
#

I don't think we should be opening PRs for little stuff like that

#

Sure this is legacy code but it doesn't hurt anything

#

We can remove it when we have a PR touching the reminder code

molten perch
#

Oh, It's a part of an issue.

#

Not, just that.

thorny obsidian
#

Isn't the context of this is that it's part of an existing issue/PR for a feature?

molten perch
thorny obsidian
#

If it's part of a feature you're working on you can just include it in your PR for said feature. The commit can be used to describe the change being made. No need for a full blown separate PR

molten perch
#

Yeah, I never wanted to open a separate PR in the first place ๐Ÿ˜„

green oriole
#

Yes, let's combine it in one PR

#

Cool

brazen charm
#

I have been thinking reminders could be allowed in all channels with the bot only sending the remainders in #bot-commands (if invoked from a non mod channel) which would be incompatible with the reply feature. Any thoughts on that or should I open an issue?

green oriole
#

Please do open an issue! We'll discuss this, but I think it should be fine

vale ibex
#

yea, I'd like that

#

sorta messes with the "reply to" idea slightly, but can be worked around

fallen patrol
#

@molten perch is there a pr for the first change yet?

molten perch
#

I'm just about to push it.

fallen patrol
#

oh okay

#

cool

molten perch
#

I'll open a draft then.

#

And then we can figure something out.

vale ibex
#

nah no need for draft

#

we can add to your logic after it's merged

fallen patrol
#

or review and add to it then lol

#

basically draft means that you are not done adding to your code

#

if its ready for review, don't draft it ๐Ÿ˜„

molten perch
#

Yeah, I thought we were gonna modify it on the way once we discussed the details.

fallen patrol
#

in that case I would still mark it ready for review

viscid coral
molten perch
#

Yeah, I'm not sure how we could find a workaround

#

I'll push my pr anways.

viscid coral
#

We can find a workaround but not sure how good that would be

molten perch
#

Well, I don't think so? Like replying: "Hey.. your reminder is in #bot-commands " That wouldn't look so good.

viscid coral
#

Yeah, I think we should only restrict it to #bot-commands

molten perch
#

If it's more convenient to not restrict it to #bot-commands then we can trash this reply idea, it worked just fine before.

viscid coral
#

Yeah but I also don't really get why to enable it in every channel

#

The reminder command does not seem so related to Python anyways

#

Why is it not in @dusky shore really?

tawdry vapor
molten perch
#

My solution would work perfectly fine, if the bot fails to reply it'll fall back to use jump_url and send it to whichever channel.

vocal prairie
#

Bulma (or it's extensions) don't offer a way to make a modal, correct? If that's needed for the site, will we have to implement our own?

green oriole
#

There is a modal class!

vocal prairie
#

There is? Oh, I must have missed that, I'll take a look

green oriole
vocal prairie
#

tyty

surreal veldt
#

uh regarding bot#447 i wanted to work on it, but i honestly don't have time for it now...

dusky shoreBOT
viscid coral
#

Why does the remind command in @stable mountain and not @dusky shore instead?

brazen charm
#

it has to interact with the api

#

and I don't think it really suits lancebot anyway

viscid coral
#

How does it suit Python bot

#

Python is for moderation and python-related commands, while lancebot is for fun commands right?

#

And remind command is a fun command which is not related to Python

green oriole
#

I would say it is part of our core features

#

We use remind internally quite a lot

vocal prairie
viscid coral
green oriole
#

No, I don't think it is

#

If all of our reminders were dropped, it would suck for our internal organization

thorny obsidian
#

I think reminders is fine where it is

molten perch
#

I managed to misspell "reminders", the thing that I'd been the most afraid of.lemon_sentimental

fallen patrol
green oriole
#

Cyan is used internally iirc

celest charm
#

@dim pelican Just a tip: when writing commits, don't include line numbers and other stuff seen in the diff into the name. Git commits are named for people reading them as a list, so they should say something like "add an option to order extra sugar in a coffee order"

sinful knot
#

How long does it usually take for a PR to get reviewed?

fervent sage
brazen charm
#

really depends on the pr, don't expect immediate reviews though

sinful knot
#

bot#1725

dusky shoreBOT
sinful knot
#

Nothing much

sinful knot
#

Ping me if you reply

brisk brook
# sinful knot bot#1725

Ah that one, personally I'll just have to test it before continuing with approving it.

To make sure the regex works correctly and it is not failing to escape correctly.

sinful knot
#

thanks as Iย said in the pr this is my first one so Iย just don't know how the whole system works

molten perch
#

Hey! Sorry, but can somebody take a look at that PR? sir-lancebot#778
Two issues were put on halt, because they involved modifications in that Cog.

dusky shoreBOT
lunar hull
#

Hello, I'm new here and would like to get involved in contributing. Any recommendation on where to get started / any projects that would be good for someone new?

vale ibex
lunar hull
#

perfect, thanks!

vale ibex
#

It should have all of the information you need

#

Check out the issues on the repos if you're looking for things to do ๐Ÿ˜„

molten perch
#

Hey, does this issue (site#369) still persist? I just want to make sure, I don't know whether issues can "expire", or not! ๐Ÿ™‚

dusky shoreBOT
gritty wind
#

They donโ€™t have a hard expiration date

#

Though they may become irrelevant or stale

molten perch
#

This one in particular does not seem to be solved, though.

gritty wind
#

Perhaps if a good solution exists, it could be added. If itโ€™s going to take too much effort, might make sense to save it for the rewrite

molten perch
#

You mean the FastAPI implementation of the current API?

gritty wind
#

Yeah

molten perch
#

Oh, well. I think it might take some time, I believe I might have an easy solution for that issue! ๐Ÿ˜„

short snow
#

why no participation in hacktoberfest lemon_pensive

thorny obsidian
short snow
#

Oh thanks

short snow
#

@green oriole yeah it is waiting for a re-review.

green oriole
#

Cool, thanks!

compact veldt
#

I have had an idea of implementing an optional monkey-patch on stdin to allow standard input to work inside of snekbox. Giving it a new stdin argument.

Thoughts on if this would be a good addition to snekbox? It could allow for the !eval command to have an optional input.

green oriole
#

I think it would be a good addition, but I'm sure how we can have a good UI with !eval. I feel like patching sys.stdin isn't an issue

compact veldt
#

Not 100% how i would do that yet. I have the stdin patch already made, i just need to figure out how it can be added to snekbox.

tawdry vapor
#

Thoughts on if this would be a good addition to snekbox?
What are yours? What are your use cases for such feature?

compact veldt
#

Primarily the possibility of allowing !eval in the python discord bot to take in optional input. This can be a great feature as you no longer have to avoid using input() in code examples. My current idea of how that could look would be:

!eval "Input one" "Input two" '''py ... '''

But i dont know what the best way that could be implemented for the least amount of misunderstanding.

brazen charm
#

I can't really think of a good UX for it and you can always patch the stdin in the code passed to eval if input is required

green oriole
compact veldt
compact veldt
#

But im not sure how we could set that custom StringIO object to stdin in snekbox. Or if thats the best way.

#

!e ```py
import io
import sys

class PrintingStringIO(io.StringIO):
def readline(self, size=None):
line = super(PrintingStringIO, self).readline(size)
print(line, end="")
return line

sys.stdin, _stdin = PrintingStringIO("Sofi\n"), sys.stdin

print("Your name is:", input("Whats your name? "))
```
stable mountainBOT
#

@compact veldt :white_check_mark: Your eval job has completed with return code 0.

001 | Whats your name? Sofi
002 | Your name is: Sofi
compact veldt
#

This is my current proof of concept.

#

Prints the stdin to where its expected to be seen if you ran the code yourself.

tawdry vapor
#

I think it makes sense to add stdin input to the API (since it's a standalone project that others can use) but not necessarily to support using it with our Discord bot, cause the interface is kinda clunky on Discord.

#

If this was implemented then I'd rather have it be done on the API so it can just pipe output to the subprocess rather than having to inject code into the user's

compact veldt
tawdry vapor
#

The nicest interface on discord may be to just have two code blocks: one for stdin and one for code.

compact veldt
tawdry vapor
#

So we just just not allow multiple code blocks in one command if you want to specify stdin

compact veldt
#

!e ```input
Sofi

```py
print("Your name is:", input("Whats your name? "))
#

So something like this?

tawdry vapor
#

Yes

#

I think It would have to be a separate command to reduce confusion

timid sentinel
#

Yeah agree with that ^. Something sort of fun would be to specify the codeblock language for the stdin codeblock as stdin, which will cause discord to ignore it, but that might just me more confusing ๐Ÿ˜…

compact veldt
#

There could also be a check of the language used. Like i used '''input ...''' in the above example which could be a way to handle it as well.

compact veldt
timid sentinel
#

and for other users it wouldn't be immediately obvious what is input and what is code

molten perch
#

Sorry, I don't mean to just interrupt. But I believe it might solve the problem, if before actually eval.-ing the code, the bot would send a message, and the user would have to reply with the desired inputs provided that the code contains code that involves user input.

tawdry vapor
#

Alternatively it could be a comment in the code that is parsed, but parsing adds complexity

molten perch
#

Wouldn't say so, not a bit harder than the logic in the reminder ๐Ÿ˜„

brazen charm
#

I didn't consider a subcommand, that could work nicely with two code blocks without interfering with the current codeblock handling

green oriole
#

I was thinking about a subcommabd to set the stdin of your next eval

tawdry vapor
#

I don't like the idea of saving state

compact veldt
#

I found out i can probably use the subprocess.Popen's stdin.

viscid coral
#

I know most developers are on vacation, but anyone might want to comment on bot#1717 ?

tawdry vapor
dusky shoreBOT
gritty wind
#

If you make it a second command, you can specify in the help that arg 1 is input, art 2 is code

#

Thatโ€™s something familiar to discord users

#

Combine that with the ignoring of non-codeblocks and you get
โ€”โ€”โ€”

#

!eval-input

Input: all this text is ignored and exists to the benefit of readers

Sofi

Code: this is ignored too

print("Your name is:", input("Whats your name? "))
compact veldt
brisk brook
# viscid coral bot#1717

I don't remember the full process, but you have not gotten any strong objections so if you would like to do this let someone know and they can assign you the issue.

I'll comment on the issue that I like it, so that we have that on record.

viscid coral
#

Wdym do this?

brisk brook
#

Would you like to make a PR that solves this?

viscid coral
#

I can't

#

I mean, I don't know how

brisk brook
brisk brook
viscid coral
#

Yeah sure I can try

#

Should I open it now?

brisk brook
viscid coral
#

Yeah

compact veldt
tawdry vapor
#

Does it block or something?

compact veldt
#

Issue is that it doesnt print out the example input.

tawdry vapor
#

Never mind communicate won't work here anyway

#

I would try writing directly to proc.stdin

compact veldt
#

We can write to stdin just fine. But the issue is that it wont show in stdout.

#

Thats what the patch was supposed to do. It puts in the stdin section into the stdout. So it looks like you have written it in yourself.

tawdry vapor
#

Oh i see

#

I don't see why that's a problem. This isn't meant to emulate a REPL or terminal, so one should not expect the output to contain the input (it's called _out_put after all)

compact veldt
#

The idea was to allow:

Input: Sofi
You wrote: Sofi
#

But writing directly to stdin makes it to:

Input: You wrote: Sofi
brisk brook
# viscid coral Yeah

You can open a draft pull request, that way if you get stuck and want to show your code you can show the whole pull request.

I'll assign you to the issue, I don't think there's any more steps to be done before you can start working. I think we have fleshed out the idea

green oriole
compact veldt
#

There might be other ways to do it. But i cant find out a good way right now

#

Like we can still swap out the input() function to a different one. But then other functions that rely on stdin will still break.

green oriole
#

Well, printing it at the right place would require timing the input, which isn't possible

compact veldt
#

And we can just get the nice stdout with the input in the right places.

brazen charm
compact veldt
#

Instead of messing with python.

green oriole
#

Well, how do you place the stdin at the right place in the stdout? That's the whole issue

brisk brook
# viscid coral What is a draft PR?

When you open a pull request, there should be an option to "open it as draft". This has that grey icon and can't be merged until it is converted to an open one.

#

It's simply a clear way of saying "This isn't done"

viscid coral
#

Oh ok

#

I need to show the solution right away?

compact veldt
viscid coral
#

Or just open a PR and fork the project?

brazen charm
#

how would that differentiate between stdout output from something like input and a normal output?

green oriole
brazen charm
#

you'd need to know when the proc is waiting on stdin which you can't really

green oriole
#

The problem is the whole stdin is avaliable when the program is ran

#

You could look at when the process reads stdin

#

But that's waaayyy too complex

thorny obsidian
brazen charm
#

I think like mark said just not writing that seems like the best option to me, the input is already in the invoking message anyway and newlines can be added to the prompts to avoid having them all on one line

viscid coral
#

But how can I open a PR from te fork?

compact veldt
brazen charm
viscid coral
#

Oh wait I have a repo from a PR I did a few time ago

green oriole
tawdry vapor
#

I'd say if you can do it, then go for it. Is this wrapper also in Python? Cause then we could just invoke it with -m wrappermodule

viscid coral
compact veldt
brisk brook
thorny obsidian
#

To briefly interrupt you wonderful folks, because I'd rather not manually delete 63 channels or come up with an int-e that I could fuck up to delete said 63 channels, could I get some help reviewing this? https://github.com/python-discord/bot/pull/1677

GitHub

The purpose of this PR is for us to avoid manually searching the permissions of team channels, and dealing with user-based overwrites. This also allows us to quickly tell what team a participant be...

viscid coral
viscid coral
#

VSCode

#

Why can't I do it from github itself maybe

brisk brook
#

Do you have the repository cloned locally?

viscid coral
#

Not that repo

#

Maybe someone else who knows dpy and github can do it

brisk brook
#

We're happy to help you here, but if you no longer want to do it @green oriole (:pppp) can un-assign you

viscid coral
#

Yeah sure I don't know how

tawdry vapor
#

I might look into it more

compact veldt
tawdry vapor
#

Thanks

cold island
#

@brisk brook I addressed the requested changes

brisk brook
#

Perfect, I'll take another look

dusky shoreBOT
vocal wolf
#

I think doublevcodes is back so they'll probably be able to finish this up. If you deleted your fork, you can just re-fork the repo on github.

#

whoops lol

#

I thought someone else owned that PR

#

I'm not really familiar with site, what seems to be the problem?

gritty wind
#

Tbh, after reviewing the site a bit, the way URLs are managed is a bit of a nightmare to reverse navigate. Since each URL can dictate where it's HTML files lie, there is no clear structure. Instead, what we could do is inject the correct path into the metadata of each page when building/starting, that way it's just available, and the button can read it without calculating

cold island
#

Thanks @brisk brook ๐Ÿ‘

#

And @green oriole too

#

for reviewing

#

Another PR

gritty wind
#

Nah, the idea is it's all automated

#

What that could look like is:
in site.manage.main, we recursively pull all html files, look for a <head> element, and add our own tag which is just the path of the file

#

I bet there is a django template to do that, but I don't know django

brisk brook
#

Here is where it failed specifically ^

#

The tracebacks all go back to Django pretty much

#

Here's what you want to know I think: ```
Creating test database for alias 'default'...
........................./home/runner/work/site/site/.cache/py-user-base/lib/python3.9/site-packages/whitenoise/base.py:115: UserWarning: No directory at: /app/staticfiles/

...................................................../home/runner/work/site/site/.cache/py-user-base/lib/python3.9/site-packages/django/db/models/fields/init.py:1365: RuntimeWarning: DateTimeField Infraction.expires_at received a naive datetime (2021-08-15 02:36:09.794182) while time zone support is active.

gritty wind
#

Do you not have testing set up locally?

brisk brook
#
.....................................................................................Unable to parse the GitHub repository metadata from response!
.......Unable to parse the GitHub repository metadata from response!
Unable to parse the GitHub repository metadata from response!
.Internal Server Error: /pages/resources/reading/
django.urls.exceptions.NoReverseMatch: Reverse for 'resources' with arguments '('reading',)' not found. 1 pattern(s) tried: ['resources/list/$']
ERROR: test_redirects (pydis_site.apps.redirect.tests.RedirectTests) (original_path='pages/resources/<str:category>/', redirect_route='resources:resources', name='resources_resources_redirect', redirect_arguments=(), args=('reading',))
Should redirect to given route based on redirect rules.
django.urls.exceptions.NoReverseMatch: Reverse for 'resources' with arguments '('reading',)' not found. 1 pattern(s) tried: ['resources/list/$']
molten perch
gritty wind
#

Opened an issue on the site repo after realizing I can't actually run the unittests locally ๐Ÿคก

#

I've contributed to the site before, surprised I never ran into problems

gritty wind
#

@clever wraith I've come up with a terribly hacky solution

#

I'll try to integrate it into your branch right now, this has to be witnessed

#

where is the branch btw lol

#

ahhh

#

I can get it from the PR and push it to a new branch

#

But the PR itself will have to be closed and reopened

#

Let me

#

try to replace your branch with this first

#

In the meantime, hack has been pushed

#

@clever wraith can you give me permission to edit your fork?

#

HassanAbouelela

#

sweet, thanks

#

From my code, or from what I'm doing now?

#

Also, was this PR created from your main branch?

#

That makes it a little harder to fix haha

#

I can sort of explain what's happening:

  1. Context processors get called whenever django is trying to render a template. I added one that adds a meta tag with the content being the link to the file. (Example: pydis_site\templates\home\index.html on the home page).

  2. If you take the value from step 1, and combine it with https://github.com/python-discord/site/blob/main/, you'll get a URL to the file:
    https://github.com/python-discord/site/blob/main/pydis_site\templates\home\index.html

  3. The button can create this URL

#

If you are curious about step 1, that's where 90% of the meat of my changes are

#

One of the variables that function sees is self.template. Self.template contains the path pydis_site\templates\home\index.html

#

haha, that's fair

#

I'm not sure if this PR will get accepted with my code

#

Lol what did you try

#

I see

#

Yeah...

#

Actually, now I'm realizing what I did won't work either

#

I'm linking to the HTML template, not the markdown content

#

Where is the button supposed to show up btw?

#

Ah, I see

#

It isn't on all pages yet

#

going to have to rethink my approach again though, not sure how these markdown templates work

slim widget
#

Erm, @vocal wolf did you intend to request a review from me? I've not really been involved in bot development so far, but I'll give it a try ๐Ÿ˜„

vocal wolf
#

Yes, it was intended

#

Thank you for any and all feedback to that PR!

slim widget
#

๐Ÿ‘

vocal wolf
tawdry vapor
#

Have you had a chance to think about the issue templates/forms for meta?

vocal wolf
#

Oh right yes, I have had some time now. Last time we spoke I had a migraine, couldn't communicate very clearly.

#

I was about to ping you about the label stuff as well

#

I need to go back and review the conversation that we had previously

celest charm
#

btw, didn't we drop fuzzywuzzy beacuse it's GPL?

#

on sir-lancebot

celest charm
vocal wolf
#

agreed

tawdry vapor
#

Never mind, that clause is about changing the license rather than the code it's applied to

celest charm
#

yeah

#
            DO WHAT THE SHIT YOU WANT TO PUBLIC LICENSE
                    Version 1, August 2021

Copyright (C) 2021 fix error

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

            DO WHAT THE SHIT YOU WANT TO PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE SHIT YOU WANT TO.
``` done
tawdry vapor
#

I wonder what the difference is between this and public domain since this license seems to retain copy right, but is trying to grant permission to do anything

celest charm
#

Public domain means you're making a contribution to humanity without asking back, WTFPL means you just could've give less fuck, I suppose

vocal wolf
#

@tawdry vapor going back to our conversation starting at the link below, how would adding such things be overwhelming?

#dev-contrib message

tawdry vapor
#

There are 4 areas and 3 types. That would mean 12 templates.

vocal wolf
tawdry vapor
#

Actually, 5 areas

vocal wolf
tawdry vapor
#

If we just have 1 for each area, then the templates either have to be vague in their descriptions or they have to have elaborate descriptions that go like "if it's an addition, then... But if it's a removal, then ... Or if it's a revision then ...."

#

I don't have high hopes for GH offering a more powerful forms feature, where we can display components dynamically based on previous choices.

vocal wolf
#

So we only want the 3 areas, being add, remove, and revise/enhance (whatever we call it), what are the types that we're talking about? By labels such as backend/frontend?

tawdry vapor
vocal wolf
#

ah those labels

tawdry vapor
#

It doesn't necessarily have to be 5 * 3 templates. There could be a way to merge at least some of them without it being too vague

#

I don't know..,

vocal wolf
#

@tawdry vapor I'm thinking of check boxes with somewhat-specific descriptions of when to use a certain type for some area, but that's probably not the best solution.

#

Hell, it's basically not a solution since what I've just said is a vague interpretation of what we need and discussed

#

Maybe it's because we don't have that many options here, either way we don't want 15 templates.

tawdry vapor
#

I think we need to determine which combinations of areas and types will require unique fields and which can be generalised

#

For example, we can probably get away with a single template for tags, regardless of add/remove/revise

#

All it needs is a description and a justification

#

A description field is a bit awkward for removal, since all it needs to have is the name of the tag.

#

An example of a unique field would be the locations field for resources. That's only needed when adding a new resource.

green oriole
green oriole
#

.love @vale ibex

#

Seems about right

#

It is a bit weird that it doesn't keep the embed

vale ibex
#

yea, there's a 7.5 delete_after on inchannel and inmonth checks

short snow
#

i am getting this for some reason on poetry install, my enhance incidents branch was behind where we had pipenv so, i rebased it to upstream and i get this

short snow
#

I hack fix for this is to change all the 3.5.* in poetry.lock to just 3.5, atleast for me

green oriole
#

Is your Poetry up to date?

short snow
#

yeah 1.2.0a2

green oriole
#

No idea

short snow
#

did i just mess up the lock file, i will just reset it to head~1

short snow
#

third point

green oriole
short snow
#

right and i didn't understand the second point, what is #message-change-log?

#

couldn't find it in the code anywhere

#

mod log channel?

#

but that's again only mod+ and not helpers

#

so i don't think we should show that then

green oriole
vale ibex
short snow
#

alright

short snow
vale ibex
#

Yea, that channel is mod only

short snow
#

so should i just ignore those messages?

#

or find the links to them but not show the content

vale ibex
#

possibly just linking to that message it enough

vocal prairie
#

@patent pivot Not sure if you know already, but shipit disappeared in #dev-log. Not a big thing, just noticed it.

patent pivot
vocal prairie
#

Ah okay

narrow stream
#

Hi, how did you start contributing to other projects

#

How did you find the right one

viscid coral
#

Wdym?

brisk brook
#

Reviewing PRs is top-tier procrastination ๐Ÿ˜…

surreal veldt
#

hey is anyone going to be checking out/working on bot#447 ?

dusky shoreBOT
clever wraith
#

finally back at contributing after 5 billion years

clever wraith
patent pivot
clever wraith
#

Oh

patent pivot
brazen charm
stable mountainBOT
#

@green oriole

It has arrived!

Here's your reminder: Ask Sebastiaan if he is back from vacations
[Jump back to when you created the reminder](#dev-contrib message)

green oriole
#

Hello @hardy gorge! I don't know if you are back in business yet, but if you are I have a question ๐Ÿ˜„ We would like to change the reminder.jump_url field in the database schema to instead be a message ID. What should we do? Should we wait for the FastAPI rewrite and open an issue there, change it now on the Django site, or some else?

short snow
#

My opinions, reminders arenโ€™t going to be transferred to api any time soon atleast not this month for sure as dB setup is remaining and we would need to review it. So I would say to implement it on django site

cold island
#

How will you tell which channel it's from?

short snow
#

Yeah wouldnโ€™t you also need the channel ID if you are wanting to fetch the message and reply to it?

cold island
#

Also from what I saw you wanted to have a fallback to the old behavior no?

molten perch
#

It's not necessary to change the API, actually.. it's better if we won't. My solution falls back to the old behaviour when it can't find the original message
bot#1749

molten perch
#

But the modifications of bot#1748 will probably render this idea useless. So :/

dusky shoreBOT
patent pivot
#

Yeah not sure why we need to change the API

#

The answer though is that we're not in a freeze for fastapi

molten perch
#

(I would love to push the generated models to get the API going, btw. ๐Ÿ˜„ )

green oriole
gritty wind
#

You can also just

#

Pull the message ID from the jump link

green oriole
#

Yes, but why saving the whole url, that's pointless

gritty wind
molten perch
gritty wind
#

Also size wise

#

We donโ€™t save/lose much

green oriole
#

Yeah we remove reminders when they are deleted

molten perch
#

But if you can use the reminder in every channel, and the bot sends the reminder into bot commands, then adding this reply feature is useless.

vale ibex
#

see how it's missing the protocol?

#

So the next line raised aiohttp.client_exceptions.InvalidURL

molten perch
#

I do, I find it very strange. I've tested it out and it seemed to match the url.

vale ibex
#

(i changed it to weebhooks before posting here so the bot doesn't zap it)

#

I wonder if it's because I tested with a canary link

#

lemme try without canary

#

It should work with both really

molten perch
#

Can I do an eval here? With the code.
Just by testing the regEx?

vale ibex
#

Sure

#

Yea, alright. It works if it's just https://discord.com/api/weebhooks/876916761482645544/KY0Wv1_JA_8O6Z4TqtcC9Sm3OuYjqCZDWdCcYySS92Jv99Zcyz25p5aOnrs7RbkTTWuv

#

But, if it's https://canary.discord.com/api/weebhooks/876916761482645544/KY0Wv1_JA_8O6Z4TqtcC9Sm3OuYjqCZDWdCcYySS92Jv99Zcyz25p5aOnrs7RbkTTWuv the https doesn't match

#

which makes sense looking at the regex

molten perch
#

oh, alright then ๐Ÿ˜„
I was a bit confused.

vale ibex
#

((?:https?:\/\/)?(?:ptb\.|canary\.)?discord(?:app)?\.com\/api\/webhooks\/\d+\/)\S+\/? should do the job

#

but there might be a better way, if anyone is lurking

molten perch
#

It seems to be working with both types of link.

vale ibex
#

Yea it should work, but there might be a more concise regex to do the job

#

I'm not the best at writing regex

molten perch
#

I'm not sure whether regEx can be concise at all ๐Ÿ˜‚
It was hell when doing NLP.

vale ibex
#

Hah

#

well feel free to commit that and we'll see if anyone has suggestions in the PR

molten perch
#

Alright, thank you! I didn't think of canary urls

clever wraith
#

hey @vale ibex when you have time ive gotten back to .reverse and re-requested a view

stable mountainBOT
#

@vale ibex, looks like you posted a Discord webhook URL. Therefore, your message has been removed, and your webhook has been deleted. You can re-create it if you wish to. If you believe this was a mistake, please let us know.

vale ibex
#

Nice @molten perch ๐ŸŽ‰

molten perch
#

Yaay ๐Ÿฅณ

clever wraith
#

hell yeah

molten perch
#

Hopefully it also deleted from Discord ๐Ÿ˜›

vale ibex
#

hah yea it did

#

I made a new server just to be safe lol

green oriole
#

Good job!

molten perch
#

๐Ÿ˜ƒ

clever wraith
#

alright chris, resolved

brisk brook
vale ibex
#

hah yea, it definitely leads to nicer code to read

brisk brook
#

Not to shit on someone's code, but here you can see a good example of where "filtering if-statements" make more sense

stable mountainBOT
#

commands/cosmetics.py lines 97 to 108

        if msg.content.upper() == "Y":
            if image_url is None:
                sql.execute_query("INSERT INTO cosmetics (cosmetic_name, cosmetic_rarity, cosmetic_description) VALUES ('%s', '%s', '%s')" % (title.replace("'", "''"), rarity, description.replace("'", "''")))
            else:
                sql.execute_query("INSERT INTO cosmetics (cosmetic_name, cosmetic_rarity, cosmetic_description, cosmetic_image_url) VALUES ('%s', '%s', '%s', '%s')" % (title.replace("'", "''"), rarity, description.replace("'", "''"), image_url.replace("'", "''")))
            await ctx.send("Cosmetic Created")
        else:
            await ctx.send("_Cancelled_")
    else:
        await ctx.send("**Error:** Permission Denied. This command requires permission rank `โ€‹MANAGER`โ€‹")
else:
    await ctx.send("**Error:** Invalid Usage")```
brisk brook
#

You end up with these error cases at the end, that you don't know to what if-statement they map to

vale ibex
brisk brook
#

The only way to figure out would be the hide the code and expand it up again

#

To be fair, it starts simple right. You want the code to run if X right

#

But then you only want to continue if Y or Z and W.

#

So you end up like this, it's tough writing readable code ๐Ÿ˜”

clever wraith
viscid coral
#

Just a question, this issue: bot#1624 , seems to handle two commands ghost pings when an error happens right?

viscid coral
#

And PR bot#1696

dusky shoreBOT
gritty wind
#

Yes

viscid coral
#

But I see there is also this thing with eval command

#

I did !eval in #python-discussion (I thought you can do it there for example) with a user mention, and it was deleted

brazen charm
#

pretty sure that is intentional for the redirect

viscid coral
#

Yeah but the user was still ghost-pinged

brazen charm
#

It's pinging the user who invoked the command immediately, while docs/pypi could have mentions of other users

viscid coral
#

!eval

print('test')```
@brazen charm
stable mountainBOT
#

@viscid coral :white_check_mark: Your eval job has completed with return code 0.

test
viscid coral
#

Dammit

#

I just wanted to show

#

Sorry for ping btw lol

brazen charm
#

ah right that'll delete the message too

#

I'd say it's worth it in this case with the likelyhood of it containing a mention and the size of messages usually passed to eval

gritty wind
#

I think there's a fundamental difference between those two concepts. When you're pining someone with a tag, there isn't as much...

#

what Numerlor said

#

Though I wouldn't really care either way

#

Admins and mods already get a bunch of ghost pings, I just accept it as a reality of life

viscid coral
#

It can still confuse other users, it'll delete the message pinged them and even in search history there won't be any result

#

I mean, there is not really anything bad about adding this

brazen charm
#

I'd have to retain messages that are currently being purposefully filtered out from the high traffic channel

celest charm
#

senpai noticed me lemon_hyperpleased

vocal wolf
#

lol

celest charm
#

Is there a way to leave a comment on some changes that are not in the diff?

#

I want to make a comment about this docstring

brazen charm
#

only for a few lines around it afaik

celest charm
#

lemon_pensive why

#

alright I'll approach it differently

celest charm
# celest charm I want to make a comment about this docstring

@short snow I think it's redundant to put explanations like "this is a dataclass" or "this is a class" in a class, Ideally it would be

@dataclass
class _QuizEntry:
    question: str
    answer: str  # comma-separater
``` alternatively, the comment is not needed if it's clear that `answer` has multiple values ```py
@dataclass
class _QuizEntry:
    question: str
    possible_answers: t.Set[str]
#

Another question: why is DynamicQuestionGen a class? seems a bit Java-y to me to be honest, you don't create instances of it, and it doesn't have any state

clever wraith
#

when people have time, please look at sir-lancebot#760

dusky shoreBOT
celest charm
#

@clever wraith not directly related to the PR, but

_EXECUTOR = ThreadPoolExecutor(10)

  1. Why 10?
  2. Are you sure that PIL releases the GIL on all the operations? How was that measured/checked?
torpid grotto
#

There seems to be a bug right now where python bot responds when someone sends a message in #discord-bots

#

Or in any channel I guess

green oriole
#

Yep yep, t'is solved now, sorry about that

dense bear
#

What happened?

green oriole
#

We tried to deploy a test bot that could only be used in 2 channels, except it sent a message when any other message was posted, because the onmessage handler was trying to process it, but the message wasn't in those two channels

short snow
celest charm
#

like

- module.py
+ module/
+     __init__.py 
+     cog.py
+     submodule.py
slim widget
#

Do I need to be assigned a PR in order to review it?

#

On either of the main bots, that is.

short snow
#

Nope, assignment is like when you are working on the pr

#

and review requests are like when someone specific are requested to do a review, for example i did some crazy devops stuff then i would need joe's approval on the pr

#

so joe would be requested a review

short snow
molten perch
#

I checked out bot#1748 and modified my PR bot#1749 accordingly, so even if the bot replies to a reminder it'll still include a jump_url and if it can't reply, it falls back to just pinging and sending the original embed. This way reminders can be allowed in every channel. Is that fine? ๐Ÿ˜„

celest charm
clever wraith
fallen patrol
#

@patent pivot does king Arthur have a custom paginator yet?

patent pivot
#

no, it doesn't need one

#

yet

fallen patrol
fallen patrol
#

Using discord buttons, too

patent pivot
#

interesting, but there is no use for it right now

short snow
#

@timid sentinel how about the most-read articles of the day before? we could also include the on this day?

timid sentinel
short snow
timid sentinel
#

Nice, no rush ๐Ÿ‘

clever wraith
#

while i wait for a merge for 760, ill work on cowsay

patent pivot
#

sure

fallen patrol
#

Interactions are fun but I'm not a huge fan of the discord.ui.View class

molten perch
#

I think it's pretty fair and straightforward, but dpy 2 is not stable just now ๐Ÿ˜„

thorny obsidian
#

-_- for whatever reason the master docs isn't possible to get to without know the URL. It doesn't appear as a dropdown on the docs page.

fallen patrol
thorny obsidian
#

I complained about this bitterly last week

fallen patrol
molten perch
#

I'm not even sure how I found it ๐Ÿ˜„

vocal prairie
#

Oh, I've been looking at latest in the dropdown

#

oops

thorny obsidian
#

Yup nope, fucking d.py and their docs. One day they'll actually be good.

molten perch
#

Oh, it was posted on the dpy server ๐Ÿ˜„

vale ibex
#

never said I knew every url