#dev-contrib

1 messages · Page 117 of 1

short snow
#

alright, another thing, there is a slight problem with the github thing, it doesn't catch blame lines, that's the only way to do for a md file, #bot-commands message

patent pivot
#

as with a few things, it's something that we can prolong until it is something that we have evidence to suggest it is necessary

patent pivot
short snow
#

umm yeah, but is it possible to implement that, haven't looked at how the current code is implemented

patent pivot
#

it's possible, yes

fallen patrol
#

that line

patent pivot
#

you need to use the GraphQL API though

fallen patrol
#

can be restructured

#

nvm

patent pivot
#
query {
  repositoryOwner(login: "github") {
    repository(name: "linguist") {
      object(expression: "master") {
        ... on Commit {
          blame(path: "github-linguist.gemspec") {
            ranges {
              startingLine
              endingLine
              age
              commit {
                oid
                author {
                  name
                }
              }
            }
          }
        }
      }
    }
  }
}
fallen patrol
#

ah

#

just change blame to blob

patent pivot
#

it's not worth the effort to implement I don't think, github will display it better than we could

patent pivot
#

right, I thought the question was how to display blame lines inside github

stable mountainBOT
#

.github/pull_request_template.md line 27

- [ ] Join the [**Piston CLI Discord Community**](https://discord.gg/c7dZ4zdGQT)?```
patent pivot
#

if we're rewriting, then yes, that's dead simple

stable mountainBOT
#

.github/pull_request_template.md line 26

short snow
#

umm

stable mountainBOT
#

.github/pull_request_template.md line 30

- [ ] Set the PR to **allow edits from contributors**?```
short snow
#

oh yeah

#

we could do that then

short snow
#

i just got it from pydis lol

patent pivot
#

yeah, we can add rewrite support from blame to blob

short snow
#

consider it approved? i can do that tomorrow

patent pivot
#

yeah for sure

#

it's not urgent though

#

if you have other stuff assigned, work on those first

#

it's very niche and we've not seen it used at all since the feature was released

fallen patrol
#

fwiw whatever regex you use

#

it can't replace any blame in the file name

#

i wish we had a regex like pixels#1 but for file lines lmao

dusky shoreBOT
patent pivot
#

bot#1616 one line PR for review

dusky shoreBOT
fallen patrol
#

Huh

#

https:// discord. gg/ invite /python

patent pivot
#

yeah, we don't check for gg/invite/code

fallen patrol
#

I mean

#

You do

#

It checks if "invite" is whitelisted

patent pivot
#

yes

fallen patrol
#

And then obviously deletes every time

clever wraith
#

could people look at sir-lancebot#760 ?

dusky shoreBOT
short snow
#

me and xithrus had a slight discussion on this on twitch, I will add a comment as soon as I get time. It was to expand its functionality a bit more

clever wraith
#

on twitch?

#

@short snow what were you two thinking

short snow
# clever wraith on twitch?

yeah kosa was streaming and we two were there, I will comment it out soon, need to cook up something myself

ancient socket
#

WHEN I OPEN HELP CHANNEL BOT DIDNT DM ME

#

HELP

vale ibex
#

Do you have your DMs turned on?

ancient socket
#

yes

vale ibex
#

Can you send me a link to the help channel open message that you didn't get a ping for?

ancient socket
#

wait i close open dm again it work sorry

short snow
# clever wraith <@!736234578745884682> what were you two thinking

Ok my mobile is dead for some reason and I cannot log onto GitHub, the thing is to have two separate sub commands called image and text. The image takes the pfp or the member mentioned(?, can be ignored too and just pfp). The text takes the nickname if nothing is specified or the text given

clever wraith
short snow
clever wraith
short snow
#

Yes

clever wraith
#

and we could flip attachments as well

short snow
#

We can not sure since other image manipulation commands don’t

clever wraith
#

who should i ask?

vale ibex
#

Open an issue to discuss it

#

I don't think it should be added to this PR, since it's already different to what the original issue described.

sleek steppe
#

if sir-lancebot#684 got closed then I don't think that this would work either

clever wraith
#

Um @vale ibex why is this happening

vale ibex
#

If you showed some code I might be able to help

clever wraith
#

sure

#
@reverse.command(name="image")
    async def image(self, ctx: commands.Context) -> None:
        """Sends a reversed version of the users profile picture."""
        async with ctx.typing():
            user = self._fetch_user(ctx.author.id)
            if not user:
                await ctx.send(f"{Emojis.cross_mark} Could not get user info.")
                return
            
            image_bytes = await user.avatar_url_as(size=1024).read()
            filename = file_safe_name("reverse_avatar", ctx.author.display_name)

            file = await in_executor(
                PfpEffects.apply_effect,
                image_bytes,
                PfpEffects.flip_effect,
                filename
            )

            embed = discord.Embed(
                title="Your reversed avatar.", 
                description="Here is your reversed avatar. I think it is a spitting image of you."
            )

            embed.set_image(f"attachment://{filename}")
            embed.set_footer(text=f"Made by {ctx.author.display_name}.", icon_url=user.avatar_url)

            await ctx.send(embed=embed, file=file)
vale ibex
#

is reverse a commands.Group?

clever wraith
#

yes

#

oh wait

#

its an avatar_modify.group() which is a commands.Group

vale ibex
#

hmmmmm not sure how a sub group would work with a root alias

#

It should be fine

#

could you open a draft PR for these changes?

clever wraith
#

sure

#

for some reason without the root alias it just doesnt register

#

theres already a pr, 749 iirc

#

oh

#

sir-lancebot#756

#

sir-lancebot#756

clever wraith
#

sir-lancebot#759

clever wraith
#

sir-lancebot#758

dusky shoreBOT
clever wraith
#

sir-lancebot#760

dusky shoreBOT
clever wraith
#

there

vale ibex
#

oh, you're expanding that PR more?

#

let me remove my approval then...

clever wraith
#

yeah

vale ibex
#

Looking at your code, its because there's two functions called image in that cog now

#

so they're being redefined

#

It's also mentioned in the lint that it's an issue

#

do you have pre-commit setup locally?

#

@clever wraith

clever wraith
#

oh

#

fudge

#

ill fix it later

vale ibex
#

I'd recommend setting up pre-commit locally too

#

it's very helpful

trim cradle
#

How would we feel about a .latex command for lancebot?

#

for math

sleek steppe
vale ibex
#

yea, it uses matplotlib in the background

trim cradle
vale ibex
#

and uses a lot of memory to render

trim cradle
#

boo

vale ibex
#

at least the package we're using does

thorny obsidian
#

The next step is finding a good way to do a local and safe latex install and somoene checking it

vale ibex
#

We could pipe the command to a local install of latex, it's just finding a safe way to do that

#

oh lol yea what kat said

#

We could reuse a lot of logic from snekbox tbh

trim cradle
#

what if we did it in snekbox

vale ibex
#

would need some refactoring, but we could

#

not sure if we should

thorny obsidian
#

I don't think it needs to be snekbox

#

there are latex install parameters you can use for a safe install

#

I just haven't had the time to personally test it

frozen galleon
#

Can I ask a question about the pixels API implementation here?

patent pivot
#

for sure

frozen galleon
#

I was looking through the codebase, specifically through the implementation of discord's OAuth2 , and I'm not sure what does the constants.client_id and constants.client_secret refer to, could you explain what those are?

patent pivot
#

they are credentials from discord

#

client_id is the identifier of the app we use on discord to sign you in, it generates the oauth2 screen when you browse to /authorize

#

when you authorize you then get redirected back to us with a code, we send that code to discord with our secret to get a temporary access token to access details on your account

frozen galleon
#

oh, I see, so by the app you are referring to the application I can make on the discord developers portal?

patent pivot
#

yep

frozen galleon
#

interesting, 1 more thing, what's constants.auth_uri? from the context I figured it's a url to discord authorization, but how would i obtain one? I noticed I can add those to the application in the dev portal, but I'm not really sure what it is at all

fervent sage
#

in the oauth2 tab of your application you can build the oauth uri by selecting a callback URL and the scopes you require for the URL (just identify in pixels' case)

frozen galleon
#

so if say, I was hosting it on pixels.itsdrike.com, I'd put pixels.itsdrike.com/callback?

fervent sage
#

i cant remember the exact url the app uses, but i think so yeah

#

actually yeah im pretty sure its /callback

frozen galleon
#

alright, thanks for the explanations, it makes much more sense now

vocal wolf
#

@patent pivot bot#1616 merged.

dusky shoreBOT
vocal wolf
#

@sleek steppe I've edited your comment since it showed as one quote block

sleek steppe
#

ty

clever wraith
#

@short snow can you please tell what do you mean by that code is redundant? I'm not sure if i got it correctly.

short snow
short snow
#

umm? got a ping

vocal prairie
#

Some messages were purged, you were pinged in one of them

clever wraith
#

Hey @vale ibex and @short snow , you two have been most involved in my pr so i thought id tell you that the expansion is done. .reverse is a command group with the subcommands text and image. text takes a string and reverses it, image is special. If an image is given, it is flipped. Otherwise, it flips the users profile picture.

short snow
clever wraith
#

okay, thanks

obsidian patio
thorny obsidian
#

I... don't really see a need for it tbh. It feels odd why the standard rainbow wouldn't work

obsidian patio
#

I thought we’d discussed that enough

thorny obsidian
#

I didn't really see a consensus to the discussion and my original comment still stands that it feels odd to include the straight/ally flag for the reasons I mentioned in the org channel.

glass pecan
#

I agree, there was no definitive conclusion to that conversation, and on review, if there was any inclination towards a consensus, it was that we should not add it.

obsidian patio
#

I don’t quite see a reason to actively disapprove of including the ally flag, but since you have such a strong opinion on the topic, I’ll close the issue

#

However, I’d say the general consensus the discussion was leaning toward was “straight cis people aren’t part of the LGBTQ+ community, allies could just use the pride flag and it doesn’t hurt to include this flag in the command as well”

thorny obsidian
#

I mean, I'm probably going to be a bit too blunt but, showing support by saying that you're... a straight ally? It's weird to me, what's wrong with the rainbow? It really gives off the vibe of a visual "but no homo" type of comment

patent pivot
#

yeah, I think lemon mentioned that he wouldn't reject a PR, but later conversation after that didn't bring us any closer to consensus

obsidian patio
thorny obsidian
#

I mean, it's not a question of if allies should exist. It's just odd that allies have their own flag when it isn't really necessary. I don't see the need for a straight/ally flag if there's the rainbow flag which is viewed as more supportive anyhow.

#

You originally prompted the question by saying that the flags available don't really fit and therefore there's a need for the straight ally flag. I'm very much disagreeing with that as the rainbow flag is the generic "I support you" flag.

fallen patrol
#

if y'all here are staff and talking about a private conversation, what's the point to do so in a public channel?

obsidian patio
#

Yeah, I get where you’re coming from. The thing that could be nice about having a ally flag (in a profile picture, this isn’t a pride parade) is that you show that yeah, you support the LGBTQ+ community, but you don’t necessarily have to be “a part of” the community yourself. Just showing that it’s not just LGBTQ+ people who are supporting it, but that’s it’s a much larger thing than that

patent pivot
fallen patrol
#

well, what's the context? 😛

fallen patrol
#

ah

obsidian patio
#

Still, I see your point. I’d say that the ally flag serves a slightly different purpose than the other ones though. The bottom line is that I don’t think we should exclude allies from showing the fact that they’re allies if they want to

vale ibex
#

!ext r help_channels

stable mountainBOT
#

:ok_hand: Extension successfully reloaded: bot.exts.help_channels.

vale ibex
#

There was only 2 active channels, I'm guessing related to the discord issue

fallen patrol
#

i don't see a reason to not include a flag if its part of the lgbtq community

#

adding all but this one flag just seems like leaving one out

vocal prairie
#

To me, it does

thorny obsidian
vale ibex
#

Something funky is going on with the help channels

thorny obsidian
#

Discord dying, no?

vale ibex
thorny obsidian
#

Do we need to reload?

vale ibex
#

And opening a channel not in that list throws a key error the sentry

#

I've tried reloading the cog thrice, but hasn't solved it

#

I'm on mobile too, so can't investigate much more than that lol

thorny obsidian
#

I remember Xith maybe noticing this a previous time @vocal wolf ?

vale ibex
#

I might have fixed it now, but we should keep an eye

#

I reload the cog so 3 channels were available

#

Before someone claimed a channel

gritty wind
#

Deleting the message and restarting the bot should force everything to resync

fallen patrol
#

^

#

deleting the message would probably fix the keyerror

vocal wolf
#

Last time this happened Discord's API was being funky

#

not our side afaik

thorny obsidian
#

Well Discord's API was being funky a bit ago

vocal wolf
#

When this previously happened I deleted the message and reloaded the bot about 3 times, nothing worked.

#

tried claiming help channels as well to fix it up

#

didn't budge

#

@thorny obsidian @vale ibex I think it's fixed now...?

thorny obsidian
#

Yeah looks good now

vocal wolf
#

noice

obsidian patio
thorny obsidian
#

But there's the generic rainbow flag to show support?

fallen patrol
#

But there's a flag for this specific part of the lgbtq community which isn't added.
The rainbow flag is for the whole community.

#

I think every other flag is added as well, except for this one flag

obsidian patio
#

The ally flag isn’t really a part of the LGBTQ+ community

thorny obsidian
#

To myself, and a lot of other queer people, the straight ally flag is a weird cop out of support where you still feel the need to definitely indicate you're not queer. But you seem to feel rather strongly about it so feel free to PR it I guess.

Also, I do not consider cishet people part of the LGBTQ+ community. They're not LGBTQ+.

obsidian patio
#

But it’s also a part of it

fallen patrol
#

ig just ask in an offtopic channel

vocal wolf
#

What's this about?

fallen patrol
#

Ik some people will feel one way or another

vocal wolf
#

The .prideavatar command?

fallen patrol
obsidian patio
#

Yeah. Possible addition of the ally flag

vocal wolf
#

hmmmmm

#

@obsidian patio I don't know about that, I thought the .prideavatar command is specifically reserved for the pride flag, which support all (?)

fallen patrol
#

Does it have the other flags?

#

.src prideavatar

dusky shoreBOT
#

I don't have that flag!

thorny obsidian
#

It does, you can specify other LGBT identity flags

obsidian patio
#

We have quite a few flags

#

.prideavatar flags

dusky shoreBOT
#
I have the following flags:

• agender
• androgyne
• aromantic
• asexual
• bigender
• bisexual
• demiboy
• demigirl
• demisexual
• gay
• genderfluid
• genderqueer
• intersex
• lesbian
• nonbinary
• omnisexual
• pangender
• pansexual
• polyamory
• polysexual
• transgender
• trigender

vocal wolf
#

.source prideavatar

dusky shoreBOT
#
Command: avatar_modify prideavatar

This surrounds an avatar with a border of a specified LGBT flag.

Source Code
thorny obsidian
#

All within the LGBTQ+ community

obsidian patio
#

That docstring could also be updated LGBT -> LGBTQ+

vocal wolf
#

According to my sources, the straight/ally flag is not a pride flag.

obsidian patio
fringe sphinx
fallen patrol
#

which flag is the rainbow itself?

fringe sphinx
#

I think it’s both gay and the community as a whole, but I could be mistaken

fallen patrol
#

.prideavatar gay

#

Ngl the error messages on that command specifically seem weird

#

Fat Chance.

fervent sage
#

how's that weird?

fringe sphinx
#

It rotates between them

fervent sage
#

also it uses the same error messages as any other command

obsidian patio
fringe sphinx
#

No, they meant what’s it represent

fallen patrol
obsidian patio
#

Ah

fallen patrol
#

Also regardless, where's my transparency

fervent sage
#

lgbt

obsidian patio
#

lgtm*

fringe sphinx
#

I would use it but it doesn’t make it animated

fervent sage
gritty wind
#

Why is that borked in the center

fervent sage
#

if you find something like transparency missing, you can always open an issue :P

fallen patrol
fallen patrol
fervent sage
#

ah sorry, i must have mistook your talking for complaining

fringe sphinx
#

It’s a fine line

obsidian patio
#

@thorny obsidian If you and some other people feel like the ally flag contributes negatively to the LGBTQ+ support, that’s not something I want to be a part of. I’ll use a standard pride flag to show my support instead. At the end of the day, that’s the reason I was considering using a flag in my profile picture at all. This event is about supporting the LGBTQ+ community, rather than unnecessary division over what flag you use to do so

crude gyro
#

that sounds good. I don't think I'm comfortable with us adding it anymore, seems like it's going to be controversial in a bad way.

#

so let's stick with rainbows for support.

vocal wolf
#

@sleek steppe If you want to, you can go ahead and implement sir-lancebot#711.

dusky shoreBOT
gritty wind
#

Ooh speaking of GitHub

#

Can we get the issue linker to parse repo/(pulls|pull|issues)/number so you can just copy straight from GitHub

#

I’ve been meaning to make an issue to discuss that idea for a while, but never got around to it

exotic ember
#

how would it work? for like the gh cli?

green oriole
#

Yes, we can do that

#

I’m assuming scale is talking about copy pasting the end of the url

#

So sir-lancebot/issues/711 for the above issue

vocal wolf
#

would be neat if we posted a single url to an issue/PR we'd get an embed

green oriole
#

The new embeds are quite neat

vocal wolf
#

oh wait

#

I forgot those exist

#

lol nvm

#

I thought it was only for repos

gritty wind
short snow
#

@exotic ember this is fine?

#

uhh

#

To add more pride leaders you can PR to my source! pithink

#

or

#

Add more pride leaders [here](link to json file)

obsidian patio
short snow
#

yeah, i would keep it as a field

exotic ember
#

@short snow hello I had dinner then promptly forgot about the ping, maybe To add more pride leaders, feel free to open a pull request!

short snow
#

np, that soudns better

#

changes pushed

wicked nova
#

Does the bot have Unit Tests?

brazen charm
#

@stable mountain does

wicked nova
#

Does @dusky shore?

brazen charm
#

No

wicked nova
#

Can I add some to my contribution?

brazen charm
#

Don't think they'd fit in when there isn't a test suite in place. Maybe something that'd only be in the modules themselves? But that would be a bit out of place

wicked nova
#

Yeah that's what I was wondering

#

I just want to unit test a bit of my logic.

#

I'll just stick it in the file itself, I guess.

fallen patrol
#

@patent pivot how much do you use olli?

patent pivot
#

lol

#

i mean i made itt

fallen patrol
#

Like, what does it stream?

patent pivot
fallen patrol
#

No not experience, how much is it used.

patent pivot
#

well I don't know what that means

#

we use it here, I use it personally, ??

fallen patrol
#

Seems like one webhook every 30 minutes?

#

Does @high trout use it?

#

Asdf

#

.@stable mountain

#

Sorry skylark

patent pivot
#

well

#

not directly, no

#

that's the point of olli

#

but yes, Python goes into Olli

fallen patrol
#

And Lance?

patent pivot
#

yes

fallen patrol
#

So how does it work through loki?

patent pivot
fallen patrol
#

Since I don't see loki mentioned in the Lance repo

patent pivot
#

yes

#

because that's not how it works

#

lancebot and python are completely oblivious to olli

#

they are also oblivious to loki

#

they print logs to their standard output

#

loki accumulates and stores them

fallen patrol
#

Hm, but how do you set them up with loki then?

patent pivot
#

olli then searches loki logs to post things to discord

fallen patrol
#

Say if someone was running them locally, how is loki implemented?

patent pivot
#

by putting it in the olli config — loki picks up any container that starts on our stack

#

you don't run loki or olli locally

#

not while devving our projects at least

fallen patrol
#

No, but if one was to set up loki, how is that done locally?

patent pivot
#

you install it and start tit

#

then configure the docker sink so that docker logs get shipped into it with promtail

fallen patrol
#

😕

#

Docker sink?
Promtail?

#

What are those?

patent pivot
#

one sec

fallen patrol
#

Ok

#

If we should move to a different channel ping me there or send it here

patent pivot
#

nah it's fine here

fallen patrol
#

I mean, I'm asking for modmail lol

patent pivot
fallen patrol
#

Does granfana tie in with any of this?

patent pivot
#

it's not really a setup that works great locally

#

yes

#

Grafana queries Loki in the same way Olli queries Loki

fallen patrol
#

Oh, loki is a portion of grafana

patent pivot
#

no it's not

fallen patrol
patent pivot
#

maintained by grafana, not part of grafana

fallen patrol
#

Jason has confused me
Nvm

fallen patrol
fallen patrol
patent pivot
#

because it's a production logging system? lol

#

it's not meant for development

fallen patrol
#

It just seems unnecessarily complicated

patent pivot
#

in development, you use docker logs

#

it's not

#

this is frankly a pretty simple production logging system

#

you'd pretty commonly see an ELK stack

#

I don't get why you are trying to fit Olli into Modmail

#

or Loki really

#

Are you hosting it?

fallen patrol
#

Mind if I dm you that?

patent pivot
#

uh, I'd rather not? but sure

whole forge
#

random Q: any reason some github features like issue embeds are on lance and some like showing lines from links are python bot?

#

i would assume thats just how it happened naturally but it can seem kinda random how such similar features are done by 2 separate bots

brazen charm
#

lance is supposed to have the "fun" stuff while Python has the things needed for the server to run smoothly, but it's not exactly a clear line so some things do get mixed up (like reddit that was moved). For the github links it's probably mostly because a direct pr was opened to the bot

whole forge
#

hm, opinions on moving one or the other over?

brazen charm
#

I think it'd be good to have them together, but no idea which bot would be more fitting. For me the github commands fall into the category that fits into both about the same amount

obsidian patio
#

I think moving the .issue command to @stable mountain would be nice. It’s a fairly important command for running the community smoothly

thorny obsidian
#

I wanted to obliterate the .issue command since we have the repo#12213521 thing

whole forge
#

right but the repo#tag thing is also on lance, so moving that to python in the same step maybe?

obsidian patio
#

Sounds feasible to me

thorny obsidian
#

I mean, I don't really consider the github repo stuff to be critical to the community, but I also don't care much either way

whole forge
#

i dont care which bot gets em, but they should be on the same bot imo

vocal wolf
#

I think @stable mountain didn't get any GitHub features in the first place because of its non-criticality, but it does seem like a utility and not as much of a fun-feature.

We should consider moving the entire cog over.

whole forge
#

for things like the black channel gh features could be quite essential

vocal wolf
#

yep

fervent sage
#

yeah, imo as a community based on open source and programming that stuff is pretty important :P

brazen charm
#

We should make some proper distinction to avoid this inevitably happening again in the future.

I think commands/features that are allowed outside of ot, bot commands or event specific channels should most probably be on Python instead

vocal wolf
#

Yeah

#

I agree with that statement.

fallen patrol
fervent sage
#

.issue pixels#1

dusky shoreBOT
thorny obsidian
fervent sage
#

.issue 1 pixels

dusky shoreBOT
fervent sage
#

literally none

fallen patrol
#

🤔

#

it used to show more

#

huh.

thorny obsidian
#

I know Alec suggested it show more, but it was just a suggestion

fervent sage
#

^

fallen patrol
#

no, it used to show more.

thorny obsidian
#

Find the git blame for me then?

fervent sage
#

i would love it if we could repurpose that command to just display info about 1 issue and display a bunch more yeah

fallen patrol
fallen patrol
#

but here's some proof

#

and yes, they are aliases i see

#

.issue and repo#num are aliases for the same command, so i don't see a reason to remove the .issue portion

vale ibex
#

I think the prefixes were dropped as part of the rewrite to make the command and the listener the same

fallen patrol
#

well, its an odd thing to drop

vale ibex
#

I'd like to see the prefixes return when there's more than one being output

thorny obsidian
#

Because it's redundant and less clear? .issue implies only look at an issue. The repo#number regex applies to PRs and issues.

fallen patrol
#

bot#55 seasonalbot#15

fallen patrol
#

yeah, i can't tell which of those goes to which lol

thorny obsidian
vale ibex
#

I also agree we should ditch the command

fallen patrol
#

.gh should stay a command

dry folio
#

hey, i have a question: what does the metricity bot actually do?

gritty wind
#

It records statistics about how you interact with the server

#

Think message frequency, channel usage, etc

twilit juniper
#

for bot#1600 I think he made a PR without any issue because I can't seem to find any for it. So what should we do about that?

dusky shoreBOT
twilit juniper
#

I personally don't mind the change but it's not gonna be consistent at all with the rest of the bot.

short snow
#

I think we wait for them to provide a proper reasoning for doing so and the core devs dicuss it ig

gritty wind
#

Xith asked them to two weeks ago

twilit juniper
#

Yeah

gritty wind
#

At this point, it's not gonna happen

short snow
#

yeah, it would be inconsistent, it would probably be better to shift all the ping commands to reply if the PR is approved

twilit juniper
#

Should we close it?

gritty wind
#

Prolly, but I'd leave that decision up to our triage lead

keen valley
#

How I can ignore the specific lines of code?

short snow
keen valley
#

For @dusky shore

short snow
#

where is your .env file? many things depend on your values in .env

#

you can get mention them manually in constants.py in bot/

#

but it should work ideally

keen valley
#

yes

keen valley
keen valley
short snow
#

yeah, well there are number of other places too which take in data from the .env

#

main directory meaning bot/ or the repository root

keen valley
short snow
#

uhh add this to the top import dotenv; dotenv.load_dotenv() see if that helps

short snow
#

np, and also you don't need to ping me on every reply, I am here

keen valley
#

Okay!

clever wraith
#

hey if any core dev/contributor is available, i'd like to discuss sir-lancebot #759
its irritating in a very small way but a small fix too.

vocal wolf
#

sir-lancebot#759

clever wraith
#

yeah so current flow is

README => go to contri.md => go to website

#

new flow
README => go to website
(which is already done in python bot)

vocal wolf
#

@clever wraith Interesting.

#

Nice catch, would you be willing to do the PR?

clever wraith
#

yeah sure.

vocal wolf
#

thanks!

clever wraith
#

also i'd like to ask one more thing.

vocal wolf
#

Also, very nice RPS PR, suggestions to discussion seem to be going pretty well.

clever wraith
#

Thanks 🙂

vocal wolf
#

What else would you like to ask?

clever wraith
#

so I'm not sure if its possible or not, but im thinking that if we can have a command like !recent.

!recent <user_name:optional>

o/p: gives our last 10 messages with channel names

reason: a lot of times helpers are helping in hell of channels, and unless they are mentioned, they get loss of which channel needed the help so recent makes it easier to lets say give last 10 messages that way helper will get it easily.

there was this proposal of sending DM(optional) to person when they message in help channel to keep track but i feel this is a better way.

short snow
#

jake is doing that

clever wraith
#

but its related to DMing right?

vocal wolf
#

If we're able to utilize self.bot.cached_messages then I wouldn't have a problem with it, since using .history would send a bunch of API traffic even with one user.

#

At the same time I don't think the cached_messages var would have all the messages that the user wants.

clever wraith
vocal wolf
#

It does

clever wraith
#

would it still send so much traffic? that's why i thought about just 10, y'know. because it gives a nice control over traffic.

#

bot#1567

dusky shoreBOT
clever wraith
#

@short snow this one right?

vocal wolf
#

Would we scan all channels for their messages?

clever wraith
#

we can think about just help channels, i mean if you think about it, we can always see our recent matches from search bar.
So even if we don't have command normal users will not that have much to loose.

but at the same time things will be handy for helpers.

vocal wolf
#

In the end, why not just use the discord search function?

#

oh we're thinking about specifically help channels

#

somehow I glossed over that, mb

#

I see where you said that previously now lol

clever wraith
#

yeah, and yes, as you said, discord search is always there, which makes a fair point.

thorny obsidian
#

What would make this useful is if it shows help channels you've talked in in the past 30 minutes. Discord search can be annoying if you're talking in multiple channels

#

I don't want a DM everytime I talk in a help channel but I would like a command I can run every so often

clever wraith
#

reasonable, considering the last 30 mins, if we show with messages, hella traffic possible.
if we just show help-channels, very less data to send however, helper may end up jumping from here to there to get the help channel he wants.
now more filtered channels to explore but still.

but again that can be put in by small control over sending max N messages from last M minutes.

vocal wolf
clever wraith
#

wow it is there

vale ibex
#

What about only showing help sessions you've spoken in if they're still open

#

rather than tieing it to a time period

#

So you run the command and it lists all channel sessions that are still open that you have spoken in

#

can hook into the current help channel logic for it

short snow
clever wraith
fervent sage
vocal wolf
#

ty 4 update

fervent sage
#

if you want i can just forget that jake's doing one too and implement it all kek

vocal wolf
#

I think waiting for jake should be done, say that in issue, ye?

fervent sage
#

kk

vocal wolf
#

thank.

#

@fervent sage very good.

#

while you're here

#

this needs updating.

fervent sage
#

yes uh im getting a haircut now but i will do so as soon as i get back

vocal wolf
#

oh lol

#

glhf with haircut

fervent sage
#

well 'now' is being used to mean in 10 minutes but near enough now kek

short snow
#

do non-staff contributors's review count in staff approval?

fervent sage
#

the requirement is (staff | contrib) & core_dev

short snow
#

ah so they do

vocal wolf
#

You saw nothing.

#

The async tag is pretty large

#

but it does contain very useful information

fervent sage
#

i think its not even the beefiest tag which is slightly scary lol

vocal wolf
#

yeah

#

There's always bigger fish.

vale ibex
#

yea lol, I think star-imports and mutable-default-args are the biggest atm

fervent sage
#

im gonna regret this...

#

!star-imports

vocal wolf
#

jeez

fervent sage
#

yep i regret that

patent pivot
#

tag to guide candidate

vocal wolf
#

We should redirect tags that are over an amount of characters to another channel /s

fervent sage
#

could i pr the star-imports tag to remove a bunch of whitespace following codeblocks lol

vocal wolf
#

please do

fervent sage
#

bot#1619 i made it fit onto my screen!

dusky shoreBOT
vocal wolf
#

lmfao it's still massive

fervent sage
#

ikr

#

anyway i go haircut now lol bye

vocal wolf
#

@clever wraith RPS command has been reviewed.

clever wraith
vocal wolf
#

@fervent sage star-tag shortening has been merged.

#

@clever wraith If you're using the commit in github with suggestions, you're able to change the message of the commit.

sleek steppe
#

I thought we were moving it to the site

vocal wolf
#

So please use something else besides "Update <some file>"

clever wraith
vocal wolf
#

@sleek steppe either way, it should be reviewed once again even if we do shove everything into the site.

gritty wind
#

“Some tags are too large to make sense, so let’s make them into site articles”

vocal wolf
#

ah

gritty wind
#

Paraphrasing, but you get the idea

vocal wolf
#

I see

brazen charm
vocal wolf
brazen charm
#

site came to mind for a page explaining it but that wouldn't really facilitate discussion about it

short snow
#

sir-lancebot#760 can take an attachment and reverse it, but i don't think any other image manipulation command supports that

dusky shoreBOT
vale ibex
#

namely the pride command allows you to use any image as a flag

vocal wolf
#

@vale ibex would you mind checking if my resolving of conflicts on the talent-pool PR is correct?

vale ibex
#

Once this PR is merged, with my requested changes I'm planning to obliterate anything that allows arbitrary images to be parroted by the bot

vale ibex
vocal wolf
#

yeah, I'll provide the specific commit after I'm done resolving conflicts

vale ibex
#

👍

vale ibex
#

yup, lgtm

vocal wolf
#

sick

#

time to fix linting

vale ibex
#

those default dict slices were a fun bug lol

short snow
#

oh your next msg says that

#

nvm

vale ibex
#

Yea, I think my comment in the PR describes our stance on it

vocal wolf
#

@sleek steppe @fervent sage async-await tag has been squash merged, co-authors assigned properly.

#

@stable mountain is now down to 13 PRs

#

that may be an all-time low

sleek steppe
#

!async

stable mountainBOT
#

Concurrency in Python

Python provides the ability to run multiple tasks and coroutines simultaneously with the use of the asyncio library, which is included in the Python standard library.

This works by running these coroutines in an event loop, where the context of which coroutine is being run is switches periodically to allow all of them to run, giving the appearance of running at the same time. This is different to using threads or processes in that all code is run in the main process and thread, although it is possible to run coroutines in threads.

To call an async function we can either await it, or run it in an event loop which we get from asyncio.

To create a coroutine that can be used with asyncio we need to define a function using the async keyword:

async def main():
    await something_awaitable()

Which means we can call await something_awaitable() directly from within the function. If this were a non-async function this would have raised an exception like: SyntaxError: 'await' outside async function

To run the top level async function from outside of the event loop we can get an event loop from asyncio, and then use that loop to run the function:

from asyncio import get_event_loop

async def main():
    await something_awaitable()

loop = get_event_loop()
loop.run_until_complete(main())

Note that in the run_until_complete() where we appear to be calling main(), this does not execute the code in main, rather it returns a coroutine object which is then handled and run by the event loop via run_until_complete().

To learn more about asyncio and its use, see the asyncio documentation.

sleek steppe
#

yeah that's big

fervent sage
#

couple weeks back

vocal wolf
#

heck

#

we can go further

#

I must triage harder

fervent sage
gritty wind
#

I’ll happily take a force merge for my PR

#

I’m ~70% convinced that won’t be resolved before I’m 100% burned out on pydis

vocal wolf
#

@gritty wind I may need help with bot#1487

dusky shoreBOT
gritty wind
#

Sure, what’s up

vocal wolf
#

with testing

gritty wind
#

Ah

vocal wolf
#

making sure it doesn't explode

#

right after I attend to the changes mark requested

gritty wind
#

I can give it a look, but probably not today

#

!remind 7H Look @ bot 1487

stable mountainBOT
#
Sure thing!

Your reminder will arrive in 7 hours!

exotic ember
vocal wolf
#

roight

trim cradle
#

You know how if you call !docs and what you try to look up doesn't exist, the bot will eventually delete their response and the message in which you called !docs?

#

I think those are two wasted steps

fallen patrol
#

without looking at the code, there's no way to know if the user invoke will be deleted if you give the wrong stuff

#

and sometimes, its never deleted.

fervent sage
#

for docs it might be nice to have something like with eval, where you can edit and click refresh

fallen patrol
#

I'm not even sure when its supposed to delete or not delete

#

pypi purges stuff, pep purges stuff, other commands don't purge stuff

#

it is so confusing

fervent sage
#

not really, sounds like its just the static info lookup commands which do

fallen patrol
#

but some don't have trashcans

#

and then delete themselves

fallen patrol
#

when @stable mountain deletes an error message, it deletes the invoke.
When @dusky shore deletes its error messages, it leaves the invoke.

fervent sage
#

ah

#

does lance even have permissions to delete messages?

#

i'd assume not

fallen patrol
#

would be so so so so nice for that to be the same

fallen patrol
#

perhaps an admin or owner can check that

fervent sage
#

(which is good, principle of least privilege)

fallen patrol
#

ik it had to be granted delete perms into #reddit lol

sleek steppe
#

lance should have manage messages perms if it's dealing with webhooks and pins, unless it's channel overwrites

fallen patrol
#

yeah, its channel overwrites lol

thorny obsidian
#

It has manage message perms

fallen patrol
#

well then, lance should delete invokes too

#

.help

gritty wind
#

That inconsistency seems so minor, it’s not worth fixing

#

That’s probably how they came to be in the first place

#

The people who wrote the feature and reviewed it didn’t think it’s important

#

Because it isn’t

#

Anyways if you want to PR go for it

#

as long as the diff isn’t > 5 lines, it’s 👍

short snow
gritty wind
#

This seems weird (just going off the title)

#

Why would you redirect someone where they can’t run the command

#

And if this added functionality to allow the command in DMs, I’ve got an even bigger problem with it

sleek steppe
vale ibex
#

ahh crap

#

lol I had the wrong tab open

clever wraith
#

hello

#
    - What do you plan on eventually achieving with python?
    - Is python your first programming language, if not, what is?
    - What's your favourite aspect of python development? (Backend web dev/game dev/machine learning and ai ect)
    - In what ways has python discord helped you with python?
    - What part of python is currently dieing? 
    - Are you currently a student, or using python professionally?
    - What is your process when you decide to start a project in python?
    - Have you ever been unable to finish a python project? What is it and why?
    - How often do you program in python?
    - How would you learn a new library if needed to do so?
    - Have you ever worked with a microcontroller or anything physical with python before?
    - How good would you say you are at python so far, beginner/intermediate or advanced?
    - Have you ever tried making your own programming language?

how do these sound?

#

there we go

#

wait a minute

#

i have to create an issue first??

#

;(

#

It is mandatory to link to an issue that has been approved by a Core Developer

#

;/

thorny obsidian
#

If it's just adding more questions to the topic file you have my explicit permission to not have an issue and can reference this message.

vocal wolf
#

you have my permissions as well

#

@clever wraith dew it.

clever wraith
#

:0

#

so i can link this message instead?

#

got it

vocal wolf
#

nah

#

I'll just comment in the PR

#

actually, we can just do both

clever wraith
crude gyro
#

glad people are adding topics.

clever wraith
#

i did it

crude gyro
#

thanks for that.

clever wraith
vocal wolf
#

@clever wraith you should probably add a description to the PR.

clever wraith
#

was just sad i got the same questions again and again

vocal wolf
#

but you can remove the "relevant issues" section of it

clever wraith
#

i said 'people feel repetetive questions so i added more'

#

:D

vale ibex
#

!paste

stable mountainBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

clever wraith
#

And by people i mean me

#

:D

vocal wolf
vocal wolf
#

you can edit it

clever wraith
#

i alr created it

#

🤔

vocal wolf
#

with the power of

clever wraith
#

oh

vocal wolf
#

github

#

just click the 3 dots in the top right of the post

#

then click on edit

#

and do what you must

vale ibex
#

I've only got 1 infraction outstanding, and it's trying to reschedule it 4 times

clever wraith
#

done

vale ibex
#

twice under Infractions and twice under Superstarify

clever wraith
#

:D

vale ibex
#

It's a mute so shouldn't touch superstarify, and not sure why it's getting schedulded twice normally

vocal wolf
vale ibex
#

This is testing bast's PR, but I'm going to downgrade and see if it's existing

clever wraith
#

aight i will read that

vocal wolf
#

noice

#

@vale ibex did you break the talentpool thingy yet

#

if you have time, please test it really quick

vale ibex
#

I haven't touched it lol

vocal wolf
#

ah

vale ibex
#

I'll have look see

vocal wolf
#

understandable, have a nice day.

vale ibex
#

did you ping me somewhere? 😄

vocal wolf
#

@clever wraith ignore my mess of title changing

#

I wish it didn't log all of those lol

clever wraith
#

:0

#

this title makes more sense tho haha

#

its more specific

#

should have thought of that

vale ibex
#

ahhh ok, scheduling twice makes sense now, since we schedule all the infractions then schedule the last again at the end.

clever wraith
#

Don't forget to lint!
whats this thinkmon

vale ibex
#

now to figure out why it's toucing startify

vocal wolf
#

@clever wraith According to precommit, this is what it wants you to change.```diff
diff --git a/bot/resources/evergreen/py_topics.yaml b/bot/resources/evergreen/py_topics.yaml
index 05af49fe..6dc9947c 100644
--- a/bot/resources/evergreen/py_topics.yaml
+++ b/bot/resources/evergreen/py_topics.yaml
@@ -27,7 +27,7 @@
- Is python your first programming language, if not, what is?
- What's your favourite aspect of python development? (Backend web dev/game dev/machine learning and ai ect)
- In what ways has python discord helped you with python?

    • What part of python is currently dieing?
    • What part of python is currently dieing?
    • Are you currently a student, or using python professionally?
    • What is your process when you decide to start a project in python?
    • Have you ever been unable to finish a python project? What is it and why?
clever wraith
#

:0

vocal wolf
#

is it just me, or is there no difference between those sentences

#

lol

clever wraith
#

wait a minute

vale ibex
#

there's a trailing whitespace

clever wraith
#

i wrote it twice??

vocal wolf
#

no

#

this is a git diff

clever wraith
#

:0

vale ibex
clever wraith
#

it looks the same to me tho 🤔

vocal wolf
#

it's tracking changes between the last commit, and your current local changes

clever wraith
vocal wolf
#

to lint, you want to run poetry run task lint

sleek steppe
clever wraith
vocal wolf
#

in your terminal

clever wraith
vocal wolf
#

in the project directory of sir-lancebot

clever wraith
#

im not using version control tho because

#

looks like a very large file to download ☠️

#

will do it when

#

i get more into it

vocal wolf
#

but... you are using version control

clever wraith
vocal wolf
#

how did you get your changes to github?

clever wraith
vocal wolf
#

file upload?

clever wraith
#

i forked it and..

vocal wolf
#

ah

#

I see

clever wraith
#

i created a pr from my fork

vocal wolf
#

did you edit the file in github?

clever wraith
#

oh i have to edit it?

#

what should i edit

vocal wolf
#

no wait

#

that's not what I'm asking

clever wraith
#

yeah

vocal wolf
#

so you forked it, right?

#

the project

clever wraith
#

i edited on github

#

because its just yaml

#

;-;

vocal wolf
#

so you didn't clone it to your computer?

clever wraith
#

nope

vocal wolf
#

alright

clever wraith
#

cause

vocal wolf
#

what editor are you using?

#

for python

clever wraith
#

looked like a large file to clone

#

VS Code for python

#

pycharm sometimes, because of that pycharm font lemon_fingerguns_shades

vocal wolf
#

Doesn't vscode already have git built in?

clever wraith
#

oh wait

#

wait

vocal wolf
#

pycharm def does

clever wraith
#

i could have just not cloned it?

#

and still done it?

#

damn

vocal wolf
#

well yes, but that's not the best way of doing it

clever wraith
#

but like

#

lancebot is probs 1 gb

vocal wolf
#

if you're going to edit stuff in the future it's better to do it on your computer and not in github

#

lancebot isn't a gig, pretty sure

#

let me see

clever wraith
#

maybe i can add a system that doesnt involve disc.py who knows 😄

#

Like maybe, a system that outputs everything to a json, or text file and

#

then it can be merged with discord.py by reading that file

vocal wolf
#

sir-lance is 10mb

clever wraith
#

thats the same as a venv

#

:0

#

hmmm

#

1000 mb is 1 gb right

vocal wolf
#

yes

clever wraith
#

hmmMMm

#

okay fine

#

next time i edit

#

i will cloen

#

:D

vocal wolf
#

clone your fork, yes

clever wraith
#

mhm

#

xith regarding that .upper change. it was actually intentional. the upper case kinda gives a better view to what move did bot play. you still want the change?

vocal wolf
#

and then when you're done with all, push changes, make that pr.

clever wraith
#

ive used version control with other projects b4

#

and contributed to other open source but

vocal wolf
clever wraith
#

😞

clever wraith
vocal wolf
#

ty

vocal wolf
#

noice

clever wraith
#

indeed, cheers for first merge in sir-lancebot! 🍻

vale ibex
#

trying to build a docker image for sir lance

#

this diff solves it

#

it's been like this in lance for a while, guess no one has done a fresh build recently

mellow hare
#

Sounds right

vale ibex
#

<@&409416496733880320> bing bong, pls review sir-lancebot#765 at your earliest convenience

dusky shoreBOT
sleek steppe
#

@vale ibex is there an easy way to reproduce that error so I can test it?

vale ibex
#

delete all lance containers and images locally

#

then do docker-compose up

patent pivot
#

GitHub has a troll face emote

vale ibex
#

lol

#

I read into that trollface emote

#

as in this was your plan all along by committing that

#

see how long until someone noticed

#

also might have been from one of the changes to the deps that caused this too

#

we have bumped d.py and arrow since then

clever wraith
fallen patrol
fallen patrol
clever wraith
#

should i use double quotes in dictonary key names as well?

#

@sleek steppe

sleek steppe
#

yes

clever wraith
#

alright thanks!

patent pivot
fallen patrol
clever wraith
#

great! I've made respected changes.

patent pivot
last patio
#

hello

#

i'm trying to run tests locally but i get the following traceback:

Traceback (most recent call last):
  File "~/workspace/pydis-site/pydis_site/apps/content/tests/test_utils.py", line 38, in test_get_root_categories
    result = utils.get_categories(Path("."))
  File "~/workspace/pydis-site/pydis_site/apps/content/utils.py", line 25, in get_categories
    categories[item.name] = get_category(item)
  File "~/workspace/pydis-site/pydis_site/apps/content/utils.py", line 16, in get_category
    return yaml.safe_load(path.joinpath("_info.yml").read_text(encoding="utf-8"))
  File "~/venv-packages/site-packages/pyfakefs/fake_pathlib.py", line 540, in read_text
    with FakeFileOpen(self.filesystem)(self._path(), mode='r',
  File "~/venv-packages/site-packages/pyfakefs/fake_filesystem.py", line 5202, in __call__
    return self.call(*args, **kwargs)
  File "~/venv-packages/site-packages/pyfakefs/fake_filesystem.py", line 5263, in call
    file_object = self._init_file_object(file_object,
  File "~/venv-packages/site-packages/pyfakefs/fake_filesystem.py", line 5318, in _init_file_object
    self.filesystem.raise_os_error(errno.ENOENT, file_path)
  File "~/venv-packages/site-packages/pyfakefs/fake_filesystem.py", line 1010, in raise_os_error
    raise OSError(errno, message, filename)
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: 'var/_info.yml'

and i'm not entirely sure what to do with it. do i need to create the file somewhere?

#

(i simplified some paths because macos likes to do 500 layers of nesting)

tawdry vapor
#

No, you shouldn't need to create anything yourself. It should be self contained.

stable mountainBOT
#

@gritty wind

It has arrived!

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

tawdry vapor
#

It might be a bug with the pyfakefs library on macOS

#

Or it somehow relies on a specific cwd to be used and you're using the wrong one?

#

Path(".") is kind of suspicious

last patio
#

yeah, that's a good point! i'll take a peek around

tawdry vapor
#

I think pyfakefs is supposed to patch out pathlib with a mock

last patio
#
(Pdb) tuple(Path(".").glob('*'))
(PosixPath('var'), PosixPath('_info.yml'), PosixPath('root.md'), PosixPath('root_without_metadata.md'), PosixPath('not_a_page.md'), PosixPath('category'), PosixPath('tmp'), PosixPath('tmp.md'))
#

in /var/, there's only folders

tawdry vapor
#

IDK why the error is trying to access it

last patio
#

i think i found it

#

get_categories iterates over folders in there, and get_category then tries to read the contents

#

now i just need to figure out why /var is a thing

#

smells like macos

tawdry vapor
last patio
#

any newly created fake file system will always have either a directory named /tmp when running on Linux or Unix systems, /var/folders/<hash>/T when running on MacOs, or C:\Users<user>\AppData\Local\Temp on Windows.

tawdry vapor
#

The way I see to fix it is to find which directory exists right after the fs is created

#

And then write the rest of the files into that rather than hard-coding /tmp

#

I guess we can't simply delete it since the docs say the dir is necessary for tempfile to work

last patio
#

do we need tempfile in the tests though?

tawdry vapor
#

Good point. I understood it differently - that pyfakefs relies on tempfile therefore it creates the dir.

#

But if it's only a matter of whether we need it, then we can probably delete it.

last patio
#

that said, a better solution would probably be putting test data in a sub directory, as the site would handle it

#

and then adjusting paths as needed

tawdry vapor
#

Yeah that's even better than my idea

last patio
#

i'll give it a shot real quick

#

wait no I actually missed something

#
# There is always a `tmp` directory in the filesystem, so make it a category
# for testing purposes.
# See: https://jmcgeheeiv.github.io/pyfakefs/release/usage.html#os-temporary-directories
self.fs.create_file("tmp/_info.yml", contents=CATEGORY_INFO)
self.fs.create_file("tmp.md", contents=MARKDOWN_WITH_METADATA)
self.fs.create_file("tmp/category/_info.yml", contents=CATEGORY_INFO)
self.fs.create_dir("tmp/category/subcategory_without_info")
#

i'll try to see whether i can kill that with the changes, otherwise i'll add /var

tawdry vapor
#

You can just move that into the subdirectory

#

The data itself is still useful, but its absolute path doesn't really matter, as long as it's all relatively the same.

last patio
#

it appears i have opened a can of worms.

#

okay, i have fixed it in the most painless way i could think of

fallen patrol
#

@patent pivot 🥳 looks like fixing the perms for the second time fixed #reddit

patent pivot
#

ya

whole forge
#

i thought there was a open issue about python not embedding blob github links, but i cant find it. am i mistaken or just blind?

stable mountainBOT
#

gunicorn_conf.py line 6

import os```
sleek steppe
#

doesn't it only embed blob links (for github and not gists)

stable mountainBOT
#

docker-compose.yml lines 29 to 39

tty: true
depends_on:
  - postgres
  - redis
env_file:
  - .env
ports:
  - "127.0.0.1:8000:80"
environment:
  DATABASE_URL: postgres://pypixels:pypixels@postgres:5432/pypixels
  REDIS_URL: redis://redis:6379```
whole forge
#

aaaaa

tawdry vapor
#

It has a line count limit

whole forge
#

well but a link with the same number of lines as that docekr compose link didnt work

#

yep

tawdry vapor
#

It doesn't have the same number of lines

#

It ends at 39

whole forge
#

oh hmm

tawdry vapor
#

If you specify past the end it just clamps it

whole forge
#

ah so it breaks without any message if its too long

tawdry vapor
#

Yes. I think it does the same if there are too many characters

whole forge
#

maybe it should just show the first few lines?

stable mountainBOT
#

bot/exts/info/code_snippets.py line 244

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

i think it not working like this is a bit confusing (example: me)

tawdry vapor
#

Maybe. I'm not sure what would be better

whole forge
#

but at least i now know what the issue i should be making is

sleek steppe
#

I mean, x#123 silently fails

fervent sage
#

imo if youre not explicitly invoking a command you shouldnt get an error message for it

whole forge
#

right, but thats because there clearly is nothing there

#

for this github links i would embed the first few until the limit is reached

#

(which would not be a error message, just staying within reasonable limits)

#

say someone specifies L1-L100 it would only respond with the first like, 15 lines

#

same for the char limit, it would respond with the number of lines that are under the limit

vocal wolf
#

btw, bot#1609 is now getting merged.

tawdry vapor
#

The concern is that the code may not make sense without all of the chosen lines. It may even be a detriment to the discussion. It could also be misleading. A reader may not realise that the author intended for them to see more than what was shown.

whole forge
tawdry vapor
#

Yeah it's still a bit subtle though

#

Might not matter

whole forge
#

well see what people think of the issue, im very obviously for showing at least a few lines

tawdry vapor
#

I dont know how users will like it in practice so I don't mind trying

fervent sage
#

discord shows "X more lines" in its file preview, it could be like

bot/exts/info/code_snippets.py line 244

if 0 < len(message_to_send) <= 2000 and message_to_send.count('\n') <= 15:
# some stuff
...  # 17 More Lines
vocal wolf
sharp timber
#

\o/ hopefully it works

whole forge
#

untested 👀

vocal wolf
#

As far as I can tell from the tests on the test server, there shouldn't be anything wrong.

sharp timber
#

Tested but hard to test thoroughly

#

yeah

vocal wolf
#

@vale ibex ty for testing m8

tawdry vapor
#

IIRC the functions were basically identical but I didn't carefully look into the feasibility of detaching it from the class

#

As for the location, IDK. It's awkward since watch channels and talent pool are in different packages, but the utils are too niche to put in the utils package.

vocal wolf
#

in my experiments with detaching them from the class, I think it would be better if both stayed as methods.

short snow
#

Whose jchrisgit?

patent pivot
#

Volcyy

short snow
#

Oh

short snow
#

regarding sir-lancebot#745 , the last comment where we would need to make load_extension an async function, should I do that since I think there are some places internally in dpy that call that function.

dusky shoreBOT
short snow
#

and it would require some changes in the extension cog too, where we can load extension

#

oh pride leaders got merged 🎉

sleek steppe
#

I think I'll do sir-lancebot#766 and sir-lancebot#767 since I'm the one who caused those errors lol

exotic ember
#

sure

trim cradle
#

for the site, isn't pipenv run pre-commit supposed to fix file new lines for you?

patent pivot
#

poetry run task lint

short snow
#

It is poetry now

patent pivot
#

I forget whether it just checks or modifies

short snow
#

pre-commit just installs and setups the hooks ig

patent pivot
#

yeah

trim cradle
#

oh, I'm on a branch that doesn't have poetry

#

guess I can deal with linting after I pull?

short snow
#

Is the branch on fork or main repo? You can update it

trim cradle
#

it's a branch of one of lemon's branches

#

so I'd rather pull from his branch when he's ready to get whatever changes are in main

short snow
#

Yeah

exotic ember
#

@trim cradle if you're on a pipenv branch, it's pipenv run precommit (note the lack of hyphen) to install the hook that fixes newlines on commit

trim cradle
#

or, for all the context

#
(site) steele@steele-mint:~/projects/pydis/site$ pipenv run pre-commit
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/steele/.cache/pre-commit/patch1622908350-60658.
Check for merge conflicts................................................Passed
Check Toml...........................................(no files to check)Skipped
Check Yaml...............................................................Passed
Fix End of Files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing pydis_site/apps/resources/resources/thonny.yaml
Fixing pydis_site/apps/resources/resources/sololearn.yaml

Mixed line ending........................................................Passed
Trim Trailing Whitespace.................................................Passed
check blanket noqa...................................(no files to check)Skipped
Flake8...............................................(no files to check)Skipped
[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
[INFO] Restored changes from /home/steele/.cache/pre-commit/patch1622908350-60658.
short snow
#

Umm, delete the file from cache and then run it again

trim cradle
# short snow Umm, delete the file from cache and then run it again
(site) steele@steele-mint:~/projects/pydis/site$ rm /home/steele/.cache/pre-commit/patch1622908350-60658
(site) steele@steele-mint:~/projects/pydis/site$ pipenv run pre-commit
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/steele/.cache/pre-commit/patch1622908527-60866.
Check for merge conflicts................................................Passed
Check Toml...........................................(no files to check)Skipped
Check Yaml...............................................................Passed
Fix End of Files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing pydis_site/apps/resources/resources/thonny.yaml
Fixing pydis_site/apps/resources/resources/sololearn.yaml

Mixed line ending........................................................Passed
Trim Trailing Whitespace.................................................Passed
check blanket noqa...................................(no files to check)Skipped
Flake8...............................................(no files to check)Skipped
[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
[INFO] Restored changes from /home/steele/.cache/pre-commit/patch1622908527-60866.
#

Doesn't appear to have mattered

#

I force committed it, we'll figure it out when we're ready to have poetry on that branch.

short snow
#

Uhh, interesting, maybe try deleting the virtual venv, and then make one again?

short snow
#

Sure 👍

fallen patrol
#

@trim cradle precommit is doing its job, lol

#
  • files were modified by this hook
    but it doesn't always actually fix the files
trim cradle
fallen patrol
#

unstage all of your files, pipenv run lint

#

well yes, but precommit is unaffected

#

its the same precommit we've had

#

the simplified difference is just the venv manager

trim cradle
#

🤷🏻‍♂️

green oriole
#

You can either fix them manually or do a manual stash when this happens

fallen patrol
#

^ same goes for poetry

fallen patrol
#

or maybe git does 🤔

stable mountainBOT
#

@green oriole

It has arrived!

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

green oriole
#

Ah

#

Well

#

I'll perhaps open an issue at some point

gritty wind
#

You can run precommit run -a to run it on all files

#

That’ll fix this problem

vale ibex
#

poetry run task precommit will install the pre-commit hook

poetry run pre-commit will run the pre-commit check (which only looks at files in the staging area)

poetry run task lint will lint all files in the project.

#

The end of file fixer doesn't automatically stage the files changed, so you'll need to stage those using git add <path> and then run the pre-commit hook again

fallen patrol
#

Why do they have to use task?

sleek steppe