#dev-contrib

1 messages · Page 77 of 1

dusky shoreBOT
green oriole
#

Also, if you guys have any suggestion ^

vale ibex
#

if mine is in the root dir, it doesn't pull any vars that aren't defined in docker-compose

#

if its in bot/ it doesn't pull anything 😂

gritty wind
#

I've learned if you start a notion page titled documentation, it'll somehow get auto populated

#

How are you running the project? (working dir and command)

vale ibex
#

PS C:\Users\Chris\src\sir-lancebot> docker-compose up

gritty wind
#

Hmm that's what I'm doing too

#

Interesting

#

Also, I'm going through the consts file right now, does anything even load the env file?

#

Wot it doesn't

#

Well that explains why it wouldn't work

green oriole
#

Docker-compose is in charge of loading in our setup

#

Hmmm.. we could use dotenv

vale ibex
#

I think the enviroment part of docker-compose pulls the env vars from the host into the container

gritty wind
#

I was running locally by having my IDE load in the env file, so I thought we had dotenv

vale ibex
#

using the .env file

green oriole
vale ibex
#

yea exactly

#

So I'm not sure how you're getting extra vars in there @gritty wind

gritty wind
#

Its pulling the file into the container, but not adding the vars to the env

#

Which would be fine

#

if we had dotenv

#

which I thought we did

cold moon
#

Wait what, variables have to be defined in environment to be loaded from .env?

vale ibex
#

if we don't use dotenv yea

gritty wind
#

Chris' solution does work though

#

It loads all the vars from .env

green oriole
#

We could match @stable mountain’s setup and use dotenv

#

But I’m fine with using docker-compose for that

gritty wind
#

I think that's ultimately the best solution, and drop the env setup from the compose completely

vale ibex
#

yea the only issue with my fix, that F1re mentioned was that we need to make sure docs are upto date with what env vars there are

gritty wind
green oriole
#

Ultimately there won’t be any env var in a couple of months or so

green oriole
gritty wind
vale ibex
green oriole
#

Yep

vale ibex
#

I guess we just need to think of an interim solution until then?

#

or accept the current process

green oriole
#

I’m fine with using docker-compose for now

gritty wind
#

So should we push on through with merging Chris' solution?

green oriole
#

I believe @hardy gorge wanted to experience a bit with how docker-compose behave, I’d also like to

gritty wind
#

It throws an error if the env file doesn't exist if that's what you're asking about

green oriole
#

Hmm

gritty wind
#

Just

ERROR: Couldn't find env file: <path>\sir-lancebot\.env

#

Discord edited out a slash there

#

The contrib page doesn't mention docker 👀

vale ibex
#

Nah, it doesn't

green oriole
#

Lol wut

gritty wind
#

nor does the readme

#

nor the contrib guide

green oriole
#

The README is also abysmal

vale ibex
#

sorta what started my question, since I was trying to figure it out

gritty wind
#

Hey at least it has the new branding lol

green oriole
#

Lmao, that’s.. an issue

gritty wind
#

We can get a description drafted for all 3

#

It should be easy to modify the bot's one

green oriole
#

In fact, I wanted to write a more thought through README with what are our bots, what they are used for, some screenshots, and fun stuff like that

cold island
#

yes the docs for lancebot are indeed in bad shape

#

Scal's work to list the possible env vars was a good start but there are still a few issues

surreal venture
#

@nocturne hare Can you please review my Pull Request?

dusky shoreBOT
surreal venture
#

Also, there are no spaces in the !help bot command title fields

gritty wind
#

well presumably there is no space in the command group itself

#

title casing helps make it more readable, and easier to remember and type

surreal venture
#

🤔

#

Also where is the contributing guideline thing?

gritty wind
#

There's the contrib page on the site which describes setup

#

And there is the CONTRIBUTING.md on the repo root that describes the contribution procedures

surreal venture
#

Would there be an explanation of docker anywhere?

gritty wind
#

That's currently lacking on the sir-lancebot repo, but available on the bot

#

Hopefully that gets fixed soon

#

We can answer your questions in the mean time

surreal venture
#

I just wanted to be clear, docker is something like a Virtual Machine right?

gritty wind
#

Yeah sort of.

#

To be clear, you don't need to use it

#

I don't for example

#

(Except for some DBs)

surreal venture
#

Ok thank you!

tawdry vapor
#
green oriole
vocal wolf
#

hmmmmmmmmmmmm

brazen charm
#

I can take a look at the bot PR soon-ish but can't help much with snekbox

vocal wolf
#

the repo isn't looked at often

green oriole
#

T'was my thought as well

vocal wolf
#

Hopefully I got the interpretation of the PR correct

tawdry vapor
#

Thanks it looks good

vocal wolf
#

ty for confirmation

stable mountainBOT
#

@green oriole

It has arrived!

