#dev-contrib

1 messages Β· Page 36 of 1

gusty sonnet
#

Perhaps you meant py self.queue_consumption_tasks[message.channel.id] = ...?

#

Ah I see now, inside the self._process_deletion_context you are checking the other dictionary, that's why it did not crash

green oriole
#

So we can still use the delay, but we need to delete the messages after we upload the context

hardy gorge
#

No, I don't think that's right for the antispam filter

#

It should not wait 10 seconds to delete the messages after triggering, but it should take action as soon as possible

#

However, since you are going to relay the attachments (right?), that's something that could happen earlier

#

@gusty sonnet That does look like a mistake, yeah

#

I'm not sure why it's there or what it is doing, I think I wanted to save a reference to the task, but there's no code to remove it once it's processed either

#

The DeletionContext tracks the messages that should be deleted

#

The add method of that class seems like a good place to relay the attachments and save the links to those

#

That happens before the messages are deleted

green oriole
#

Okay i’m going to change it as soon as possible

glass pecan
#

thank you

#

it's appreciated

#

will read it through properly when i get the chance

glass pecan
#

it only requires one more review and it can be merged

brazen charm
#

noticed the constants are a bit messy, should I group them in some way or order them?

glass pecan
#

up to you

#

if you think it's able to be improved, you're welcome to throw in another commit

#

ping me if you do, as i've now approved a review so the change would be best to be rechecked.

#

looks fine

glass pecan
#

30 commits blobsweats

hardy gorge
glass pecan
#

i look so sad down there

green oriole
#

That only count commits to master? yes it does

crude gyro
#

wait @hardy gorge what's this now

glass pecan
#

commit contributions on bot master

crude gyro
#

in what time period?

green oriole
#

For the month

crude gyro
#

aha

#

I don't remember having committed anything this month

#

I thought I only did duck pond

hardy gorge
#

Yeah, not alltime

crude gyro
#

but that's not merged

glass pecan
#

maybe a suggested edit

crude gyro
#

no, not 12 suggested edits

green oriole
#

But there was only 2 commits in it

glass pecan
#

13 commits are hiding somewhere lol

#

branch merges count

crude gyro
#

aha

#

that makes sense.

#

that PR is from October, @green oriole

green oriole
#

Oh yeah

hardy gorge
#

It's not this month, but about a month of time (30-31 days depending on the month and ignoring February, like any programmer should)

#

@green oriole I'm looking at it

brazen charm
#

scargly is on fire today

hardy gorge
#

