#dev-contrib

1 messages · Page 58 of 1

tawdry vapor
#

I think the point of doing it is to make sure checks like tests still pass when merging

#

But it feels redundant to have 2 merge commits in a row

subtle kraken
#

suppose its good for bigger PR's then

cold moon
#

@subtle kraken I will look into it (and into all other my pending PRs) when my PrestaShop PR is done.

subtle kraken
#

sounds good to me

crude gyro
#

it's tempting to press that big juicy update branch button

#

but ideally we should just do it right before we're gonna merge

#

so a good rule of thumb is to not bother until you already got approvals.

subtle kraken
#

I only have been updating just before merging so far

crude gyro
#

then why would there be two in a row?

subtle kraken
#

To which PR are you referring ?

crude gyro
#

ask @tawdry vapor

tawdry vapor
#

2 in a row because the first merges master into feature, and the second merges feature into master

#

If the branch is out of date you cannot merge the PR without first updating the branch, unless you use admin overrides.

#

I'm saying to just use admin override most of the time

#

Worst that will happen is a test or lint will fail and it won't get deployed, which may take an extra commit to fix but you would have needed to do that commit anyway. Difference is you now have to do it after merging the PR rather than before.

#

So if you're willing to take on that responsibility instead of the PR author then force the merge 👿

tough imp
#

can merge & run tests locally

#

but I always thought the double merge was something that was agreed we'd do

#

because it's safer

crude gyro
#

yeah I don't really like your suggestion, @tawdry vapor. there's a risk the CI will fail on the merge then, and that's messier to clean up.

tawdry vapor
#

Messier in what sense?

crude gyro
#

you'd need to push your fix to master or open another PR

tawdry vapor
#

How is a push to master messy?

crude gyro
#

and master would be in an unstable state.

#

until it was fixed.

#

an unstable master is just bad.

tawdry vapor
#

Point is it shouldn't happen anyway for these small PRs where only 1 string is changed

crude gyro
#

probably not. but I think it's nice merge an updated branch as a rule of thumb, and honestly the commit history is not something I ever worry about.

#

commits are for blame and search, not for browsing

#

and a merge commit doesnt show up in blame annotations

#

so it never really enters my world.

tawdry vapor
#

I sometimes search by browsing the log

#

It's not a big deal

#

Just a suggestion that you can use your discretion to do it. if you don't want to that's fine.

crude gyro
#

yeah. I sometimes would for a oneliner.

tawdry vapor
#

Why is Dependabot unable to open PRs for JS dependencies on the site

#

It just shits itself

patent pivot
#

incompatibilities between deps we pin at and the new ones

#

JS deps are a shitstorm

tawdry vapor
#

Oh

#

It's cause we don't even have a package-lock.json

#

What the fuck?

#

What is it analysing then?

cold moon
#

When you don't want "merge master into" commit then use rebase + force push.

woeful thorn
#

I don't think we should be advocating for rebasing and force pushing as a rule of thumb

brazen charm
#

Would adding the pr # to commits be something conventional? Think I've seen it from someone here and realised it would've been handy the few times I was looking through the history

tawdry vapor
#

I don't mind either way

#

May be usefully locally, but GH already shows relevant PRs when looking at commits

brazen charm
#

Didn't notice that when looking through specific commits in the history, is that new or did I just miss it?

tawdry vapor
#

Been around for as long as I can remember

brazen token
#

how did yall create a timed mute system on the python bot

tawdry vapor
#

Combined with storing infractions in a database for persistence. They are re-scheduled when the bot restarts.

green mesa
#

I have one question about modmail I mean when someone message modmail it creates threat I wnt to know when it will close threat

#

Like if any mod message user will user get the message through modmail

#

Can user can know who is messaging?

indigo wedge
#

where is everyone usually typing?

#

I'm new here and there are lots of channels!

tawdry vapor
indigo wedge
#

ok thnx

crude gyro
#

@green mesa modmail isn't a pydis project, and I have no idea what you're asking anyway

hardy gorge
#

@green mesa We've configured it that threads are closed by moderators on our end. I think ModMail has an option to allow the other party to close the threads too, but we're not using it. (As @crude gyro mentioned, it's not one of our projects; we're just using it.)

As for the identity of the mod who replied, we typically use a reply command that includes username of the author in the reply. It means that people should typically be able to see which mod replied to them. There's also an anonymous reply option that does not reveal the identity of the mod but rather says something like "Python Discord Moderators". This means the answer is "it depends", I guess, as it depends on which option we use to reply.

green mesa
#

Ok ty ves for this answer I am looking for

neon garnet
green oriole
#

Yeah, but is that completely safe?

#

We could do the same thing as for the regex command, format some code and send it to snekbox

neon garnet
#

I'll take a look around first

green oriole
neon garnet
#

Ohhh, that's fair

#

Think I'll set up the dev environment soon to check a few things

green oriole
#

Good luck!

neon garnet
#

Thanks 😄

tawdry vapor
brazen charm
#

not at all, should have the time

tawdry vapor
#

excellent

brazen charm
#

@patent pivot how much of a non issue was the memory usage? Poking around I found out that just importing intersphinx eats up 10-20MB of memory and then fetching inventories seems to keep some unecessary references alive. If we copied the code and made it more suitable for the bot's use case we could at least drop that usage while getting rid of the big dependency and adjusting it for async instead of running in executors

patent pivot
#

hmmmm

#

memory usage is a non-issue as long as it isn't leaking

#

we have enough

brazen charm
#

Also more on the side of getting rid of sphinx when only 5 definitions from of the whole package are used through the inventory fetching

tawdry vapor
#

I've pushed those changes btw

cold moon
#

Sorry about not addressing reviews, but I got extra requirements for paid PrestaShop module development and I have to finish this first.

tawdry vapor
#

No problem since it's mostly low priority

#

This just got bumped up since I need to add support for multiple code jam categories

#

And the jam is coming up

brazen charm
#

@tawdry vapor Why have you decided against the tests in the code block detection PR? Just wondering if it had something to do with parsing as I'm not quite sure how to tackle it for the doc html parsing

tawdry vapor
#

Because I don't feel I have an adequate understanding of software testing to write tests

#

Not really related to what was being tested

#

For testing HTML parsing you can have sample HTML documents and pass them to the parser, then assert the results

brazen charm
#

You've made some tests PRs to the bot before, what changed your mind about your abilities? I consider myself not very experienced with testing and sometimes it feels like I'm doing things the wrong way so would be nice to have some insight. Here it'd be useful because of all the checks I do after introducing a change and still miss things. The code is atomic enough to be tested with normal asserts at points but I feel like exact asserts, or without looking for some structure, on the end result would be too restrictive on changes to the code

tawdry vapor
#

I cannot reconcile the conundrum of precise tests vs. decoupled tests

shut aspen
#

just thought id throw this out there, i implemented the ability for my bot to print its own source and ive found it crazy useful on my server

subtle kraken
#

I think we had that idea but it would easily flood the chat
Especially if some command takes many lines

shut aspen
#

ya it could prob be abused, tho the ability to specify lines is nice

#

i have just found personally i use it non stop when developing and helping others contribute

#

cuz they can show me what theyve written in the test server with just a command

subtle kraken
#

source command of @stable mountain takes command/cog as input so you dont need to know files nor lines

shut aspen
#

ya mine defaults to the whole file if you dont give it lines

#

itll chunk it and send it all in the channel, which yes gets wordy lol

#

its more used for testing and contributing then as a real server command

#

idk ive found it useful, thought id suggest it

celest charm
#

You could use := in that method

