#dev-contrib
1 messages Β· Page 172 of 1
uhh that's weird
What about if you just go to https://install.python-poetry.org and save it as a python file from there
Where ever you like
went to eat dinner; but yes i saved it, what's next?
Hey! I'd love to have some review on sir-robin#20 , it's a fairly straightforward migration π
!ot Wrong channel, you could ask in off-topic
Off-topic channel: #ot2-never-nesterβs-nightmare
Please read our off-topic etiquette before participating in conversations.
https://github.com/python-discord/bot/issues/2116
Any thoughts for this one?
I personally don't like the auto-formatting of code like that. Even if it takes a bit more work, I'd rather the person learn going forward to format things rather than relying on the bot to do it.
You could use context menues for that, or whatever they are called
arl implemented it for their bot
and it works pretty great
(didn't have immediate access to it, so copied hsp's screenshot)
Fair enough
Howdy, everyone. Made some progress on this issue:
https://github.com/python-discord/bot/issues/2079#issuecomment-1068626315
Hey! It looks pretty good. If you wish to showcase your features I could suggest you to open a draft pull request. This way we know that you haven't finished it yet, but you have made progress. (Maybe you could upload this gif/video as the description for the draft)
Oh... that's a good idea. Never opened a draft PR before so will be a learning experience.
I think the only difference is marking it as a draft after creation
You can actually open a PR as draft right away, which has the added benefit of not auto-requesting reviewers until you're actually ready
It's in a dropdown under the normal open PR button
Is anyone available to help me get Poetry up and running?
I've installed it, but am running into an issue that I can't quite figure out... none of the commands are working as they should.
ericfletcher@Erics-MBP ξ° ~ ξ° poetry run python ξ² β ξ² 1391 ξ² 20:38:06
RuntimeError
Poetry could not find a pyproject.toml file in /Users/ericfletcher or its parents
at .poetry/lib/poetry/_vendor/py3.9/poetry/core/factory.py:369 in locate
365β if poetry_file.exists():
366β return poetry_file
367β
368β else:
β 369β raise RuntimeError(
370β "Poetry could not find a pyproject.toml file in {} or its parents".format(
371β cwd
372β )
373β )
Then from within the project in PyCharm with poetry run task precommit
ericfletcher@Erics-MBP ξ° ~/Documents/open-source-repos/bot ξ° ξ 2079 ξ° poetry run task precommit ξ² 1 β΅ ξ² 1393 ξ² 20:38:34
FileNotFoundError
[Errno 2] No such file or directory: b'/Library/Frameworks/Mono.framework/Versions/Current/Commands/task'
at /opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py:607 in _execvpe
603β path_list = map(fsencode, path_list)
604β for dir in path_list:
605β fullname = path.join(dir, file)
606β try:
β 607β exec_func(fullname, *argrest)
608β except (FileNotFoundError, NotADirectoryError) as e:
609β last_exc = e
610β except OSError as e:
611β last_exc = e
I think this is tripping me up / not properly executed:
To get started you need Poetry's bin directory ($HOME/.poetry/bin) in your `PATH`
environment variable. Next time you log in this will be done
automatically.
Have you run poetry install?
I think I've gotten this error because I haven't before
I have this in my .zshrc
export PATH="$HOME/.poetry/bin:$PATH"
I just did in my terminal on my Mac laptop:
ericfletcher@Erics-MBP ξ° ~ ξ° poetry install ξ² β ξ² 1396 ξ² 20:45:22
RuntimeError
Poetry could not find a pyproject.toml file in /Users/ericfletcher or its parents
at .poetry/lib/poetry/_vendor/py3.9/poetry/core/factory.py:369 in locate
365β if poetry_file.exists():
366β return poetry_file
367β
368β else:
β 369β raise RuntimeError(
370β "Poetry could not find a pyproject.toml file in {} or its parents".format(
371β cwd
372β )
373β )
Oh should I run that command from within the project in PyCharm?
from within the project, yeah
It'll install the dependencies from the pyproject.toml into a venv
oh my
it's installing so many things
lol I'm such a noob π¦
Oh my the lint is so cool!
Everything passed except Flake8 for 4 errors i need to fix
Now when ready to commit and push, after running lint and precommit, I get this commit failed with error message:
21:01:48.934: [bot] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- bot/exts/info/resources.py
21:01:48.939: [bot] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F /private/var/folders/nn/7bxtpjwx1sbbfnynm05zdtjc0000gn/T/git-commit-msg-.txt --
Check for merge conflicts................................................Passed
Check Toml...........................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
check blanket noqa.......................................................Passed
isort (python)...........................................................Passed
Flake8...................................................................Failed
- hook id: flake8
- exit code: 1
Executable `poetry` not found