@green oriole I think the only thing I'm missing is that you don't test the GET method (or I'm overlooking it)

#

I see tests for creation (including validation), deletion, and not allowing update methods

green oriole
#

Hmm yeah I may have missed it

#

It is half tested in the deletion test but doesn't have a proper test

hardy gorge
#

It's probably better for that test not to rely on the GET, but rather to check the database directly

green oriole
#

Well I copied the test process from another test suite

hardy gorge
#

You could do an assertFalse with OffensiveMessage.objects.filter(id=id).exists()

#

Hmm, I'm just thinking about making these tests fully independent

green oriole
#

Yeah that's logic

hardy gorge
#

In principle, we could go for an API design in which we don't allow someone to get a list using GET, but still allow DELETE (and maybe individual GET lookups based on pk)

#

Not likely here

#

but just for the general pattern

green oriole
#

That's crazy the amount of code redundancy we have in the test suites

#

I wonder if there is a way to make reusable tests

#

Anyway I'm going to fix those two things as soon as I'm on my computer

hardy gorge
#

Some tests can be shortened, yeah, but it's quite a project

#

Anyway, there's also a value in keeping testing logic simple; the more complex you make it, the easier it is for a test not to actually test what you're trying to test

#

That said, a lot of tests are "this specific payload for this endpoint", execute, "check if I get the specific response for this endpoint"

crude gyro
#

+1 for keeping tests simple. they should be readable and intuitively understood, much more abstraction might hurt that.

#

something that isn't always understood is that tests can serve other functions than just preventing breaking changes from being introduced. A good test should serve as a showcase for how to interact with the implementation it is testing, and what the expected response is for each component. If the tests were written by the author of the code, the tests may even serve as a window into the authors intentions.

#

this can be a really powerful way to quickly understand complex moving parts in a system.

#

so it is imperative that we keep the tests readable.

glass pecan
#

also because my eyes glaze over if i have to force myself to be acquainted with unreadable code and that's super hard to push through
pls don't do this to me

#

wew, ok i went through all issues

woeful thorn
#

only 6 more to go!

#

πŸ˜„

glass pecan
#

repos?

#

lol

#

gotta do PRs first

#

thankfully there's only a bit over a dozen of them

woeful thorn
glass pecan
#

that is one very strange picture

#

i'd expect it to be more like a giant man-wombat with the power of sending magpies to swoop people

woeful thorn
#

He should at least have a pouch

glass pecan
#

or be poisonous and venomous

stable mountainBOT
mellow hare
#

That feels cryptic

mellow hare
#

That's less exciting than like

#

A secret code

#

Or number of days to live

tawdry vapor
#

my bank pin

green oriole
#

So guys have you checked out the nondocker guide i’ve written? There is probably some things that could be improved

#

So we can quickly get in on the site

glass pecan
#

not yet, i've been busy actioning the labels task first

#

once it's done i'll turn to it

green oriole
#

Okay nice

#

i would also love to hear what non staff people think about it, so if you want to check it, it is in the pins πŸ˜„

molten bough
#

so it turns out users with numeric usernames make it impossible for me to mention some users by ID in #592000283102674944 when I'm using the actual Discord client

#

If user event stuff is gonna be integrated into the pydis systems, then I think that'd help, but I dunno what else to do really

#

Figured out a stopgap for now anyway

austere veldt
#

Hi I am trying to design the UI for the whitelisting task. I am clear about the listing operation. But for the edit operation I have a doubt. Is it possible to make a command like !whitelist edit channels add 1233445? This will add 1233445 to channel whitelist or !whitelist edit channels remove 1233445 will remove 1233445 from channels whitelist

#

I saw the edit operations for !tags command. But In that case we are overriding the list of tags.

hardy gorge
#

What you could do is have !whitelist channels list the channels whitelist and have !whitelist channels add and !whitelist channel remove as mutation subcommands

#

or is channels a dynamic name?

austere veldt
#

yes

#

it can be roles or something else as well

hardy gorge
#

I wouldn't be opposed to !whitelist add <type> <item> and !whitelist remove <type> <item>

#

That will keep the commands shorter

austere veldt
#

we can not add a new type with the command. Only the existing types whitelists can be modified. Still, I think this looks good.

hardy gorge
#

No, not to add a type, just to be able to specify which type you're adding an item to

austere veldt
#

Cool!

#

I also need some direction regarding the model design for the whitelisting table. My plan is to have a model like this

class Whitelist(ModelReprMixin, models.Model):
    """Whitelisted items for a type."""
    GUILD_INVITE = "guild invite"
    FILE_EXTENSION = "file extension"
    CHANNEL = "channel"
    ROLE = "role"
    TYPE_CHOICES = (
        ("guild_invite", GUILD_INVITE),
        ("file_extension", FILE_EXTENSION),
        ("channel", CHANNEL),
        ("role", ROLE)
    )
    type = models.CharField(
        choices=TYPE_CHOICES,
        max_length=100,
        help_text=(
            "Type for which the whitelist is stored."
        ),
        primary_key=True
    )
    whitelisted_items = pgfields.ArrayField(
        models.CharField(max_length=200),
        help_text=(
            "List of items to be whitelisted."
        )
    )

    def __str__(self):
        """Returns the type of this whitelist, for display purposes."""
        return self.type
#

what are your thoughts on this?

hardy gorge
#

I like it. It would make it fairly easy to extend it in the future.

austere veldt
#

Yup

#

Will this !whitelist add <type> <item> allow to have type with spaces in them?

hardy gorge
#

It does, but not easily: It would require quotes around the name

austere veldt
#

okay, So think it's better to keep the types snake cased

hardy gorge
#

I think invites or invite is enough to know what we're talking about when it comes to guild invites for instance

austere veldt
#

Yeah! I think we can go with the single words. Thanks!

green oriole
#

(the new labels colors are way better than the old ones)

green oriole
brazen charm
tawdry vapor
#

No, I don't think it's really worth it. It'd have to be fetch so that means making an API call.

#

The code would get a bit complex too to handle potential exceptions

brazen charm
#

I've searched and asked around, is there other way to get it?

tawdry vapor
#

Just don't show a nick for the proxy user

brazen charm
#

yeah but the normal objects are Users too and you can't get nicks from there neither as far as I can tell

#

there's display_name but that returned the user name too

tawdry vapor
#

You can show their username then

#

Without the discrim is probably better

brazen charm
#

alright

tawdry vapor
#

There was another pr that got closed related to this

#

I suggested using fetch but it got complicated like I said

#

Then realised the api can return user info since we sync that to the db

#

So for the infraction search you could make it always display the nickname by using the api

#

But you don't have to if you don't want to

brazen charm
#

I'll look into it

tawdry vapor
#

You should read the pr then for more infi

#

I'm on mobile though can't link

brazen charm
#

got the issue to get my feet wet around the moderation stuff so won't hurt to look at the other things with it too

brazen charm
#

@tawdry vapor actually, it looks like only the scheduler gets User objects and management + superstarify get Members with management fetching them from the guild. Should I be consistent or do usernames in one and nicks in the others?

tawdry vapor
#

Get the nickname where available (without using fetch_member). Otherwise, fall back to the username (without discriminator). If neither available, just don't show anything extra.

#

I don't think consistently really matters since their nick/username should not be used to actually refer to the users - that's what the ID is for. It's just there to quickly identify who someone is, particularly in the case of the mention "failing" due to the user not being in the client's cache.

#

That's only my view of it though.

#

Maybe someone else thinks it's worth doing an API call to get user info.

#

But considering we've gotten by fine without that so far, it doesn't seem necessary to me.

brazen charm
#

Thanks, if there are different views there are also multiple reviewers so it can be caught there

tawdry vapor
#

Yeah but ideally it should be decided before you go and implement something. You can do it now but you may end up changing it, so up to you. In retrospect, I admit the issue I posted wasn't fully fleshed out with details.

brazen charm
#

the method in the scheduler have union of Member and User hinted for the user, although I haven't seen a member so far when trying a few command is it worth checking if it's an instance of member and then using nick? (if you know when it gets the member by chance)

tawdry vapor
#

Sorry, which method are you referring to?

brazen charm
#

apply_infraction in InfractionScheduler for example

tawdry vapor
#

Yeah, you should. It's meant to be kind of general purpose and it's not a lot of code to check for that

#

I think you should check for the nick attribute instead of checking the type

brazen charm
#

oh, I see, sorry for taking up so much time with this but at line 112 in the scheduler the user is redefined for the case where the user is a ProxyUser but that also redefines it when the user is a Member which I don't think make a whole lot of sense and results in the nick being unavailable even though it's passes as an arg to the command. Assume that's not the indented behaviour?

tawdry vapor
#

You could say that. More like it wasn't a consideration when it was written so it didn't matter if the object was overwritten for what the code was trying to accomplish at the time.

brazen charm
#

should it be rewritten now to get that functionality back?

tawdry vapor
#

Sure

#

I think all you need to do is check the current user type instead of always assuming the user needs to be fetched

brazen charm
#

yeah, will also take some unecessary load off of the api

brazen charm
#

with regard to the comment linked above, does the api keep the nicknames of the users? Haven't found anything apart from the username

molten bough
#

Check the User model under the API app

#

That's what it's using

brazen charm
#

only the name is there afaik but to make sure I'm not missing anything because the comment suggests it does exist

hollow lichen
#

yes, the website does track the nicknames

brazen charm
#

Where are they kept? Haven't had much luck finding it

austere veldt
molten bough
#

It doesn't seem to track the nick

#

@austere veldt You have a file that isn't fully covered by your unit tests

#

pydis_site/apps/api/models/bot/whitelist.py

#

That file

brazen charm
#

the str of the class defined there

molten bough
#

I don't see any nickname storage, yeah

#

Just looks like username

austere veldt
#

Thanks @brazen charm and @molten bough

molten bough
#

If you're working with the login system.. Hm, no, that won't give you the nickname either

austere veldt
#

When I am running the tests locally. I don't get that error

molten bough
#

Run it with coverage enabled

austere veldt
#

@brazen charm You are talking about the __str__ of the Whitelist model?

molten bough
#

Some IDEs will also be able to run the tests with coverage for you and show which lines aren't covered

#

PyCharm can do that for example, though it may be a pro feature

brazen charm
#

yes the line 35

#

@tawdry vapor Should the member and the nick be fetched from the discord api for the search then when they're not kept in the server's api?

austere veldt
#

@molten bough I have the pycharm pro, How do I run the test using that?

molten bough
#

It's in the top toolbar (turn it on in the view menu if you haven't), near the run/debug buttons

austere veldt
#

@brazen charm How do I add test for that? And I am confused, as I haven't test case for the entire model, then why it just throws error for the str method?

tawdry vapor
#

@brazen charm Yes. Alternative would be to change the endpoint to support saving nicknames but that's more work since it would also involve having to use the bot as a one-off to fetch the member for all existing users in the db.

brazen charm
#

That's a bit beyond what I can achieve for now πŸ˜„

tawdry vapor
#

Maybe I'll get around to that eventually

#

There's no reason the syncer can't handle that

brazen charm
#

oh, also wanted to ask; what are the # region: name # endregion for?

glass pecan
#

they allow collapsing in editors

#

if you define a region, a small - icon shows near the line number

#

it'll auto collapse the entire defined region

brazen charm
#

oooh didn't notice that

#

thanks

molten bough
#

Yup, super handy

#

They're known as code folding regions

brazen charm
#

I hardly collapse for some reason

#

just scrolling around like mad

molten bough
#

Folding is reeeeally useful

brazen charm
#

how are the infraction searches used? Wondering if it'd be worth to keep some sort of short timed cache around the fetching

glass pecan
#

it's not really worth it, no

#

only the bot interacts with it so it's not like we're dealing with lots of traffic, and we want the data to be up to date

tawdry vapor
#

By the way you can still use the expanded api to get the username if fetch_member fails

brazen charm
#

Looking at the search_user using the UserConverter ([discord.User, ProxyUser]), can that even get to a ProxyUser when the user is fetched from the discord api before it reaches that?

glass pecan
#

discord.User doesn't fetch from the api

#

discord.User fetches still from cache but global