#
if (event := getattr(value, __event_listener__)):
    messenger.subscribe(event, value)
#

And I have a suspicion you might be reinventing or overengineering something...

#

wrong channel, sorry

shut aspen
#

@celest charm I’m still on 3.7 or i would 😃

celest charm
#

oh

shut aspen
#

Ya Big F ik lol

celest charm
#

@shut aspen Sorry, my keyboard screwed up somehow, 3.7 is understandable

#

Anyway, you could use getattr(obj, name, None) to make it fall back to None

shut aspen
#

I would update but that requires the entire community to update and that’s a pain lol

celest charm
#

true

shut aspen
#

And ahh ok, that’s the default overload i assume

celest charm
#

anyway, this is off-topic here

brazen charm
#

I'm creating a second subclass now for doc parsing to change behaviour of the used modules, do you think it'd be worth it to place them in a separate module so only the relevant parsing parts are in the module that does parsing?

#

Taking around a 100 lines now because some of the code had to be copied over

tawdry vapor
#

Don't know what the code is exactly but separating them sounds good.

brazen charm
#

Any ideas on a good name for it? The subclasses are only marginally related, one is the MarkdownConverter subclass which is in the master code (+ some methods) and second is from one of bs4's objects to allow some extra behaviour

tawdry vapor
#

So one is for MD and one for HTML?

brazen charm
tawdry vapor
#

So you could name one markdown and the other html

tawdry vapor
#

Is it feasible to make the Bot instance a global? Getting tired of having to pass it around or create classes to store it.

#

I'm imagining it to be pretty simple: create the instance in another module, then import that in __main__. That'll avoid circular imports.

tough imp
#

seasonalbot instantiates it in the module where it's defined

#

then the instance is imported into __main__

#

I think it's probably a feasible approach

tawdry vapor
#

My concern is that it's not explicit, so it may be a gotcha if someone tries to use code that relies on the bot. It's a gotcha since obviously the bot has to be running in like 95% of the cases it'll be used for.

#

So there'll be static method or functions in modules that are ostensibly fine to call before the bot is running, but they aren't.

#

But the convenience of it being global outweighs that risk, I think.

tough imp
#

the only time where I wanted to import the instance somewhere where I didn't have it already (so neither main nor within a cog instance) was when I was doing something that I probably shouldn't have been doing, it felt dirty and you talked me out of it iirc

#

and yeah you're right

#

hmm, what are you working on by the way?

tawdry vapor
#

Syncers 3.0

#

Rewriting it again cause I found the previous design too hard to work with

glass pecan
#

@tawdry vapor what you describe is why i originally had the seasonalbot instance bot within constants.py before we had a dedicated bot.py. Now that it's in it's own module, it can be imported from there instead, which should be fine enough of a setup in place of a global.

#

Wouldn't take much to set a similar setup in Python bot.

#

There's a couple of other methods that are slightly over-engineered for now that I've considered using in my own bots too, and was actively working on when I was more active on my own projects that allow for globally accessed commonly needed contextual variables via a proxy object.

#

No matter the setup though, I'm not a fan of plain globals

#

The IDE doesn't detect what it is without additional tweaking and typehints.

#

It's also not intuitive to new contributors

crude gyro
#

yeah I also think it's a bit implicit. but having the bot be some sort of singleton that you can import really easily seems alright. kind of like how flask does from flask import g

glass pecan
#

ye, that's pretty much what it would be

#

could make it top-level even

#

from bot import bot seems nicer than

#

from bot.bot import bot lol

#

so much bot

crude gyro
#

yeah, from bot import bot seems alright to me

glass pecan
#

it may require a proxy of sorts to do it, but i'm sure it'll be fine

#

mostly to avoid cyclic imports

tawdry vapor
#

If you're keen I also have 2 more PRs you can take a look at

hardy gorge
#

I'm working on it. There are some interesting things in this PR

crude gyro
#

if you're handing out reviews, I'd still love one for the bot filterlist PR

brazen charm
#

Speaking of reviews, the pr for truncating internal eval should be ready now

tawdry vapor
#

Yeah, we're getting a bit behind on reviews. But I suppose none are high priority

#

Anyway, thanks for having a look

brazen charm
#

I was skipping the more async heavy ones when reviewing before since I don't understand python async that well, but can look into it more later if it's needed

obsidian patio
#

Do I have to use pipenv for the bot? I haven't used pipenv before and it's acting in a weird way for me. Would something like venv work as well?

sullen phoenix
#

you shouldn't really be directly using pipenv unless you're working on something for site as well that the bot depends on

#

have you seen the setup guide?

obsidian patio
#

Yeah. I'm going through it right now

#

It asks me to run the following two commands:
pipenv sync --dev
pipenv run precommit

sullen phoenix
#

ahh alright, what troubles is pipenv giving you?

obsidian patio
#

RuntimeError: location not created nor specified is probably the main part of it. The traceback starts with the following though:
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.

sullen phoenix
#

you can ignore that

obsidian patio
#

I cloned the repo to an external SSD, which may have soemthing to do with it

sullen phoenix
#

what's the rest of it?

obsidian patio
#
Failed to load paths: /bin/sh: /Users/X/.local/share/virtualenvs/bot-6jSLwY9f/bin/python: No such file or directory

Output: 
Failed to load paths: /bin/sh: /Users/X/.local/share/virtualenvs/bot-6jSLwY9f/bin/python: No such file or directory

Output: 
Failed to load paths: /bin/sh: /Users/X/.local/share/virtualenvs/bot-6jSLwY9f/bin/python: No such file or directory
#

And a really long traceback that ends with the RuntimeError I showed you earlier

sullen phoenix
#

right

#

i usually get that when using docker, but it works anyways

#

i guess you could try

pip install -U "pipenv==2018.11.26"
obsidian patio
#

I'm not running docker though?

#

I'll see if that helps

sullen phoenix
#

this probably isn't the issue, but can you comfirm that this does exist?

/Users/X/.local/share/virtualenvs/bot-6jSLwY9f/bin/python

obsidian patio
#

I tried to run that pip install. It seems like it's not giving me any errors, yet

sullen phoenix
#

alright

obsidian patio
#

I think it worked. Should I run pipenv shell to activate it, as it tells me that I can do, or can I leave the pipenv from now on?

sullen phoenix
#

you shouldn't need to activate it

#

maybe try and run lint

#

pipenv run lint

obsidian patio
#

What will that do?

sullen phoenix
#

if that works, you should be set

#

that'll just lint the code

obsidian patio
#

Aah okay

sullen phoenix
#

or even better.. run the tests pipenv run test

obsidian patio
#

Already running the lint now

#

Seems like it passed the lint

#

Thanks for the help :)

sullen phoenix
#

alright, cool

#

no problem!

obsidian patio
#

This part:

Setup categories, channels, emojis, roles, and webhooks in your server. To see what needs to be added, please refer to the following sections in the config-default.yml file:

style.emojis
guild.categories
guild.channels
guild.roles
guild.webhooks

We understand this is tedious and are working on a better solution for setting up test servers.

sullen phoenix
#

you need to setup a test server for the bot following the config file in those specific sections

#

when i say server, i mean discord server

obsidian patio
#

Should I setup everything and then update the IDs in the config file to match the server info?

sullen phoenix
#

yes, exactly

#

it is a bit tedious

obsidian patio
#

So, I should create every channel and add every emoji manually?

sullen phoenix
#

you don’t have to add the emojis

#

as for the channels, you’ll need to add the ones in the config

obsidian patio
#

It won't really be complete without emojis ahhah

#

But yeah, thanks again