Here's your reminder: Add an env_file entry to the sir lancebot compose.
[Jump back to when you created the reminder](#dev-contrib message)

green oriole
#

Someone made it already, all good

surreal venture
#

Why is the README.md in the sir-lancebot repo an executable?

gritty wind
#

It's just an md

#

Is it a problem on your system?

surreal venture
#

¯_(ツ)_/¯

#

This is what l returns for me on a fresh clone of the repo
bot/ CONTRIBUTING.md docker-compose.yml Dockerfile LICENSE Pipfile Pipfile.lock README.md* sir-lancebot-logo.png tox.ini

surreal venture
#

@green oriole You left a comment on my PR asking me to change it to Spooky Mane Rate instead. You did mean Spooky Name Rate right?

green oriole
#

Yeah, I edited it, sorry

surreal venture
#

Okay thank you!

green oriole
#

I often type mane instead of name haha

surreal venture
#

😆

gritty bolt
#

If an issue is open from two years ago, can I still ask to be assigned to it?

#

For the sir-lancebot repo

green oriole
#

Can you tell me which one? It will depend on what the issue is about

gritty bolt
#

Also Akarys, while you are here, I submitted a PR to port the python-discord LinePaginator class to Sir-lancebot, which fixes one of the issues that you opened

green oriole
short snow
gritty bolt
#

Does sir-lancebot have unit testing?

crude gyro
#

no.

#

@stable mountain has some unit tests, but we've intentionally avoided putting tests in @dusky shore so that it'll be more approachable and beginner-friendly

#

besides, if @dusky shore breaks, it isn't actually a big deal.

#

it might even be a nice learning opportunity for whoever gets to fix it.

gritty bolt
#

I see... I like test-driven development, so I was hoping that there would be unit tests.

gritty bolt
crude gyro
#

I am against unit tests for sir-lancebot, but every other repo we have welcomes unit tests with open arms.

#

so perhaps you'd prefer to solve an issue for one of those?

gritty bolt
#

I see, okay, just checking to make sure

#

For the valentines issue, I need to create a txt file with poems on it, do I put it into bot>resources>valentines?

green oriole
#

Yep

gritty wind
#

Would it be txt, or MDs?

gritty bolt
#

What would be?

gritty wind
#

The poems

#

A lot of the other text things, like tags for example

#

are md

gritty bolt
#

Well, the first file type that came to mind to me was txt

#

There are no font decorations, like bold and italics

#

I am currently referring to a closed PR that was never merged, so I am basing my current PR off someone else's

gritty wind
#

Well text decorations make more sense in md

green oriole
#

The resources can be any format

gritty wind
#

because that's what you'll do for discord

gritty bolt
#

I suppose it is possible to use MDs?

gritty wind
#

But either will work

gritty bolt
#

Alright, let's say if it's MD, is it still in the same directory?

green oriole
#

Since it will be used for a Markov chain, pure text makes more sense

gritty bolt
#

Yes, that's what I thought

#

Unless, additional features outside of the Markov chain are added

green oriole
#

I think using text files is fine, even if we need additional data

short snow
#

m_cht are you storing your poems in the resources?

#

and are those poems all from one site?

gritty bolt
#

The previous assignee created a corpus from Shakespeare's poems and plays

#

The txt file contains that corpus

short snow
#

https://poets.org/love-poems heres a bunch of them, if you could try web scraping, or if the data is json, then could be better

gritty bolt
#

I will take a look at it, thanks

gritty bolt
#

Just wondering, when I install a new module with pipenv install ..., will it automatically run pipenv lock?

crude gyro
#

I think it does, yes.

short snow
#

doesn’t pipenv install automatically add it ?

hardy gorge
#

it will relock, yeah

trim cradle
cold island
#

I guess it could

sharp timber
#

Seems like a great place to use reply

sullen phoenix
#

the bot should respond instantly, i feel like it’d just be more noise

gritty bolt
#

Is logging the formal version of print?

gritty wind
#

Yeah sort of

#

It has a few added benefits, such as level, time stamps, and we’re writing to a file, not just stdout

#

The “when to use logging” header on this page describes a few use cases for the library

gritty bolt
#

Ah I see, thanks

short snow
#

how about improving the wikipedia to show a short summary or 100 words or less when the user chooses

#

using line paginator

#

(not using wikipedia module)

#

like:

#

.wikipedia football

late wolf
cold island
#

I think the consensus was it wasn't something we needed

late wolf
#

May I know why?

subtle kraken
#

rarely ever do we need to give same infraction with same duration and same reason to more than one user

late wolf
#

The only example I could think of was a chain

#

But ok

subtle kraken
#

its just very big niche that yet is not worth the development time it'd take

late wolf
#

How would it take development time?
Would it not just be changing the parameter to greedy and looping through the input, and applying the infraction

subtle kraken
#

considering that chances are we would only use it once a month if not less
Any development time for it is a waste

gritty wind
#

Any change to @stable mountain does not only come down to the literal time to implement it, there is also the time to test it, write tests, review it, and maintain it

#

If it isn't a solution to an active problem, why waste resources on implementing it

late wolf
#

🥺 ok

gritty bolt
#

Is it a good idea to have a bot respond to one request at a time? The current poem generator cog takes about 5 seconds to process, if everyone does it in that same 5 seconds, I am afraid it might crash

gritty bolt
#

It's currently in my fork

sharp timber
#

ah. Is that public for me to look at?

gritty bolt
#

I can push the changes to my fork and send you the link

#

Actually

#

I can also invite you to my private test server

sharp timber
#

Either is fine

#

Realistically the compute time doesn't matter too much, it's the blocking time that matters

#

There's also typing() that can be useful

gritty bolt
#

I have PM'ed you the invite link

short snow
gritty bolt
#
gritty bolt
short snow
#

oh ok

gritty bolt
#

When I should I use an embed and when should I not?

sharp timber
#

👍

gritty bolt
#

Or should I use an embed 100% of the time?

short snow
#

embed should be used all the time probably.

sharp timber
#

Honestly I'm not familiar enough to tell you. But in this case, perhaps a code block could be neat.

short snow
#

also instead of catching the error in the poem function (the cog function), why not just raise the error in the functions

#

for example on line 192

gritty bolt
#

Aren't I raising the error in the function?

short snow
#

ah you do, my bad

sharp timber
#

I like the embed format

#

But I'm no dev lead so ymmv. On the other hand, due to how you run it, you're awaiting things fairly often

gritty bolt
#

Yeah, I already feel like it's valentines already

sharp timber
#

keep in mind that asyncio transitions to other tanks upon await

#

So despite the bot spending a lot of time working, it's really spending most of that waiting on the api, and is free to respond to other commands in the meantime

gritty bolt
#

Not just the API, but also the markov chain

sharp timber
#

right

#

You're guaranteed to await on every loop iteration, so that's free enough imo

gritty bolt
#

Should I make it so that the bot can work on only one poem at a time?

sharp timber
#

I don't know. You could consider using the reply feature because of the delay between poem request and response, but I'm not sure how that'll go, and honestly a bit out of my depth

#

the real concern I had was that it would for-loop lock up for the duration, but that's not an issue here at least

gritty bolt
#

What's a for-loop lock up?

sharp timber
#

If you were just processing and not awaiting anything inside your for loop, then you never release control to asyncio

gritty bolt
#

Oh I see

sharp timber
#

because of that, the bot would lose the ability to do important things like respond to other messages or remain connected to the api

#

yeah

gritty bolt
#

So that means I have to make sure that it awaits something in every path

sharp timber
#

Yes, no? Just ensure there's no chances of ending up locked in a non-awaiting path for a large chunk of time

#

considering how you're hitting an api for all this, probably no concerns here. The python code is probably quite fast and unlikely to cause an issue

gritty bolt
#

It also depends on the size of the poem, I am considering adding a limit to the # of lines the user can make

#

And complicated rhythm structures also take a while because the bot has to take more time to find rhymes

short snow
green mesa
#

y site all commands show in help message

#

but doc one doesnt

#

both are using group.commands

hardy gorge
#

!docs is not part of our Site group, is it?

#

Because we're not searching our docs or our website. We're searching through the docs of others.

green mesa
#

nope but doc also has subcommands

gritty wind
#

I think it does show all the commands that you have access to

#

But the docs group only has one public command

hardy gorge
#

For me it will show the commands I can use, yeah

#

!help

short snow
#

it shows which the user has access to

hardy gorge
#

Or not

#

!help docs

stable mountainBOT
#
Command Help

!docs [symbol]
Can also use: d, doc

Lookup documentation for Python symbols.

Subcommands:

!docs delete <package_name>
Removes the specified package from the database.
!docs get [symbol]
Return a documentation embed for a given symbol.
!docs refresh
Refresh inventories and send differences to channel.
!docs set <package_name> <base_url> <inventory_url>
Adds a new documentation metadata object to the site's database.

short snow
#

woah, powerful ves

hardy gorge
#

Ah, they're subcommands of that main command

#

Did you look for configuration related to them showing up in the help or not?

#

I think you can set options for that in the decorators

#

Not sure

green mesa
#

hmm

short snow
#

i can manage your help command emojis

#

ig

green mesa
#

see when u type !help it only showed one command

#

not its subcommand

short snow
#

well yeah i can

green mesa
#

but when u scroll to page 3 site command does

#

only on this part i am confused

short snow
#

@hardy gorge i can manage the reactions on your help command.

cold island
#

yeah we don't mind that generally

short snow
#

when i did delete reaction, it got deleted

#

so not good ig

cold island
#

it did?

short snow
#

yeah

cold island
#

!help

#

oh

late wolf
#

yep

short snow
#

see?

cold island
#

ok

#

do you want to open an issue?

hardy gorge
#

We don't bind it to a specific user, no

cold island
#

yes but we do so for the trashcan iirc

hardy gorge
#

There's a consideration here: We don't want to bind it too closely, as mods often use each others embeds

short snow
#

try for sirlancebot

cold island
#

.help

late wolf
#

right but other people shouldn't be able to delete others help messages

short snow
#

nope

#

not here

hardy gorge
#

Yeah, trashcans should probably be bound to the author + staff

cold island
#

ok yeah it's a bug

short snow
#

can someone open a issue, away from laptop rn, or i can later

hardy gorge
#

I'm not sure though

green mesa
#

i tried with my test bot

#

that didnt work

hardy gorge
#

Not sure then

green mesa
#

😓

hardy gorge
#

But there are probably others that are way more familiar with this part of our bot

green mesa
#

ok

short snow
#

@cold island can you do another command which has the use of line paginator in bot?

#

just want to see if it is paginator issue or the help command

#

since the paginator looks good and doesn't seem to cuz the problem

#

looks like the help command bug

#

yep is a help command bug

cold island
#

I just tried another command and the bug is there as well

short snow
#

hmmm, can u do it here?

cold island
#

sorry, it's a mod command

short snow
#

#bot-commands message not here tho

cold island
#

couldn't think of another paginator

short snow
#

ah it shld a paginator

cold island
#

I think the eval trashcan is written separately from the paginator

#

and since the help command and the command I just tried both have the bug and they both use the paginator, it's probably the paginator

short snow
#

yea got that

#

but the paginator source looks good, can't seem to find the problem in there

cold island
#

it might be related to the check, i.e what reactions it's listening to

short snow
#

do !tags

cold island
#

!tags

short snow
#

yep

green oriole
#

What's up?

short snow
#

some prob in bot paginator

#

do !tag once again pls

green oriole
#

!tag

short snow
#

ok thanks

#

problem with the whole not the trashcan only

green mesa
#

@green oriole sorry for the ping but u know how all sub command of site show in help embed but docs one doesnt, just curious

green oriole
#

Hmmm

green mesa
#

use !help and check docs and then move to page 3 and check site

#

it shows all command in an embed

green oriole
#

I don't understand

#

!docs is in the embed

green mesa
cold island
green oriole
#

Hmm

#

I don't mind that actually

short snow
#

but not in sir lancebot

#

so should i fix it?

green oriole
#

We don't need to show each command

green oriole
cold island
green oriole
#

Hmmmm

#

So we would need to restrict that to, let's say, moderators?

cold island
#

yeah

green oriole
#

Alright, I was about to open an issue about allowing moderators to use the trashcan on any embed, we can do that at the same time

gritty bolt
#

Whenever an error is raised in sir lancebot on my cog, my cog's error handler captures it, but it still logs this:
bot.exts.evergreen.error_handler ERROR: Unhandled command

obsidian patio
green oriole
#

Hmm

cold moon
cold moon
vale ibex
#

imo it does the job

gritty wind
#

X and Os are distinctive shapes, so they're mostly distinguishable on smaller sizes

balmy sparrow
#

I remember when I was making a tictactoe command for my own bot, I made the X and O with 4 custom emojis each, so when they're put together they're of a decent size

eternal blaze
#

hey guys what auto formatter is used for the official cpython repo?

patent pivot
#

I don't believe they have one

gritty wind
#

There is clang on the c side

#

Nothing for python though

eternal blaze
#

oh i guess they just formatted it by hand then, dunno cuz i thought the formatting was nice

#

but i tried few auto formatters and i didnt really like them

#

i asked in #python-discussion no one really answered, or if u guys recommend a good python formater?

#

one thing i thought was interesting was that it didnt seem like it was exactly pep8

vocal wolf
#

@cold moon sorry, miscommunication I my end, I meant whenever you wanted me to review.

eternal blaze
#

so is pep8 not that important or?

vocal wolf
#

It's pretty important, I'd say.

#

Are you looking for a program that formats your code for you?

#

Or one that tells you what's wrong

cold moon
#

This is ready for reviewing yeah

vocal wolf
#

thank you for the speedy reply

eternal blaze
#

i mean like in cpython repo i see little stuffs like between function definitons only 1 line i think it should be 2?

#

so i mean technically its not strictly adhering to pep8

gritty wind
#

Two lines between classes, etc, but between functions one is fine

eternal blaze
#

oh ok

#

idk black always makes it 2 for me

#

between everything so ye

#

so u guys format the python code by hand then?

gritty wind
#

I mean my IDE points out linting problems as I write

#

So it's never really a major problem

#

On the pydis projects, we also use flake8

vocal wolf
gritty wind
#

Which helps enforce it on the repo level, and can point out some errors my IDE doesn't catch, but not frequently

eternal blaze
#

ok thanks guys

vocal wolf
#

np

eternal blaze
#

and u guys use vscode or pycharm?

vocal wolf
#

for python, pycharm

eternal blaze
#

oh same

#

i tried both but couldnt find an "inspect code" for vscode

#

where it will point out all code issues etc.

vocal wolf
#

pycharm should automatically tell you if something's wrong

#

should be just built in

eternal blaze
#

so no need to use flake8 with it or?

vocal wolf
#

pycharm on its own should be fine

eternal blaze
#

ite gucci thnks

vocal wolf
#

If you're not sure you can always do flake8 your_file.py

#

After installing flake8, of course.

gritty bolt
#

If I would to allow other contributors to work on my issue, I just put "[WIP]" in front of the issue and set my PR to draft mode, right?

tawdry vapor
#

You opened a PR and want someone else to complete it?

#

If you don't have a PR then just write in the issue that anyone can work on it. If you have a PR then set it to draft and write a similar comment

gritty bolt
#

No no no, I haven't opened the PR yet. I am still interested in working on the issue, I just want to see if anyone else would be interested to work on it with me

tawdry vapor
#

Oh alright

#

Just write somewhere in the PR that you're open to collaborate

gritty bolt
#

Oh okay

patent pivot
#

also maybe worth linking it here for further visibility 👍

gritty bolt
#

Hi guys, I am currently working on a poem generator that uses the markov chain for valentines: https://github.com/python-discord/sir-lancebot/pull/558

If you are interested in working on it with me, please feel free to check it out

short snow
patent pivot
#

was testsing a feature which meant I couldn't have it

short snow
#

ok

sullen phoenix
#

hello @frosty coral, this channel is for discussion of Python Discord projects

#

feel free to share in an off-topic channel though

#

(nice animation!)

sullen phoenix
#

another fun error

gritty wind
#

Though I suppose we'd be maintaining more bugs than code
hahaha

#

I'll look into it now

sullen phoenix
#

lol

#

cheers

gritty wind
#

Can I get the invocation command? I hope that got logged somewhere before that error

cold island
#

It started with CommandNotFound('Command "!!" is not found')

gritty wind
#

Perfect, just what I was looking for

#

But now to figure out how that got past the checks

cold island
#

yeah I'm not sure how to recreate it

#

Why does it not return here? 🤔

gritty wind
#

We want it to fall through and continue to the suggester

cold island
#

ah

#

ok

#

so that's how it reached the suggester I guess

gritty wind
#

Well the suggester would also run it through the tag converter, and not cause problems, no?

cold island
#

It errors out in line 164 in that file

#

And I don't see a tag converter

gritty wind
#

Ah no, you're right

#

Why are we even running the input through the tags twice

#

Feels like we should just remove that portion all together

cold island
#

which portion and where do we run it twice

gritty wind
#

Trying to convert to tags in the suggestor

#

Lines 162-167 should be ripped straight out

#

The alternative is combining it, and ripping out the section before it

#

We'd need to duplicate the tag conversion code to keep both

cold island
#

Because it tries to suggest even when the tag name is invalid

gritty wind
#

The tag suggestions are already handled by the fuzzy match

#

There is no situation where the fuzzy match won't trip, but still have suggestions to show

#

At least I don't think

cold island
#

What I mean is that when the tag name is invalid BadArgument is raised and you never try to fuzzy match

#

You try to fuzzy match inside line 158 which is inside else

gritty wind
#

That's what line 149-158 achieve as well though. tag get calls display tag which shows the nearest suggestion, or fuzzy matches

cold island
#

Right, but only if the tag name is valid

#

!! isn't

gritty wind
#

And we'd presumably not want to search with a tag with a non valid name

cold island
#

The idea originally I guess was to find a suggestion

gritty wind
#

So if the 150-160 handle fuzzy matching tags, why does the suggestor try doing it again

cold island
#

I don't mind ripping it out, but I'm trying to follow the original logic that made the person add it

gritty wind
#

Hmm, maybe that could be done, but it already will return a tag if the fuzzy matching finds something

#

Otherwise it probably means it has no suggestions

cold island
#

So it will be the first time it's fuzzy matching

#

ok sorry

#

you're right yeah

#

it's not optimal

#

What should maybe happen is to get rid of the try and make the get command deal with an invalid name internally

gritty wind
#

The thing is it normally would

#

Like if you invoked !tag get

#

But the converter doesn't get run on a code invocation

cold island
#

!tag get !!

stable mountainBOT
#
Bad argument

Tag names must contain at least one letter.

#
Command Help

!tags get [tag_name]
Can also use: tags g, tags show

*Get a specified tag, or a list of all tags if no tag is specified.

Returns False if a tag is on cooldown, or if no matches are found.*

cold island
#

Ok, so here it works because I invoked it directly

#

So why do we need the try?

gritty wind
#

Yeah the ctx.invoke doesn't call the pre-invoke hooks

#

Its in the docs I think

cold island
#

hmmmm

#

ok but it does manage to reach the suggesting code

#

It just doesn't handle the string well

gritty wind
#

The get tag function expects that there will always be a letter in the input

cold island
#

but yeah something should be done about the duplication regardless

gritty wind
#

Which the converters gaurentee

cold island
#

it fails in the fuzzy matcher

#

because the regex removes any non-alphabet characters

#

and !! has none

#

so basically what you just said

#

Do we even want to suggest anything if it's a bad argument?

gritty wind
#

The definition of a bad argument for a command and tag might at some point diverge

#

And the suggestor handles other options well

cold island
#

A bad argument in the context of a tag

gritty wind
#

Ah okay, no it shouldn't

cold island
#

No characters, too long, etc.

gritty wind
#

It doesn't atm

cold island
#

It tries to

#

Which is what caused the error

gritty wind
#

Oh yeah the suggestor does, which is what I think should be removed

cold island
#

yeah so just rip out everything after the try-except-else part

gritty wind
#

Yeah pretty much lol

cold island
#

but

#

This is the part where it checks for mod+ roles

gritty wind
#

I meant everything inside the if

cold island
#

Which makes me believe that the suggester should have been a separate thing

gritty wind
#

So

if not any(role.id in MODERATION_ROLES for role in ctx.author.roles):
  ...
  if not sent:
    await self.send_command_suggestion(ctx, command_name)

To:

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

Which does what it currently does

#

But without tags

cold island
#

ah yeah

#

that works

#

that can just go into the except part though

#

And not have an if in the else

#

and just invoke the command instead

gritty wind
#

Hmm I think I prefer it the way it is, as it creates a clear logical divide between trying to convert to tags, and trying to fuzzy match a command

#

Though either will be functionally identical

cold island
#

hmm

#

wait

#

Why are we running the converter separately even

late wolf
#

leme check

gritty wind
#

It won't work for people that only have mod, or only admin, etc

#

You can get it to work with an all if you move the not

#

But this structure is used throughout the project

#

(This line specifically)

cold island
#
try:
    await ctx.invoke(tags_get_command, tag_name=tag_name):
except errors.BadArgument:
    if not any(role.id in MODERATION_ROLES for role in ctx.author.roles):
        await self.send_command_suggestion(ctx, command_name)
except ResponseCodeError:
    pass
#

won't that just work?

#

Invoke the tag, if the tag name is bad, suggest anyway

gritty wind
#

Yes, but see comment on purpose separation

cold island
#

yeah but with this you have don't have the conversion part, you just try to run a tag

gritty wind
#

You still need to run the converter, otherwise you get the error that started all this

cold island
#

The converter is run in the tag get command implicitly

gritty wind
#

The BadArgument is not raised by the function itself, but the converter which doesn't get called on an invoke

#

See note here

#

We can get it through bot.invoke which calls the checks

#

I think... maybe

#

But the thing is

#

We probably don't want to send a conversion error

#

Because like if I type
!@help
That can be converted to !help, but not a tag

#

and if we just run the check like it was entered as a !tag get

#

It'll send the conversion error, as well as a suggestion for help

cold island
#

ok yeah, that's getting too complicated to be worth it

#

lets keep the change minimal

#

And I still don't know how it even tried to run !! as a tag lol

gritty wind
#

Its a very hyped tag ¯_(ツ)_/¯

cold moon
#

https://github.com/python-discord/site/pull/421 Can anybody take a look at this? I updated this to match with current state in site, but somebody should take a look to find did I missed something. After this is done, I think this is good to go.

gritty wind
#

Pushed a fix for the zero division error from this morning which was sort of stuck in limbo

short snow
gritty wind
#

I don't think deferred issues are usually open for work

#

Though that was only waiting on 3.9

#

@green oriole status of this ^

short snow
#

cuz i know fix using regex

green oriole
#

Yep, it is waiting for the 3.9 migration

short snow
#
async with self.client.session.get('https://http.cat/') as response:
  text = await response.text()
  http_codes = re.findall(r'<a href="/(\d{3})">', text)
  http_codes.append(0)  # Easter egg code
  self.http_codes = [int(x) for x in http_codes]
gritty wind
#

I mean, that was suggested even before a 3.9 migration became viable

#

We didn't go with it so we can use the stdlib

#

So you'd still need to wait for the 3.9 migration

short snow
#

ah alright

gritty wind
#

There are ~12 unassigned approved issues, and 9 unassigned planning

#

One of those would be a safer bet

#

(the planning ones for discussion not direct assignment)

short snow
#

yeah, currently looking at them

#

in connect four, will it be a player vs player, or player vs plaer and player vs ai?

gritty wind
#

Another thing that would really help is submitting PR reviews, though it isn't for everyone

#

What's the issue #?

short snow
#

not much experienced with it, just started doing codereviews, (For gurkbot), so later can can help there.

gritty wind
#

Looking at the connect four issue, bot seems optional. Though there is also a PR open, and I believe the preferred path here would be resuscitating the PR and addressing the feedback

cold moon
#

I'm working on upgrading dpy and py version, but I'll finish after forms current stuff is ready

gritty wind
short snow
#

there are so many prs with waiting for author 😮

cold moon
#

No, I will do this. I have this already started in my computer

late wolf
#

Hey @green oriole in pr 1358

                or user_.id == restrict_to_user.id
                user_.id == restrict_to_user.id

why do you have 2 of these?

green oriole
#

Huh

late wolf
#

in your pr why is there 2 same lines

gritty wind
#

Are you looking at the deleted and added lines?

#

I just see one

late wolf
#

oh right

#

Sorry

green oriole
#

Yeah, the first one is a deleted line

late wolf
#

In your pr if you didn't make the change and it already existed beforehand but i want to request something, can I?

green oriole
#

You can write a comment, yeah

late wolf
#

aight

gritty wind
#

Hmm you might want to expand the rest of that file haha

#

There is more code in that scope after the if

green oriole
#

I don't understand your suggestion @late wolf

late wolf
#

Wait leme check what scaleios was saying

green oriole
#

Those two ifs are doing two different stuff

short snow
#

@gritty wind can i start working on connect 4 pr now?

late wolf
green oriole
#

Ai'ght, can you add a new comment to the PR?

#

Thank you

late wolf
#

Doing review in githubs are hard,
they don't show the entire thing,
you have to go the bottom of the page to scroll sidways (for me at least)
i don't like its plus minus thingy, it confuses me

gritty wind
#

Yeah lol, try checking if your editor/IDE has any review tools

short snow
#

i use pycharm to see the file, and keep github open on side

#

but now, i have got used to github, not much of a problem

gritty wind
#

Pycharm should be able to show you a diff like github, and allows you to interact directly with the PR, so I usually use it for reviews

#

I was trying to get you the review guide, but I need to dig for that a bit more

short snow
#

pycharm proffesional has

gritty wind
#

Ah ok

rapid swallow
#

i don't like its plus minus thingy, it confuses me
@late wolf it's pretty nifty at showing what actually changed

#

to view the changes side by side

short snow
green oriole
#

What do you mean by ai ?

gritty wind
#

Yeah the issue lists it as optional

short snow
#

in the connect 4 issue

#

ok thanks, will start working on it

green oriole
#

Oh, this AI

gritty wind
#

Hmm, I'm still waiting on a reply on whether its okay to assign you

#

I uhh... really have no clue lol

short snow
#

ok

late wolf
#

I don't get the logic behind lock decorater, 😕

gritty wind
#

I've worked with it a bit for one of my PRs, any specific questions?

late wolf
#

what does it do and how does it work?

short snow
#

my sir-lancebot fork didn't show up on devlog

patent pivot
#

we might have them disabled

short snow
#

but why enabled for bot, and not sir lance?

green oriole
#

Because we are the masters of consistency

patent pivot
#

lol

#

enabled

gritty wind
#

For example, if we had a command to rename a channel, and a user typed:

#

!rename A
!renamd B

#

Shh bot

#

You’d expect the bot to first rename to A, then switch to B

late wolf
gritty wind
#

To guarantee that order you might lock the channel so the command only runs once at a time

#

Well a resource is pretty vague

#

In the example, it was a channel

#

But as long as the lock can look at the new request and compare it to the locked item

late wolf
gritty wind
#

Then it can be locked

#

Right so

#

You would typically hear about locking in multi synchronous operations

short snow
#

so it basically makes it not run parrallel, and one by one?

gritty wind
gritty wind
short snow
#

ok cool

late wolf
#

oooh

gritty wind
#

But basically, it ensures that an object can only be used if the function has the lock, otherwise the object can not be modified

#

If you want to compare it to real life, well, imagine a lockable door that only has one key. If you only have one key, then only one person at a time (the key holder) can unlock the door and enter

short snow
#

thanks, understood it pretty well now.

short snow
#

#bot-commands message

late wolf
#

Hey guys we have this issue with !raw#bot-commands message

short snow
#

RuntimeError: Line exceeds maximum page size 1992

green oriole
#

Yep yep, we got a sentry issue

hardy gorge
#

You could also say that the line paginator should be robust against such input

#

Instead of patching every function that tries to use the paginator one by one

green oriole
#

Right, that's on the paginator

#

Updated the issue

vale ibex
#

Only 1 available help channel, is the bot having issues?

gritty wind
#

Yeah the bot desyncs every now and then

#

It requires a reload

vale ibex
#

ahh makes sense, just the cog reload?

#

or the whole bot?

gritty wind
#

At this point we should just have the reloads automatically scheduled lol

#

Just a cog reload

green oriole
#

!ext reload help_channels

stable mountainBOT
#

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

green oriole
#

I wonder why that keeps happening

gritty wind
#

Thanks :D

vale ibex
#

I haven't found the time to setup a test server for the main bot, I'd be interested in investigating that though

gritty wind
#

Do we have an open issue for it? Maybe we should

green oriole
#

Not sure

#

I don't see anything in the logs too

vale ibex
#

Would a script to setup a blank server to one compatible with the main bot, and save all of the relevant IDs locally be something worth considering?

short snow
#

smart config is being made for that purpose

vale ibex
#

ahh oki, cool 😄

vocal wolf
#

@gritty wind Yep, very much a stale PR. Since it's so old it would probably be best to make a new PR.

#

At the same time there's still a lot of stuff that needs to be resolved

#

We'll just continue where it left off

#

@short snow I've assigned you and reopened the PR.

#

Make sure that you fix up everything from Shira's comments.

short snow
#

Ok thanks 😄

short snow
#

Ok am probably done with it, so do i need to call someone to my test server to test the bot?

patent pivot
#

We test it on our own test server. You submit the code and we test the functionality.

short snow
#

oh ok

patent pivot
#

Make sure you include things that'd help with that. For example, screenshots & command example never go amiss

short snow
#

one more thing,i will open a new pr right?

#

ok

patent pivot
#

yep

short snow
#

since i was working on a pr, which was left of by the original person

patent pivot
#

hmmmm

#

best to open a new PR yeah

#

and say it replaces an old one

short snow
#

ok

#

when i did lint, i got issues in file which i haven't worked on

#
bot/exts/evergreen/branding.py:3:1: F401 'json' imported but unused
bot/exts/evergreen/branding.py:21:3: T000 Todo note found.
bot/exts/halloween/hacktoberstats.py:16:3: T000 Todo note found.
bot/exts/halloween/hacktoberstats.py:44:26: F821 undefined name 'make_persistent'
bot/exts/halloween/candy_collection.py:13:3: T000 Todo note found.
bot/exts/halloween/candy_collection.py:42:26: F821 undefined name 'make_persistent'
patent pivot
#

hmmmm

#

that's wayyyy behind

#

we ditched make_persistent ages ago

cold island
#

hmm.. you were working on an stale pr? did you update the branch?

short snow
#

somethig wrong happened

#

i guess i made the new branch from gurkan branch

cold island
#

the gurkancount branch?

short snow
#

yeah, idk how

#

shld i close that pr and open new? or?

#

just remove those files

#

and stash them?

cold island
#

you can technically fix that... but if you just opened the pr it might be simpler to just open a new one. Do you know how to transfer your changes to a new branch?

short snow
#

coool, correct now

short snow
#

is logcord for viewing logs on the web?

gritty bolt
#

Is there a way of checking how efficient a function is? I know there is a timer module that can see how fast it runs in one use. If I want to automatically process it like a 10000 times and see the average, is there an easy way to do it or do I have to do it manually?

short snow
#

just run it in a for loop

#

and time it

gritty bolt
#

Is there a module that does it for you?

#

Like I can attach a decorator and it processes it a 100 hundred times fo rme

short snow
#

not that i know of

#

just make a decorator

#

i have it somewhere

#

one minute

tawdry vapor
#

Is this question related to our projects somehow?

short snow
#

ig for their love poem gen

gritty bolt
tawdry vapor
#

Yes, there is a module

#

It's called timeit

short snow
#

cuz, u said it was taking a lot of time

gritty bolt
#

I am working on a cog and it takes a while for certain stuff, so I need to be as efficient as I can

short snow
#
import timeit

def timer(function):
  def new_function():
    start_time = timeit.default_timer()
    function()
    elapsed = timeit.default_timer() - start_time
    print('Function "{name}" took {time} seconds to complete.'.format(name=function.__name__, time=elapsed))
  return new_function()
#

here

tawdry vapor
#

It only measures time performance, not memory or other resources

gritty bolt
#

So I need a good way of testing efficiency for the purposes of sir lance bot

sullen phoenix
short snow
#

message logs, or mod logs?

sullen phoenix
#

message logs

#

for use with our antispam filters and a !relay command coming in the future

short snow
#

what advantages would that give?

#

like what is the use of message logs?

#

won't they just take a shit lot of space

#

can anyone link the code review guide of hemlock?

gritty wind
short snow
#

thankyou, can u have a look at my pr when you are free 😄

gritty wind
#

Might not be till later today, but sure

short snow
#

#bot-commands message

#

problem

#

@gritty wind

gritty wind
#

What's the problem?

short snow
#

i can do !branding

#

set apply

#

and etc.

gritty wind
#

cc @cold moon you were working on the branding manger recenetly

#

Alright its a problem in the usage of the in_whitelist deco (cc @tawdry vapor @hardy gorge). Because the redirect was automatically set to the bot commands channel, we were able to bypass the role checks in there

#

!branding

stable mountainBOT
#

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

gritty wind
#

We can't use it here, or anywhere else

#

The most obvious fix is to set redirect to None, though maybe something should be added to the decorator docs?

#

Though a has any role built-in deco would've worked better in this context

late wolf
#

Huh, shouldn't helpers be able to use it in every channel?

gritty wind
#

Its mods+

late wolf
#

oh i see, what's that command meant for?

gritty wind
#

KS has gone ahead and addressed it

#

The branding is the server logo

late wolf
#

right, but what does that command do

gritty wind
#

(and the image at the top of the channel list I think)

#

It changes them, and controls the automatic cycling

#

If you hover over the server logo everyday, you'd see a different animation

late wolf
#

oh that's very cool

short snow
#

we can close this:

#

.issue 365

dusky shoreBOT
short snow
#

it is being mentioned in :

#

.issue 560

dusky shoreBOT
gritty wind
#

Oh did you decide to abandon the other PR?

short snow
#

i can't mention/change anything in it

#

and joe told to open a new one

gritty wind
#

Hmm did you use code from the old PR?

short snow
#

yeah

gritty wind
#

Alright

short snow
#

thankyou

gritty wind
#

If you mention the issue number in your PR, it'll automatically link to it

#

So something like:
closes #<number>

#

You can still edit your post to add it

short snow
#

ok one minute

#

done

gritty wind
#

Thanks

short snow
#

can we add command suggestions if the commandnotfound error comes to seasonal bot too?

gritty wind
#

Hmm do we have an open issue for command suggestions on lancebot?

#

If not, could you open one

short snow
#

alright

cold island
short snow
#

ok

#

in class, will open the issue once finished, mentioning that

gritty bolt
#

Is there anyone here familiar with async? I am working on the valentines poem generator and one of the feedback in the past is to have an async_timeout as a fail-safe measure in case the bot freezes or takes too long. I think some blocking functions are being ran even after the timeout though, but I am not too sure how to fix, can someone help me out?
https://github.com/melodicht/sir-lancebot/tree/markov-poem-gen

short snow
#

you can see the battleshpi cog, the last part

#

where it asks users for a reaction to join

gritty bolt
#

Oh yeah I see that, but the use of async_timeout in mine is a bit different

gritty wind
#

@short snow I left a review on your PR. Don't get discouraged by the amount of feedback, its a good PR

short snow
#

yeah scaleios, am working on that

gritty wind
#

I'm just a little picky :D

#

No worries, I'll give it another look when you're ready

short snow
#

🚫 adds this, so that when this is clicked, it will end the game

gritty wind
#

Yeah that seems reasonable

short snow
#

if the user who those that is the orignal guy

gritty wind
#

Possibly the original user, and the second player

short snow
patent pivot
#

it's not too weird

#

it's trying to connect to redis

#

but it can't find redis

#

@short snow you need to enable fakeredis

short snow
#

in seasonal bot too?

patent pivot
#

yes

#

for sir-lancebot it's an env var

#

USE_FAKEREDIS should be set to true

short snow
#

okh

short snow
#

@gritty wind , when i did what u said this happened (thanks to numerior for letting me know of it)

#
In [1]: a = [[]]*3

In [2]: a[0].append(1)

In [3]: a
Out[3]: [[1], [1], [1]]

In [4]: id(a[0]), id(a[1])
Out[4]: (2199257602112, 2199257602112)
#

ah wait, on enter, a new issue got formed

#

lemme edit it

short snow
#

#bot-commands message error

#
ConversionError: (<class 'bot.converters.Duration'>, OverflowError('Python int too large to convert to C int'))
short snow
#

it is probably because of lowercase letters

#

i.e.
me: A2
bot: ok

me: b3
bot: not ok

gritty wind
short snow
#

in the tic tac toe command ks123 did, can we use gurks/lemons/snakes instead of x and o?

#

lemon: 🍋

gurks: 🥒

snakes: 🐍

#

it would randomly choose any two ig

balmy sparrow
gritty wind
#

If you use the tempelate, everything on discord is good to go

#

All you have to do is copy the IDs and add them to the bot config

#

The categories listed correspond to the ones in the config file that need to be filled for it to work

#

The only things not covered by the template are emojis

balmy sparrow
#

Are the emojis necessary?

gritty wind
#

Some commands do require them yes

#

for example the line propagater requires the trashcan

balmy sparrow
#

Also, is the template pinned in this channel the same as the one on the site? I made a server with the one pinned here

balmy sparrow
gritty wind
#

The template here and there are the same, yeah

balmy sparrow
#

Okay cool

#

Generally how long does it take to get a response, after making an issue on the repo?

gritty wind
#

Triage is usually pretty quick (things like basic labels and whatnot), but to go from a concept through discussion, to an approved idea might take a couple of days

#

Bugs are usually quicker

balmy sparrow
#

Alright, sounds good. Thanks!

gritty wind
#

Feel free to drop a link here if you think the issue needs attention quickly

balmy sparrow
#

No it isn't really urgent

#

I just wanted to be able to work on it in case it gets approved

#

I'll just see if there's something else I can do

gritty wind
#

Are you looking at the sir-lancebot or bot repo?

balmy sparrow
late wolf
balmy sparrow
#

Manually add the emoji and then change the ID in the file i assume

gritty wind
#

You add them to the server, then add the emoji ID to the file

#

Yeah, that

balmy sparrow
#

Will I need the webhooks?

late wolf
#

right but to add them we actually need the emoji picture, where do we get that?

gritty wind
#

Hmm you might need them for some features, but everything you need to start the bot in general is listed in the getting started guide

#

You can add any emoji

late wolf
#

ooh

gritty wind
#

For my test server, I just added random emojis off the internet

late wolf
#

right

green oriole
#

There ya go

balmy sparrow
#

Thanks :)