#

it's almost useless to our bot though

brazen charm
#

it gets passed to InfractionSearchQuery before it reaches that method

#

which does a fetch user

#

and has a wrong typehint

glass pecan
#

i don't follow what you mean

#

can you show the code area you're working on

brazen charm
#

when you do an infraction search, it triggers the search command at L163 in management.py

glass pecan
#

give me a minute. i'll open github in a second then

#

but it sounds like it's just reusing a generic union converter that's used fine elsewhere

#

okay, so you're talking about the subcommand being invoked via the parent group

brazen charm
#

the search triggers search_user if the query got converted to an User, so it shouldn't then need a converter for a ProxyUser typehinted in it

glass pecan
#

when the group is invoked instead of the specific child search commands, it will fetch

#

but the InfractionSearchQuery isn't used for the child commands alone

#

search_user when used directly (!infr search user) will use proxy_user still

#

it's rare to occur, but for example if someone is given a note before joining the server

#

tbh i don't even like the usage of fetch_user here in the InfractionSearchQuery either

#

oh well

brazen charm
#

oh right, thanks so it's kina a roundabout check through the proxyuser

glass pecan
#

it's only for checking if the given string matches a valid discord user id so it knows to search via infr search user

#

since id's don't have information about the type of object they're created for, that's one of the most simple methods to do so

brazen charm
#

I was thinking about implementing the nick fetching that was talked above by adding member fetching into the InfractionSearchQuery and then checking instances and creating a passable nick from that in the commands

glass pecan
#

i'm not really up to speed on what you're working on atm

brazen charm
#

showing the user's nick when you search infractions

glass pecan
#

give me 10 minutes

#

i'm half way through writing something

brazen charm
#

and trying to find a nicer implementation

#

oh no problem, least I found is that wrong typehint πŸ˜„

glass pecan
#

it's not really wrong though

#

it's only useless in the case the parent command invokes it

brazen charm
#

meant the one in InfractionSearchQuery's convert that fetches Users but has a Member hinted

glass pecan
#

yes that would be correct, that it's inaccurate

#

it should be discord.User

brazen charm
#

thanks for clearing up the above for me

glass pecan
#

no probs. sorry for taking a bit to get up to speed

#

adding member fetching into the InfractionSearchQuery

#

this sounds fine

#

in which case if you add it, the return hint would need to still add discord.User but discord.Member can stay

#

wheres this nickname going to show anyway

brazen charm
#

yep, just when the subcommands are executed directly. Not sure if it's the best way to add that to the converter Union or some other way

glass pecan
#

the subcommand doesn't need anything different

#

the InfractionSearchQuery does

#

oh the UserConverter doesn't have the Member type in it

#

right

#

that makes more sense

#

yes, you can just add discord.Member to UserConverter but i think we have a similar typehint elsewhere

#

if that's the case we could probs just reuse what's necessary

#

if you adjust the management.py one, it's best to see if these unions are taken into consideration and ensure we keep things DRY as possible

brazen charm
#

the discord converters only .get, and what was proposed is .fetching the Member from the api for the nick so it appears if possible. So I was thinking about doing it in the InfractionSearchQuery by fetching the Member and if that fails doing an User like mentioned above, but when the command is invoked directly, that doesn't happen and it's inconsistend because it only gets the User user instead of trying to .fetch it which also has the disadvantage of nick never being available and a higher chance of failing

glass pecan
#

oh you want to fetch the member object

#

not the user

#

yeah

brazen charm
#

yeah for the nick if it's possible to get it from the guild

glass pecan
#

right.

#

as long as you're checking cache first that sounds good enough

brazen charm
#

right now making a superclass of the InfractionSearchQuery is going around my mind that doesn't return a string but fails it as the User not existing in discord will also mean it can't have any infractions

austere veldt
#

Hi, I have been using docker to run the bot and site till now. I have added a new API to the site and want to access that in the bot. How can I run them locally and connect without docker?

austere veldt
#

I was able to make some progress on this. I am running django server locally and have set the SITE_URL=api.pythondiscord.local:8000 . Still the bot is trying to connect to api.web:8000

green oriole
#

have you added the bot to the site compose project?

austere veldt
#

you mean docker compose?

molten bough
#

They're trying to do it without docker

#

Just update your config for the bot so it has the right domain

green oriole
#

right here

#

Have you tried that?

austere veldt
#

@molten bough You got it right. I want to run it without docker

#

Which config do I need to change?

green oriole
#

Oh you don’t use docker?

molten bough
#

See the link above

austere veldt
#

@green oriole I do but I am trying to debug something. So I think running locally will be easier to debug

green oriole
#

@molten bough there is still missing output with docker or it has been resolved?

molten bough
#

I have no idea

green oriole
#

You still doesn’t use docker?

molten bough
#

I haven't bothered with it, no

green oriole
#

Oki

austere veldt
#

I think I got it. I need to change site url in default-config. Thanks!

#

No luck yet! Even after doing the changes I am getting this on running pipenv run start

   raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.web:8000 ssl:None [Name or service not known]
green oriole
#

Oh yeah try to change in the config site to pythondiscord.local:8000

austere veldt
#

my bad! I did changes in the config-defualt.yml instead of config.yml

green oriole
#

git checkout -- config-default.yml to revert changes

mellow hare
#

I've done that so many times....

green oriole
#

Surprisingly enough, it haven't done it yet..

austere veldt
#

And finally! it worked.

mellow hare
#

Nice

hollow lichen
#

congrats

mellow hare
tough imp
#

I wonder, is it safe to rename my fork on github while I have a PR open?

molten bough
#

I think so

green oriole
#

Yep it is

#

So guys, what about the nondocker guide? You're still stuck with the labels?

glass pecan
#

if i could get two reviews on this please, it would be appreciated

molten bough
#

There's one for you anyway

glass pecan
#

thank

glass pecan
#

ah yes

#

wonder how he went

#

@snow zealot did you happen to poke around our repos a bit?

snow zealot
#

@glass pecan yes, yeah
I'm finding it moderately difficult since I've actually never done anything opensource before so it takes me a while to understand other people's codes..
I'm learning albeit slowly.. and yeah, I had an idea which umm I dunno if people think is cool, but nevertheless I opened my first issue on there :D

I honestly think there's a loooot more python I need to know before I can be of value.. atleast that's what week 1 of trying-to-git-gud-at-bot-dev tells me

#

Also, I think I'm going to be away for the next 2 weeks owing to my semester exams, so I think I'll try to grind again after that

Mm but yeah this thing y'all do is hard xd, you guys are crazy smart, and have perhaps put in a lot of time and effort to get there

glass pecan
#

hahaha, sounds like you've at least dipped your toes though

snow zealot
#

yeah well I read every message posted on this channel this week, tried to see how much of it made sense

glass pecan
#

make sure to ask questions to clarify things that seem confusing though, that's absolutely fine to do

snow zealot
#

like when Shirayuki pointed that dictionary thing ves zappa's code, that was like big brain

glass pecan
#

i probs missed that

snow zealot
#

yeah, definitely will.. Infact I love asking questions here for I always get more than what I expect πŸ˜„

glass pecan
#

noice

#

well keep it up

#

hope the enthusiam is maintained and if there's ever anything you need just ask

snow zealot
#

yeah, absolutely.. I'll hang in around here more often and try to pick up something from y'all.. mm brb in a couple of weeks