sullen phoenix
#

no problem 👍

obsidian patio
#

This feels like a silly thing to ask, but how do I add the emojis?

#

I can't seem to find any image files in the repo

sullen phoenix
#

erm, most of the emojis aren’t public

obsidian patio
#

Is there a way to add them?

sullen phoenix
#

there is not

obsidian patio
#

Okay

sullen phoenix
#

they should work anyway

#

except maybe for the trashcan

obsidian patio
#

Oh, okay. What was the part about adding emojis about?

#

Why not the trash hahah?

sullen phoenix
#

because @stable mountain reacts using the trashcan

#

the other custom emojis are in embeds afaik

obsidian patio
#

Okay

shut aspen
#

so im looking into using snekbox for my own bots evaluation, does the container restart on every eval?

#

or is nsjail the primary sandboxing tool

green oriole
#

It is nsjail

crude gyro
#

@velvet ether hey dude, thanks so much for the work you've been doing on django-simple-bulma, I really appreciate it.

#

are you keen to take on the rest of the submodule tasks? I guess maybe it's only extensions. I think the approach you suggested sounds good.

#

I've also been thinking about how we can do the same sort of thing for FontAwesome - it'd be really cool if it used the latest version of this as well, but I'm a little unsure how we could achieve that.

#

still, "always use the latest version of everything" is a very cool feature.

velvet ether
#

No problem :) I was working on a django project and needed a stylesheet that wasn't bootstrap, so i figured i might as well help out

#

I looked around for a fontawesome cdn that just provided the latest version, but couldn't find any. In my project i just ended up serving it myself

crude gyro
#

yeah, that's the problem.

#

we'd need some cleverness to solve that, I think

#

the latest versions of fontawesome expect you to make a user and use a custom CDN link for only you

velvet ether
#

if we make people add that to bulma_settings it would basically be the same as adding a <link> manually in some template

crude gyro
#

the right approach might be to have the user put their info in BULMA_SETTINGS

#

yeah

#

I mean, you're right

#

the template tag makes things a little more readable though, maybe.

#

but I agree that the feature is a little dumb

#

I wonder how much info they'd have to put into BULMA_SETTINGS for us to generate the CDN link

#

and if we can support Pro as well

#

there may be a little bit of convenience there, if they just need to put a token and we can support both Pro and Regular

velvet ether
#

i guess

crude gyro
#

alternatively we could remove the feature, but that's not backwards compatible and so it might be a hassle for existing users.

#

maybe we could make the token optional, and just do what we're currently doing (provide an older version) if no token is provided

velvet ether
#

i can generate an api token on their website, but can't quite figure out how to use it

crude gyro
#

so they have an API?

#

hm.

#

iunno, it just feels like they are going in a different direction

#

they want everyone signing up

#

and getting in the way of that is kinda stupid

#

maybe we should just remove the support.

velvet ether
#

don't get me wrong, font awesome is awesome, but damn is it fragmented. There seems to be a different website for every release and then some stragglers like github pages and some cdns. Also i can find no documentation for their api 🙄

crude gyro
#

yeah, agreed.

velvet ether
#

and yeah, the font_awesome tag really isn't that usefulanymore

crude gyro
#

yeah maybe not.

#

I'll give it a think

molten bough
#

font-awesome expects you to do one of three things

#
  1. Use their CDN and kits system (the user-specific links you mentioned)
#
  1. Download it and serve it statically from the site itself, but you can't put the pro icons in a git repo
#
  1. Use your credentials to get everything from an NPM repo at build time
#

that last one is probably your best bet for automation

#

but the issue then becomes, do you make django-simple-bulma/whatever django addon rely on npm or implement some custom download logic?

#

the API keys exist to allow one to configure kits programmatically btw, the wordpress plugin uses them for that

green oriole
#

You could pull them in your setup.py file perhaps?

molten bough
#

I mean it's certainly possible to configure a kit that way

#

in the settings.py

#

that's the absolute easiest option, but it doesn't solve the issue of people that want to serve the assets themselves

#

the API is documented, it's graphql, but it doesn't seem useful other than that

crude gyro
#

I'm leaning towards

  • Allow users to specify their kit token or whatever in BULMA_SETTINGS, and use that if provided.
  • Otherwise, use an older CDN like we're doing now.
molten bough
#

Yeah, I think probably a whole download system is probably out of scope

crude gyro
#

I would be leaning towards just removing the feature, but I don't wanna break backwards compat

molten bough
#

kits are going to be the most common use-case

crude gyro
#

but how much info would we need in the BULMA_SETTINGS to generate a kit CDN link?

#

is it just a single token?

#

and is it the same for pro and regular?

molten bough
#

There are no free kits

#

you just use their CDN

#

the point of kits is that you can customize them in the font-awesome site's ui

crude gyro
#

okay, you're getting hung up on terminology

#

the CDN link for the free stuff still has a token in it

#

at least in recent versions

#

and you have to like sign up with your email and become a free member to get that token, right?

molten bough
#

hmm

#

yeah, it does seem that way

crude gyro
#

what I'd like to do here is

  • put as little information as possible into BULMA_SETTINGS - maybe a single token?
  • generate either a Pro or a Regular CDN link using this token
  • If token is not provided, just put an older version CDN like we're doing now
molten bough
#

alright, I just made a free kit and yeah it's the same

#

<script src="https://kit.fontawesome.com/IDENTIFIER.js" crossorigin="anonymous"></script>

crude gyro
#

hm, okay. so basically we just need that identifier

molten bough
#

that's all there is to it

crude gyro
#

that seems pretty easy to implement then

molten bough
#

since this is a free test kit, here's what the site shows

#

you just get that script tag

#

the settings are just things like, the version, whether to use web fonts/SVG, and a handful of misc options

#

they don't change the url

crude gyro
#

very cool

#

that suits us perfectly then

#

@velvet ether Hey dude, are you around?

#

just wanted to say, I've assigned you a Contributor role here on the server as thanks for the work you've put in. Enjoy the fancy green color. Also, if you'd like to handle this FontAwesome thing (see the conversation above) and the Bulma-Extensions submodulification, they're all yours. We'd be grateful for those changes. I think that would really modernize the whole app and make it more maintainable.

If not, I can probably handle them myself.

molten bough
#

There'll be an official django plugin when FA 6 rolls around as well, so no need to overengineer

crude gyro
#

huh?

#

what do you mean

#

are FA making one?

molten bough
#

yup

crude gyro
#

huh.

molten bough
#

so you won't need to worry about it after that

crude gyro
#

okay, cool.

#

guess we'll add some info about that in the readme at some point

#

when it comes out

molten bough
#

I already obtained a pro license for it so you guys will be able to use it as soon as the beta rolls around, if that's your prerogative

#

I'll let you know

crude gyro
#

cool.

#

thanks for that

molten bough
#

👍

#

oh right, I got an email the other day as well

#

apparently they're releasing a feature that will let you add your own icons to kits if you wanted a pydis icon or anything

#

should be.. "soon™️" ("very shortly")

crude gyro
#

well, I mean, it sorta already has the pydis icon

molten bough
#

Oh yeah, they do have the python logo don't they

crude gyro
#

yep

velvet ether
#

just wanted to say, I've assigned you a Contributor role here on the server as thanks for the work you've put in. Enjoy the fancy green color. Also, if you'd like to handle this FontAwesome thing (see the conversation above) and the Bulma-Extensions submodulification, they're all yours. We'd be grateful for those changes. I think that would really modernize the whole app and make it more maintainable.

If not, I can probably handle them myself.
@crude gyro Thank you, I appreciate it. I'm not at home right now, but if be happy to look at it later today.

