#dev-contrib
1 messages · Page 174 of 1
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
What's the heading of Robin's PR?
Would Hosting Services make a better title if were to be merged?
I would prefer one as to not confuse users. Both of these are very similar and connecting them in some way would be best
i think so too.
we should have it all on one page, titled appropriately, with appropriate headers. then you can make a table of contents which will create links like
pythondiscord.com/blah/hosting-services/#why-free-hosting-sevices-bad
(for example)
Shoud I close my PR?
I think so, and maybe you can migrate it so that it does the sidebar links?
so to prevent further confusion.. we agree we want this on one page?
Aye
https://github.com/python-discord/site/pull/711 we can comment on this including that info so if anyone stumbles on it, they'll know
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
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
You can't exist your current one?
Edit**
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?
how does one add a toc in the md file?
toc?
Learn how to write and publish a page to this website.
ahh
Is it just toc: number and then to put a toc you do ## title?
thank you
yeah
which looks like https://www.pythondiscord.com/pages/frequently-asked-questions/
The Python Discord FAQ.
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
It goes in the embed like here, not sure where else
description for that is the "The Python Discord FAQ." bit
as per site#711 , does this format look good?
just ignore the blank lines, I edited another page
CC @hoary haven
Hello everyone, may I ask how do I contribute to the Python discord/site ?
!contributingn
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
- Read our contribution guide
- Chat with us in #dev-contrib if you're ready to jump in or have any questions
- Open an issue or ask to be assigned to an issue to work on
Alright thank you!
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 ?
Those sort of questions are better suited for #community-meta
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
Seems official
Interesting, well alright then
I think that answered it, sorry for not asking at the right place
No worries 🙂
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.
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
What sort of smooth transitions?
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?
I don’t mind if Raven works in on
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
Where would it be applicable in our website?
Everywhere, like a new website.
Or maybe we can start it with the More ( Arrow Down )
Sorry, I'm not sure I understand
i definitely agree on this, maybe we could open a public thread in this channel for the bot migration project so the messages don't get missed or flooded
can you check this by the way @trail pilot
!remind 30m check site#698
Your reminder will arrive on <t:1728830371:F>!
will do
Oh yeah +1 on the thread idea
i keep forgetting it's 30M not 30m
my comments would be virtually analogous to Bluenix's, so i'm not sure how valuable my review would be
just lmk when you fix thoe
those*
have I not?
oh one hour ago
I didn't see that
yep
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?
There's multiple methods that can be used to customize the help command, command_callback is not the only one.
can you give one?
also I decided to reomve the internal attribute for command cooldown
ah
Oh my lmao 30 months??? 🤣🤣
Didn't even notice
Dumb question, where's our server template?
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
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
Just a couple. I don't think we have them hardcoded in our config either? We just have the categories
i have like 15 in my test server, and im 99% sure i just used the template
Hemlock is working on a tool to automatically create the server and add IDs to the config
Not hard coded, no
But I might as well just snag the id's along with the rest
And alright, that works for me
oh you meant the bot config, i see
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)
@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)
It's not completely correct (you should call get_destination()) but maybe you just want to link each method? The docstring contains useful information
what's the difference between get_destination and self.context.send
for the point of overriding that I guess it's better to use actually
let me change it
what do you mean by link each method?
The documentation like I sent
do hyperlinks work in docstrings?
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?
okay so I made everything except I'm not sure what to write for - Why to use a VPS for bot hosting, I have a little only so far so as of now I'm not sure if it deserves it's own part in the toc
can you give some information to put?
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
also do you know this?
It won't render no, you'll have to place it in the markdown
the raw link?
i read that wrong
i didn't understand this question, sorry
i just made the PR to view the preview
did you read this section: https://www.pythondiscord.com/pages/guides/pydis-guides/how-to-contribute-a-page/#table-of-contents
Learn how to write and publish a page to this website.
what is this?
didn't you set up site locally on your machine?
that's my clipboard not copying properly lmao.
no I did not
this link: https://www.pythondiscord.com/pages/guides/pydis-guides/how-to-contribute-a-page/#table-of-contents
Learn how to write and publish a page to this website.
you've never run the site using docker?
you should do that
yeah I'll get that done tomorrow
do you have docker desktop installed?
yep
can you follow the instructions here: https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/site/#run-with-docker
A guide to setting up and configuring Site.
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
You can look at the log, rendering may have failed.
@surreal veldt the reason the preview did not work is that github is being a trouble child again and not returning your pull-request from the API
https://api.github.com/repos/python-discord/site/actions/runs?event=pull_request&per_page=1000
Now in terms of a fix, I'm not really sure
Nothing should be causing it to not show up on that page
@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
Hey, I'd appreciate a review on site#713, it's fairly easy to review.
So I assume there's no way to get that preview from the bot for site#712?
But yes I'll get the site running
For the guides like those, was it considered to have video representation? Because many people I believe tend to understand those better. Just a thought
Oh it's ok, I'll try focus on something else
it should be as easy as cd to the site repo in terminal, and then doing docker-compose up
please give it a try (but i am heading to bed soon)
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
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
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
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
Try updating your branch, it's currently 40 commits behind
That might fix it
what do you mean by upading it? What's the command?
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
that semed to work but i can't still see the preview link
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
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.```
do you already have a container running? run docker ps
I do, yes
do I need to do anything with postgre for this?
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
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```
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
how do I stop it?
docker-compose down in the bot directory
Or if you’re on windows or Mac, you can do it via docker desktop
so once I use docker how do I view previews of PR's?
Once you start the site container it will launch the website in localhost:8000
You type that in your browser's address bar ^
that opened this page, but then what do I do?
pressing the site project goes to github
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
by load the site do I have to do docker-compose up again?
also it seems I'm already in that branch
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
but like if I'm on the branch, where do I go to se the live page?
wdym by the live page?
in the guides page
i think it's apps>content>resources>guides>python-guides but
should be in /pages/guides/python-guides/ then
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
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?
I was watching a video on it and saw a diagram I get what has happened, but i'm not sure what to do
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
Nope I have no idea what caused this
let me check
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?
That was for site#712 which I pressed the update button, this is another branch
Does this help?
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
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 🥥 :
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)
at a glance, looks good. but i won't be able to review for some time
I kept getting ImportError in fact that I haven't changed anything in the code?
how are you trying to start the bot?
I've tried 2 ways, by using poetry run and by running it directly
when you say running it directly, what is the exact command you use?
python bot or by clicking the run button
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
oh I see
Check out this section on our contributing guide, specifically the "Ways to run code" section, which can be expanded: https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/bot/#setting-up-a-development-environment
A guide to setting up and configuring Bot.
Okay, will definitely check that out, thanks!
Hey! I'd appreciate a review on site#713 , it's literally a single line change 😄
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
package
!pypi <package>
Can also use: pack, package, pip
Provide information about a specific package from PyPI.
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
is there a PR?
You mean an issue?
oh yeah that
There's an issue yes, although there's no conclusion there. I can update it a bit later
was it assigned?
Nope
@vale ibex does your PR move the custom help thingy to botcore or does anything with it?
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
It doesn't, it's handled by the error handler
nah, just the extensions cog has been moved
only changes to the help command in that PR
Why was #help-lemon closed?
i think it goes dormant 30 minutes after your latest message, or 10 minutes after someone else's. whichever comes later
oh it's not 30 minutes after any message?
No, it's what mina just said it is
so it would have closed at :55 but the other user prolonged it to close at :01
chris your pfp is terrible
oh i was not aware of this
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
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
also is 10 minutes not too little?
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
oh so it's 10 minutes added on to the thirty, got it
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
@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
silence lemme think
i'll go away then ¯_(ツ)_/¯
why does it not say (2 days)?
ok, bye! ping me if you bak
Because by the time it's processed it's not 2 full days anymore. Although it might have been ok to still say two days if the difference is small
but its there
what is there?
the difference
You think it shouldn't say two days?
i think it should say "Duration: 2 days" the (1 day 23 hours) isn't required
🤔 why is it better to use an alpha version of Python than one covered by the safeties of official Python releases
My guess it was an automated script looking at the version of debian the images were running on, rather than the python version
But suggesting an alpha release to fix vulnerablities was pretty ironic
Was site#712 seen?
@vale ibex psutil is no longer maintained according to whom or what?
maybe the wrong choice of words, psutil have been exceptionally slow to build wheels for new releases
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
Python guide for functionfunctions, classes and decos (maybe)?
So...what do you think?
I would usually direct people to something like realpython for that
Could I get a code review on bot-core#61 and bot-core#56 they're very small
hey @molten perch, sorry realised that redis is actually optional so I changed that PR to use getattr
Oh, sure. I was checking the other PR.
👌
So, in theory putting _guild_available into setup_hook won't cause any deadlock, right?
It's just the event.
yea, it's just any wait_for
Looks fine.
@brisk brook for you most recent suggestion here https://github.com/python-discord/site/pull/698 , what changes did you make?
I moved the multiline strings into the methods, as to create docstrings
At which point is the setup_hook called? I recall we had some issues between it and the ready events
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
I don't think there's anyone using botcore except us for us to have to make deprecation warnings, but alright
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
anyone know why I'm getting docker failed to initialise when opening docker desktop application?
Update: Reinstalling it worked
@brisk brook would you like to see a preview of the custom help command on site?
Wish I had logged in this morning, the redis-reconnection PR is actually counter productive to the aioredis upgrade I hope we get done soon
oh
Connecting and disconnecting is basically not a thing anymore
we can just delete that anyways, once your pr is merged
how do connection pools work then?
They are no longer a thing either
They're connection parking lots now
Lmfao
nice
You just send your requests and it’s all managed under the hood, no longer accessible
ty zig
yw
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
Hey, can I get one final review on site#713? 😄
(It's just a singe line change)
damn setting up the bot is a tedious process
Yeah, even @dusky shore was pretty hard to set up for me lol
idt its hard yet, i havent run into any problems
but there are just a lot of steps lol
Well it was kinda both for me haha, 1. that it was hard and 2. many steps
it's about 80% of the battle ;)
hmm
i think i have the redis running, whatever that is by doing docker-compose up redis
yeah, now im getting this error
you need to define the urls
like this, right?
after that im getting this error
i did set DEBUG = False in .env
what guide are you following to setup the config variables?
A guide to setting up and configuring Bot.
and sometimes searching my error logs in this channel
That guide says to get site_api to site_api: &API !JOIN [*DOMAIN, "/api"]
where did you get api.web:8000 from?
I'd suggest just following the guide, it should get you fully setup
got it working
Nice
is there an existing function that converts a string to a timedelta?
yea, bot.converters.DurationDelta
ty
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?
yeah. fwiw I think Literal can accept several strings, instead of having to specify each separately
oh ok cool
ill push my new changes
https://github.com/python-discord/bot/pull/2134 new changes pushed
I need to go, but will check it out tomorrow 👍
I'd argue that should be solved at the parser's level
My opinion isn't worth much, do as you want
@cold island 
Discord.py has updated how ctx.send_help() works
it now set's the context itself, and doesn't let you set help_command.context.
This affects the button thing you did 
@brisk brook in case you missed it
Oh sorry I realize I didn't respond! I saw this earlier. What are you proposing?
Like- taking a screenshot?
yeah
if you wanted to see it for the changes to make (if any)
Sure if you have screenshots, send 'em!
Were they sent?

i zoomed out a bit though so that's why the text is fairly small
The docstrings are still incorrectly placed here 😅
oh i updated it by pressing commit suggestions on your code change, let me check again
it doesn't get updated on vscode?
I'm not sure what was changed, but I did it so that the function building the help message could inspect the context. When I invoked it from outside a command, the help command had no context
Where is the change documented?
It was this PR https://github.com/Rapptz/discord.py/pull/7685
but actually, it looks like the change was reverted in https://github.com/Rapptz/discord.py/commit/29668c51aebfe429b386db32396753e7ae4d44e5
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
Make sure you're correctly pulling the changes from GitHub and re-building ☝️
Wait - you can suggest more changes on a PR? How do you do that?
What do you mean? Like- when you see those "Bluenix suggests" comments?
Yeah
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
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?
Nope, nothing else required. Note that you can only edit lines you have marked
Otherwise you'll add lines
TIL
TYSM, now I can look like I actually know what I'm doing
in the evening eh?
well, I can bump the version in bot-core easily
😅
it's doing things about that is the hard part lol
What's re-building
updated the docstrings
When you launch the site using Docker, all Markdown files are turned into HTML - that's what I am referring to.
luckily the breaking changes since then have no affect on us 🎉
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
This bot PR has quite a lot of moving parts now 😅
6.0 🙈
I feel like we could start with a beta version lol
but I've just incremented major version for anything breaking
probably could have done some beta versioning yea
How do I know the commit from the zip url
I need to make sure you're not reverting us to dpy 0.9
lol
Go to https://github.com/Rapptz/discord.py/tree/<commit hash>
the name of the zip file is the commit hash
I acknowledge your sanity
for now 
hi
Hello
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
Frankly there's no complexity in making the commands parse unix timestamps. It can be done with just a arrow.get, which we use on the bot anyway
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
oki
Hii guys
hello
Thanks for the review @timid sentinel I know it wasn't a small one 😅
Was a pleasure to review
. Seeing the stuff that could be removed because of botcore was very satisfying haha
Yea, so much boiler plate has moved there now, it's nice
woop woop, ready to merge then?
Yea, lets do it
lucky to have both of us around in case we hit something weird in prod
Will let you do the honours :)
Hey @timid sentinel could you take a look at https://github.com/python-discord/bot/pull/2136
the modpings scheduler issue we've been seeing is now causing the task to fail, so cogs don't load
ah ok
An actual fix would take longer, and is coming in the PR mentioned
hopefully everything should be working now
lol #dev-alerts
ah I probably should have looked there before saying that
most things are working
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
This one isn't quite as trivial, but does the job bot#2137
not sure if you're still around @timid sentinel
the entire error handler?
the cog isn't loaded, yea
I thought the above is just fixing the modlog cog
an error on the modlog cog loading caused the error handler cog not to load
that seems... very bad
:white_check_mark: Restarted deployment bot in namespace default.
this actually might hlep
I mean, can we try to ensure our error handler cog loading is more robust?
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
hm, i have to head out but why did ka restart do anything?
.
cog load order is random every boot
yea
oki
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
Chris just tell me which buttons to press
Also
!issue new "Make cog loading deterministic" P0
lol nah
just don't use get_cog on init
and/or deal with the fact it can be None
easy
lol
intercog dependency is a pain lol
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 😅
yeea, that probably shouldn't be a private class lol
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
Realistically that's probably worse considering we don't run in CI, just CD
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
sounds like the fix would be to reraise task errors?
as that would return to previous behavior
i mean, not really
my bot uses a ton of intercog dependencies
yea, it's not bad, so long as you manage the fact that it can be none
which this wasn't
bot-core#65
will tag and push to the branch on merge
I really dislike that solution on principal. It means we need to add all this redundancy and checking for None, when we can just force cog load order
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
i use TYPE_CHECKING and a property for cogs that i use
hm i could use typing.cast
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
but yeah #dev-alerts
would it be possible to remove hardcoded variables in the modmail plugin repo? - 🏓 @vale ibex
mainly looking at the appeal plugin rn
I wouldn't be against it, but I also don't have much time right now
@brisk brook can you take over the subclassing context
Do you not wish to continue it?
I hope I didn't "complain" too hard in my review?
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
Okay- but you're still gonna continue with the other ones yeah?
You currently have one empty line between bot = ... and @bot.command() but there should be two ones: ```python
bot = ...
@bot.command()
async def ...(): ...
and for the new hosting thing here's the preview on site
Yeah I think I saw those, looks great rendered!
yeah i don't think empty lines in the code have any affect on the final outcome but i'll change them
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.
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
huh... how did the last one happen
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?
the first one
the !clean invocation was deleted before that line was hit
yes, but by what 🤔
not sure how
Did someone clean inside a mod channel?
Because that's the only way it can happen really
Doesn't matter, the fix is fine anyway
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
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
yeah, and we assume modlog is always loaded
That's a short term solution still for me, but has the benefit of being a smaller diff and a bit cleaner. In the long term, there's this comment I wrote: https://github.com/python-discord/bot/issues/303#issuecomment-1073034658
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
yeah that was from a mod channel #dev-alerts message
mod-spam
the command did work elsewhere before that iirc
I just dislike the idea of taking unlogged actions
I could edit the PR now if you'd like?
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
oh the content cleaned was from mod-spam as well, i guess that's what you were asking
no
iirc i did !clean until <msg id>
@exotic ember colour 
does one of these PRs fix the 500 error for site logs? or is that an unrelated thing?
I got rid of u when I moved to america 
i am american but am slowly getting indoctrinated by all the brits 
yea
the color one
@vale ibex coulor
thank
whose color is the string, the bot's role color?
the embed colour
oh the embed
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
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?
@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
Very naice
this is a private thing?
Mod+ at least since its a moderation action
Is it needed in bot-core?
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
ok
do you still want the diff?
naah, I'll just PR it to core this evening
Well here it is anyway https://github.com/python-discord/bot/commit/138a39c6d8c8324f5dbd0b2cf1670ccb5161db12
oh, that diff
yea I can get that into the PR now
and refactor to a help util in another PR
it can probably wait until later either way, so up to you
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
merging anything at this point is risky bc bot will redeploy automatically, correct?
Affirmative, but if you want to merge something just inform devops to be on standby
Worst case we can roll back a little
i just approved 2140 but it's not urgent
I’m available if you want to merge it now
(not as urgent as the others i mean)
is the plan to just redeploy bot using king arthur as needed?
that makes me nervous lol
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
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
@gritty wind by the way any update for the docs command to slash commands?
No one’s pushed that yet and I’m not available to head anything right now
What do you mean by push?
nvm misread.
i'm guessing by " no one's pushed' he means "no one has strongly advocated for"
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
just need to reboot until defcon loads after modlog
likely will happen first time
couldn't you just reload the mod log cog?
or
the extension manager cog isn't being loaded
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
docs command doesn't work?
nice
🤡
Hey, how would I contribute to the bots? I am still confused on how-to.
Have you seen the guides for setting up the bots on our site?
How far did you get with those
Alright, I can try and guide you through it if you tell me what you’re on
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
- Read our contribution guide
- Chat with us in #dev-contrib if you're ready to jump in or have any questions
- Open an issue or ask to be assigned to an issue to work on
I want to help to the Sir Lancebot one 👀
Sure, I can help with that
Do you have python, docker, and git installed on your machine?
Docker is optional, but it can make things easier
I only have Python
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
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
How can I install git?
What operating system are you on?
Windows
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
so if I install docker I do not have to install git?
You’ll still need git either way
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
hello- anyone up to review my pr? https://github.com/python-discord/bot/pull/2134
will review now
congrats 
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
you could await guild.chunked
We do have the members in the redis cache
Lol didn't it catastrophically fail last time we tried?
nah, it failed last time trying to chunk
guild.chunked is a bool
just wait until this is true
hi chris how fix site#717?
uhhhhh
ah, you've made a model change, so you'll need to generate a migration too
are you running locally or in docker?
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
should the site venv be active in the other terminal?
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
i thought i had run site locally recently but i guess not, getting some errors. one min
can explain how to do it with docker if you want
yes pls
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
uhhh wut
could you do poetry run python
then ```py
import socket
socket.gethostname()
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'```
'127.0.0.1'
that's odd
why isn't it working in the code then
can you just try and run the code again? 😅
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
yea
Found bugs in our extensions cog with the new discord.py bump. Will PR in a sec
ah cool, add SECRET_KEY=suitable-for-development-only to your .env
do i need to restart docker
I'm guessing the load and unload cogs not being awaited?
no
yep
django.core.exceptions.ImproperlyConfigured: Set the METRICITY_DB_URL environment variable
cool, add METRICITY_DB_URL=postgres://pysite:pysite@localhost:7777/metricity
edited it btw, had wrong
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
poetry install --remove-untracked
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
maybe this will work?
This is necessary after cog loading was made async in a new discord.py version
https://paste.pythondiscord.com/gefohehigo i think that's good?
seems it, try the migration command now
i did the steps in that comment except my pyenv3.9
jsut do poetry install --remove-untracked first
to make sure you're on the correct version in our lock file
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```
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
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
yeah i pushed that change already
ah cool
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
i did something weird, gonna redo
mmm how can I empty the member cache?
during runtime, or have it not populate at all on boot?
yea, likely the best
for this error when installing botcore did we agree we suspect it's a poetry bug? https://paste.pythondiscord.com/hoyamenake
edit: nevermind i think i'm misremembering
Moderators might not get their pingable role back if the discord.py cache is missing members during rescheduling. This PR makes the rescheduling resolve every entry in the redis cache.
Additionally...
is there a way to disable @stable mountain from sending message after you open help channel?
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
so the bot stores chat message with that?
what if I delete it?
Delete webhook?
I am setting the bot up on a test server following the guideline of "contributing guide"
currently the test server don't have any webhooks
If you dont mind spam you can just set it all to same webhook iirc
Since its for dev test it shouldnt matter
@glad zinc is it possibly a regional thing?
this is the character you are producing https://www.compart.com/en/unicode/U+2018
U+2018 is the unicode hex value of the character Left Single Quotation Mark. Char U+2018, Encodings, HTML Entitys:‘,‘,‘, UTF-8 (hex), UTF-16 (hex), UTF-32 (hex)
It could be. Using the English (UK) keyboard if that makes a difference
okay i looked it up, there's an iOS setting for "smart punctuation" that you can turn off
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
another general tip in case you are not aware is to use text replacement features like this
since ` takes a while to get to
Interesting, never thought about doing that
That is botcore in __main__.py? I can't find it in the project folder or in the PyPI
do anyone knows?
how did you install the other dependencies?
It was in grey color, so I just try to pip install them
in the pyproject.toml file there should be a link to the botcore package (a zip file)
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
A guide to setting up and configuring Bot.
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
#dev-contrib message
This?
@rapid swallow i think my issue was different
i might've gotten your error before too but it was a while ago.. i don't remember
you'd think with the amt of times i've run into issues repeatedly i'd have a manual lol
have you ever used poetry before?
Btw, the default-config.yml in the contributing docs is very different from the current default-config.yml being used by the bot.
https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/bot/#configyml
vs
https://github.com/python-discord/bot/blob/main/config-default.yml
(Context from a help channel session: #help-pretzel message)
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
The user had a .env file, but it wasn't being read or found
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
Gotcha gotcha
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
💜 🟪 did someone say lean 🟣 💜 🟪
Is it possible to self-host https://github.com/python-discord/sir-lancebot ?
they didn't say lean?
There's a setup guide https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/
A guide to setting up and configuring Sir Lancebot.
Alr, thanks
congrats @surreal veldt, i think this is your first merged PR on pydis repos? 
thanks for the contribution!
https://www.pythondiscord.com/pages/guides/python-guides/discordpy_help_command/
Overwrite discord.py's help command to implement custom functionality
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
thank you!
I do have pre-commit installed I believe
Why does some github posts come in #community-meta?
can you link to one?
The most recent
Those are the ones on the meta repo
oh my bad misread the message, yeah any interactions on the meta repo go to the meta channel
because #community-meta and https://github.com/python-discord/meta are spaces for discussion regarding improvements and feedback for the server
it's not a development thing - we just use meta as a generic issue board
Got this "undefined alias 'DOMAIN'" after changing the yaml file. How to fix it? Thank you
The original is ```yaml
site: &DOMAIN "pythondiscord.com"
The &DOMAIN is the part that you need to keep
is there a way to delete a bookmark?
That would be cool, but I don't think you can. Yet. I have a strange feeling someone was gonna PR that feature at some point, but I'm not sure.
If there isn't one open already, you could most certainly open one
I'm not sure if I made a issue about it before, I'll try to find it if it's open
sir-lancebot#918
and there is the pr of it: https://github.com/python-discord/sir-lancebot/pull/929
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
👍
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
How familiar are you with discord.py? cogs, commands, etc.
Because most of the bot is structured to work with that library
I am in the day 1 on touching this package. I am also have limited experience on reading/working big-scale package.
I can build basic discord bot that reads text message events.
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
Could I get a review on bot-core#69
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
lol
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
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
How would I go about doing that in this stage 😅
Not sure what you're talking about, but you could send the bot instance to a separate task
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?
cog load event? You mean just the cog's init? Either way creating a task to unload and exiting early should work yeah
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
It's a new dpy thing I think
discord.ext.commands.Cog

danke