#

also I think

#

I should probably educate myself a little more in making basic bots themselves before trying to do fancy things with python so that's that

#

So I thought I should probably create a dummy server and make a real simple bot and get it in there, and start playin around to get a feel for it

#

but yeah, I do feel good gettin into this so thanks for that

glass pecan
#

go for it

#

making a basic botto is a great way to get familiar with working with them

snow zealot
#

yup, thanks. πŸ‘

tough imp
#

im trying to set up pycharm to help me write better code for seasonalbot, but there must me something im doing incorrectly as it keeps telling me the discord package isn't installed

#
[kwzrd@kwzrd-thinkpad pydis-seasonalbot]$ pipenv shell
Loading .env environment variables…
Launching subshell in virtual environment…
 . /home/kwzrd/.local/share/virtualenvs/pydis-seasonalbot-yCADgX3-/bin/activate
[kwzrd@kwzrd-thinkpad pydis-seasonalbot]$  . /home/kwzrd/.local/share/virtualenvs/pydis-seasonalbot-yCADgX3-/bin/activate
(pydis-seasonalbot) [kwzrd@kwzrd-thinkpad pydis-seasonalbot]$ pip list
Package              Version
-------------------- -------
...
...
discord.py           1.2.3  
...
#

i added the interpreter via pycharm's settings, pointing it to a 3.7.5 pyenv install and checked install packages from pipfile

#

anyone know what could be causing pycharm to not see the package?

#

i havent used pycharm nor pipenv much

molten bough
#

You clicked the install link in the banner, I take it?

tough imp
#

yeah, it runs some process installing packages for a few secs, then the banner comes back same as before

#

i can run the project just fine via pipenv run start

molten bough
#

I'm not sure, honestly

#

I don't have that problem though

tough imp
#

mm ok, thanks for checking anyway

tough imp
#

works fine when i install via pipenv sync --dev and then add the interpreter as a virtual envrionement, but just wont work when added as a pipenv environment, weird

green oriole
#

I have a similar problem everytime I checkout a new branch, if that can help

#

Oh wait only with discord.py? That's because the package name is discord but it is noted discord.py in the pip list

molten bough
#

that isn't the problem here

#

It'd be saying discord isn't installed

green oriole
#

Hmm weird on my computer it is saying discord not discord.py

tawdry vapor
#

Was confused why a branch wasn't checking out

#

took me too long to realise that it's cause the branch's name starts with a # so the shell thought it's a comment

#

I'm not sure what's wrong but I cannot trigger the mentions filter when testing. I can trigger other ones though

exotic ember
#

is your role getting whitelisted?

tawdry vapor
#

I removed my roles

#

So no, that couldn't be it

hardy gorge
#

That is odd. We do still get the occasion mention spam alert, but they are fairly rare. Now I'm hoping that we're not missing half of the events or something.

#

Did you spam with repeated identical mentions or different mentions in a message?

#

It only counts unique mentions in a message

tawdry vapor
#

Oh they weren't unique

long garnet
#

I spent some time today exploring discord.py and reading parts of the source code for @stable mountain and learning a bit from it too

#

is there something like a documentation for @stable mountain, or relevant tags?

hardy gorge
#

No, we have no special documentation, other than the docstrings, but you can always ask questions.

long garnet
#

I see

#

thanks

#

well I'd need someone really patient honestly, maybe I should poke Scragly after all

#

since he volunteered for the pain

hardy gorge
#

There are probably more people that can help you, but he did volunteer.

tough imp
#

i recently started looking into python's code myself and its very well written and easy to understand

hardy gorge
#

Anyway, it's bed time for me. Only 7 hours of sleep left.

tough imp
#

had no issues

long garnet
#

good night @hardy gorge

tough imp
#

sleep tight Ves

green oriole
#

Guys, it is still okay for contributors to leave reviews?

glass pecan
#

yes

brazen charm
#

Yours count towards the required too I think

mellow hare
#

Correct

glass pecan
#

it does, but we require at least 1 core dev still

mellow hare
#

^

#

But there's no such thing as too many reviews

glass pecan
#

so 1 core, 1 non-core is fine

#

and having more reviews means sharing the load

mellow hare
glass pecan
#

you know it

mellow hare
#

You knew I was going to use that gif

#

I saw you typing as I was searching

glass pecan
#

i was thinking of it before i even hit enter

mellow hare
#

HA

green oriole
#

Well, let’s share the load then πŸ˜„

crude gyro
#

we definitely want you to leave reviews, if you can.

#

and reviewing is a skill

#

you'll need practice to get good at it

#

this is a good place to find that practice.

molten bough
#

100 comments on gitlab and rising!

#

That was really something, that MR

green oriole
#

Sadly we can’t find it anymore 😦 πŸ˜„

ornate moat
#

The PEP8 linter doesn't seem to check for multi-line [fbcu]-strings

woeful thorn
#

?