crude gyro
#

there's no rush, @velvet ether, I'd be happy even if you looked at it a week from now.

#

I'm just looking for a clarification on whether I should put it on my own agenda or leave it to you.

#

I don't think these changes are urgent, but I'd love to see them at some point.

velvet ether
#

I know, but I'm gonna work on it later today anyway

crude gyro
#

that's fine of course lemon_hyperleased

crude gyro
#

what are you up to?

#

working on something fun?

brazen charm
#

No, just adding one validator and setting up a normal environment instead of a static clone of the repo

brazen charm
#

Any way I could run the site tests through docker? Want to avoid messing with postgres on the host machine

glass pecan
#

should be able to by specifying a different command on launching the container

#

are you using compose?

brazen charm
#

Yes

glass pecan
#

docker-compose run web
is the same as if you'd do
docker-compose run web run --debug
which is eq to if you'd done
python manage.py run --debug if you were locally running it.

#

i'm like 80% sure on this anyhow lol

#

using that baseline, you're able to pass anything you want to manage.py instead of run

#

with django, to run tests, you'd normally do manage.py test

#

so i assume it's docker-compose run web test to get it to run tests

#

let me know if that's wrong though, in which case i should be able to dig up how i set it up previously

brazen charm
#

Yeah I was doing something similiar before but at first it seemed to not apply migrations at first and then it wasn't started in debug. This is a lot simpler and only needs the debug env var added, thanks

crude gyro
#

I just run the tests in PyCharm with the docker-compose for the site running

#

required minimal setup, and no local postgres

brazen charm
#

Pycharm didn't seem to like them much when I tried through it, how does your run config look?

crude gyro
#

well, I changed it so that the template for Django tests contains some environment variables

#

the database URL I'm using is DATABASE_URL=postgres://pysite:pysite@localhost:7777/pysite

#

other than that, nothing spceial

#

then I basically just right click the tests folder and run

#

and it works like a charm

brazen charm
#

Complains about something with the db config when I try that

brazen charm
#

For migration names, is it just just ####_change ?

crude gyro
#

yes.

patent pivot
#

lol why does the github bot send the introduction twice

#

guess it is treating ready to review as PR opened

#

oh

#
  def handle_cast({:pull_request, :ready_for_review, payload}, state) do
    handle_cast({:pull_request, :opened, payload}, state)
  end

yeah okay

#

fixed

cold moon
#

Does GitHub bot collect some statistics too?

patent pivot
#

no stats on the github bot, no

#

it's completely stateless

#

It could collect stats, but most of what it is sent is collectable by the GitHub API as well

cold moon
#

Why this last revert?

brazen charm
#

<@&267629731250176001>

#

Help channels broke with it

woeful thorn
#

!tempmute 731475449162760214 1H shh

stable mountainBOT
#

:incoming_envelope: :ok_hand: applied mute to @clever wraith until 2020-08-05 16:43 (59 minutes and 59 seconds).

cold moon
#

Oh

tough imp
#

There was a bug that I didn't catch in testing

#

it was causing channels to not move out of available sometimes when spoken in

#

looking into it now

tawdry vapor
#

I think I wanna do some work on this cog. Clean it up a bit and investigate the 1 available channel bug

#

Ah also 886 since it moves out some funcs to utils, but whatever, I'll take what i can get

obsidian patio
tawdry vapor
#

Like I said earlier, It'd be nice to have the PRs that touch help channels out of the way so I can do some refactoring there

brazen charm
velvet ether
#

Hey @crude gyro, did you see I my pr on django-simple-bulma? I got lots of other stuff to do, so it's no rush, but I still just wanted to make sure it didn't get lost in your feed :)

molten bough
#

I think he's taking a break at the moment, at least from what I heard in the OT channels

crude gyro
#

I was on a bit of a vacation, yeah.

#

but I'm back now

#

thanks for the reminder, @velvet ether, my apologies, it got lost in my feed

#

coming back to work after a vacation turns out to be quite busy

green oriole
#

Vac.. ations ? Like the owners of this server sometimes sleep? lemon_scared

crude gyro
#

just took a vacation from working on Python Discord stuff and from my dayjob, and focused on a personal project for a bit.

#

even on my vacation, I still can't help but spend most days programming

tawdry vapor
#

I wish our API had more specific error codes

#

Cause doing this is annoying py if e.status == 400 and "already exists" in next(e.response_json.get("id", []), ""):

#

It gets even worse. I have to do iter() before next()

hardy gorge
#

That does sound like a hassle

tawdry vapor
#

It may not be necessary, but IDK what I can and can't rely on from DRF's default error handler

hardy gorge
#

I'm trying to think of a neat way to solve this.

#

Some APIs return a unique error code in the JSON

tawdry vapor
#

I can abstract it into a custom exception that subclasses ResponseCodeError for now

#

Yes, Discord's API does that

hardy gorge
#

If I'm not mistaken, most of our current response will be {"field_name": "some reason in a long string"}

tawdry vapor
#

It doesn't explicitly state it will always have a list as the value for validation errors

hardy gorge
#

"Any example validation error might look like this:" (emphasis mine)

#

Yeah

#

It's basically "it could be this, but, hey, no guarantees, and good luck"

#

Anyway, the custom exception part beneath that is indeed interesting

tawdry vapor
tawdry vapor
#

This is so they can be distinguished from extensions by the !ext reload command and its friends

hardy gorge
#

Doesn't sound like a bad idea to me

tawdry vapor
#

Well, I suppose that's enough for me to move forward

#

People are welcome to complain in the PR if they dislike that

thick rock
#

the bot has complained about code block escape attempt twice to me

#

when I use !e

#

what's that about

tawdry vapor
#

It doesn't allow triple backticks or triple zero-width characters

#

I don't really know why the zero-width characters are disallowed but the backticks would obviously end the Markdown codeblock prematurely

thick rock
#

I don't get it

#

