#dev-contrib

1 messages · Page 174 of 1

surreal veldt
#

I thought we were doing the sidebar thing

hoary haven
#

i explained that it was an option

#

lol, so what do you guys think, better as 1 combined page? or 2 separate pages?

#

you didn't do the relevant links though? i only see a title & a description so if this were to be merged there is no "relevant links" sidebar

#

i think it makes sense to have the vps info & detriments (cons) of heroku/replit on one page

surreal veldt
#

What's the heading of Robin's PR?

hoary haven
#

the title of the page is "VPS Services"
or the PR #? site#697

surreal veldt
#

Would Hosting Services make a better title if were to be merged?

sharp crag
hoary haven
surreal veldt
#

Shoud I close my PR?

sharp crag
#

I think so, and maybe you can migrate it so that it does the sidebar links?

hoary haven
#

so to prevent further confusion.. we agree we want this on one page?

sharp crag
#

Aye

hoary haven
#

ok then i think the simplest way forward is for Raven to close this PR, then one of you can open a new one
and it would be editing the vps-services.md file to add a line at the top of the file: toc: 2

and we'd have to add some headers to the markdown file which will autopopulate a table of contents on the side of the page

sharp crag
#

Great, @surreal veldt do you want to do that (opening a new one)? I don't want to bug you with too many PR requests haha

surreal veldt
#

Edit**

hoary haven
#

we can edit existing pages yes, but that's done by creating new PRs that are then merged to main

#

the process is more or less the same as adding new pages, except the commits are of modified existing files instead of creating brand new ones

#

does that make sense?

surreal veldt
#

Yep

#

Can I bump site#698 please

dusky shoreBOT
surreal veldt
#

how does one add a toc in the md file?

vale ibex
#

toc?

vale ibex
#

ahh

surreal veldt
#

Is it just toc: number and then to put a toc you do ## title?

surreal veldt
#

also for the metadata, where the description text put in description: appear on the page? I looked at one and couldn't find it anywhere

timid sentinel
#

description for that is the "The Python Discord FAQ." bit

surreal veldt
#

as per site#711 , does this format look good?

dusky shoreBOT
surreal veldt
#

just ignore the blank lines, I edited another page

surreal veldt
upbeat oak
#

Hello everyone, may I ask how do I contribute to the Python discord/site ?

vale ibex
#

!contributingn

stable mountainBOT
#

Contribute to Python Discord's Open Source Projects
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!

Projects to Contribute to
Sir Lancebot - our fun, beginner-friendly bot
Python - our utility & moderation bot
Site - resources, guides, and more

Where to start

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
upbeat oak
#

Alright thank you!

vale ibex
#

No problem!

#

feel free to ask here if you have any questions

upbeat oak
#

Sure !

#

Also, about this discord server, how was it created ? And by who ? Like the people who made python or the community ? If that's the question I can ask here

#

Or probably off topic ?

vale ibex
#

This isn't a server made by the Python software foundation though

#

It's an unofficial server.

#

We do have many members of the PSF in here though

upbeat oak
#

Seems official

#

Interesting, well alright then

#

I think that answered it, sorry for not asking at the right place

vale ibex
#

No worries 🙂

upbeat oak
#

Hey guys I have a question, about the website, do you guys consider about improving the website design? Like how some websites have those smooth transitions.

hoary haven
# surreal veldt as per site#711 , does this format look good?

something like this yeah, though we want the order of this switched. also are you working on this or just experimenting? because as of a few days ago @sharp crag said that he would come up with something so i didn't expect you to open that PR yesterday. we should coordinate so that we are not duplicating work

#

normally we would have issues and then assign those issues to specific people to avoid this confusion, but we are skipping that process for this project hence my wanting clear communication on this here

cc @trail pilot

cold island
upbeat oak
#

It's where our mouse cursor, wherever it goes, if it goes to a certain area, there may have some movement in the screen to reveal other commands. Let's say I move my cursor to a word called "Menu", it'll reveal the subcommands of "Menu". Is that clear?

sharp crag
hoary haven
#

ok let's make it official then, @surreal veldt is officially "assigned"

i would recommend putting the "why not to use free hosting services" at the end, not the beginning.

i also don't think replit/heroku need to be their own links in the toc

what about

  • Why to use a VPS for bot hosting
  • Recommended VPS services
  • Why not to use free hosting services for bots
cold island
upbeat oak
#

Everywhere, like a new website.

#

Or maybe we can start it with the More ( Arrow Down )

cold island
#

Sorry, I'm not sure I understand

trail pilot
surreal veldt
trail pilot
#

!remind 30m check site#698

stable mountainBOT
#
No problem.

Your reminder will arrive on <t:1728830371:F>!

dusky shoreBOT
trail pilot
#

will do

austere hornet
trail pilot
trail pilot
#

just lmk when you fix thoe

#

those*

surreal veldt
#

oh one hour ago

#

I didn't see that

trail pilot
surreal veldt
#

does it mean line 4 and 5

#

is that the double space?

#

I have shown how to get the cooldown but that uses internal attrs, can I have feedback whether to remove it because it's internals?

#

also @brisk brook do you mind elaborating on this?

brisk brook
#

There's multiple methods that can be used to customize the help command, command_callback is not the only one.

surreal veldt
#

can you give one?

#

also I decided to reomve the internal attribute for command cooldown

brisk brook
#

There's all of these methods if you scroll up and down a bit ^

surreal veldt
#

ah

austere hornet
#

Didn't even notice

mellow hare
#

Dumb question, where's our server template?

gritty wind
#

Pinned here and in the set up guide

#

Or if you're looking for the actual server

mellow hare
#

Ah yeah, doy

#

Thanks

#

Do you think I really need to list out all the help channels or are a couple in each category enough for the setup?

#

Just writing it up for the yml template thingy

#

Also, the only thing that is going to bug me is the lack of permissions coming ready to go

#

Unlike the template which has all those prepped and ready

gritty wind
#

The permissions are not really necessary for development, and not actually visible to 99% of users, since they don't have any visible changes if you are the server owner

gritty wind
wild prism
#

i have like 15 in my test server, and im 99% sure i just used the template

gritty wind
#

Hemlock is working on a tool to automatically create the server and add IDs to the config

mellow hare
#

Not hard coded, no

#

But I might as well just snag the id's along with the rest

#

And alright, that works for me

wild prism
#

oh you meant the bot config, i see

mellow hare
#

Also, I think I am going to call it auto-guild

#

It just flows nicely

#

Unfortunately I can't find a simple way to pull this straight from our existing config file since the categories and listed channels aren't all there or don't cover eachother

#

And the categories that would cover some of them are listed as comments

#

And I'd honestly rather not have to tokenize/detokenize all that

#