ornate moat
#
s = (
    f'{this} is a long '
    'string that has '
    'been spread '
    f'across {n} lines'
)```
tough imp
#

is it preferred to f the ones that dont need to be f'd too?

ornate moat
#

yes

molten bough
#

Huh, I didn't know that

ornate moat
#

It doesn't explicitly say so in PEP8 but it follows from the aligning guidelines

tough imp
#

for once my desire to align everything isnt antipep

ornate moat
#
  • core devs have said "do it" yert
mellow hare
#

Isn't there a like.... unindent thing

#

Or something like that

ornate moat
#

textwrap.unindent?

mellow hare
#

Yeah I think that's it

ornate moat
#

might work

#

I think uh

#

inspect.cleandoc or whatever

#

is better

#

I don't like either personally though

mellow hare
#

Unless we're wanting to remove the newline characters

#

I think I'm just confused by the intent

hardy gorge
#

Hmm, I think I've just added the f prefix to the lines that needed it in the past

green oriole
#

I'm more afraid that the linter would trigger of there is a f without any formating

mellow hare
#

Wait, does it actually?

tough imp
#

the linter isn't the only one i'm afraid of triggering when i format for my eye's pleasure

woeful thorn
#

Is there actually a plugin to enforce this?

hardy gorge
#

I don't think so, Hem

crude gyro
#

I've seen dozens of reviews saying "this doesn't need an f", so we should probably stop doing that if we buy this

woeful thorn
#

It's definitely not consistently enforced in any of the repos

crude gyro
#

and I think I buy the alignment argument. does help readability a little.

hardy gorge
#

I don't really have an opinion. I like it fine without the additional f there, but I'm not opposed to adding it

#

I just don't think relying on us noticing it in reviews is going to work consistently

#

And, some reviewers not present here have commented to remove the unnecessary fs in the past

ornate moat
#

black seems to uh

#

be completely broken

hardy gorge
#

We could probably catch the latter pretty easily, but I don't think we can consistently enforce it that easily

ornate moat
#

s = f"{this} is a long " "string that has " "been spread " f"across {n} lines" lol

#

ill eat brb

woeful thorn
#

Not enough people can be convinced to add black anyway

#

At least to anything that isn't a new start

molten bough
#

Yeah, I noticed a couple oddities with black too

hardy gorge
#

I think this one does not change the logic of the code (four separate strings that will be combined implicitly), while black reformatting it to one explicitly joined string in the source code would do that. It would also have to perform logic to see which prefixes the entire string should get and the prefixes may be incompatible.

#

The second one could have {} in it not meant for formatting (no prefix)

molten bough
#

To be fair, that one is still joined implicitly

#

Super weird though

hardy gorge
#

What I mean is, this is not broken; what else should it do?

#

This fits one line, so it goes on one line

molten bough
#

Oh, yeah

#

Yeah, I suppose so

crude gyro
#

yeah, but that looks ridiculous.

hardy gorge
#

I agree, yeah

molten bough
#

I can see why it'd do that

hardy gorge
#

but black can't resolve it within the style framework it works in

crude gyro
#

if it was gonna reformat it to a oneliner, it ought to have put it inside a single f string.

molten bough
#

What happens if they're all f-strings?

hardy gorge
#

It can't do that, lemon

crude gyro
#

sure it can.

hardy gorge
#

What if the second one had a literal {a} in it?

crude gyro
#

it's just code.

molten bough
#

They're not the same type of string, technically

hardy gorge
#

It would have to start parsing the strings to know if it should escape those and changing the actual code

crude gyro
#

yes.

#

I'm not saying that's what the black devs should've done, just that I agree with Ava that this example is terrible.

#

and it's the kind of thing that makes half of us not be open to using black.

#

on the pydis repos anyway

woeful thorn
#

The existing ones at least

#

flake8-annotations is black formatted and nobody's noticed

molten bough
#

The reason it doesn't work is that it (the code) doesn't follow the devs' undocumented recommendation

#

I wonder if that should have been in a PEP too

#

Might be worth raising an issue for

woeful thorn
#

@hardy gorge I'd probably prefer modlog over message change log for the attachments deletion. Though the advantage of a discrete channel means we can more easily look for how often the filter is triggered & by what attachments so we can see if the rule needs adjusting

#

Another channel isn't going to bother me, most of it is muted and collapsed anyway

hardy gorge
#

Hmm, true

#

I don't mind any of the solutions, I just think it would be a mostly dormant channel to begin with

#

We rarely ever relay messages from antispam and it's even rarer for them to contain attachments

#

Guess it doesn't really matter

#

Okay, let's do another log channel then. I'm not sure I'd like it in mod-log, since it's a channel that has actual information some people (or maybe just me) want to look at to see what's been happening

ornate moat
#

@gusty sonnet I use kind of the reverse approach in my old bot ```py
intervals = (
('week', 604_800), # 60 * 60 * 24 * 7
('day', 86_400), # 60 * 60 * 24
('hour', 3_600), # 60 * 60
('minute', 60),
('second', 1),
)

def display_time(seconds: int) -> str:
"""
Turns seconds into human readable time.
"""
message = ''

for name, amount in intervals:
    n, seconds = divmod(seconds, amount)

    if n == 0:
        continue

    message += f'{n} {name + "s" * (n != 1)} '

return message.strip()```
gusty sonnet
#

Hah!

#

That does look cleaner actually, in term of not having to reverse the result

#

But then you gotta do the multiplying beforehand

#

In term of performance I love your approach

#

I went with the easier to read lol

#

Imma steal your 's' approach @ornate moat

#

That is a damn clever way

ornate moat
#

I learned it from a fizzbuzz that I learned about a week into my python career

#

(and said fizzbuzz I think is one of the nicest piece of code even though it's not maybe the mots readable)

#
'Fizz' * (not n % 3) + 'Buzz' * (not n % 5) or n for n in range(1, 101)```
gusty sonnet
#

's' * (amount > 1) is readable enough lol

#

Hmm, or should I still stick with the 's' if amount > 1 else ''

#

Meh.

green oriole
#

The latter is more readable

gusty sonnet
#

That's what I thought as well

#

xd

green oriole
#

We aren’t all doing esoteric python! πŸ˜„

gusty sonnet
#

qq

#

I edited the code, I realized a pitfall with years ( dividing int by 1 always gives 0 remainder ), added more tests, and added Ava's method

#

I have to mention it!

ornate moat
#

I would put it outside the f-string

#

something like plural = 's' if ... else '' f'{thing}{plural}'

gusty sonnet
#

That way fstring stays simple and naive, it will just assemble values into a string

#

Thanks Ava

#

Also Imma stick to .0f instead of int()

tawdry vapor
glass pecan
#

mm github have a lot of great guides

#

it'll be worth adding some links in when we make appropriate sections for them

crude gyro
#

I'm playing with the photoshop animation stuff

#

it kinda sucks

#

but it's usable.

hardy gorge
#

I've used it in an older version, I remember giving up after getting frustrated

crude gyro
#

I essentially created a video instead of a gif, I think

#

like, photoshop says it's a video

#

so I can't export to gif

#

I can only export it as an mp4 or something

#

but when I try to convert it to a "frame animation", then the transform options disappear

#

and all the work I did is gone

#

so I tried to convert the mp4 to a gif

#

but that makes it really dirty looking

#

in one software I tried

#

and full of artifacts in the other

#

maybe @tough imp has some advice how I can possibly export this in a way that doesn't suck.

#

here it is guttersized.

#

the big version looks a bit shit but the tiny version looks alright I think.

#

okay, think I found a solution

#

@hardy gorge whatchu think honeycomb

hardy gorge
#

That looks good to me. The larger one has a few artifacts and we were super critical of them with the first animated icons, but I think that comes with the gif format ultimately and they're not visible at server icon size anyway

crude gyro
#

does it?

hardy gorge
#

hmm

#

Maybe not

crude gyro
#

just my poor excuse for a dust cloud, I think

#

the whole thing looks like an artifact pleased_lemon

#

but I do think the smaller one looks alright.

hardy gorge
#

No, my screen is showing a couple of ligher "lines" in the blurple snake, but maybe it's just the downsize Discord does when embedding

crude gyro
#

huh. maybe.

#

anyway, gotta run.

hardy gorge
#

Anyway, looks good

tough imp
#

i think the last one came out alright

#

i use the export for web (legacy) option

#

and then mostly defaults

#

most of the artifacting i was seeing was compression on discord's side

#

mostly present with colour changes, the spinny one was a headache

#

just make sure you check loop forever, because the gifs dont loop by default using the web exporter

#

im still not happy with the christmas one tbh, it somehow ends up looking blurry

crude gyro
#

hmm.

#

yeah.

#

can the insides of the snakes maybe be a bit less transparent?

#

I think that's why it looks blurry

tough imp
#

@crude gyro looks like the glow is the culprit, if i remove the glow its a lot more crisp, but the icon looks more poor

#

but i can have the glow come in on hover

#

this is a screenshot from my phone

#

first one has no glow and transparent fill

#

i think i prefer the first one, let me know what you think

crude gyro
#

@tough imp uh..

#

that's four.

tough imp
#

yeah sorry lol the first screenshot is phone, second is computer

#

but the logos are the same

crude gyro
#

I'm still confused which one is the one you are suggesting

#

is the top one the old one?

#

anyway both of the bottom ones look pretty good to me.

tough imp
#

you mean both logos on bottom screenshot or bottom logo on both screenshots (im sorry)

crude gyro
#

lol

#

the latter

#

but honestly those screenshots suck

#

they're very pixelated and it's hard to tell what's what.

#

the bottom logo on both screenshots looks brighter and has more contrast

tough imp
#

can you try this on the test server

crude gyro
#

you might be right about that.

#

that looks very clear.

tough imp
#

alright im also fairly happy with it