so don;t have anything after closing ```?

#

how can I avoid triple backticks

#

both times I pasted the same thing again, and it accepted it, at least I think I didn;t change anything

tawdry vapor
#

If your input is in a code block and you put any text before or after it, the command will not be able to extract the code from the code block and will therefore treat the entire message as the code.

green oriole
#

Why aren't we getting rid of the text before and after the codeblock btw?

#

It would allow us to place explanations before and after

#

And it is just a small regex change

tawdry vapor
#

No reason

green oriole
#

Time to open an issue I guess then

#

Will do that tomorrow

little pecan
#

need some help. Anybody Willing?

exotic ember
neon phoenix
#

I'd like to contribute to the bot but I don't know how to set up the bot and the site. Is there a guide to get started?

#

I'm using Manjaro XFCE (a Linux distrubution)

exotic ember
#

feel free to ask here if you get stuck at some point

neon phoenix
#

in that page it only says what are contributors and what's the contributors role

exotic ember
neon phoenix
#

oh

#

well, thanks

#

i though it was going to lead me to github

exotic ember
#

that probably says something about the UX though lemon_thinking

#

the link that says Github leads you to github

neon phoenix
#

i should start setting up the site, right?

green oriole
#

Yup, you'll need the site for the bot anyway

neon phoenix
#

okay

#

git clone go brrr

#

damn i'm so excited to contribute lemon_pleased

#

hm, about the test server

#

there is a new feature called "server templates"

#

they're used to create a clone of the server, but they do not contain the members and messages

#

if anyone has already a test server they could share it here so people could set up their own one in just one click

neon phoenix
#

how do i set up the big brother and the talent pool webhooks?

molten bough
#

You need to also run the site locally

neon phoenix
#

i did

#

it's running on 0.0.0.0:8000

molten bough
#

No, that's the listen address, you connect to it at 127.0.0.1

#

But you need to add a hosts file entry really

#

Like api.localhost

neon phoenix
#

hm

molten bough
#

Or you could just configure it to not use a subdomain

neon phoenix
molten bough
#

No, that api entry needs changing

#

So it's just *DOMAIN

neon phoenix
#

i see
i got 3 pings lol

molten bough
#

Rather than joining that list

neon phoenix
#

okay, so, what do i do??

molten bough
#

I'm not sure I follow - did you do what I said already?

neon phoenix
#

i didn't really understand you

#

i don't really know yaml

#

i think it doesn't work because api.0.0.0.0:8000 or api.127.0.0.1:8000 are not valid

molten bough
#

Well, yes

#

look at the site_api line

#

&API is giving that entry a name, which can be referred to using *API later in the document

neon phoenix
#

i see

molten bough
#

after that, we're joining api. and the entry labelled DOMAIN together

neon phoenix
#

okay

molten bough
#

when really all you want there is *DOMAIN

neon phoenix
#

oh

#

so

molten bough
#

however

#

now that I think about it

#

I think the django setup does require a subdomain

#

so, the DOMAIN should be set to localhost:8080

#

you can test whether that works, but if it doesn't, you need to edit your hosts file and add api.localhost

#

the hosts file is OS-specific and not part of the project

neon phoenix
#

oh sheet

molten bough
neon phoenix
#

hm, but

#

im not using docker

molten bough
#

that doesn't really matter

#

you can follow this guide, it defaults to non-docker instructions and tells you how to modify them if you're using docker

#

then you'll change the DOMAIN entry in your config to pythondiscord.local:8000

neon phoenix
#

okay

molten bough
neon phoenix
#

done

#

now why am i getting this?

molten bough
#

pretty much exactly what it says

neon phoenix
#

also, thanks :D

molten bough
#

you haven't synced yet, so

#

you'll need to confirm that

neon phoenix
#

now everything works :D

molten bough
#

No worries

neon phoenix
#

i managed to mute myself for 1 month

#

thanks for helping me @molten bough :D

molten bough
#

All good

neon phoenix
#

note: verified role is developers role

patent pivot
#

where is the DUCK POND

timid sentinel
neon phoenix
#

where is the DUCK POND
o shit

#

well

#

is it really necessary?

patent pivot
#

not really lol

neon phoenix
#

well can we pin one of the two templates?

#

because they can be useful

neon phoenix
tawdry vapor
#

Ask Joseph, he wrote he was interested in implementing them

neon phoenix
#

@patent pivot read above please

patent pivot
#

oh yeah, I have some stuff locally for that

#

so assigned to me, I'll PR it either today or tomorrow

neon phoenix
#

okay

neon phoenix
#

how do i add docs so the docs command will work?

brazen charm
#

You need the inventories of the individual docs pages e.g. http://docs.python.org/objects.inv and then add that with the base url through the set command or the admin panel on the site

neon phoenix
brazen charm
#

!d

stable mountainBOT
neon phoenix
#

:o

brazen charm
#

The base url for the package is here, and you need to grab discordpy's inventory, python.org's only has symbols that are on docs.python.org

neon phoenix
#

how would i do that?

brazen charm
#

the inventories are almost always behind the base url + /objects.inv

neon phoenix
#

huh, it seems that there's nothing on https://pypi.python.org/pypi/discord.py/objects.inv

#

maybe i'm not getting something or something's weird

brazen charm
#

The base url is what's hyperlinked in the inventories embed above

neon phoenix
#

oh

brazen charm
#

It's then used to construct the absolute urls when you fetch a doc symbol so it's the part that's shared between all of them in the package

#

You're missing the en/stable/ path

neon phoenix
#

yay now there is one :D

#

(can anyone assign me?)

brazen charm
#

You should wait for it to be discussed and approved, personally I don't think it's very impactful of a change but also don't see much use in deleting the doc embeds

neon phoenix
#

fair enough

#

i'll wait

#

i'll not pr until it's approved

brazen charm
#

(You can start that dicussion by weighing in to potentially speed it up)

neon phoenix
#

wdym?

mellow hare
#

As in like... adding any insights or comments you have about that particular issue

#

Something to help clarify why this particular issue should be carried out

brisk tinsel
#

guys

crude gyro
#

yes

neon phoenix
#

yes

neon phoenix
#

i have a question about git

#

i got assigned for the issue #1098 and i commited, but, how do i push?

#

is git push enough?

#

sorry, but this is my first "big" contribution and i don't want things break

carmine sluice
#

dev

#

local.clietn

#

local.client

green oriole
#

git push should be enough yeah, and it will probably ask you to run a longer command to set the upstream, you can do what gut says

#

Github will probably even respond with a link to directly open a PR

#

(all the lines starting with remote: are send by github)

neon phoenix
#

also, for some reason the lint is successful but the azure pipelines lint is not successful

#

bruh

green oriole
#

That's weird

neon phoenix
#

guess i'll need to commit again with some fixes to satisfy azure

opal pebble
#

is there an easy way I could copy the !doc command to my own bot as a util?

sullen phoenix
#

sure, have you seen the source?

#

you would just need to implement the database persistence on your bot instead of on a separate site (unless you have a separate site)

opal pebble
#

I have the source open atm

#

what's database persistence?

brazen charm
#

the bot requests inventory info from the site api for the bot here, but it's trivial to do that from a local source or an another way

opal pebble
#

and what do you mean by a local source?

#

I haven't been doing programming like this for very long, so even though my skills have been steadily increasing over the last few months since I started making a bot, I have yet to learn about things and terms like this

neon phoenix
#

local source -> something saved locally, for example a file

#

and, be aware that @stable mountain (bot) highly relies on https://pythondiscord.com/ (site)

#

Infractions, emails, tokens, docs... everything is saved there, in a database

#

(with emails and tokens I don't mean your discord ones, with emails I mean your github email that is got when you link your github there)

opal pebble
#

okay

#

and how should I implement the database persistence on my bot?

tawdry vapor
#

Saving the inventories to a file or to a local database

#

You'd replace the calls to the API with some file reading/writing operations, or some SQL if you're using a database.

crude gyro
#

hahaha @velvet ether, Remove blasphemous whitespace is a pretty good commit message.

velvet ether
#

Thank you @crude gyro 😁 . Also, I'll try your suggestion about passing the element, give me a couple of minutes

crude gyro
#

it's so ugly to have the show and hide functions defined inside the loop and then have the other function, defined earlier, make use of them

#

it just.. doesn't feel very Pythonic

celest charm
#

I think IIFEs can be replaced by simple scopes?

#

😄

#

oh, huh

#

no, functions bleed out

#

what a beautiful language

crude gyro
#

I know, but can't we solve this in a cleaner way? In my dream solution, we'd define all those functions outside the loop and then somehow still make it work on the right elements.

celest charm
#

Maybe you can use .bind

#

Oh, wait. You can just define the functions outside of the loop, right?

#

and use this

#

(disclaimer: I am not really a JS guru 👀)

velvet ether
#

alright, if you pass the menu_element to the wrapper, then this also works

celest charm
#

Wait. How are you using show and hide in handle_event if they are defined outside of it?

crude gyro
#

scope bleed. that's the thing that sucks.

#

I think this is better, @velvet ether

#

what you showed there

#

if it works

velvet ether
#

it does

crude gyro
#

then I'd be happy with that

velvet ether
#

Wait. How are you using show and hide in handle_event if they are defined outside of it?
i have no clue

crude gyro
#

gotta run now but I'll have a look tomorrow and probably do a 2.0 release

celest charm
#

But handle_event will refer to the last defined function, right? Have you tested it with multiple elements?

velvet ether
#

as i also explained on the pr, i did not inted for this to happen

crude gyro
#

thank you so much for all the excellent work you've put towards 2.0

velvet ether
#

np

#

But handle_event will refer to the last defined function, right? Have you tested it with multiple elements?
yikes you are right

celest charm
#

I think it works exactly as it does in Python

#

If you don't want the functions to bleed out and you don't need to use/pass this inside, you can create an arrow function and bind it to a variable

#

oh, wait, you can bind normal functions to variables.

#

So instead of

function show() {
    element.classList.add("is-active");
}

do

const show = function() {
    element.classList.add("is-active");
}

or, if you don't need this inside the handler,

const show = () => {
    element.classList.add("is-active");
}
#

and then you don't need an IIFE

crude gyro
#

can you explain IIFE?

celest charm
#

Immediately-invoked function expression

crude gyro
#

ah yeah

celest charm
#

so yes, probably the best way is to create a higher-order function outside the loop

#

as JonasUJ suggested

velvet ether
#

but it's not working rn 😳

celest charm
#

hold on

#

why do you need menu_element?

#

You're attaching the event handler to element, not menu_element

velvet ether
#

mistake

#

I tried to clarify that in the msg right after

celest charm
#

oh, sorry

#

I somehow missed it

#

why are you removing the event listener after the element has been clicked?

velvet ether
#

i dont know actually

#

is just converted the original script away from using jquery

#

it works fine without so i guess there is no reason for it

#

no sorry, that is a wrong way to think about it

#

also, menu_element was actually just some leftover

celest charm
#

maybe move show to the named function and pass in the element instead?

neon phoenix
#

One question about bot/cogs/doc.py: is the doc_cleanup function I made OK or it's preferably to use the cleanup function from bot/utils/messages.py?

cold moon
#

@neon phoenix use premade cleanup function

neon phoenix
#

okay

#

new commit today afternoon if I can

#

for the pr #1106

#

BTW, the help cog does the same :p

#

It doesn't use the pre-made cleanup function

short snow
#

How does the docs work for the bot? do you write it or it is web-scraped from some place?

molten bough
#

The docs command?

short snow
#

yes

molten bough
#

I think it uses sphinx's indexing files from documentation sites generated with it

short snow
#

oh!

brazen charm
#

It uses those to get urls pointing to what you can request, then those are scraped for relevant contents and turned into markdown

neon phoenix
#

One question: how actually the Azure Pipelines test the bot?

#

i have no idea how a program can test a bot lol

cold moon
#

@neon phoenix This can be tested with Mocking

neon phoenix
#

mocking????

#

well, i did it

#

i used wait_for_deletion from /bot/cogs/messages.py instead of using the original doc_cleanup

#

now it's time to wait for approval :|

neon phoenix
#

@cold moon one thing about the comment you made

#

you also said to not specify client

#

wouldn't it break? in the wait_for_deletion's sources, the client parameter is: client: Optional[Client] = None

cold moon
neon phoenix
#

oh, i didn't see that

#

it seems i need to read all the bot's source code if i want to write cleaner code, at this point lemon_pleased

#

uh, wait a moment

cold moon
#

This is in docstring too

neon phoenix
#

if i don't set the client parameter to self.bot, this exception AttributeError: 'Member' object has no attribute 'wait_for' is raised

#

because discord.Member doesn't have wait_for, but discord.Client/discord.ext.commands.Bot/bot.Bot does

#

hm, i think i'll open an issue

cold moon
#

Hmm

#

Yep

neon phoenix
#

@cold moon so, finally, what do you think it's cleaner?

await wait_for_deletion(await ctx.send(embed=doc_embed), (ctx.author.id,), client=self.bot)```
or
```py
doc_embed = await ctx.send(embed=doc_embed)
await wait_for_deletion(doc_embed, (ctx.author.id,), client=self.bot)```
IMO the first one is cleaner because there are no function calls inside the function call
#