running this from within PyCharm
I'm not sure what could cause that
Eh... I restarted PyCharm and it worked
lol
Yea! going to enter a draft pull request now
Don't worry the issue was assigned to me π
And approved
Hi, everyone. I just submitted my first ever draft pull request to the Bot repo. My PR has failed 1 of the lint checks and am not entirely sure how I can fix what it has identified.
Can anyone help me with this?
Do you know how to view the logs for CI?
I clicked details, and it says bot/exts/info/resources.py:5: ModuleNotFoundError
But it's properly working on my local version in PyCharm.... the disnake module
There were recently commits merged into main which switched from disnake back to discord.py
oh no
I guess I could just replace disnake with discord./py and replace what I can with discord.py
Your branch is just out of date. If you merge the changes from main and update your import then it should work
oh
ok i can do that
but then I have to re commit and then recommit to my pull request
Though it is strange that the CI used the latest changes (regarding dependencies) despite your branch being on an older revision...
Do iw ant to merge incoming changes into the current branch?
Or rebase the current branch op of incoming changes
Since your PR is still a draft, no one has reviewed it yet. So you're more flexible with the git history. Doing a rebase would require you to force push, but it will result in cleaner history; the merge would create an extra "merge commit"
It says I have no tracked branch
Can't perform the update
Can I share my screen with you?
Sure
Can you join the dev voice channel here or is it locked for you
<@&831776746206265384> please grant stream perms to @signal forge
!stream 750693589532672100
β @signal forge can now stream until <t:1647481245:f>.
wait that only gives 5 minutes
Thanks
No it's fine I think
It's just the window of time they have to start the stream
ah
yep, dev voice is blocked for us
Could you point me to the section of the server / site where I can learn how to become able to stream video without having to ask permission?
currently we don't have such a system, a mod has to be present in vc already and it's at their discretion
what time zone are you in, out of curiosity?
there is a chunk of the day where we tend to have mods on vc, but it's usually not around this time.
Sorry for ping but @vale ibex do you mind following up on what you were saying about getting the pre hooks installed?
Iβve got some free time right now if youβd like help
Well... you'd need to read a lot for context
I was watching yesterday, you should just need to run the script with the correct environment π
But yeah you can wait for Chris, thatβs fine
When i run some code i now get this
task: <Task pending name='disnake: app_command_preparation' coro=<InteractionBotBase._prepare_application_commands() running at C:\Users\tenuk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\disnake\ext\commands\interaction_bot_base.py:849> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x0000022E7F8BDF70>()]>>```
It maybe because of the files i added or changed yesterday I'm not sure what to do
This is good, it means the application is running
Did you stop it while it was running?
No it came when i ran the code
It's a script for a discord bot
But it doesn't normally come
No just a personal project
But it doesn't run the code with that error
Could you post a full traceback
I have a print on on_ready which isn't printed
I'm not currently on my pc but iirc that's the full tb
oof
webscale software sometimes has hickups
maybe they deleted /etc/ on one of their hosts
@patent pivot @last patio thoughts
lol
From now on I'm gonna call doing that pulling a joe
haha okay, good. I thought I broke my git
They're a helper
ah, didn't find a member tag on them, so got suprised
whats their discord tag, out of curiosity?
π its me... i didn't realize i could close it myself so it happened by mistake
Ah π
You can hide organisation membership on GitHub, it's fairly common. For example, the PyPA has 45 public members (me included) but I can promise you there's almost double that in actual members.
In that case usually the tag is "contributor" or even nothing IIRC?
Contributor is unrelated to membership
Itβs about making commits to any branch on the repo
But yeah a ton of hidden members
well that's fair, I was just talking about the visible tags for hidden membership -- it's fairly common since members do typically make commits
but yes they are separate things, they only overlap when GH decides which tag to present
you see the member tag even if you have hidden your membership IIRC
ok yeah, got them confused with the contributor tag π
Got an error about the server #discord-bots message
Seems like a Discord hiccup
π
@tawdry vapor
try:
is_future = target > arrow.utcnow())
except TypeError:
is_future = True
if not is_future:
await ctx.send("!!!!")
return
func(...)
is a bit cleaner, i think?
Sure that works.
Or maybe instead of return early just do if-else.
Up to you I'm not super concerned about minor readability details at this point
I used up my quota for the docstring :D
lol
hmm also, how do i do the "resolved in <commit_hash>" thing on github
nvm googled it
Oh... I just realised we have almost 30 PRs open
That is not good
Possibly the most we've ever had
Even more if we consider other repos
all the more reason to merge mine quickly /s
Yeah I was gonna be lazy and review it tomorrow cause it's late but I'm gonna test it now while I'm still in the mindset of contrib stuff
Ah yes I am reminded of how painfully slow discord API responds on my machine
um? ```
Installing dependencies from lock file
RuntimeError
[BUG] bot-core (1.2.0) is not satisfied.
at /usr/lib/python3.10/site-packages/poetry/mixology/partial_solution.py:200 in satisfier
is this your first time setting up bot since bot-core stuff was added?
Yes I think
i've on & off had to destroy my venv and poetry install fresh
I tried that already though
kosa had a completely different issue
let's see if it gets fixed if I re-lock
but i think kosa's was smth abt python being set to 3.9.0a somewhere, which i'm sure is not your scenario
I don't think this lock is gonna work... 90 seconds and still going
Wait it finished
Nope still broken. No idea why. I'm using 3.9.9
The error says "bug" which implies it's some Poetry bug. Also weird that the lock took so long
could I be assigned an issue from one of the python bots?
link? \π₯Ί
i donβt really mind
any would suffice
when I use poetry commands in terminal it raises errors like the system cannot find the path specified. I'm not able to find them in the file explorer as well, so they might've been deleted.
Can anyone tell me how to re-install poetry?
you could use pip install --force-reinstall poetry
oh that seemed to work I think
after running that, in my command prompt i did pip show poetry and it gave something though
is that normal?
oh also it raises ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. httpx 0.13.3 requires idna==2.*, but you have idna 3.3 which is incompatible.
was helping raven, and for whatever reason poetry install only worked after pip installing poetry into the project venv
big Β―_(γ)_/Β―
I am not sure how often you check your mail or GitHub notifications so I'll ping you here. I reviewed your pull request @signal forge!
What does this mean?
That human has notified others he will be working on the issue and/or pull request they've assigned themselves to.
So he's going to be doing the changes?
where was this notification found?
are you the author of this PR?
yes
ah, then this was most likely a mistake I believe
if you hadn't discussed this beforehand
@last patio y u assign
i was looking forward to working on it lol it's my first time doing markdown and the YAML formatter
usually a person would assign themselves if it was discussed before, so this is still your PR
okay, thank you
Does preview not support this? Actually first of all, is this how I should be using YAML formatter in a .md file?
if you have the site up and running you can actually just live load the changes in your browser
i haven't done that step I believe
if you're interested, here's the full walkthrough to get it working
https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/site/
A guide to setting up and configuring Site.
Yeah I considered that but then thought I'd skip that step
@surreal veldt if you assign yourself or someone else to a PR it also means you may review
We generally do review requests for that but that's the other meaning
I was not aware of this, ty
I'm sorry I didn't understand what you mean, you're talking for Volcyy he wanted to review it?
if he assigned himself to your PR it probably means he's going to review it
so I can still change it and update it? Or he will do that
if I want to view this and what it looks like, I have to follow the steps to get it running?
@last patio maybe use review requests in future for things like this unless you have another meaning review reqs don't cover
I hope I can avoid those steps because it's kind of a long task at least for me to get a small thing done
Oh wait I just realised he asked to use YAML frontmatter which I read as YAML formatter
Anyways, the member who self assigned it said he doesn't think markdown headers shouldn't be used for text, can I ask for feedback here? Right now it looks like this
for me it means that Iβm making myself responsible to getting it into master, e.g. requesting review as well
ty for letting me know
avoid what steps?
This is my only question now
I don't think this many headers should be necessary, should be formatted to look similar to this: https://github.com/python-discord/site/blob/831f56f71d76741276d13e20954f46088e754d18/pydis_site/apps/content/resources/guides/python-guides/creating-python-environment-windows.md?plain=1
So remove the title of Custom Help Command?
oh got it updated
at first I thought it looked more readable but in retrospect the body was too big
Hey! Thank you so much @brisk brook .... a lot to learn π This is my first time dealing with a code review and I don't want to mess up the git history on the repo or locally on my machine. Is there a learning resource you can suggest for me to implement code review changes via git properly?
I am not aware of one personally, sorry.
It's relatively simple though. Go through the comments and apply the feedback you agree with by making those changes locally, if there's something you don't agree with then make a reply on the comment discussing it. Once you've applied all comments you can commit the changes and push, lastly click "Mark as resolved" on the comments that you fixed. It's fine if you leave some open, as they may also be asking others' opinions as well. I recommend not force-pushing on larger PRs (it's fine on for example one-line changes) because all comments get marked as Outdated (even when they may not be) and if I mark files as viewed that gets reset.
Don't be too worried about messing up the Git history, your PR can simply be squashed in the end if things get messy.
If i make a PR and update the code, how do i update it in the pr? Do i need to make a new PR?
the pr will be updated if you push to its branch
lol
before I had a button here to do that I think which isn't there now can you tell me what to do please?
That looks correct, if you were on the incorrect branch then it wouldn't say M for Modified - the file would've been created if I am not mistaken.
but it hasn't been updated on github
Have you pushed the changes?
I use the commit command right?
Yes, first you commit and then you push the commit to GitHub
how do I stage files?
git add .
cool thank you it was updated
CC @last patio (sorry for the ping I'm just letting you know)
@patent pivot hey can you accept my friend request just wanna ask you something
then you can remove me
my DMs are open
lol
hi
Pre-fetching them with an asyncio.gather will speed this up dramatically, thanks to the power of non-blocking networking.
was it tested to see if this actually does speed it up?
when testing yeah it was loads faster
in the bot's current state it takes 25~50s to give us the bb watched message
testing that PR on the test server it took less than a second. granted that's with a much smaller set of users
bot#2115
not sure how we can replicate a larger number of users for testing
right, but you would also need to test with a ton of watched users
run some int e to add everyone in the test server to the watched list 
additionally, disable the member cache while testing
it's definitely going to be faster in the test server because all users will be cached automatically as the guild has less than 250 members, so it will be using the cache and making no requests, which means that the gather won't be doing anything in testing
and in prod it also won't do anything due to dpys sequential ratelimit handling
dpy makes one request to a route and waits for it to return before letting the next request through
it's slow, it's clunky, and it means that you get no api benefit from gathering requests together
and even if you did gather them together, there's not a great way for the library to handle the 50 requests/sec global baseline, but that can't be assumed either because bots can be given a different global ratelimit, and the only way to get those update ratelimits is to be cloudflare banned a couple of times and then reach out (seriously, this is what the docs say)
so if the library did make concurrent requests, which dpy does not, you would want to chunk asyncio.gather to make around 35 requests to leave overhead for the rest of the bot's functions, and then wait a second before making the next batch, and then repeat.
I'm working on refactoring the ratelimit handling for disnake to allow users to use the benefit of asyncio.gather if they desire, as right no there is virtually no benefit
and the only way to get those update ratelimits is to be cloudflare banned a couple of times and then reach out (seriously, this is what the docs say)
lol wat
yes
but yeah if dpy itself is the bottleneck anyway i suppose this won't help
disnake should soon have this handled better
as an example right now making 40 channels with dpy takes around 8 seconds, new ratelimit handling brings that down to 0.7 seconds
which is a huge speed increase, it allows bots to actually take advantage of ratelimits while also making sure you dont get 429s
to note, moving when it happens (from on command to prefetch) will help but now that's a lot of requests every time the bot starts, so some middle ground could be reached
but there is also a gateway command which could help with this which I've detailed on the pull
wait
@hoary haven how many watched users are there
just curious if the websocket idea is any good
it might not, depending how many users there are to be fetched within 40 seconds, although I have to keep in mind that I have no idea how many are cached
this topic is whooshing over me so i'll let others comment tmrw 
Why does this line show this path for invoke_help_command when it's not there? https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/utilities/colour.py#L16
bot/exts/utilities/colour.py line 16
from bot.exts.core.extensions import invoke_help_command```
It is there.. imported from another file. That's not great of course
the correct import is bot/utils/extensions.py like hsp mentioned
oh so it's not imported from the file the function is created in
yeah
@brisk brook - are you around for a quick screen share? I'm working on your code review and have a couple questions about how I should go about creating commits.
Sorry no, but if you have questions I can answer them in here!
Ok cool. Does each comment get its own commit with comment, or should I just make all the changes then commit?
If there's for example multiple typos you fix I would put those in the same commit.
If the changes are completely unrelated then I sometimes put them in different yes.
Ok cool
For example, you can have one for fixing the docstrings (I left multiple comments for this), one having to do with extracting the tag from other content and one for embed improvements
I see some people just say "Fix after review comments" sometimes, but that can make it unclear what changed when you don't know exactly which comments were made and which were addressed.
Ok cool thanks for the info! And so since httpx is not used, I can pass over your suggestion regarding request blocking?
Ah, no, like Mark pointed out you should use aiohttp though.
Let me see where the session is stored, hold on.
bot.http_session
Hmmm... I'm not sure I really understand what aiohttp is doing. Is it making the request to the site?
So I would be accessing the site and pulling the html using aiohttp.
Yes, the same as requests. It's doing the same job, but asynchronously so that the bot can do other things meanwhile!
Agh sweet.... I'd still use BeautifulSoup to get the data from the HTML, right?
yes
does site not expose this in the API?
No. The categories are kind of hard-coded
I say kind of cause the icons are hard coded, but IIRC it actually uses whatever categories it finds in the loose files. Didn't see any validation for that.
In regards to the site, what do you mean when you say API?
There is a particular API we can use to access data from the site? Like particular methods that allow for the gathering of data from the site?
Yes, but that API is not accessible to the outer world, just inside the cluster, so the bots can access it.
You can find it here: https://github.com/python-discord/site/tree/main/pydis_site/apps/api
I advise you to read the README it explains you how it works and how the app is structured.
pythondiscord.com - A Django and Bulma web application. - site/pydis_site/apps/api at main Β· python-discord/site
@brisk brook - What do you suggest I do with the code that's removed from my PR ahead of the API update.... copy paste it somewhere and when the issue is open see if any of it is useful?
the API also handles things not related to the site frontend, like moderation infraction history, but it's still tied into the site project
That's the beauty with Git. It will always be there in the history: https://github.com/python-discord/bot/blob/e268c7b9e5fcf829c7f2ddbaee0d584b07808aa3/bot/exts/info/resources.py#L14-L36
Even if you push more changes, it'll be right there in this commit. As long as you don't force push and delete it permanently
oh wow
Simply comitting changes that remove it, will still keep it in the history
That's the point of Git and why it's used!
if there's an issue open for the API changes, you could link to that commit in a comment
and if there isn't you could open one
I'd love to, but really need to finish making changes to my current PR. It's a little overwhelming being my first PR of any real significance lol.
you dont have to of course, but also opening an issue doesnt mean you have to be assigned to it
I'd want to be assigned to it... it seems really interesting plus a terrific learning opportunity.,
I'm going to completely remove the scraping portion from my current PR and move it to the future API request issue.
I think you should just do some basic work to separate obvious resource from the user's message (like splitting by ., newline, | and similar) then just try to set that as a resource
Get this working and merged, meanwhile you can look at the site API and open another PR using this new API once it's been merged.
Yea that's what I'm going to do.
Would you suggest not SCREAMING_SNAKE_CASE the url since it is being mutated via the appending on to the URL?
Actually, I don't need the resources url in my current PR since it's included in the string and fstring
I'm going to hope to have my PR updated later tonight.. I have to jet for a bit, but will be back
Thank you so much for all the help.
why is this even a thing lol
it should just be on the context object
and use a custom context class
type hints would not need to be changed, as the methods do already exist
Context.send_help IIRC
That could be overridden to send the correct help and wouldn't require this weird method
idk, didn't delve deeply into that code π
It's likely to be replaced eventually with botcore
should use a custom context IMO
i'm trying to set up the site repository, and docker runs and it gives me the link (http://0.0.0.0:8000/), but the link doesn't work and just says "site can't be reached"
or just localhost:8000
@vale ibex bot#2115, are you fetching users that aren't in the guild
i think you are
that means you have around 30 to 60 members who aren't in the cache, and are being fetched as a user
huh
no, every member is in the guild
There are many users that aren't in the guild yes
but they won't be fetched since we're using get member, so get_or_fetch member will just return None
my comment in the conversation isn't accurate, since I made it on my phone and didn't actually read the code properly
So we just need to get all the member objects for the people in the guild, but can't solely use member cache since offline user's won't be in there
so this is a ratelimit issue
although why will offline users not be in the cache?
hm
seems like chunking should be done to fix the cache issues, although i wonder
what exactly is the data used for?
bot/exts/moderation/watchchannels/_watchchannel.py line 368
line += f" ({member.name}#{member.discriminator})"```
bot/exts/moderation/watchchannels/_watchchannel.py lines 371 to 372
if not member: # Cross off users who left the server.
line = f"~~{line}~~"```
!d r
I have a vivid memory of offline users not being in the member cache
which was causing us issues with modmail
Start up cache?
Shit, not even online members are in it most of the time, as the reminders command constantly reminds me
nah, even after start up
we were having issues where offline users couldn't open modmail threads since they weren't cached
We had to change a get to a get or fetch iirc
but checking guild.members now, it looks like it's full
sounds believable lol
probably not worth forcing the command to take ~1 minute just to cover the case where discord might decide to do that
it was painful to add fetches everywhere
might just change it to a get only
you could try to get and fetch if it isn't in the cache
isn't there a utility for this already?
it's using get or fetch already
there's just so many not in the cache that it's causing a bunch of fetches
(this is for the bb watch list)
I was thinking about that lol
currently not, but it's already server-side pagination so why not add it π
probably just pass a coro instead of a line to the paginator and have it inspect for coros
yeah
I've never had to do this before, so what's the most pythonic way to lay this out?
Ideally the paginator would take either a coro or a normal func
and then either call the func, or await the coro
is there a good way to tell if a given callable is a coro and await it, or just call it if not?
my first thought was something like ```py
result = a()
if isinstance(result, typing.Coroutine):
result = await result
there's inspect.iscoroutinefunction
ah, would I use that over the isinstance?
if inspect.iscoroutinefunction(f):
await f()
else:
f()
alright cool, thanks π
!docs inspect.isawaitable
inspect.isawaitable(object)```
Return `True` if the object can be used in [`await`](https://docs.python.org/3/reference/expressions.html#await) expression.
Can also be used to distinguish generator-based coroutines from regular generators...
Even better @vale ibex @placid ermine
Wouldn't that require us to actually call the coro?
IE inspect.isawaitable(f()) vs inspect.iscoroutinefunction(f)
Not really?
I mean
Wait
You want an awaitable object
You want to pass f()
then await it when needed
So you are free to pass whatever arguments you want to f beforehand, basically getting a more powerful API for free
Yea, so its py result = a() if inspect.isawaitable(result): result = await result vs ```py
if inspect.iscoroutinefunction(f):
await f()
else:
f()
*args **kwargs to the coros ofc
You probably want a check for callable, awaitable then just copy the variable
You do not need args and kwargs if you use an awaitable object
I was thinking of allowing the paginator to accept an awaitable, or a normal func
So IG it could accept a partial or an awaitable
I think that's the best option if you want to pass a list of callbacks
Yep
well you may as well put Callable[[], str] instead of your partial
I wonder if you can set the return value of your awaitable too
Yea, it would need to return a str
kind of a weird api tbh lol
it makes sense whne you think about it
is the new paginator anywhere?
bot-core but it is imported as botcore
I see no paginator
paginator hasn't been ported yet
and this new thing I'm talking about I havne't written anny code for it
just thinking about how I'd implement it
oh yeah, I was just looking for some code to steal
nope, haven't updated it
!bigbrother
Can also use: bb
Monitors users by relaying their messages to the Big Brother watch channel.
Subcommands:
!bigbrother oldest [update_cache=True]
Shows Big Brother monitored users ordered by oldest watched.
!bigbrother unwatch <user> <reason>
Stop relaying messages by the given user.
!bigbrother watch <user> <reason>
Relay messages sent by the given user to the #big-brother channel.
!bigbrother watched [oldest_first=False] [update_cache=True]
Shows the users that are currently being monitored by Big Brother.
aah
not quite pagination
iirc you can control the interaction too
we didn't restrict to author
looks like I'm asking the octocat for help
I see, I see
!src help
An interactive instance for the bot help command.
There's some examples in the repo https://github.com/Rapptz/discord.py/tree/master/examples/views
with fairly decent comments
not sure about written guides
I bashed my head against the API ref and it was pain
I feel like that's where I'm currently going lmao
Represents a UI view.
This object must be inherited to create a UI within Discord.
I could have made those docs
Google adjusts results to you. Try searching from incognito
Unless that's what you meant by SEO π€
Hi, everyone. I think I'm almost done with my current PR here: https://github.com/python-discord/bot/pull/2117
I am going to adapt a portion of my code from the above PR that was removed to create a new addition to the site API (open the issue and hopefully get assigned to the issue). I've never worked with an API before, so was wondering if there are any more experienced members who could help briefly explain the API and how it interacts with Discord / how the methods are called / utilized across the project? Perhaps a screen share voice chat session would be most beneficial for me. I live in the EDT time zone and can be available anytime after say 8:00 PM.
Views and buttons generally don't need this much boilerplate, the use case here is just a bit on the edge since the components are created dynamically
Hmmmmm
@last patio ^^
does @stable mountain use a database for anything?
Yes
what database does it use?
PostgreSQL, it's accessed using the site API.
oh ok
Suggestion: not really major nor significant but on the discord.py articles for the website, make one about subclassing bot and/or Context?
@vale ibex i've made a lazy view based paginator that I'm quite happy about, if that can be useful here
https://github.com/Akarys42/StarBot/blob/main/starbot/utils/paginator.py
It will arrange items given by the list/(async) iterator to form a page until a certain character limit is reached
I basically needed that to format my infraction list, and I didn't know how many I could fit in a single page
You could use that for BB, with each item being a line about a user
Or alternatively scrap that item logic and just take pages straight from the source
.bm
@austere hornet, please enable your DMs to receive the bookmark.
.bm
Shoot, sorry for the ping

/j
Don't forget the rule, if you steal code you star! (yes I just made the rule up)
.bm
.ttt
^ that command is causing this error #sir-lancebot-playground message
hmm interesting, it works in #bot-commands
maybe it was just the channel occupation thing
bot/exts/fun/tic_tac_toe.py lines 256 to 257
@is_channel_free()
@is_requester_free()```
Do you mind if I reload it, or do you want me to leave it so you can investigate what went wrong?
I was going to make a PR about subclassing commands.Context and commands.Bot as an article on the pydis site. But as this requires some knowledge of OOP, I haven't found any articles on the site about basic subclassing so could this be made? I wouldn't mind writing it down
I'm wondering if that's the right place for such a guide. Wouldn't it be more beneficial on the discordpy docs?
You mean for the dpy github? Or for the dpy docs on the pydis github
Hi, thanks for the suggestion. I'd like to have this included within the site as I believe subclassing bot is very beneficial and provides you more control over your bot. If you want to take this up and make a PR, I wouldn't mind helping. If you don't want to though, I would be fine making one as well. Just let me know what you plan to do :)
I wouldn't helping?
Oh you do?
Well not us
May have missed it
No plans to make a detailed explanation of it?
Well they only have examples, I feel like it would be useful if we had both the example, explanations, and advantages/disadvantages of it
Just bare code examples aren't really helpful if you get what I'm saying
Yeah
For example, this has a subclassed client: https://github.com/Rapptz/discord.py/blob/master/examples/edits.py but again it's just a barebones example that could be confusing to newer users
I feel that advanced topics within discord bots that require both examples and detailed explanations which discord.py doesn't do all that well
So you think both are worth making pr's?
I do, yes, and make it much more detailed
Can i make it?
Both?
I'm fine with whatever just make sure you can handle it
I wouldn't want you to have to do too much work :p
I'll let you know and i enjoy making these now so it's fine haha
Great, think about it and let me know which ones you want to do :)
Oh wait maybe they can be in the samd fil
File*
Because in order to subclass context you need to subclass bot
Hmmm
I think itβs best to seperate them but have custom context build upon subclassed bot
Something like βin order to have a custom context, you need a custom bot, so itβs recommended to read the subclassing bot guide before reading this guide, if you havenβt alreadyβ
The latter
No
The former
lol
So you think it's not worh makinga PR?
I don't mind, just wondering where it will be the most useful
@patent pivot out of curiosity, what's the traffic for our dpy guide? π€
Probably deserves an update after 2.0 comes out, it doesn't even mention intents
last 7 days it's the 4th most viewed page on pythondiscord.com
based on a 10% sample of requests
that's after the homepage, /resources/ and the code of conduct
again my usual disclaimer of these analytics are dodgy and should not be trusted
for last 12 months, Google Search puts it as our 5th most clicked page from search results after homepage, homepage with www, setting up test server and setting up test server with www
tnx
Hey, everyone. Do any of you accept suggested changes from within GH Pull Requests? Is this advisable?
I'd have to update my local project so to have the latest changes locally, right?
That is if I accept the suggested changes in the PR.
I find suggested changes helpful, personally. I usually don't click the "commit" button since that creates a whole commit; rather, I just copy/make the suggested changes locally. Although that's a personal preference.
@vocal wolf I thought the future of that PR was somewhat unknown because of changes happening to the infrastructure?
Hey @brisk brook! Thanks for the review.... I'm working on it now π
which PR are you talking about? the global leaderboard?
Yeah
I am unsure myself
since no one had commented on the issue about this, I have absolutely no idea, actually
I'm pretty sure that DevOps is going to enforce that Redis (or KeyDB, not sure) not be relied on for persistence at all, so there shall be no persistent storage for Sir Lance.
cc @patent pivot because he knows
not no persistent storage, just no persistence relying on redis, anything persistent needs to use site @vocal wolf
very well
Lance will never use site though, will it (in the foreseeable future)?
To keep a low barrier of contribution and all
So doesn't that mean that Lance will have no persistent storage?
It won't, so lancebot won't have any persistent storage
that's what I meant, sorry if it wasn't clear
uhhh
I think with bot core we can make it not so bad
I don't recall us making the decision that Lance will have no persistent storage
@brisk brook Would you happen to have time to briefly explain why from urllib.parse import quote is needed? Wouldn't it accomplish the same thing as the code currently is configured?
Apologies if I am mistaken. My understanding was that all persistence should go through site, and that Lance should never need site so that users don't have to spin it up to run it, since having to do so is a barrier to contribution (although less so with Docker and all).
wasn't that one of the reasons we went with the event bot, or am I missing something?
It'll replace characters that are invalid with their %-escapes. It's a way of sanitizing the user-input you format into the URL.
I think the solution there is to make site easier rather than to completely rule out persistence -- site isn't too bad to spin up nowadays, we removed the need to move /etc/hosts, we're working on documenting the project more -- site should not be a complex project
Oh wow.
Awesome. Thanks π
not the sole reason -- maybe a contributing factor -- I really don't want to see persistence ruled out on Lance
understood, thanks~
It's not like it posses a huge security risk right now, don't get me wrong. I believe there was a PR that changed all URL formatting to it though so I think it's best to keep that, good practice as well!
Emojis come to mind immediately, they'll be changed because they're invalid in URLs
urlparse so neat.... would love to see the source code for that.
Trust me, you probably don't π . I've looked into it once, and the code wasn't very clear. Very oddly designed.. but hey!.. it works!
lol
Here it is if you're curious:
https://github.com/python/cpython/blob/main/Lib/urllib/parse.py
lol I recognize some of the names in the comments from my job.
I work as an Executive Assistant at MIT.
T. Berners-Lee
I got a weird error using quote
Unexpected type(s):(set[str])Possible type(s):(bytes)(str)
Sorry, an unexpected error occurred. Please let us know!
TypeError: quote_from_bytes() expected bytes
Bot is throwing an error as well.
That looks odd, is that just your editor?
It is, but the bot is erroring after comman dis provided.
set[str].. huh? Where does that come from?
async def resources_command(self, ctx: commands.Context, *, resource_topic: Optional[str]) -> None:
Can you show a screenshot where you hover over it maybe?
Yeah look, you have an odd pair of { around respurce_topic
Also.. I was thinking you do the formatting inside of response_url = "...". Not sure if it's better that way though, but just to be clear π
Got it! Just pushed to the repo!
Awesome! I will have to take a look tomorrow
Thanks for all your help...
Once this one is finished, perhaps I can work on opening the issue for the site API feature for scraping.
I don't think making site a dependency to Sir Lancebot is the way to go. I even opted for Sir Robin to prevent site being required for Lance.
If you don't use docker site is still very =/ to set up (as someone who doesn't work with pg on the daily outside of specific work projects)
There is no command that shows the python guides on the pydis site?
wdym?
pythondiscord.com - A Django and Bulma web application. - site/pydis_site/apps/content/resources/guides/python-guides at main Β· python-discord/site
just a command to link that?
Yeah maybe something like (with the command name beng x)
!x (optional guide)
@sharp crag do you know any article which is good that explains basic subclassing in python?
Unfortunately no, it's just OOP that I learned from CS classes in school
I think if you know how inheritance works conceptually you can get subclassing within python relatively easily
how do I make two seperate PR's?
Fork it, make 2 different branches, and PR each of those branches
oh no i know subclassing but for the subclassing bot pr i'm gonig to make
What about the PR?
basic subclassing
What I mean is I asked for any good article on basic subclassing in python to put in the PR about subclassing bot, because basic understanding of subclassing is a better start to doing it
Ohh I see
Just like "Subclassing bot requires you to know how subclassing works, to learn more about that look at this article: " or something like that?
ah so fork it twice
No no, just fork it once
is a fork a branch?
You fork an entire repository and all the branches inside it
You can then add more branches to the fork
So you could fork python-discord/site then add 2 branches like: subclassing-bot and custom-context
Hmm let me double check
got it
Use git branch -b <branch-name> to make a new branch
and yes
Then to switch to that branch, use git checkout <branch-name>
From there you can git commit and git push
I'd recommend using vscode's native git integration as you don't have to worry about commands but worry about making the actual content
ah welp on my local machine I meant to delete one new file I just made on the site but deleted a whole bunch...
Luckily you can always just delete the folder and clone it again if worst comes to worst
yeah i'll just fork it again
@surreal veldt in this case you can just do git restore . to restore all those files
oh cool that worked thank you

i saw it in the error but wasn't sure
not error, in the git status command*
error: unknown switch `b'```
what did I do wrong?
Nothing, my fault. It's just git branch without git branch -b
I was looking at something else
Got it confused with checkout -b
if you want to make a branch and switch to it, you can do git checkout -b some-branch
git branch some-branch will just create the branch, and you won't switch to it
Yeah that's just 2 steps in one, doesn't really matter
yep
oh wait what's the difference between git checkout [branch] and git checkout -b [branch]?
I just did git checkout [branch]
but it seemed to do the same thing though
Since you already created the branch, git checkout will switch to that branch you had previously created with git branch
git checkout -b some-branch combines the two steps into one by creating, then switching to said branch
Can I ask here the benefits for subclassing bot to put in the PR?
so, git checkout -b some-branch is equivilant to git branch some-branch && git checkout some-branch
This is what I have already
Subclassing Bot can be very beneficial as it provides you with more control and customizability of how your bot functions. For example, the default `commands.Context` can be overridden to add more functionality.```
Maybe you could add some more examples?
mind reviewing these?
Great, looks like you have it. Could you make a PR with it and I'll review it on github instead of here? I'd like to keep everything in one place and also have the others pitch in
If you could also request a review from me on github that sends me an email
You have a pretty good foundation to build upon which is awesome π
How do I do this?
Once you make a PR, you should see something like this with a little cog in the top right:
From there you should be able to request a review
What's your github username?
Should just be Robin5605
okay thanks, will do in a bit
Cool, I'm off to bed then. Thanks again for taking this up π
Good night!
I've made the PR, but can't find the button to add reviewers I just saw it now, do I need to press the convert to draft button?
You can't add reviews if you don't have certain perms on the repo iirc
no not to add a review, I want to add a reviewer
I meant requesting reviews, must have done the wrong word!
If youβd like to request someone for review, youβre going to need to ask them on discord to request themselves, or just ask them to review right away
Itβs a spam/harassment protection mechanism, otherwise you could just flood people with review requests
CC @sharp crag ^
No prob, Iβll take a look at it later today
Thank you, also I've more or less written the subclassing Context, for the most part i was able to copy subclassing bot and tweak a bit but I may PR that later if it's thought to be worth doing so
π
For making PR's, if I am on branch x and add a file, and then when I switch to another branch (take it as y), that same file that i made for branch x comes to the branch y. How or can do I prevent this?
You commit it to branch x
First save your changes. You can commit or stash. Then checkout the main branch, then create a new branch. You can do the last two steps at once with git checkout -b y main
i believe i did those steps
Which steps
they didn't say they want to create a new branch though
I believe the lower b flag checks out if it already exists
The crucial step here is commiting/stashing tho
by the way @sharp crag regarding the comment you made on the PR, would it be
async def start(self, token: str, *, reconnect: bool = False)
self.db = aiosqlite.connect('database')
await super().start(token, reconnect)
I'll get it updated soon
And also, acquiring a cursor using custom context is another excellent use case. RoboDanny has that feature, I would recommending checking out its implementation and maybe include it in your custom context guide
Mind Linking it? Can't seem to find it
Also, for this, how would the database be accessed? self.db in the main file and self.bot.db in cogs?
Yeah, or use the custom context database connection
https://github.com/Rapptz/RoboDanny/blob/rewrite/cogs/utils/context.py#L10-L25 might be interesting
yeah i will remove the overriding start method from subclassing bot I think
or maybe I can just write
Yeah I think having custom context with a database connection would be really good since you can just do something like
async with ctx.cursor() as cur:
await cur.execute(...)
async def start(self, token: str, *, reconnect: bool = False):
# here you are overriding the default start method. You can do some code here for example establish a database connection
await super().start(token, reconnect)
why is it blue?
You forgot the : after the function declaration
oh lol
class _ContextDBAcquire:
__slots__ = ('ctx', 'timeout')
def __init__(self, ctx, timeout):
self.ctx = ctx
self.timeout = timeout
def __await__(self):
return self.ctx._acquire(self.timeout).__await__()
async def __aenter__(self):
await self.ctx._acquire(self.timeout)
return self.ctx.db
async def __aexit__(self, *args):
await self.ctx.release()
Yeah I don't understand anything here
robodanny uses postrgreSQL?
yeah
It's just implementing a async context manager
the __await__ isn't important
__aenter__ and __aexit__ is what's important
so..robodanny is able to do this
query = """INSERT INTO guild_mod_config (id, mute_role_id)
VALUES ($1, $2) ON CONFLICT (id)
DO UPDATE SET
mute_role_id = EXCLUDED.mute_role_id;
"""
await ctx.db.execute(query, guild_id, role.id)
async with ... as something: # __aenter__() is called and passed to `something`
...
# __aexit__() is called
Well not really
def acquire(self, *, timeout=300.0):
"""Acquires a database connection from the pool. e.g. ::
async with ctx.acquire():
await ctx.db.execute(...)
or: ::
await ctx.acquire()
try:
await ctx.db.execute(...)
finally:
await ctx.release()
"""
return _ContextDBAcquire(self, timeout)
is this a lot more easier or efficient for aioqlite? compared to using the default way
Definetely not easier. It's on the advanced side but gives you much more customizability
You can also include some other examples that RoboDanny has for the custom context doesn't have to be this
i saw he has ctx.prompt too may do that
Yeah that might be interesting to people
For the database if you want you can just stick to overriding start() and doing it there so we don't confuse people too much
okay also for that when it's self.db in main but self.bot.db in cogs, can you tell me if it is self.bot.db in cogs, why isn't it bot.db in main?
Well in main we're inside thee commands.Bot subclass so it would be self instead of bot
If we didn't subclass, then yeah it'd be bot.db
class CustomBot(commands.Bot):
def __init__(self):
super().__init__(
command_prefix = #your prefix here as a string
intents = #your intents here
#other kwargs can be put here
)
#custom bot attributes can be set here, for example:
self.launch_time = datetime.datetime.utcnow()
self.example_integer = 5
async def start(self, *args, **kwargs):
# here you are overriding the default start method. You can do some code here for example establish a database connection
#as shown in this example below
self.db = await aiosqlite.connect('database file')
await super().start(*args, **kwargs)
bot = CustomBot()
token = YOUR_TOKEN_HERE
bot.run(token)
This is correct?
Correct me if I'm wrong, don't you have to await aiosqlite.connect()?
nope
wait
oh wait you have to
i guess i never used it that way
Can I make some changes to the code by pressing the edit button?
I'm having some issues when trying to update the code in the PR
You can edit it in the GitHub interface if you want, thatβs up to you
okay so I noticed that if I start with a PR for branch x with a starting file, and then after that I make a new branch y and make a new file, when I PR the changes in branch y both the changes from branch x and y gets added
Are your changes commited to branch x or not
If they are, you have to make sure that the branch y is created from the βmainβ branch, not the x branch. That is something you have to ensure when creating the branch.
If the change isnβt commited, git wonβt automatically remove it when you open a new branch, you need to make sure you have no changes. You can do that by commiting your existing changes on branch x, or use git stash
Why does !ot <anything after that> not work?
. That is something you have to ensure when creating the branch. how does one do this?
git checkout -b branch_name main
This will create a branch called branch_name, and itβll start from the main branch, not x
Since it's a tag, and !ot is fuzzy matching to !off-topic, I imagine the extra stuff on the end is interfering the the fuzzy matching
Oh I see, thx for the info π
so if I were to do git branch something and do git checkout -b something it's wrong?
No, it just wonβt do anything special
But if youβre still in the x branch when you run that
Itβll keep your changes from the x branch in the new branch
Fwiw, I typically donβt recommend people who are still trying to wrap their heads around git start from the command line.
Tree visualizations, and not having to memorize commands helps you understand first, then you can learn the commands when you want
oh okay so that's where I went wrong
unfortunately I made a PR with two extra files which weren't relevant so three in total now I have to delete them
What's the status on the bots in this server's library? Are they fully moved to dpy?
yes
so...i had a suggestion: Make the bookmark command into a message application command. Can I make a PR/issue?
a context menu would likely be even better
Does d.py support those yet? I'm not even sure
is this what you mean?
the apps
Yea, that's called a context menu
okay so I'm not sure why I keep calling it a message application command but I thought it was that
anyways, that's what I meant
oh i remember now
We're not on the latest commit yet, but we thought of doing that, yeah
I'm pretty sure, there were so many changes added in the last two weeks or so
oh and also can I have response on this?
No, there isn't
and there aren't any plans to do this?
I don't think it's something that's ever come up before
That list and the quality of the guides is a little undefined at the moment
(the pip version is still on 1.7.3 though, so technically not yet - despite it being there in the github)
For example the dpy guide is very outdated
I guess so, after dpy 2.0 comes out
we download directly from master on github
pinned to a commit hash
ah
but yeah - the 2.0 components are still very much work in progress as far as I know, there could be breaking changes until they 'officially' release 2.0
Hi I downloaded the zip of python discord bot
from the github, how would i set it up?
https://github.com/python-discord/bot
like which file do i edit.
Hello! Check out this page for contributing to (and setting up) the bot: https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/bot/
A guide to setting up and configuring Bot.
Please note that we do consider Sir-Lancebot to be a bit more beginner friendly:
https://github.com/python-discord/sir-lancebot
https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/
Oh dear @brisk brook - I'm so sorry for waisting your time by removing the new lines again. I pushed the update adding back the new lines and will hopefully not cause such trivial wastes of time again!
could we fuzzy-match tags only up until a newline?
What is meant by a new line?
It is the '\n' character, you can't see it, but it signals the device to print the other characters on a new line
For example
"Hello\n World!"
That will print the following
Hello
World!
Who's jchristgit?
@Volcyy#2359
@last patio about the comments for the PR can I ask you something about it here? I find it easier
hit me
What did you mean by It may be nice to maybe run the full codeblock through a formatter to adapt it to a single style.?
And this bottom comment should be a docstring?
Iβm guessing run it through black?
What's that?
Python formatter, In goes ugly code, out comes consistent and good code
How can I get that set up?
I havenβt used it before let me check
pip install black
Thereβs also an online version of it
Playground for Black, the uncompromising Python code formatter.
Ah yeah just use whichever you find convenient, either way make a commit after youβve prettied up the code
it raises a lot of cannot parse errors
oh nevermnind oops
Cannot parse: 121:4: elif request_confirm is True:
A different solution I've been thinking about is to take one additional word at a time, and see if there's still a fuzzy match with the message taken so far. Once you encounter no fuzzy matches, you use the last fuzzy match found
yeah that could work
for site#703 how would I link another file on the site as a hyperlink? or would it have to be done by staff here
You just specify the path to the file. For instance, for a file in the same directory, the url would be:
./file_name
For a file in a directory higher:
../file_name
Etc
I found an example
pydis_site/apps/content/resources/guides/pydis-guides/contributing/bot.md line 50
See [here](../creating-bot-account) for help with setting up a bot account. Once you have a bot account, invite it to the test server you created in the previous section.```
right now are all users able to edit/cancel other people's reminders?
i just accidentally edited the duration of someone else's reminder
Nope, that's just an admin thing:
https://github.com/python-discord/bot/blob/main/bot/exts/utils/reminders.py#L476:L477
bot/exts/utils/reminders.py lines 476 to 477
if await has_any_role_check(ctx, Roles.admins):
return True```
ic ic
can we exclude mina from that
Sure, sure π
try !remind edit duration 4286 1d
!remind edit duration 4286 1d
You can't modify reminders of other users!
Hmm I wonder why anyone would need to edit someone else's reminder. That would be.....rude ig lol. Just like with the !user command, you can only run it on yourself, so I suggest the same for the reminder command.
Mods can run user on others though π
I think it's just an extension of admins being able to delete other's reminders, I don't mind disallowing editing though
even for deleting.. idk that i would expect to have that ability thru the bot. a confirmation would be nice if i'm about to modify or remove anyone else's reminder. it's all too easy to mistype a reminder ID
but yeah in the meantime i will be more diligent if i ever edit my reminders
I'd rather not have to directly mess with the database to delete a reminder
sure, it makes sense to have a feature to delete your own
it also makes sense for it to be made known if you're deleting someone else's bc you have elevated perms
re: https://github.com/python-discord/site/pull/691#discussion_r833742960
perhaps we can add a new directory of images under pydis_site/static/images/content ?
I updated site#703 , if anyone can check that
also, site#702
Anyone else have trouble installing rethinkdb on mac?
ericfletcher@Erics-MBP ξ° ~ ξ° brew install rethinkdb ξ² 1 β΅ ξ² 1460 ξ² 19:11:14
Error: rethinkdb: no bottle available!
I could install from source, but am wondering if anyone else dealt with the above error.
Or maybe I should use the docker approach to installation
Actually, looks like rethink doesn't work with ARM Macs https://github.com/rethinkdb/rethinkdb/issues/6932
It appears that I've gotten things working with Docker... would love to screen share with someone more familiar with running site locally.
What's up? You need to modify the .env variables slightly, but afterwards, you should just need to run docker up inside the site folder and it'll start!
Oh my....
I got it the website running locally that is!
So much damn abstraction happening with Docker....
Yup π
Feel like it would be helpful to know what it's doing.
Excited to get going on the scraping API feature.
Seems like a bug, you could open an issue on https://git.pydis.com/bot
we might just have to correct something with the !docs command
i'm not too familiar with how to do that though
They just have conflicting namespaces
Not sure there's a better solution than dropping one of them
internal priority
add some sort of priority for packages
well, take the existing priority and add it to the site and add a command to set it
What would be the purpose of that? in the end it's for it to be fetched via the docs command
I see you're not familiar with the source
?
there's already programmed priority which renames symbols when they conflict, as is shown in the screenshot above
it makes the stdlib and a few other things have top priority to not be renamed--it will rename the other object
(that's how the current docs inventory code solves the name conflicts, by renaming existing objects, unless they're in the priority)
so just take the existing system, and modify it a bit to store the priority on the site, and a command to set the priority
That's what I figured could be a solution, although I'm not sure how much I like it given that you're not actually going to use that namespace in code. But if it already exists then 
!d discord
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
That works too π
I wonder if it does
could you check if this is persistent by reloading the cog?
ext is doc iirc
!ext reload doc
:ok_hand: Extension successfully reloaded: bot.exts.info.doc.
!d discord
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
lmao so no consistency whatsoever
I should add some sort of priority to my own....
!src d
Look up documentation for Python symbols.
I've taken the docs command and heavily modified it for my own use, and then extended it to some other things as well
you're all welcome to take some of its changes back upstream if you want to
We already have a system! π All our tags are kept here https://github.com/python-discord/bot/tree/main/bot/resources/tags
So to add a new tag it's as simple as opening a pull request and getting it merged
This gives us the chance to check the content of tags before they're added to the bot.
No problem! As for tags, the usual process is to open an issue first, with your suggestion, just to gather interest in the tag, before you spend time writing it
When we post github links with the line specified, how is the embed automatically removed when the bot responds with the code in the line(s)
bot/exts/info/code_snippets.py line 257
await message.edit(suppress=True)```
Wait what... bots can do that?
to note that requires manage_message permissions in the channel
that is the only thing bots can edit about other user's messages
Interesting
I just wanted to say there should be a command for python discord bot, the command being called "give" (or any other name) the command passes over the channel to another user
Are you talking about the help channels?
yes sir
Ok, I'm not sure why that would be necessary then
if there is a fairly simple issue and instead of closing the channel it could be passed over to someone who has a more difficult issue to fix.
Hmm, not sure I'm following what you're saying, but let's see what the admins think about this
anyone can claim their own help channel from the available help channels category
there's always 3 available
Wanted to live stream my digging into site, but am unable to find out how to get the video role. Does anyone have guidance on this?
If there is a moderator in VC, you can ask them.
Nice to know. Thanks! Unfortunately, there isn't one now, but maybe one later!
@warm vigil told me I have to fight to the death to be able to stream.... so am willing to do whatever it takes!
For site#697 Migrate VPS services pin by Python bot to site, how about we incorporate this message in it too #discord-bots message
CC @sharp crag because you're the author of the PR
Sounds good!
We're gonna wait until the permission rework. Then we'll assess our situation.
discord is changing the way slash commands permissions work (as in, who can use or see slash commands and how admins can manage that)
Yeah, and right now, everyone can see all of the commands, if I remember correctly.
and even then, once some are implemented, it will most likely not be for all commands for quite a while (if ever)
For something specific?
iirc we're keeping an eye out on the Forums as a possible replacement for the help channels, and considering using threads for #discord-bots and possibly other topical channels, but either way no immediate action planned
We're currently looking at forum channels for the help channels. We have them on this server already, but the API doesn't support them yet, so we're waiting for that.
The publicly documented API that is
Threads for topical channels when π₯Ί
someone missed a staff meeeeting
There's a couple of moderation related things that need to be done before we allow members to create their own threads
which just hasn't had anyone pick it up yet, due to other more pressing things coming up
I was literally working
π on a Sunday for 14 days in a row
Hopefully at least your bank account is happy π
π€
Happy to help?
Did a bunch of thread related stuff, might as well finish :P
Site does migration on startup right?
Yes
Okay, thank you.
Hi, any interesting python open source projects you're familiar with to contribute to? ones that are active and for building useful tools
We have 3 open source projects right on this server! @dusky shore is the easiest project to contribute to (for beginners in Discord bot programming). There's also @stable mountain which is a bit harder, and lastly there is the PyDis site. You can find the Github repos for all 3 projects at https://git.pydis.com
(!contribute tag also
)
Oh yeah forgot about that
!contribute
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
Not that I think this matters, but I noticed that the buttons for the Announcements and PyWeek Announcements roles on the !subscribe command have a period at the end I personally think the periods there are unnecessary, but it's such a tiny detail so I don't expect anything to be done about it, but thought I'd point it out anyway just to gather some other opinions purely out of curiosity.
If people agree it's not a big deal, it's a really small PR and we could get it merged in no time
@vale ibex @brisk brook @exotic ember @patent pivot I require reviews. https://github.com/python-discord/black-knight/pull/36


This is the way
This is the way
what's it do?
Okay
@fading gale
That's it. :)
Read the bot description. :)
I think that was part of a larger commit, so didn't even realise when I was reverting
Great!
It returns a link to the first symbol loaded with that name
Because the libraries all share it there's really not much to do apart from giving discord a priority, but I'm also not sure if the page that links is what people want when they try to look it up
class discord.User```
Represents a Discord user.
x == y Checks if two users are equal.
x != y Checks if two users are not equal.
hash(x) Return the userβs hash.
str(x) Returns the userβs name with discriminator.
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
Hm I wonder how to get sphinx to just not document the 'discord' name for nextcord and disnake
cause the discord alias reaslly doesnt need to be included in the docs for the libs
since its only there for compat
ok I have concluded i dont have a clue how sphinx works lol
Surprisingly not much info to be found if you look it up
But we already do manipulation on the loader side, so this is just more manipulation
That said, a bespoke system for a single bad symbol is overkill
Yeah that's why I'd rather change it docs-wide
Are you suggesting changing it upstream?
Yeah
Ah gotcha
I'm in a slightly unique position of being able to achieve that too 