crude gyro
#

did you change the hex too?

tough imp
#

yep thats done

crude gyro
#

okay, cool. let's go with that, then

tough imp
crude gyro
#

and, uh, nice work.

tough imp
#

i mean its your logo lol

crude gyro
#

naw, you're fixing it

tawdry vapor
#

this is interesting

#

Tempted to see how well it works with pipenv

gusty sonnet
#

That is interesting

green oriole
#

@tawdry vapor I think it would be easier here

#

for every Message in messages, there is a corresponding list (which could be empty) in attachments

#

So.. they should both have the same lengh

tawdry vapor
#

OK you can resolve that then

hollow lichen
#

Nice bit logo

crude gyro
#

@tough imp how's the logo coming along? we'll need it live on Sunday, so time is running out.

tough imp
#

😬

#

give me 1 sec

#

ill get back to you shortly

#

making some fixes

#

@crude gyro how do you feel about this

crude gyro
#

looks great in that size, but how does it look in gutter size I wonder

#

guess we gotta test it out and see

tough imp
#

you can sort of preview it in server settings

#

and if you apply it you get to see the first frame in the gutter

hardy gorge
#

live testing!

tough imp
#

alternatively its possible to not have the fade-in, fade-out

#

but then the first frame has snow, not sure how that works with you

#

1 sec ill export

crude gyro
#

yeah but the server settings preview is also much larger than the gutter image

#

although it does look good there, too

tough imp
#

would you like me to make one with the flakes bigger so that we can switch them on-demand if needed

hardy gorge
#

Why don't we just actually do a live preview for 5 seconds

#

Then we can all look how it will look and it doesn't really matter

#

most people are celebrating thanksgiving anyway

#

Or so I've heard

crude gyro
#

yeah, I don't really mind if we just do that.

#

was gonna suggest it myself.

tough imp
#

check it on your phones as well

hardy gorge
#

Okay, it clearly looks like snow to me

crude gyro
#

it looks good on both desktop and phone

#

let me change it to my runner

#

oh. guess I fucked up and lost it.

#

never mind then.

tough imp
#

it must be in the history of this chat

crude gyro
#

I still have it but only in windows.

#

rebooting

#

<@&267629731250176001> check out the guild icon while it lasts

hardy gorge
#

oh

#

sorry

crude gyro
#

haha. whoops.

hardy gorge
#

it ran away

crude gyro
#

oh you set it to runner

#

nice.

#

well, check that out instead then.

clever wraith
#

the icon was nice

tough imp
#

the snowy one is scheduled for december

#

we were just doing a quick test because you cant really preview it on a non-booster server

clever wraith
#

fair

crude gyro
#

it's only one boost to unlock animated icon, right?

#

we should probably move one boost to the test server.

#

but it's like.. we don't have any margin then

#

for level 3

clever wraith
#

2 boosts

tough imp
#

i only have the cheap non-boosty nitro

clever wraith
#

1 boost level

tough imp
#

otherwise i'd help out

clever wraith
#

you can now buy boosts just stand alone

#

i think it's $3.40 or something

tough imp
#

thats a one-time payment?

#

i assume just 1 month

crude gyro
tough imp
#

good good

#

so are we happy with the snowy one?

hardy gorge
#

let it snow, I'd say

tough imp
#

the alternative is to just have it loop

#

no fade

#

i think it doesnt look horrible

hardy gorge
#

I like the faded one better, I think

tough imp
#

this way we can reduce the filesize greatly as the loop is actually only like 1 sec, and on hover it snows forever

hardy gorge
#

ah

tough imp
#

but yes perhaps its better with the fade

#

i dont have a strong opinion

crude gyro
#

I don't really care if it fades or not, I think it looks good in both.

#

you did a great job making the snow look realistic.

#

quite impressive work

#

the fact that they're spinning makes all the difference.

tough imp
#

i ended up taking it to sony vegas

#

this wouldnt be achievable with photoshop

crude gyro
#

sounds like you should learn AE

tough imp
#

yes i really should

crude gyro
#

you should and you will. it's a holiday miracle!

tough imp
#

ive actually been wanting to since primary school lol

crude gyro
#

since you were 6 years old.

#

how about that.

tough imp
#

when we made runescape videos the kids that used AE had better intros than us Vegasers

crude gyro
#

filthy vegasers

tough imp
#

but they were using templates mad

#

ok so, fade or nofade

#

we need someone to decide

#

actually Ves said he prefers fade

#

so lets go with that

crude gyro
#

fade it is. how big is the file?

tough imp
#

3 MB roughly

#

its not bad

#

the ones coming out of PS were up to 20 lol

#

well in 1024x1024

#

would you like me to PR the t-shirt template as well

#

or should I just dm it to you

crude gyro
#

yeah

#

just PR it all in

tough imp
#

@crude gyro PR is ready

crude gyro
#

already looking at it

#

didn't the spinner use to spin the other way?

crude gyro
#

mkay

#

okay, so

#

the banner, with the updated logo, is font too dim now in comparison?

#

what do you guys all think

#

it's probably fine

#

here's the design on a shirt.

molten bough
#

At the size it's gonna be at, I think it's fine too

tough imp
#

that looks blurry af

crude gyro
#

it does. it's probably too glowy.

#

the mockup is probably a little shittier than it would actually look

#

but it's probably still too glowy

molten bough
#

I feel like it'd look better without any glow on a shirt

tough imp
#

yeah

crude gyro
#

yep, that's likely the case.

#

so if you'd like to, you can render that again?

tough imp
#

im on it

molten bough
#

I mean, since you don't get semi-transparency

tough imp
#

i think its because it blends into white

#

rather than into the background colour

#

its the exact same logo as the one on the banner, just enlarged

crude gyro
#

well let's just try it with no glow

tough imp
crude gyro
#

weird

#

still appears to have a glow

molten bough
#

It's totally got glow

tough imp
#

but thats ur glow not my glow mad

crude gyro
#

you got the psd

#

but I'll give this a try anyway

tough imp
#

i can remove your glow too just need a minute

#

ill have to extract it from the original psd because i converted the snakes to smart objects so that i could animate them

#

but now i dont have access to the effects

crude gyro
#

I think you may need to cause this looks better but still not great.

tough imp
crude gyro
#

loving the filename

tough imp
#

_final_final_final

crude gyro
#

that's a lot better

#

although I'm a little unhappy now with the layer mask around the eyes.

#

makes sense when the glow is there but without it, it's way too big

#

gives it giant rings around the eyes.

#

would you mind spending a minute cleaning up the excessive layer masking?

#

there's some along the edges too

tough imp
#

im trying to figure out how you've done it

crude gyro
#

the bits are on a layer at the bottom of the snakes folder I think

#

and those have layer masks

#

iirc

#

which I mostly just drew in free-hand

tough imp
#

would you mind if we finish this tomorrow

#

its getting really late for me

crude gyro
#

naw that's okay

#

we got time tomorrow

#

I gotta go sleep too

tough imp
#

alright

crude gyro
#

although, I'm out all tomorrow

#

but just ping me anyway

tough imp
#

thats fine, i will commit to the PR and ping you once its ready

crude gyro
#

excellent. thanks a million for doing this

tough imp
#

no problem at all, thanks a million for this community rainbowcat

green oriole
#

Guys, is it possible to disable check_run on the gh webhooks, since it is redundant the azure webhooks?