¯_(ツ)_/¯

thorny fossil
#

hey soo im kinda new here. I took an online basic python class and i would like to move forward with learning python. Where or how would i do that?

neon phoenix
#

!resources @thorny fossil you can check this out

stable mountainBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

neon phoenix
#

and... this is not the right channel

#

please read the topic

crude gyro
#

seems like the new release is pretty much unusable

velvet ether
#

wah

#

then i must have misunderstood how the MANIFEST.in works

crude gyro
#

the only thing I can think of is that sdist just doesn't have the submodules available to look inside of, it just sees, you know, a .git or whatever

#

but I don't know. it's a little hard to troubleshoot. I thought the release would've failed if something like that was true.

#

did you try to build it locally?

#

okay, yeah, the build does have some warnings but didn't fail

#
warning: no directories found matching 'django_simple_bulma/bulma/sass'
warning: no directories found matching 'django_simple_bulma/extensions/*/src'
no previously-included directories found matching 'django_simple_bulma/extensions/*/src/docs'
no previously-included directories found matching 'django_simple_bulma/extensions/*/src/demo'
warning: no directories found matching 'django_simple_bulma/extensions/bulma-coolcheckboxes/dist'
warning: no files found matching 'django_simple_bulma/extensions/bulma-megamenu/megamenu.css'
velvet ether
#

running python setup.py sdist bdist_wheel in my local repo gets me a build and dist folder. In the build folder i can see all the bulma files

#

did you run git submodule update?

crude gyro
#

probably not

velvet ether
#

it is required to pull them

crude gyro
#

might need to be added to the release workflow then.

#

here's the current workflow

#

basically all it does is check out the master branch, install python, install dependencies, and build

#

so I guess we need a step to do that submodule update then

velvet ether
#

so like this? yaml - name: Install build dependencies & build run: | git submodule update python -m pip install --upgrade pip pip install setuptools wheel python setup.py sdist bdist_wheel

crude gyro
#

maybe, but I'm not sure git will be available at that stage.

#

so we miiight have to install it first

#

maybe we can just add this

#

then we can just add this on the step before the build

steps:
- name: Checkout submodules
  uses: textbook/git-checkout-submodule-action@master
velvet ether
#

I'm unfamiliar with github workflows so I wouldn't know

crude gyro
#

using marketplace actions is nice. someone else can go through the trouble of maintaining it.

#

anyway I can try to add this step

#

attempting a new release now.

velvet ether
#

it ain't there

crude gyro
#

the action failed

velvet ether
#

oh

crude gyro
#

hm.

velvet ether
#

is it trying to run the git command in .githib/workflows dir instead of the base dir?

crude gyro
#

hm, I found something

#

ah yes, okay

#

which, actually, we were already using. but submodules need to explicitly be set to True

neon phoenix
#

Sorry for interrupting you guys, but, do you think a repository map will be a good idea on the site and bot repos?

tawdry vapor
#

recursive is probably a better value, just to be safe

#

Unless it would never make sense for one of your submodules to have a submodule it depends on for normal functionality

#

@neon phoenix What's that?

crude gyro
#

yeah I'm setting it to recursive

neon phoenix
#

a markdown file, which inside there all folders and files are explained

tawdry vapor
#

We should probably do a better job of adding module docstrings rather than relying on a separate file then.

#

I suppose not every folder is a package though

neon phoenix
#

Yes, but, there's a lot of files

tawdry vapor
#

I dunno, I don't think it's necessary.

#