balmy sparrow
#

what part of the URL are we supposed to add?

gritty wind
#

In that case

#

The ID apparently

green oriole
#

Oh wait, no, the first number

gritty wind
#

I'm using the first part, the number, and it seems to work as expected

balmy sparrow
#

Wait a minute though, the url is of the form

stable mountainBOT
#

@gritty wind, looks like you posted a Discord webhook URL. Therefore, your message has been removed. Your webhook may have been compromised so please re-create the webhook immediately. If you believe this was mistake, please let us know.

#

@green oriole, looks like you posted a Discord webhook URL. Therefore, your message has been removed. Your webhook may have been compromised so please re-create the webhook immediately. If you believe this was mistake, please let us know.

balmy sparrow
#

lmao

gritty wind
#

Oh really

balmy sparrow
#

i was about to do that as well

gritty wind
green oriole
#

I mean, I redacted the secret part haha

gritty wind
#

it just matched the webhooks/ part lol

balmy sparrow
#

isn't the first number just the guild ID?

gritty wind
#

its the hook id

#

only two bits stored in the link, the specific hook id, and the token

balmy sparrow
#

oh right

gritty wind
#

I assume you might be able to extract the guild ID or something out of the hook ID, but I've never looked into their generation

balmy sparrow
#

This is taking longer than I expected 😅