tawdry vapor
#

Yeah we probably should if that's possible

hardy gorge
#

There's a check suite option; the Check runs is currently not enabled

green oriole
#

Well check_run is the extended version of check_suite, so I think you should disable it

hardy gorge
#

Yes, I've disabled it

#

The first is not exactly the extended version; it's just for different kind of events (individual checks vs a check suite)

green oriole
#

Oh yeah my bad they didn’t affect the same part

#

Because every actions included in check_suite is also in check_run, I was confused

#

Looks like it has worked!

crude gyro
#

can someone fill me in on what that did?

molten bough
#

Checks are basically what CI reports back to GH when the build is done running

tawdry vapor
molten bough
#

Yup, was getting a link to that, haha

green oriole
green oriole
#

You haven't disabled it on the seasonalbot?

hardy gorge
#

No, I'd only disabled it for bot to see what was going to happen

#

It takes a bit of time to modify the webhooks for all repos, so I rather waited to see if this change is desirable

green oriole
#

Oki

crude gyro
#

yeah let's do it on seasonalbot too

tawdry vapor
#

Did two filters trigger simultaneously?

hardy gorge
#

Basically.

#

They spammed a lot before the mute was finally effected

#

So, the antispam triggered twice, since to runs for each on_message and will trigger as long as the messages have not been removed yet.

#

Normally, the bot is quick enough, but sometimes there's a bit of lag

#

It triggered after the first four, but they were able to sent more messages before they were muted.

#

Oh, they were able two sent four duplicates twice, so, yeah, forget the previous for every on_message explanation. They may have just been able to trigger it twice in rapid succession.

tawdry vapor
#

Thanks. So nothing to really worry about?

hardy gorge
#

No, I don't think so. The double mute failure is a bit ugly in a public channel, but it does now gather the deleted messages into a single deleted message content (as you can see, they're all in one screen). We used to get multiple smaller deleted messages contexts, too, but there's now a delay/consume task.

tough imp
#

hmm it looks like my commits are being timestamped one hour into the future

molten bough
#

Looks like your PC's time is set incorrectly

tough imp
#

oh wow ok i fixed it

#

my computer's clock was one hour ahead and i previously fixed it by putting -1 on the time widget

#

all good now

molten bough
#

haha, I love that solution

#

such a kludge

tough imp
crude gyro
sleek mason
#

yes indeed, i'll do that soon :)

clever wraith
clever wraith
#

probably no . cuz the thing it supposed to fix is still there

green oriole
#

You can try searching through gh issues, and if there is none for it (opened or closed) you could open one @clever wraith

clever wraith
#

i will do it when i get home . in 24 hour

glass pecan
crude gyro
#

@tough imp maybe we should fix the hex, it does suck a bit that one of the bits is outside the frame if we're gonna print it on a t-shirt..

#

and I had the idea that maybe it should just be a link to the advent of code website instead

tough imp
#

yes im planning to make the fix tonight

#

both are good ideas

#

we can do aoc

crude gyro
#

it sort of.. makes it the aoc t-shirt, you know?

tough imp
#

yeah

spring ermine
#

Moving from #esoteric-python:
Add -save and -load to eval to allow using a previous snippet multiple times to allow easier esoteric testing. The suggested implementation was to simply prepend the saved code to the new snippets.
Things that need discussing:

  • Memory usage
    Saving strings of up to 2k characters can take up a lot of space. We need to find ways to clean this somehow, maybe if unused for x hours it gets removed. Alternatively, we could try precompiling this, but this would come with limitations too.
  • Argument parsing
    We need to parse -save and -load, and we want this to be as clean as possible (preferably not a code.split()[0] check)
gusty sonnet
#

A task to autoremove unused code after x hours sounds good, to prevent hogging memories

#

a way to deal with -save and -load would be adding more alias to !e and then we check the ctx.invoked_with or whatever it was

#

like !e-save / !e-load

#

Then we dont introduce extra args to the commands and have to deal with complicated of checking

spring ermine
#

I mean I had an ArgumentParserCommand somewhere in my old codebase that literally used argparse for command parsing

gusty sonnet
#

Same, I used to do that

green oriole
#

Also, implementing a re-run emoji on the input message (something like πŸ”„) to run the same code again in case it was edited to avoid copy pasting, could be nice

tawdry vapor
#

I think you're overthinking the arguments thing

gusty sonnet
#

That's a nice idea @green oriole

spring ermine
#

Maybe we could just use a LiteralArgumentConverter which could take an optional keyword, where it would return a literal if in the list of literals passed or return None/raise ArgumentError depending on optional param if not present

#
class LiteralConverter(Converter):
    def __init__(self, *literals: str, optional: bool = False):
        self.literals = literals
        self.optional = optional

    async def convert(self, ctx: Context, argument: str):
        if argument in self.literals:
            return argument
        if self.optional:
            return None
        raise BadArgument(f"Expected literal: {self.literals}")


@command()
def eval(ctx: Context, action: LiteralConverter("-save", "-load", optional=True), *, code: str):
    ...
green oriole
#

@spring ermine have you opened an issue so we don’t forget in 1 hour? πŸ˜„

gusty sonnet
#

That looks great @spring ermine

green oriole
#

Btw, I see people structuring their issue with paragraph named abstract, specification, rationale and motivation, is it a good practice?

tawdry vapor
#

Yes, if you actually have that much to say.

#

You don't have to though

#

enforcing it would feel too bureaucratic

spring ermine
#

I feel like giving an introduction like that gives a clear picture of what we want, why we want it, and how we'd implement it, answering the 3 most common questions you could have as maintainer

gusty sonnet
#
Abstract:
In order to get the community involved with a project, the codebase should be united, clean, and structured. <insert 5 more paragraph>

Rationale:
If we have multiple ways to format / structure codes, it will make reading the codebase once it grows larger very hard. <insert 20 PEP>

Motivation:
When I was younger, with my first steps into the field, I have always wanted to join projects. First part is always be able to know what it is doing, hence good structures are amazing. <insert 20 more personal experience>

Specification:
@client.command()
async def hello():
    print('Hello command was called for testing')