Their names should be self-documenting

neon phoenix
#

The repo map could help contributors that are beginners, so they don't need to really dive in
idk

#

Tbh I didn't know bot/utils/messages.py was a thing

velvet ether
#

as someone who haven't contributed to either, I would say the site is at least decently understandable

crude gyro
#

@velvet ether I think it was resolved with that last release, although I'm still getting this warning in the build log:

warning: no files found matching 'django_simple_bulma/extensions/bulma-megamenu/megamenu.css'
#

not sure why, but I don't think it has anything to do with the release workflow at least

velvet ether
#

i know

#

it's an scss file

#

🤦‍♂️

crude gyro
#

oh, lol.

#

so we just need to add an s in the MANIFEST file?

velvet ether
#

that should do it

crude gyro
#

okay, I'll do a quick release for that too

velvet ether
#

sorry about all this... It's quite a bummer of a v2 release

crude gyro
#

naw, it's fine. he was probably the only person who noticed :D

hardy gorge
#

Haha

#

I just DM'ed you the same thing about the s

crude gyro
#

man

hardy gorge
#

I guess that errors are going to be made

#

Version numbers are free, man!

crude gyro
#

yeah it's fine. it's natural even for quite popular packages to have little bugfix releases on the same day as a new major release

velvet ether
#

little bugfix releases

crude gyro
#

granted, they're usually not as serious as "this package is now unusable" lemon_hyperleased

hardy gorge
#

I guess one way to fix these build issues is to have a CI that uses the test PyPI which you can test before tagging an official release

crude gyro
#

but the megamenu thing is a small bugfix

hardy gorge
#

Haha

crude gyro
#

I honestly don't think it's that major of a problem if it's broken for a few hours. it's nice that it has enough users that someone will report a bug

velvet ether
#

this is what you get when you don't specify a version in your requirements.txt xd

crude gyro
#

the only people who would've been affected by this are people who chose today as their day to update

hardy gorge
#

Nah, but if you want to try a fix to the CI, having an actions file that pushes to the that test PyPI repository that only keeps your package around for a short while may work. It allows you to test the entire thing without actually pushing to PyPI proper.

velvet ether
#

seems to work now

crude gyro
#

nice.

green oriole
#

Was that an issue that running a local pip install (pip install <path to the source>) wouldn't catch?

hardy gorge
#

Basically, yes

#

The issue was that we needed to include a submodule during the build step

#

So, the files need to be there in the CI

#

And if you do have the files locally (which is probably because you need it to run/dev the package), it will look like it works locally

#

but then fail in the CI

green oriole
#

I've just tried to local install the package without installing anything, using the v2.0.0 tag, and it seems to build without any warning, that's really weird

crude gyro
#

there are warnings in the build log

#

they just don't stop the build

#

I would've expected the build to fail

#

that's basically why this happened

#

but it's fixed now so it's all good

brazen charm
#

@green mesa inv files are fetched through the intersphinx fetch_inventory function, they have their own format

green mesa
#

Ooo how can I start

#

I don't know much about this topic¯_(ツ)_/¯

#

Can u link me some useful link😅 easy one which I can understand

#

@brazen charm

brazen charm
#

There isn't much to it. You just install sphinx and use the sphinx.ext.intersphinx.fetch_inventory function

green mesa
#

how will I know what all it takes?

brazen charm
#

you can look at its help() output or find it in the docs

green mesa
#

Not there

#

It's not showing at docs

#

😐

#

it says fetch_inventory did not match any query

brazen charm
#

You can find the usage in @stable mountain's source, but you need the mock app (you can pass the uri to get the full links as output) and inv is the link to the inventory

green mesa
#

ok ty i will look into this

#

😄