(and not only because I don't know how)

surreal veldt
#

@brisk brook is this better, before updating, is there anything I am missing? ```py
class MyHelp(commands.HelpCommand):

async def send_bot_help(self, mapping):
    await self.context.send("This is main help")

this is triggered when !help <command> is invoked

async def send_command_help(self, command):
    await self.context.send("This is help command")

this is triggered when !help <group> is invoked

async def send_group_help(self, group):
    await self.context.send("This is help group")

this is triggered when !help <cog> is invoked

async def send_cog_help(self, cog):
    await self.context.send("This is help cog")

# if there is an error, send a embed containing the error
async def send_error_message(self, error):
    await self.context.send(error)
brisk brook
surreal veldt
#

for the point of overriding that I guess it's better to use actually

#

let me change it

surreal veldt
brisk brook
#

The documentation like I sent

surreal veldt
#

do hyperlinks work in docstrings?

surreal veldt
#

additionally how do I add a ### [text] heading when I have toc? does it look for the first x heading where x is the number you put into toc: in the metadata?

surreal veldt
#

can you give some information to put?

hoary haven
#

i based that header on your screenshot from earlier

#
  • VPS Services
  • Why not to use free hosting services bots

^ i think this is fine too

brisk brook
surreal veldt
#

i read that wrong

hoary haven
surreal veldt
#

i just made the PR to view the preview

hoary haven
surreal veldt
#

what is this?

hoary haven
#

didn't you set up site locally on your machine?

#

that's my clipboard not copying properly lmao.

surreal veldt
#

no I did not

hoary haven
hoary haven
#

you should do that

surreal veldt
#

yeah I'll get that done tomorrow

hoary haven
#

do you have docker desktop installed?

surreal veldt
#

yep

hoary haven
surreal veldt
#

what happened to the preview for the PR i made?

#

yeah i shouldv'e done first sorry that I'll just edit it tomorrow it's pretty late

brisk brook
#

You can look at the log, rendering may have failed.

gritty wind
#

Now in terms of a fix, I'm not really sure

#

Nothing should be causing it to not show up on that page

hoary haven
# hoary haven can you follow the instructions here: https://www.pythondiscord.com/pages/guides...

@surreal veldt some time this week or weekend definitely try and get the site to run on your localhost using docker. that way you don't need to rely on github/netlifly to view what your result of your PR. as you can see it's not always reliable 🙃

even if it were, you should learn how to view the results of your changes locally before pushing anything to github. it will be a good skill to learn, plus you'll be able to see changes in realtime as you make them

i think with time zone differences, we don't have too much overlap where we're both active. but others here should also be able to help, and if not, we can schedule a time in advance when we're both free

molten perch
#

Hey, I'd appreciate a review on site#713, it's fairly easy to review.

dusky shoreBOT
surreal veldt
#

So I assume there's no way to get that preview from the bot for site#712?

dusky shoreBOT
surreal veldt
#

But yes I'll get the site running

surreal veldt
upbeat oak
hoary haven
#

if you see stuff happening with no errors, then going to http://localhost:8000 you should see the pydis website

#

as for video.. maybe. video production is a lot more work than publishing text, and videos also quickly go out of date and have to be remade entirely, whereas site pages can just be quickly modified

surreal veldt
#

Oh no not for this, I used docker with the python bot so this should be easy but that was just a suggestion i didn't think a video showing how to fork and setup the site would need to be maintained frequently

hoary haven
#

hm yeah maybe a very short generic video or gif of someone forking a repo & then cloning it could be made. we might be able to find a video that someone else has already made explaining that. maybe github has produced a video themselves that we can then embed on one of our git-related pages

gritty wind
#

I’m not sure how useful such a video will be it made by us, compared to the 100s of forking and docker guides

#

You’re already expected to read/know how to fork and pull to get started, we link stuff for that

#

And for docker, it should just be docker-compose up

#

If you have any errors or problems, the video most likely won’t cover it

gritty wind
#

That might fix it

surreal veldt
gritty wind
#

There’s a button on GitHub at the very bottom of your PR

#

Or you can git fetch upstream && git merge upstream/main while on your main branch, and then git merge main on your other branch

#

Though doing it from GitHub is pretty good too

surreal veldt
#

that semed to work but i can't still see the preview link

gritty wind
#

I’m still not sure why, it seems to possibly be an issue from github?

#

If I unfilter the api responses from PRs, I can find your action runs, but it returns missing and broken data

#

(Nothing you’ve done to be clear)

#

Just GH being annoying

surreal veldt
#

do i need to set Environment variables if using docker?

#

I got this error when using docker -compose up

ERROR: Encountered errors while bringing up the project.```
exotic ember
#

do you already have a container running? run docker ps

surreal veldt
#

do I need to do anything with postgre for this?

gritty wind
#

Docker-compose up will start Postgres for you

#

But what kosa was getting at is that you already have another container running on that port, so docker is unable to start the site because it needs it

#

What containers do you have in ps output

surreal veldt
#

Oh the bot

#
CONTAINER ID   IMAGE                                   COMMAND                  CREATED       STATUS                 PORTS                      NAMES
696cb3964d25   postgres:13-alpine                      "docker-entrypoint.s…"   4 hours ago   Up 4 hours (healthy)   127.0.0.1:7777->5432/tcp   site_postgres_1
d620e54d3139   bot_bot                                 "python3 -m bot"         8 days ago    Up 2 days                                         bot_bot_1
c2c961f8fae7   ghcr.io/python-discord/site:latest      "python manage.py ru…"   8 days ago    Up 2 days              127.0.0.1:8000->8000/tcp   bot_web_1
ef1fd2a9a9da   redis:5.0.9                             "docker-entrypoint.s…"   8 days ago    Up 2 days              127.0.0.1:6379->6379/tcp   bot_redis_1
0ecdaadeb25a   postgres:13-alpine                      "docker-entrypoint.s…"   8 days ago    Up 2 days              5432/tcp                   bot_postgres_1
1d0e2b0ea9c3   ghcr.io/python-discord/snekbox:latest   "gunicorn -c config/…"   8 days ago    Up 2 days              127.0.0.1:8060->8060/tcp   bot_snekbox_1```
gritty wind
#

The bot’s docker starts up an independent instance of the site for the API

#

So that’s colliding

#

One solution here is to just stop the bot’s first

surreal veldt
gritty wind
#

docker-compose down in the bot directory

#

Or if you’re on windows or Mac, you can do it via docker desktop

surreal veldt
#

yeah...

#

not sure where

#

i'll use the command instead

surreal veldt
#

so once I use docker how do I view previews of PR's?

cold island
#

Once you start the site container it will launch the website in localhost:8000

#

You type that in your browser's address bar ^

surreal veldt
#

that opened this page, but then what do I do?

#

pressing the site project goes to github

wild prism
#

what you're seeing is the site as generated by the code in your current branch

#

so to see what it looks like in a given PR, checkout that PR's branch and then load the site

surreal veldt
#

by load the site do I have to do docker-compose up again?

#

also it seems I'm already in that branch

wild prism
#

it has some hot reload capability, I dont know the limits of it off the top of my head

#

restarting the docker container would work though

surreal veldt
#

but like if I'm on the branch, where do I go to se the live page?

wild prism
#

wdym by the live page?

surreal veldt
#

like the new md file I made

#

to preview on the site

wild prism
#

you would navigate the site normally

#

where is the md file you made?

surreal veldt
#

i think it's apps>content>resources>guides>python-guides but

wild prism
#

should be in /pages/guides/python-guides/ then

surreal veldt
#

oh okay I found it, I've not used that site before

#

also how do I restart the docker container?

#

also I'm getting Conflict: both modified on a md file I made when trying to commit

#

i see this button

#

but when I click sync changes it says

gritty wind
#

It means that you've made changes to your local branch that aren't on the remote branch in a way that git can not resolve (conflict)

#

Best represented in a diagram

#
Local branch on your machine
      B -- C -- HEAD
A --
      X -- Y --- HEAD
Remote branch on github

Merging these two branches, even though they started from the same place can be a difficult challenge

#

But I believe in your case

#

it's probably just merging main?

surreal veldt
#

I was watching a video on it and saw a diagram I get what has happened, but i'm not sure what to do

gritty wind
#

Alright, do you know what changes you have locally, vs what you have remotely?

#

I haven't used github desktop in ages, and I don't use VSC, but most good git integrations should be able to show you a map of your branch vs remote so you can compare commits

#

Or at the least, compare the changed files

#

That's the first step

surreal veldt
#

let me check

gritty wind
#

Well, if it's your branch I was helping with earlier, I'm guessing that you merged main on github, and made other changes locally?

surreal veldt
#

That was for site#712 which I pressed the update button, this is another branch

dusky shoreBOT
surreal veldt
#

Does this help?

gritty wind
#

I'm not sure what I'm looking at hm

#

Is that the current commit?

#

Actually, could you send the branch on github, and a screenshot of your local commits?

#

That should help narrow it down hopefully

#

If you aren't sure how to get the local commits, you can do git log --oneline

#

I've gotta run now, but we can pick it up later if no one comes around

surreal veldt
#

yeah so that command shows 6da57daf (HEAD -> pinned_messages) add custom help command 7412af33 add custom help command fbb18ca6 Update discordpy_help_command.md 76658654 Update pydis_site/apps/content/resources/guides/python-guides/discordpy_help_command.md 45d13700 Add custom help command 939aa26d Add custom help command fa78e753 Add custom help command 60200a0a (origin/main, origin/HEAD, main) Merge pull request #688 from python-discord/joe-said-"we-dont-do-main-pushes-anymore" c771333d Remove API change references d1c43285 Merge pull request #686 from python-discord/readme-for-api-app 073e09a0 Mention human-readable migration names 0d1fb628 Add a README for the API app e5b27503 Merge #684 kill test warnings 2734a68e Explicitly pass timezone b7af4cf7 Capture GitHub response logs 66061855 Fix timezone awareness warnings 193f0a97 Merge pull request #683 from python-discord/readme-for-project-directory 9d5b0baa Add link to contributing guide cdb7af59 Add reference to the `resources` app 004751ad Add serial comma 8eca5c8d Add newlines for the apps section 69c88813 Elaborate on settings.py 143e0ad3 Elaborate on purpose of the urls module bd3a12eb Remove newlines added by an 🥥 INSANE PERSON 🥥 :

surreal veldt
#

Also I think i should note that i updated code from the github files changed tab directly

#

update: I'm not sure what I did exactly but I fixed it

#

Apparently changing one word and syncing again removed the error

#

this is the preview of the page about hosting/VPS
CC @hoary haven

#

site#712 (just checking the PR to see if I committed it)

dusky shoreBOT
hoary haven
#

at a glance, looks good. but i won't be able to review for some time

night wing
#

I kept getting ImportError in fact that I haven't changed anything in the code?

thorny obsidian
night wing
thorny obsidian
night wing
#

python bot or by clicking the run button

thorny obsidian
#

with poetry it should be poetry run task start

#

That would be the issue, our bot repo is supposed to be run as a module, so: python -m bot

night wing
#

oh I see

thorny obsidian
night wing
#

Okay, will definitely check that out, thanks!

molten perch
#

Hey! I'd appreciate a review on site#713 , it's literally a single line change 😄

dusky shoreBOT
surreal veldt
#

For the command errors, for example !pypi, it sends two embeds on each error, can it be merged to just send one embed?

#

for exapmle:

#

!pypi

stable mountainBOT
#
Missing required argument

package

#
Command Help

!pypi <package>
Can also use: pack, package, pip

Provide information about a specific package from PyPI.

cold island
#

Ah yes, the eternal question. Last time I probed about this I only saw positive responses, so I'm going to go ahead and say that yes, it can

cold island
#

You mean an issue?

surreal veldt
#

oh yeah that

cold island
#

There's an issue yes, although there's no conclusion there. I can update it a bit later

surreal veldt
#

was it assigned?

cold island
#

Nope

#

@vale ibex does your PR move the custom help thingy to botcore or does anything with it?

surreal veldt
#

so I just wanted to see the source code for the pypi command, but i can't seem to find where it sends those errors

cold island
#

It doesn't, it's handled by the error handler

vale ibex
#

only changes to the help command in that PR

surreal veldt
hoary haven
#

i think it goes dormant 30 minutes after your latest message, or 10 minutes after someone else's. whichever comes later

surreal veldt
#

oh it's not 30 minutes after any message?

vale ibex
#

No, it's what mina just said it is

hoary haven
#

so it would have closed at :55 but the other user prolonged it to close at :01

#

chris your pfp is terrible

vale ibex
#

thanks

#

As reparation for that heinous insult, you can review my PR bot#2118

dusky shoreBOT
surreal veldt
#

but then shouldn't #❓|how-to-get-help state this? currently it says Channels will automatically be closed after 30 minutes of inactivity which may be confusing or misleading

gritty wind
#

The thing is, we did consider that but trying to explain "it closes after 30 minutes but only when ..." is more confusing

#

For people looking to get help, they usually want to read the least possible information

#

30 minutes is a good-enough number

surreal veldt
#

also is 10 minutes not too little?

vale ibex
#

If the claimant hasn't spoken for 30 minutes then having someone else keep the channel open for another 30 minutes by sending a message didn't make sense

surreal veldt
#

oh so it's 10 minutes added on to the thirty, got it

vale ibex
#

It it 30 minutes after the claimant's last message, or 10 minutes after the last non-claimant's message

#

which ever one is later

hoary haven
#

@clever dust it will be better if you flesh out your issue to explain why you think this is a problem, what would be preferred, and a possible solution if you have one

#

also your example as it is right now isn't completely accurate

hoary haven
#

i'll go away then ¯_(ツ)_/¯

clever dust
#

why does it not say (2 days)?

clever dust
cold island
cold island
#

what is there?

clever dust
#

the difference

cold island
#

You think it shouldn't say two days?

clever dust
#

i think it should say "Duration: 2 days" the (1 day 23 hours) isn't required

brisk brook
#

🤔 why is it better to use an alpha version of Python than one covered by the safeties of official Python releases

vale ibex
#

But suggesting an alpha release to fix vulnerablities was pretty ironic

surreal veldt
#

Was site#712 seen?

dusky shoreBOT
tawdry vapor
#

@vale ibex psutil is no longer maintained according to whom or what?

vale ibex
#

they really slowed us down when migrating to 3.9, not sure if they have 3.10 wheels yet or not, haven't looked recently

tawdry vapor
#

Okay

#

Thanks for clarifying

surreal veldt
#

Python guide for functionfunctions, classes and decos (maybe)?

gritty wind
#

What are functionfunctions

#

Or is that a typo

surreal veldt
#

function *

surreal veldt
#

So...what do you think?

cold island
#

I would usually direct people to something like realpython for that

vale ibex
#

Could I get a code review on bot-core#61 and bot-core#56 they're very small

vale ibex
#

hey @molten perch, sorry realised that redis is actually optional so I changed that PR to use getattr

molten perch
#

Oh, sure. I was checking the other PR.

vale ibex
#

👌

molten perch
#

So, in theory putting _guild_available into setup_hook won't cause any deadlock, right?
It's just the event.

vale ibex
#

yea, it's just any wait_for

surreal veldt
brisk brook
#

I moved the multiline strings into the methods, as to create docstrings

surreal veldt
#

ah

#

oh my bad i misplaced them

cold island
vale ibex
#

it's called after login but before ws connect

#

The issue is when you try to await the guild_ready event in an cog load method

#

since the guild ready event can only be triggered by a websocket event

cold island
#

I don't think there's anyone using botcore except us for us to have to make deprecation warnings, but alright

vale ibex
#

Yea, I think i hit it once, because I had it setup wrong

#

so I doubt we'd ever hit it again

#

but still no harm in doing it

brittle prawn
#

can i work on this?

surreal veldt
#

anyone know why I'm getting docker failed to initialise when opening docker desktop application?
Update: Reinstalling it worked

surreal veldt
#

@brisk brook would you like to see a preview of the custom help command on site?

gritty wind
vale ibex
#

oh

gritty wind
#

Connecting and disconnecting is basically not a thing anymore

vale ibex
#

we can just delete that anyways, once your pr is merged

gritty wind
#

Which is a pretty weird model all things considered

#

Yeah true

vale ibex
#

how do connection pools work then?

gritty wind
#

They are no longer a thing either

cold island
#

They're connection parking lots now

gritty wind
#

Lmfao

vale ibex
#

nice

gritty wind
#

You just send your requests and it’s all managed under the hood, no longer accessible

vale ibex
#

ty zig

cold island
#

yw

vale ibex
#

will need to bump d.py up a bit too

#

there's forum channel support as of a few days ago

#

so we should add that. will wait until my current PR is merged though

molten perch
#

Hey, can I get one final review on site#713? 😄

dusky shoreBOT
molten perch
#

(It's just a singe line change)

brittle prawn
#

damn setting up the bot is a tedious process

austere hornet
#

Yeah, even @dusky shore was pretty hard to set up for me lol

brittle prawn
#

idt its hard yet, i havent run into any problems

#

but there are just a lot of steps lol

austere hornet
#

Well it was kinda both for me haha, 1. that it was hard and 2. many steps

brittle prawn
#

like docker which is around 500mb and url.sites change, etc

#

whoops, lol

hoary haven
#

it's about 80% of the battle ;)

brittle prawn
#

hmm

#

i think i have the redis running, whatever that is by doing docker-compose up redis

brittle prawn
#

yeah, now im getting this error

brazen charm
#

you need to define the urls

brittle prawn
#

like this, right?

#

after that im getting this error

#

i did set DEBUG = False in .env

vale ibex
#

what guide are you following to setup the config variables?

brittle prawn
#

and sometimes searching my error logs in this channel

vale ibex
#

That guide says to get site_api to site_api: &API !JOIN [*DOMAIN, "/api"]

brittle prawn
#

i think from this channel

#

i either misread or smth

vale ibex
#

I'd suggest just following the guide, it should get you fully setup

brittle prawn
#

got it working

vale ibex
#

Nice

brittle prawn
#

is there an existing function that converts a string to a timedelta?

vale ibex
#

yea, bot.converters.DurationDelta

brittle prawn
#

ty

brittle prawn
#

hey guys

#

new pr

brittle prawn
#

update to this pr

#

is it okay if the new error handling is like this?

#

i think @cold island is the reviewer

#

i used unions, but it gave a completely different error from the original

#

is this ok?

cold island
#

yeah. fwiw I think Literal can accept several strings, instead of having to specify each separately

brittle prawn
#

oh ok cool

#

ill push my new changes

cold island
#

I need to go, but will check it out tomorrow 👍

green oriole
#

I'd argue that should be solved at the parser's level

green oriole
#

My opinion isn't worth much, do as you want

vale ibex
#

@cold island PepeHands

#

it now set's the context itself, and doesn't let you set help_command.context.

This affects the button thing you did sad

green oriole
surreal veldt
brisk brook
#

Oh sorry I realize I didn't respond! I saw this earlier. What are you proposing?

#

Like- taking a screenshot?

surreal veldt
#

if you wanted to see it for the changes to make (if any)

brisk brook
#

Sure if you have screenshots, send 'em!

surreal veldt
#

Were they sent?

surreal veldt
#

i zoomed out a bit though so that's why the text is fairly small

brisk brook
#

The docstrings are still incorrectly placed here 😅

surreal veldt
#

oh i updated it by pressing commit suggestions on your code change, let me check again

#

it doesn't get updated on vscode?

cold island
#

Where is the change documented?

vale ibex
#

might need to bump d.py up to latest in this PR

#

to avoid having to rewrite that

#

would give us forum channel support too

#

I'll look at it this evening

brisk brook
outer oasis
brisk brook
#

What do you mean? Like- when you see those "Bluenix suggests" comments?

outer oasis
#

Yeah

brisk brook
#

Mark the lines you want to change, which can be multiple, by clicking that + and dragging it

#

Then all the way to the left in the Markdown editor there is a file icon with like a plus-minus icon in the middle

#

It'll paste a codeblock with the suggestion language and then you can edit the code inside of it

outer oasis
#

Ooooh
Well now I feel dumb
I've never seen that button before, so I've just been leaving comments with suggestions

#

So it's just the suggestions codeblock, nothing else required?

brisk brook
#

Otherwise you'll add lines

outer oasis
#

TIL
TYSM, now I can look like I actually know what I'm doing

cold island
vale ibex
#

well, I can bump the version in bot-core easily

#

😅

#

it's doing things about that is the hard part lol

surreal veldt
#

updated the docstrings

brisk brook
vale ibex
#

it actually improves something too

#

on_thread_create is a thing now

#

rather than being rolled into on_thread_join

#

Just need a sense check on bot-core#64 and I can push it to the bot PR

dusky shoreBOT
vale ibex
#

This bot PR has quite a lot of moving parts now 😅

cold island
#

6.0 🙈

vale ibex
#

lol

#

we probably don't need to be super strict on semver for this

cold island
#

I feel like we could start with a beta version lol

vale ibex
#

but I've just incremented major version for anything breaking

#

probably could have done some beta versioning yea

cold island
#

How do I know the commit from the zip url

#

I need to make sure you're not reverting us to dpy 0.9

vale ibex
#

lol

#

the name of the zip file is the commit hash

cold island
#

for now lemon_warpaint

vale ibex
#

thank

#

just got 2 oddities to investigate now

vivid summit
#

hi

brisk brook
#

Hello

hoary haven
#

i would like to add support for epoch time stamps for when editing infraction durations. the reason is, sometimes we use the .epoch command to give ourselves a formatted timestamp to use when responding to users in modmail

so it would be nice to be able to just copy/paste that same epoch timestamp when editing a mute or a ban duration

if core devs are on board with this idea, is this something we should consider putting on bot-core? since we now have time/duration-related things on bot and lance (idk about sir robin)

#

by "this" i mean the converters and such

cold island
#

We can consider it for bot-core, but for now if we want this feature it can just be added

#

Also .epoch generates timestamps, it doesn't parse them

hoary haven
#

oki

earnest bone
#

Hii guys

surreal veldt
#

hello

vale ibex
#

Thanks for the review @timid sentinel I know it wasn't a small one 😅

timid sentinel
vale ibex
#

Yea, so much boiler plate has moved there now, it's nice

timid sentinel
#

woop woop, ready to merge then?

vale ibex
#

Yea, lets do it

#

lucky to have both of us around in case we hit something weird in prod

timid sentinel
#

Will let you do the honours :)

hoary haven
#

should things be working?

#

or no

vale ibex
#

the modpings scheduler issue we've been seeing is now causing the task to fail, so cogs don't load

hoary haven
#

ah ok

vale ibex
#

An actual fix would take longer, and is coming in the PR mentioned

timid sentinel
#

hopefully everything should be working now

thorny obsidian
timid sentinel
#

ah I probably should have looked there before saying that

#

most things are working

vale ibex
#

yea

#

working on a fix for the things that aren't

#

I'm ripping out the modlog dependency from defcon

#

we can't guarantee load order

#

So I'm just going to send things to the defcon channel instead

vale ibex
#

This one isn't quite as trivial, but does the job bot#2137

dusky shoreBOT
vale ibex
#

not sure if you're still around @timid sentinel

thorny obsidian
#

@vale ibex are our tags broken?

#

also like... commands like !pep and !pypi

vale ibex
#

error handler is broken

#

the PR above will fix it

thorny obsidian
#

the entire error handler?

vale ibex
#

the cog isn't loaded, yea

thorny obsidian
#

I thought the above is just fixing the modlog cog

vale ibex
#

an error on the modlog cog loading caused the error handler cog not to load

thorny obsidian
#

that seems... very bad

vale ibex
#

we just merged a big PR so there are some snags

#

arthur deploy restart bot

radiant merlinBOT
#

:white_check_mark: Restarted deployment bot in namespace default.

vale ibex
#

this actually might hlep

thorny obsidian
#

I mean, can we try to ensure our error handler cog loading is more robust?

vale ibex
#

is load order dependant

#

I think the fix is to make an error in one cog not stop the whole task

#

can deal with that once these issues are fixed though

#

!venv

#

should be fine now

#

the problem is only hit if defcon is loaded before modlog

#

which none of us hit when testing 😅

#

!c list

hoary haven
#

hm, i have to head out but why did ka restart do anything?

vale ibex
#

cog load order is random every boot

hoary haven
#

oh you restarted bot, using ka

#

?

vale ibex
hoary haven
#

oki

vale ibex
#

Alright bot#2137 is critical, as it could cause the bot to fail to load some cog depending on load order.

bot#2138 is high, as it's causing !cog list to report incorrect load statuses

gritty wind
#

Chris just tell me which buttons to press

#

Also

#

!issue new "Make cog loading deterministic" P0

vale ibex
#

lol nah

#

just don't use get_cog on init

#

and/or deal with the fact it can be None

#

easy

gritty wind
#

lol

vale ibex
#

intercog dependency is a pain lol

gritty wind
#

I'm making the suggestion more to address the "which none of us hit when testing"

#

Uh

from botcore.utils._extensions import unqualify

#

not sure if we have time to like

#

not do this 😅

vale ibex
#

yeea, that probably shouldn't be a private class lol

fallen patrol
#

sound like a simple fix is crash on import errors when loading cogs

#

this will mean that the bot will not work if a cog fails to load

#

its also what @dusky shore does afaict

#

basically, don't catch cog load errors

gritty wind
#

Realistically that's probably worse considering we don't run in CI, just CD

vale ibex
#

we don't catch them, but they're async now

#

so it's done in a task, meaning if one fails already loaded cogs are happy running

fallen patrol
#

sounds like the fix would be to reraise task errors?

#

as that would return to previous behavior

fallen patrol
#

my bot uses a ton of intercog dependencies

vale ibex
#

yea, it's not bad, so long as you manage the fact that it can be none

#

which this wasn't

vale ibex
dusky shoreBOT
vale ibex
#

will tag and push to the branch on merge

gritty wind
vale ibex
#

I suppose it is rare cogs are unloaded like this

#

this is currently how we get our cog list

#

So the change would be to update this frozenset(set) to a list/tuple/dict IG

#

so long as walk_packages has deterministic order

fallen patrol
#

hm i could use typing.cast

hoary haven
#

well, the reactions are being added to incidents, but sending them to the archive isn't working

#

nvm, misread smth
also didn't see the archive bc i had it muted

green oriole
#

would it be possible to remove hardcoded variables in the modmail plugin repo? - 🏓 @vale ibex

#

mainly looking at the appeal plugin rn

vale ibex
#

I wouldn't be against it, but I also don't have much time right now

surreal veldt
#

@brisk brook can you take over the subclassing context

brisk brook
#

I hope I didn't "complain" too hard in my review?

surreal veldt
#

I honestly didn't think I would have to change so much and i have quite some open and changes for all of that are getting a bit tedious for me to be honest

brisk brook
#

Okay- but you're still gonna continue with the other ones yeah?

surreal veldt
#

i will try to do it yes

#

also what's this mean?

brisk brook
#

You currently have one empty line between bot = ... and @bot.command() but there should be two ones: ```python
bot = ...

@bot.command()
async def ...(): ...

surreal veldt
brisk brook
#

Yeah I think I saw those, looks great rendered!

surreal veldt
#

yeah i don't think empty lines in the code have any affect on the final outcome but i'll change them

brisk brook
#

It's about following the style guide we have for all code

#

@surreal veldt what I meant there is that instead of writing this: ```

  • Some very long sentence that gets difficult to read on most editors
...you can write:
  • Some very long sentence
    that gets difficult to read
    on most editors
#

They should render the same in the output because of how Markdown works. You can split it on like 120 characters which is what we use for code

#

I am on my phone so it's a little difficult counting the characters compared to the vertical lines you can place in editors and the bottom-right info with cursor placement.

vale ibex
#

Alright, there's a few outstanding PRs off the back of last night's discord.py upgrade site#716 bot#2140 bot#2138 bot#2137 and bot#2142 for an existing issue

all but 2 of them are very trivial. the 2 less trivial, are still <50 lines

cold island
vale ibex
#

not too sure

#

wait, how did it happen as in how did the bug get hit, or how did the code make it into the codebase?

cold island
#

the first one

vale ibex
#

the !clean invocation was deleted before that line was hit

cold island
#

yes, but by what 🤔

vale ibex
#

not sure how

cold island
#

Did someone clean inside a mod channel?

vale ibex
#

@hoary haven

#

explain

#

thank

cold island
#

Because that's the only way it can happen really

#

Doesn't matter, the fix is fine anyway

vale ibex
#

Yea, the auto-deletion is done after

#

and only in non-mod channels

cold island
#

In the defcon thing, how about instead of using a property for modlog, make an async getter function which will await until the cog is loaded?

#

Just sleep for a second every time loading fails

vale ibex
#

I guess realistically it doesn't make a difference in practice, since modlog will always be loaded really

#

So it'll just mean we don't need to deal with it being None

#

since it'll never be None, it'll just wait forever/raise (if we add a timeout) if it's not

cold island
#

yeah, and we assume modlog is always loaded

vale ibex
#

yea agreed, that would be better

#

since we can just use bot.bot.instance

#

I might make that change this evening anyway

#

but we probably want to merge the PR I have now, since the bot could break if redeployed without it

hoary haven
#

mod-spam

#

the command did work elsewhere before that iirc

cold island
#

I could edit the PR now if you'd like?

vale ibex
#

I can make the change if you give me a diff, so you can approve

#

just in work calls so can't think too hard without losing attention lol

hoary haven
vale ibex
#

The !clean commadn that you invoked

#

did you manually delete it?

hoary haven
#

no

#

iirc i did !clean until <msg id>

#

@exotic ember colour LaserKeypora

#

does one of these PRs fix the 500 error for site logs? or is that an unrelated thing?

exotic ember
#

I got rid of u when I moved to america pydis_strong

hoary haven
#

i am american but am slowly getting indoctrinated by all the brits sadcat2

exotic ember
#

@vale ibex coulor

vale ibex
#

thank

hoary haven
#

whose color is the string, the bot's role color?

vale ibex
#

the embed colour

hoary haven
#

oh the embed

vale ibex
#

well, that's what was causing the problem in that specific issue

#

the thing I fixed was to have the helper func work with both ints and strings

hoary haven
#

btw how does dev-alerts work, does it somehow know not to make duplicates of the same kind of error? is that done on sentry's side?

vale ibex
#

yea

#

to all those questions

hoary haven
#

ThumbsUp_BC danke

#

i will review what i can in a couple hrs

vale ibex
#

@gritty wind @cold island @exotic ember for the modlog defcon thing, I'm planning to write a send_log_function util into bot-core tonight

#

which should solve the problems

gritty wind
#

Very naice

surreal veldt
dim pelican
#

Mod+ at least since its a moderation action

vale ibex
#

it's not going to be specific to mod-log, since you pass it a messageable

#

so it's just a wrapper around Mesageable.send with options to have embeds etc

#

so it could be reasonably useful for other bots

cold island
#

ok

cold island
vale ibex
#

naah, I'll just PR it to core this evening

cold island
vale ibex
#

oh, that diff

#

yea I can get that into the PR now

#

and refactor to a help util in another PR

cold island
#

it can probably wait until later either way, so up to you

fallen patrol
#

ctx.reply(..., fail_if_not_exists=False)

#

if that doesn't work, then use Message.to_reference(fail_if_not_exists=False) and pass that to the reference kwarg on Messageable.send

#

this behaves on discord's backend, which means you won't get an error if the reference doesn't exist

hoary haven
#

merging anything at this point is risky bc bot will redeploy automatically, correct?

gritty wind
#

Affirmative, but if you want to merge something just inform devops to be on standby

#

Worst case we can roll back a little

hoary haven
#

i just approved 2140 but it's not urgent

gritty wind
#

I’m available if you want to merge it now

hoary haven
#

(not as urgent as the others i mean)

hoary haven
#

that makes me nervous lol

gritty wind
#

I don’t fully understand what’s broken or how to fix it, so instead I plan on giving that a shot maybe one time, then rolling back the deployment to a working version

#

That requires direct cluster access, hence devops

hoary haven
#

bot#2140 is comparably less urgent, it just affects the incident queue a little bit
i would like to review site#716 before we try anything, bc the logs not being available is annoying

surreal veldt
#

@gritty wind by the way any update for the docs command to slash commands?

gritty wind
#

No one’s pushed that yet and I’m not available to head anything right now

surreal veldt
#

What do you mean by push?

hoary haven
#

nvm misread.

#

i'm guessing by " no one's pushed' he means "no one has strongly advocated for"

gritty wind
#

No one has brought it up, or attempted to reach a conclusion

#

Yup

hoary haven
#

and even if someone were to, i'm guessing core devs need to come to an agreement on our approach to migrating to slash commands in general

#

and these conversations & decisions do take some time and planning

#

the issue is still open though iirc, so it will eventually be addressed & decided on

vale ibex
#

likely will happen first time

fallen patrol
#

or

#

the extension manager cog isn't being loaded

hoary haven
#

hm, how do i reproduce the error that caused site not to be able to parse a color given as a string?
i've tried spamming with youtube links and twitter links but logs load fine

surreal veldt
#

docs command doesn't work?

fallen patrol
#

nice

still prawn
#

Hey, how would I contribute to the bots? I am still confused on how-to.

gritty wind
#

Have you seen the guides for setting up the bots on our site?

gritty wind
#

How far did you get with those

still prawn
#

Not far

#

They are confusing

gritty wind
#

Alright, I can try and guide you through it if you tell me what you’re on

still prawn
#

I lost the link 💀

#

!contrib

stable mountainBOT
#

Contribute to Python Discord's Open Source Projects
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!

Projects to Contribute to
Sir Lancebot - our fun, beginner-friendly bot
Python - our utility & moderation bot
Site - resources, guides, and more

Where to start

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
still prawn
gritty wind
#

Sure, I can help with that

still prawn
#

Great!

#

What do I need to do?

gritty wind
#

Do you have python, docker, and git installed on your machine?

#

Docker is optional, but it can make things easier

still prawn
gritty wind
#

Alright. Git is mandatory for almost all open source projects, since it’s what enables multiple people to work together on the same thing at the same time

still prawn
#

Ah

#

I thought I could copy-paste

gritty wind
#

You can technically commit your code online through GitHub directly, but you won’t be able to easily get the code on your machine, or make contributions

still prawn
#

Ah

#

Then I can install it

gritty wind
#

What operating system are you on?

still prawn
#

Windows

gritty wind
#

You can download git from here in that case

still prawn
#

Thanks

#

And what is Docker?

gritty wind
#

Docker at the most basic level is just a tool to allow us to run the code in similar environments, even if we’re on different machines.

Basically, if you run the project with docker, it’ll run on a Linux-like machine, with the exact requirements for the project installed on it. There’s more to it than that, but this is one of the core things

#

This means, you can either set up everything on your machine, or you can install docker, and have everything be set up for you

still prawn
gritty wind
#

You’ll still need git either way

still prawn
#

Okay

hoary haven
# still prawn Okay

feel free to ask a question if you get stuck, even if Scaleios isn't available, eventually one of us will be able to get back to you

brittle prawn
cold island
#

will review now

brittle prawn
#

thanks :D

#

thanks for the merge

hoary haven
#

congrats party

cold island
#

hmmm @vale ibex I'm thinking about how to fix the modpings cache issue. With the reminders, we knew who the member was, so we could just get_or_fetch them. Here, we get the members through the role, which might not have all members yet

#

ah I know

vale ibex
#

you could await guild.chunked

cold island
#

We do have the members in the redis cache

cold island
vale ibex
#

nah, it failed last time trying to chunk

#

guild.chunked is a bool

#

just wait until this is true

hoary haven
#

hi chris how fix site#717?

dusky shoreBOT
vale ibex
#

uhhhhh

#

ah, you've made a model change, so you'll need to generate a migration too

#

are you running locally or in docker?

hoary haven
#

at the time i did this, docker

#

i can do either

vale ibex
#

locally would be easier to generate the migration

#

get the site running locally on this commit

#

then do poetry run python manage.py makemigrations in another terminal

hoary haven
#

should the site venv be active in the other terminal?

vale ibex
#

shouldn't matter since you prefix it with poetry

#

poetry run will always run under the venv

#

if there is a poetry env for the current wording dir

hoary haven
#

i thought i had run site locally recently but i guess not, getting some errors. one min

vale ibex
#

can explain how to do it with docker if you want

hoary haven
#

yes pls

vale ibex
#

so in the sites docker compose the postgres server has the follow port config ```
ports:
- "127.0.0.1:7777:5432"

#

that means localhost:7777 on your machine points to postgres within docker

#

so in your .env add DATABASE_URL=postgres://pysite:pysite@localhost:7777/pysite

#

run the project in docker

#

then in another terminal run the same migration command as above

#

it might need more, so tell me if it errors

hoary haven
#

mk

vale ibex
#

uhhh wut

#

could you do poetry run python

#

then ```py
import socket
socket.gethostname()

hoary haven
#
site on  BIG-SOLIDUS-MAKETH is 📦 v1.0.0 via 🐍 v3.9.8 took 7s
❯ poetry run python
Python 3.9.8 (main, Jan  7 2022, 01:06:40)
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostname()
'mbp.local'```
vale ibex
#

hmm

#

ok

#

now try socket.gethostbyname(socket.gethostname())

hoary haven
#

'127.0.0.1'

vale ibex
#

that's odd

#

why isn't it working in the code then

#

can you just try and run the code again? 😅

hoary haven
#

yeah

#

so i'm restarting with docker, it's telling me my models have changed blah blah blah

#

in a new terminal run poetry run python manage.py makemigrations

vale ibex
#

yea

cold island
#

Found bugs in our extensions cog with the new discord.py bump. Will PR in a sec

hoary haven
vale ibex
hoary haven
#

do i need to restart docker

vale ibex
vale ibex
hoary haven
#

django.core.exceptions.ImproperlyConfigured: Set the METRICITY_DB_URL environment variable

vale ibex
#

edited it btw, had wrong

hoary haven
#

django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'

vale ibex
#

poetry install --remove-untracked

hoary haven
#

psycopg2 is the thing that fails when doing poetry install too. i don't recall if i ever managed to get that working on my mbp

vale ibex
#

yea, that'll be an issue

#

what's the failure?

hoary haven
vale ibex
#

maybe this will work?

cold island
vale ibex
#

seems it, try the migration command now

hoary haven
#

i did the steps in that comment except my pyenv3.9

vale ibex
#

jsut do poetry install --remove-untracked first

#

to make sure you're on the correct version in our lock file

hoary haven
#
site on  BIG-SOLIDUS-MAKETH is 📦 v1.0.0 via 🐍 v3.9.8 (.venv) took 4s
❯ poetry run python manage.py makemigrations
Migrations for 'api':
  pydis_site/apps/api/migrations/0082_auto_20220421_2329.py
    - Alter field name on offtopicchannelname```
vale ibex
#

cool

#

that's worked

#

just rename the file so that it describes what the migration is

hoary haven
#

oki

#

thank youuuu. when i looked at the git blame for when you added support for <> i didn't realize there was another file changed

vale ibex
#

hah no worries

#

once the site side is merged, there's some changes needed in bot too

#

it'll be in the converters file iirc

hoary haven
#

yeah i pushed that change already

vale ibex
#

ah cool

hoary haven
#

site one has to get merged first right?

#

what happens if it is done out of order?

vale ibex
#

site needs to be merged before bot side yea

#

otherwise the bot will allow the new characters to be used in the convertor, but then site will 400 error when you add an otn with them

hoary haven
cold island
#

mmm how can I empty the member cache?

vale ibex
#

during runtime, or have it not populate at all on boot?

cold island
#

runtime

#

I guess I can just empty the deque directly

vale ibex
#

yea, likely the best

cold island
#

or no wait

#

nvm I'll find it

#

it's a dict

hoary haven
cold island
cursive relic
#

is there a way to disable @stable mountain from sending message after you open help channel?

frozen wren
#

What is the function of webhook for python discord bot?

subtle kraken
#

Sending messages
Webhooks allow you to use different name and avatar for every message so that allows for nice logs of what other people said

frozen wren
subtle kraken
#

Delete webhook?

frozen wren
#

currently the test server don't have any webhooks

subtle kraken
#

If you dont mind spam you can just set it all to same webhook iirc

#

Since its for dev test it shouldnt matter

hoary haven
#

@glad zinc is it possibly a regional thing?

glad zinc
#

It could be. Using the English (UK) keyboard if that makes a difference

hoary haven
#

okay i looked it up, there's an iOS setting for "smart punctuation" that you can turn off

glad zinc
#

I see. Thanks, have that turned off. Will try it out again

#

#bot-commands message Ty!

hoary haven
#

nice

#

as for your original idea to have the ” ‘ characters automatically transformed, i think we might lean towards not doing that because we probably don't want snekbox to accept invalid python

bot#2147

dusky shoreBOT
hoary haven
#

since ` takes a while to get to

glad zinc
#

Interesting, never thought about doing that

frozen wren
#

That is botcore in __main__.py? I can't find it in the project folder or in the PyPI

#

do anyone knows?

hoary haven
#

how did you install the other dependencies?

frozen wren
hoary haven
#

in the pyproject.toml file there should be a link to the botcore package (a zip file)

vale ibex
#

You need to use poetry to install the project dependencies, to ensure you use the correct version of each thing

#

The bot contributing guide walks you through doing this, and setting up the rest of the bot

hoary haven
#

i have issues with poetry installing specifically for botcore so if that's the only one that fails i just pip install it

#

but yes you should use poetry

hoary haven
#

i might've gotten your error before too but it was a while ago.. i don't remember

rapid swallow
#

remember or ban

#

🔫

hoary haven
#

you'd think with the amt of times i've run into issues repeatedly i'd have a manual lol

hoary haven
dim pelican
vale ibex
#

That's not out of date

#

The required flag means the token key inside the bot category is required

#

bot.token pulls from the env file

dim pelican
#

The user had a .env file, but it wasn't being read or found

vale ibex
#

The one in the bot guide is a template to setup dev, the config-default file in the repo are the vales used in prod

#

Your supposed to laleave config-default alone

#

And make a config.yml file

#

Which overrides the values in the defaults

#

It's explained in the contrib guide

dim pelican
#

Gotcha gotcha

hoary haven
#

i would also recommend making a backup of your config.yml once you finish it

i've deleted my local bot directory once and then later realized oops i deleted my config too, which is gitignored and isn't present on your fork or git history

hazy lily
gritty gate
gritty gate
hazy lily
gritty gate
hoary haven
#

there was just 1 minor thing that i pushed a fix for, which was linting-related
if you have pre-commit installed, git will prevent you from making any commits that don't pass our flake8 configurations

#

let me or anyone here know if you need help setting that up, since it's important to lint before you push any commits

#

in some cases it will actually edit your file for you if the fix is minor (like removing extra white space)
otherwise, it will tell you which rule prevents your code from "passing" so you can change it before staging & trying to commit again

#

write poetry run task precommit in the site project directory to install pre-commit

#

if it installs correctly you should get pre-commit installed at .git/hooks/pre-commit

surreal veldt
surreal veldt
patent pivot
surreal veldt
timid sentinel
#

Those are the ones on the meta repo

patent pivot
#

oh my bad misread the message, yeah any interactions on the meta repo go to the meta channel

#

it's not a development thing - we just use meta as a generic issue board

frozen wren
#

Got this "undefined alias 'DOMAIN'" after changing the yaml file. How to fix it? Thank you

tawdry vapor
#

The &DOMAIN is the part that you need to keep

cursive relic
#

is there a way to delete a bookmark?

austere hornet
#

If there isn't one open already, you could most certainly open one

cursive relic
#

sir-lancebot#918

dusky shoreBOT
cursive relic
vale ibex
#

ah yes, that PR

#

I'm going to simplify that cog a lot

#

it doesn't need redis, and it adds so much complexity to it

austere hornet
#

👍

frozen wren
#

Hello. What is your general procedure of reading a developed package and tries to understand it, then working on it?

I am looking at the Github package of this python server.
I want to discover how the bot manage "help channels (available / occupied / dormant)". Just this feature.

I have forked the depository in my computer and this is the starting point of reading it.
https://github.com/python-discord/bot/blob/main/bot/exts/help_channels/_channel.py

I feel overwhelmed because there are so many items. Many functionalities there.

When checking a project file, as a general procedure, which files you would start with? Thank you

cold island
#

Because most of the bot is structured to work with that library

frozen wren
#

I can build basic discord bot that reads text message events.

vale ibex
#

the help channel system is one of the more complex parts of our bot

#

so it will be quite hard to get a handle on it at first, even if you were experienced with discord.py

#

I would recommend starting in _cog.py and looking at the command & event handlers

#

as that is the first part that get's hit when interacting with the cog, so you can follow the logic from there

vale ibex
#

Could I get a review on bot-core#69

dusky shoreBOT
gritty wind
#

No

#

It's too late

#

Is there an opposite to else in a while loop

#

Probably calling code before breaking, my brain can be 🥜 sized sometimes

vale ibex
#

lol

gritty wind
#

Should we still load the cog or not hm

#

Originally I did have an x attempt timeout, followed by not loading the cog, but I couldn't figure out how to abord from an on_load

#

I can skip loading syncers pretty easily

vale ibex
#

I think loading the user syncer without the member cache would be bad

#

the role syncer would be ok

#

but if the cog is loaded, then an admin could unintentionally start a user sync via the command

#

so might be better not to load the cog at all

gritty wind
#

How would I go about doing that in this stage 😅

cold island
gritty wind
#

Trying to prevent or unload a cog from the cog_load event

#

Bare in mind I haven't kept up with d.py development at all, and I have no idea what that event is

#

So like create a task to call unload?

cold island
#

cog load event? You mean just the cog's init? Either way creating a task to unload and exiting early should work yeah

gritty wind
#

There's a new post-init event (may not be part of the library, just something chris did), that is possibly called in a task?

#

But the function is just called cog_load and is inherited from Cog

#

Cog here being

cold island
#

It's a new dpy thing I think

gritty wind
#

discord.ext.commands.Cog

cold island
#

Maybe you could unload from inside the load directly

#

Just await the unload

#

Can't think of anything preventing that