#

Once I do this for the bot, will I have to make a different setup for lancebot?

#

Or can I copy my config file on there

gritty wind
#

Sir lancebot only requires a couple variables

#

I don't think we even use the same config for lancebot

#

we just edit the constants file directly

#

Not that you need to, all that needs to be added is the commands channel from the server you created

#

the bot token

#

(added to the env file so you don't accidentally commit)

balmy sparrow
#

Oh right

gritty wind
#

I think I personally set a large portion of the environment variables, but that's only to allow me to work on most features

#

And if you follow the full environment variables link you can see all the other ones you can set

balmy sparrow
#

Oh, thank you :D

#

What's the BOT_SENTRY_DSN?

gritty wind
#

Sentry is the issue monitor we use for our projects

#

You can leave it empty

balmy sparrow
#

So the token is all I'd need in there really

gritty wind
#

Token and CHANNEL_COMMUNITY_BOT_COMMANDS otherwise it will keep telling you are using the wrong channel

balmy sparrow
#

Oh, why isn't that listed on the site?

balmy sparrow
gritty wind
balmy sparrow
#

Sweet, I've got the bot set up. Thanks @gritty wind!

gritty wind
#

I'm sorry if it was difficult to get it working, @green oriole is working on a project to streamline setup in the future

#

Glad its done now :D

green oriole
#

Yep yep

balmy sparrow
#

I haven't used docker before so I might come here asking amateur questions 😅

gritty wind
#

Docker can be a little overwhelming (especially on windows and mac), so feel free to ask if it gives you any trouble

balmy sparrow
#

Also, what exactly is precommit? And do I only have to run pipenv run precommit once now?

green oriole
#

Yep, and it will automatically lint your code before allowing you to commit

gritty wind
#

pre-commit, at least in git, are hooks (processes) that run before a commit is made

#

Here we use it to enforce things like code style

#

(And other things listed in the precommit.yml file)

balmy sparrow
#

Oh right right

short snow
gritty wind
#

The chance of not actually making the stated play is general behavior

#

The comment "10% chance to not place" should be included in the docstring, so you don't have to view the function to know its behavior

gritty bolt
#

How long does it take for a PR to get reviewed and pushed? I am currently working on the love poem generator cog and I hope that it gets ready before Valentines day

#

Just asking so that I can plan my deadlines

gritty wind
#

Well, as everyone who contributes is a volunteer

#

There is no guarantee anyone will review your PR quickly

#

Though if its for an upcoming event, it'll usually be handled pretty fast

#

How long to go from a review to a merge will depend on your code quality though

gritty bolt
#

Considering that an event is upcoming

gritty wind
#

How large do you think this PR will be?

gritty bolt
#

I can show you the link now. It's almost done, just need to fix some bugs

gritty wind
#

It seems most of the PR is from the pre-generated poems, so two weeks should be more than enough

gritty bolt
#

Okay, perfect

gritty wind
#

But, the earlier you submit, the better the feedback you'll get will be, and the more time you'll have to update

gritty bolt
#

Ah alright, I will get it done ASAP then

gritty wind
#

No worries, take your time

#

(Also just from a quick look through, you need to version lock dependencies you add. You can do so by following the format used in the pipfile)

gritty bolt
#

Is it just pipenv lock?

gritty wind
#

That updates the lock file, but you have to actually write out the version in the pipfile

#

For instance, if you are using the latest version:
For instance: markovify = "~=0.8.3"

gritty bolt
#

Oh I see

gritty wind
#

You can see in the other dependencies:
PyYAML = "~=5.3.1"

#

After that is updated, you can relock yeah

gritty bolt
#

Alright, thanks, I will do that

balmy sparrow
#

i'm getting an odd pipenv error - the path it says is an old version of python that has since been deleted

#

i uninstalled and reinstalled pipenv, the error persists

gritty wind
#

Well, our projects run on 3.8/3.9 so you should try to update either way

#

but that's a weird error hmm

balmy sparrow
#

i run 3.8 3.7.9, I'll update

hardy gorge
#

Did you recreate the local environment with the correct version of Python?

#

Could you show more of the error?

balmy sparrow
#

For some reason I can't copy paste from the command prompt, let me just try again

short snow
#

look for Python351 in regedit (win+r , regedit)
and delete the entries (their content)

#

or try

#

pip3.8 install pipenv==2020.11.15

#

(from issues in pypa/pipenv repo)

balmy sparrow
short snow
#

hmm, dunno am on linux, try going to their repo or google your error and the first result is that issue

gritty wind
#

Installing with your base python3 may work better than the anaconda install

short snow
balmy sparrow
#

how should i be setting pipenv? maybe i've missed some step

short snow
balmy sparrow
#

using vsc right now, installed pipenv

daring peak
#

when does the sir lancebot get updated

#

I created a pull request and it got accepted. but i dont see the change

#

when I use the bot in this server

#

oh wait nvm,

#

it just passed the tests

hardy gorge
#

The bot will redeploy automatically when the master branch receives new commits

#

In this case, after your PR has been merged

balmy sparrow
gritty wind
#

This might mean pipenv is not installed on your global 3.8

hardy gorge
#

Or if you did not configure your PATH variable to include the script directory

#

If you have it installed, but it's not showing up automatically, you could try to locate it manually by clicking on that folder icon

#

The exact location depends on how you installed Python and the package, though

#

Scripts from User installs typically end up in %userdir%\AppData\Roaming\Python\python38\Scripts I think, but it probably depends on how you installed Python

#

I don't use Windows often

late wolf
gritty wind
hardy gorge
#

A "push" event to master triggers a GitHub Actions workflow that first lints/tests (just like with a PR), then builds the docker container and pushes it to GHCR (GitHub container registry), and then triggers a redeploy

gritty wind
#

It builds a docker image, and sends the redeployment command to the k8s cluster

late wolf
#

the bot also runs on k8s?

hardy gorge
#

Our entire back-end runs on kubernetes

gritty wind
#

I think a good portion of our projects do

#

Yeah

hardy gorge
#

It would be quite difficult to only run a small portion on kubernetes. I mean, you can do it, but it kinda defeats the purpose of having the cluster.

patent pivot
daring peak
#

new version of graph?

patent pivot
#

just the one from the last hour

daring peak
#

wokay

brazen charm
patent pivot
#

ooo missed that

#

so are we storing the data on our nodes or temporarily?

#

ah right

#

redis

#

hmmmmmm

#

yeah, I'm fine with it providing we have a clear up task

brazen charm
#

The first thing to know would be if it is a wanted feature, but wasn't sure on the privacy as it goes to permanent storage

patent pivot
#

privacy wise it's all fine as long as reasonable measures are taken to remove the data (e.g. clearing after an hour (TTL would make this nicer and then the burden is on redis, but I don't know how hook into async-rediscache is to TTLs)).

feature wise I think it's nice but I agree with Mark that the use we'd see would probably be low, it's not something we've received frequent complaint about

balmy sparrow
#

How do I run precommit now? When I try, I think it is checking for pipenv inside this environment

short snow
#
#  install the development dependencies.
pipenv sync --dev

# This will install the pre-commit hooks.
pipenv run precommit

# initialize them.
pipenv run pre-commit run --all-files

# Run the bot
pipenv run start```
gritty wind
#

Try not creating an environment for the project, that might be what's throwing it off

#

pipenv creates its own environment

#

to get out of an active environment, type decativate

short snow
#

but then u won't be able to pipenv lock or pipenv sync the file

#

if u update the dependencies

gritty wind
#

?

#

I'm not sure I follow

short snow
#

if we update the depdendicies, are not into the virtual enviornment, will we able to lock the pipfiles?

gritty wind
#

If you run pipenv install depend it'll automatically get added to the pipfile

#

if you add it manually to the pipfile, it'll work as expected

#

Pipenv automatically handles your virtual env for you