should be
@client.command()
async def hello(ctx):
    ...```
#

Jokes aside, it depends on how complicated / the level of details of your issue

#

If it's new features / enhancements, more often than not, if you can do that, please do

green oriole
#

But what’s the difference between the rationale and the motivation?

spring ermine
#

Β―\_(ツ)_/Β―

gusty sonnet
#

We have the best of fisk

green oriole
#

I’m reading the same issue haha

#

(What is this dark theme magic?)

gusty sonnet
#

It's a chrome extension

#

It saves my eyes

green oriole
#

That’s great!

green oriole
#

i did the same with the python docs actually

#

Oh yeah thanks!

spring ermine
#

hmm

#

so the converter seems to consume the parameter

#

i.e. it doesn't show up in the code parameter

crude gyro
#

this seem overengineered

#

why don't we just use a command group instead of parsing -save and -load flags

spring ermine
#

I actually have it working with what Danny gave me and it's a pretty clean solution

crude gyro
#

I just don't get why we would need that if we can use existing discord.py features for it

spring ermine
#

I asked him what he recommended we do tho

crude gyro
#

I don't really care what danny thinks we should do.

spring ermine
#

oh

molten bough
#

I too was wondering why we didn't use a command group

#

but I'd just woken up so I wasn't sure if I was crazy

crude gyro
#

so, flags would make sense if you need to pass multiple flags at the same time

spring ermine
#

in that case I'll leave it up to someone else to impl since I don't have the experience nor time to implement command groups

crude gyro
#

but I can't think of a reason why we would do both -save and -load

molten bough
#

command groups are like.. one of the easiest things

#

haha

#

you'd be fine

crude gyro
#

yeah honestly we use command groups in a bunch of places already and it's as easy as using a decorator

#

it's absolutely trivial

spring ermine
#

I mean I have 7 minutes to do it if I want to do it in the next few days :P

crude gyro
#

okay

#

sounds like you don't have time then

#

that's fine, too.

green oriole
#

@spring ermine you should run pipenv run precommit In your local copy of the bot so your code is linted before being commited

spring ermine
#

huh

#

I ran flake8 over it tho

green oriole
#

Yeah, but we have a special flake8 config so..

molten bough
#

and it also means you're all set if the pre-commit config changes

spring ermine
#
Creating a virtualenv for this project…
Pipfile: /home/mart/git/bot/Pipfile
Using /home/mart/.pyenv/versions/3.7.0/bin/python3 (3.7.0) to create virtualenv…
β Ό Creating virtual environment...Already using interpreter /home/mart/.pyenv/versions/3.7.0/bin/python3
Using base prefix '/home/mart/.pyenv/versions/3.7.0'
New python executable in /home/mart/.local/share/virtualenvs/bot-vQrXOkDg/bin/python3
Also creating executable in /home/mart/.local/share/virtualenvs/bot-vQrXOkDg/bin/python
Installing setuptools, pip, wheel...
done.
Running virtualenv with interpreter /home/mart/.pyenv/versions/3.7.0/bin/python3

βœ” Successfully created virtual environment! 
Virtualenv location: /home/mart/.local/share/virtualenvs/bot-vQrXOkDg
Error: the command pre-commit (from precommit) could not be found within PATH.
glass pecan
#

did you use pipenv sync --dev specifically with the dev flag

spring ermine
#

why does it even create a new venv when I already put it in a pyenv notlikethis

glass pecan
#

yeah you don't use other virtual envs, you have to let pipenv create it as it appends a hash after the project name that it tracks

spring ermine
#

goddamnit

glass pecan
#

no matter what project is involved, there's usually one established way to set it up. it's why there's contributors guidelines and setup docs.

gusty sonnet
#

Oh my god I completely forgot commands group

#

That is indeed cleaner

molten bough
#

The best part about programming XKCDs is that Randall isn't a programmer, haha

spring ermine
#

Then how is it always so accurate blobthinkingdown

molten bough
#

I dunno if I'd call it accurate

#

They're not supposed to be taken seriously, yknow

gusty sonnet
#

Hmm @green oriole is there a reason why we initialize to None and then reassign later in the __init__()

#
        self.countdown_task = None
        self.status_task = None

        countdown_coro = day_countdown(self.bot)
        self.countdown_task = asyncio.ensure_future(self.bot.loop.create_task(countdown_coro))

        status_coro = countdown_status(self.bot)
        self.status_task = asyncio.ensure_future(self.bot.loop.create_task(status_coro))```
green oriole
#

Dunno, I wasn’t even on the server when the cog was created

#

I can delete it if you want

gusty sonnet
#

Hmm, yeah, refactor should be another PR

#

Adding cog_unload in itself is worth a PR i believe

glass pecan
#

yes it's an unnecessary part of init

#

i seen it too but the PR scope was worth just approving

gusty sonnet
#

That's what I thought

#

Anyway I reviewed it, it should be good to go

glass pecan
#

coolio

#

thanks

clever wraith
#

what does this mean ?

green oriole
#

pipenv run lint if you haven't setup precommit

glass pecan
#

Both

gusty sonnet
#

Hmm, anyone knows how to round ... relativedelta?

glass pecan
#

Still setup precommit

gusty sonnet
#

I'm running into 4 days 23 hours 59 minutes 59 seconds

#

With max 2 units it's 4 days 23 hours

green oriole
#

Oh yeah you need to add one second

#

I got the same problem

gusty sonnet
#

The problem is that that date is from the api

#

So I wont know if it's lacking 1 second or 7 seconds

green oriole
#

Well if it is always 59 seconds, you lack one second right?

#

The api is pretty fast

#

But I don't understand how the api could influence that

gusty sonnet
#

I have a feeling it's the microseconds

#

Let me try crazy stuff

#

Oh well, it'll be good enough xD

clever wraith
#

Any status on the Feature request ? Cuz i completed its code ;-;

#

I am so proud of myself today ;-;

#

@crude gyro

glass pecan
#

Please don't ping staff randomly

clever wraith
#

He asked for that last night

glass pecan
#

we all know when an issue ticket has been created

clever wraith
#

@glass pecan What should i do next , add a PR ?

glass pecan
#

you just have to be patient sometimes, you only added it less than a day ago

#

no, the issue hasn't even been approved yet

crude gyro
#

yeah I don't really have time to look at this atm

clever wraith
#

ok will wait

clever wraith
#

@glass pecan

#

there ?

glass pecan
#

whats up?

clever wraith
#

So i have several question and answers to the comment you did an hour ago

glass pecan
#

then can you please address them in the ticket?

clever wraith
#

can i do it here PLEASE

glass pecan
#

if it's directly related to the ticket, no it's best to keep discussion about the feature itself within the issue so it's not lost and other contribs can reference it

#

if it's generally about contributing such as linting and such, then you can ask it here

clever wraith
#

@green oriole there ?

green oriole
#

Yep!

green oriole
#

@clever wraith having the full project also imply some thing, for example using a config entry for emojis

clever wraith
#

ok

#

lets try doing that

#

how to do that again

green oriole
#

Setup it? There is the guide in the pin

#

The guide have just been written, if have any issue, ping me :)

#

You have to start by the site first, that's the bottom file

clever wraith
#

Cloning a repository

#

m doing this

#

where to find this ?

green oriole
#

Also if you spot any typo, that would be nice if you tell me about it :)

#

Yep this button

clever wraith
#

where to find that

green oriole
clever wraith
#

i took that pic from site

#

website

green oriole
#

Oh yeah, tbh I would suggest you to go with command line :)

#

I think you need to close your currently opened project to make it appear

#

But I'm not a PyCharm pro

clever wraith
#

downloading git

#

got my dad's hotspot , it speed time

#

17 KB/s

#

wtf with git website its too slow

green oriole
#

Don't think that's git fault of you do 17KB/s

clever wraith
#

it was

#

anyways

#

git installing

green oriole
#

Nice!

clever wraith
#

oh it should be in git bash

#

got it

#

got it

green oriole
#

You need to add it to the PATH

#

Not git bash

clever wraith
green oriole
#

Why are you downloading kosa's fork πŸ™‚

clever wraith
#

F

green oriole
#

You need to make you own fork and download it

clever wraith
#

ahh

#

i never used git u know

green oriole
#

I know I know, that's not a problem πŸ˜„

clever wraith
green oriole
#

You can disable Windows Explorer Integrations and keep everything else

clever wraith
#

now what

green oriole
#

Yep this one

clever wraith
#

installing

#

git working now

#

cloning

#

done

#

creating venv

green oriole
#

You did pipenv sync --devright?

clever wraith
#

yeah