green mesa
#
    config=SimpleNamespace(
        intersphinx_timeout=3,
        tls_verify=True,
        user_agent="python3:python-discord/bot:1.0.0"```
this is mandatory
green mesa
#

examples and explanation is not given

brazen charm
#

The inventory files only get you the link to the symbol, you have to parse it yourself from the site

green mesa
#

ooooo

#

mean now bs4 comes into play

tawdry vapor
#

Also spent all morning fixing the code in that bottom commit, but rebased so it doesn't show.

green oriole
#

It sure does

tawdry vapor
#

Apparently 22% of commits on bot's master are merge commits

brazen charm
#

That's a lot more than I'd expect

crude gyro
#

probably a good thing.

#

means we're good at keeping PRs small, basically.

#

it also probably means we're a bit too eager when it comes to clicking on Update Branch

green mesa
#

Hello
!ask command is not working 🙂

#

I tried thrice !ask but py bot is not responding other commands are working except !ask

tawdry vapor
#

It's been removed

#

I think it was announced

green mesa
#

Ahh y that was very useful😐

#

Can we some command which explains what helpers need when someone ask for help

#

I think it was announced
Sorry but I aren't able to find any announcement for that🙂

tawdry vapor
green mesa
#

Ok ty mark🙂

crude gyro
velvet ether
crude gyro
#

hm, interesting.

#

didn't realize.

#

I agree then.

patent pivot
#

quite urgent

brazen charm
#

Can take a look at it in a bit

green mesa
#

i wnt to particapte in hacktoberfest of pydis

#

how i need to participate 😄

#

i can work on issue with WIP tags but that issue also have approved tag

#

so its have been approved?

subtle kraken
#

WIP on an issue most likely means that someone is already working on it

green mesa
#

oo so on which issue i can work

patent pivot
#

If you don't see any activity in it though ask a core developer and we could reassign it

#

Otherwise the approved ones

green mesa
#

one more question i am using python 3.7.7 will i need to download 3.8 or i can work with 3.7.7

brazen charm
#

For the bot, you should use 3.8 as that is its specified environment

green mesa
#

ok

#

ty Numerlor

green oriole
#

Do we have a little guide somewhere about how to setup the SocialApp on a local website?

#

I'm seeing 3 fields in the social accounts tab of the admin panel

#

I somehow figured it out

#

How do you store if a user has accepted the privacy police? I have a user entry with my id an the "In guild" checkbox checked

crude gyro
#

this just means you're not in the User table at all

#

so, if you're on the server you can usually just sync the users to solve it

#

although I'm not sure how well OAuth works locally?

brazen charm
#

For the reminders issue, should I expand the api to allow some fetching of reminders by id, or just figure out the result from the available author filter

green oriole
#

I think my bot is currently broken, and I'm a bit too lazy tbh

crude gyro
#

For the reminders issue, should I expand the api to allow some fetching of reminders by id, or just figure out the result from the available author filter
@brazen charm

you can't fetch reminders by ID already?

green oriole
#

But I am in the User table

#

You can delete them by id, but not fetch them by id iirc

brazen charm
#

filtering is restricted to active and author ids, and get is disallowed on the direct reminders/id path

green mesa
#

what configuration should i have with flake8 before PRing

green oriole
#

There's a configuration already in the repo

green mesa
#

ok

green oriole
#

pipenv run lint should do the trick

green mesa
#

wow ty

green oriole
#

So all auth now work, but I can't access the setting page

#
Access to fetch at 'http://pythondiscord.local:8000/accounts/settings' from origin 'http://0.0.0.0:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.```
#

what

green mesa
#

where is how to setup bot is given

#

i arent able to find

#

i wnt to work on seasonal bot

green oriole
green mesa
#

ty buddy

green mesa
#

MONTH_OVERRIDE whats the use of this?

green oriole
#

To make the bot think that we are in a particular month

green mesa
#

oo so i have to give 8?

obsidian patio
#

I would prefer not to cut off the hair on the side. That just makes it look weird

crude gyro
#

yes, that looks pretty good. would've been nice if we saw the whole drop maybe

#

could possibly make the drop a tiny bit smaller

obsidian patio
#

I agree about wanting to see the whole drop. Making it smaller could make it less distinct, though

crude gyro
#

well, how about you make the drop a tiny bit smaller and the crop a tiny bit larger and sorta meet at the middle

#

maybe even move the drop down a few pixels

#

use all of these in combination to solve it, instead of just adjusting one of those factors

obsidian patio
#

Yep, I just scaled the crop and moved it slightly down the face

crude gyro
#

that could work

#

we should test it

obsidian patio
#

Yeah. I'm quite happy with how that looks

crude gyro
#

can you give me a png that has no whitespace

obsidian patio
#

Sure

green mesa
#

nice

#

emoji

#

personal access token is github, api token? which bot needs??

obsidian patio
#

Here we go

green mesa
obsidian patio
#

@crude gyro

crude gyro
#

lemon_sweat😅

obsidian patio
#

Hello lemon_sweat

crude gyro
#

yeah that's pretty good

#

nice work

obsidian patio
#

Awesome, thanks

crude gyro
#

now make us a pull request lemon_hyperpleased

green mesa
#

lemon_sweat 👍 okhandbutflipped

obsidian patio
#

Sure thing

crude gyro
#

and grats on your first lemoji

#

the first of many!

#

@green oriole lemon_sweat

green oriole
#

Yay

obsidian patio
#

Any preferred dimentions for the png?

crude gyro
#

just do what we've done for the other ones I guess?

obsidian patio
#

Right, 128x128

green mesa
#

github api token is http://api.github.com/users/{username}?

crude gyro
#

@green mesa what are you doing?

#

I'm not sure why you need a github API token

green mesa
#

i wnt to contribute to seasonal bot so configuring env vars but i am stuck with github api

#

where to get

molten bough
#

It's in your account settings, under developer on the left side

crude gyro
#

sounds like an xy problem to me

molten bough
#

iirc

crude gyro
#

I don't see why you would need a github token to work on seasonalbot

#

just disable that extension if it's throwing up errors, or configure the env var to anything at all

#

unless you're working on a github API-related feature for seasonalbot, it's not relevant

green mesa
#

ok

brazen charm
#

It only raises ratelimits

green mesa
#

i am not doing anything related to github APIlemon_sweat

obsidian patio
#

First PR lemon_sweat All feedback is appreciated

green mesa
#
Loading .env environment variables…
Traceback (most recent call last):
  File "__main__.py", line 6, in <module>
    from bot.bot import bot
  File "C:\Users\HP\Desktop\seasonalbot\bot\bot.py", line 13, in <module>
    from bot.constants import Channels, Client, MODERATION_ROLES
ModuleNotFoundError: No module named 'bot.constants'; 'bot' is not a package
PS C:\Users\HP\Desktop\seasonalbot\bot>```
getting this annoying error
crude gyro
#

that's not how you run the bot

brazen charm
#

use pipenv run start, or if you're using some kind of an ide for it you have tu run it as a module

crude gyro
#

if you wanted to run it with a regular command, you'd use python -m bot, and that would run the __main__.py as a module

green mesa
#

ooo

crude gyro
#

but, yeah, we have a run script so you should just do pipenv run start

green mesa
#

i am new to pipenv

#

never used it

brazen charm
#

How to run it etc. should all be in the contributing page for seasonalbot akarys linked

crude gyro
#

yes

green mesa
#

ok

#

wow ty

#

now its online

tough imp
#

github token is used by the branding manager

#

but it's not necessary, it only raises ratelimits for the API

#

unless you're working on the cog, you don't need it

green mesa
#

Ok

brazen charm
#

@tawdry vapor Just so I'm sure I didn't misunderstand how something works, how would I get them by ids without the api change? filter_fields is defined with ('active', 'author__id') for the reminder viewset so passing in id: id_val through params didn't have any effect and returned the whole reminders list

tawdry vapor
#

I was probably misled then

#

I only tried with a single reminder active and it looked like it worked cause it returned something

neon phoenix
#

can anyone close issue #1098?

cold moon
#

I'd like to work on it, but this is still not approved

green oriole
#

Shame that PyPi still doesn't have a search api

patent pivot
#

doooooes it not?

#

How does poetry search?

#

ah

tawdry vapor
#

That class basically looks like a mutex to me

#

Except it raises an error instead of blocking

#

I couldn't find any examples of that elsewhere

#

So I don't know what the proper name for it is

#

But surely it's some kind of mutex

#

Maybe it should just wait instead of raising an error. Chances are whatever operation happens 2nd will end up raising an error anyway.

#

Never mind. In the case of a scheduled task, we must abort it if e.g. the duration was modified, or the task itself would have to be responsible for checking if it's still valid somehow.

hardy gorge
#

Hmm, I just called it that because it acts as a gatekeeper

#

So, like a sentinel (the soldier at the gate) who either lets you through or not

#

It's probably not the correct term from a compsci/programming point of view

#

You're probably more aware of that terminology than I am

tawdry vapor
#

Perhaps, but only since today

#

Was trying to research a better name for it

#

The closest I got was PTHREAD_MUTEX_ERRORCHECK but that's only for raising an error if the same thread tries to lock a mutex it already owns

#

Nothing came up for a "non-blocking" mutex

obsidian patio
#

Any feedback is appreciated

crude gyro
#

it's a little harder to identify as a lemon without the green hair, but

#

obviously the hair shouldn't be there

#

I don't hate it.

hardy gorge
#

I think it's recognizable enough in the context of our server

#

Since we have a bunch of lemojis, this one will work

#

It won't do as well used externally, I think

#

As far as being recognizable as a lemoji

obsidian patio
#

Yeah. I agree

#

Is there anything specific that you’d like to see changed with it before I create a pull request?

#

I don't hate it.
@crude gyro I must say that this really doesn’t sound too good lemon_sweat

crude gyro
#

sorry

obsidian patio
#

It won't do as well used externally, I think
@hardy gorge are the lemojis actually used externally? Of course they would be used to some extent, but would anyone who isn’t from this server know what a lemoji even is?

#

No worries. I need honest critique in order to improve it

crude gyro
#

I'm a little preoccupied. it really is rather good, I love the cloud particularly.

#

I'm just worried that the head looks like a yellow strawberry

obsidian patio
#

Bahahah that’s really true

#

A chocolate dipped, yellow strawberry

hardy gorge
#

No, I'm not too worried about external use. It's just that in context with the other lemoji, it's recognizable; outside of that context, you may not recognize it as a lemon

crude gyro
#

I do really like it apart from that

patent pivot
#

No, I'm not too worried about external use. It's just that in context with the other lemoji, it's recognizable; outside of that context, you may not recognize it as a lemon
I think the recognition of lemojis outside the community is questionable anyway, since most lemons do not have beards

crude gyro
#

the really good ones do

obsidian patio
#

I’ll give it some minor tweaks tomorrow and push it to the branding repo

#

Sadly, it’ll have to be bald

crude gyro
#

we will just have to live with that

obsidian patio
#

Sadly, yes. At least the beard survived the explosion

hardy gorge
#

It's just lemon, but in 20 years.

neon phoenix
#

Do you think processing commands on edited messages is a good idea?

bleak grail
#

.http_cat 418 doesn't exist and that makes me sad

green oriole
#

It is because the bot is using the http module to validate the code and they didn't included 418

#

It will be fixed in 3.9

#

@neon phoenix the issue is that d.py doesn't have a native support for it, does it?