#dev-contrib
1 messages · Page 92 of 1
Is sir-lancebot#561 on high priority? Or i can get it done later, kinda packed rn
{**dict_1, **dict_2} when
Ok cool.
!e ```py
a = {"a": 1, "b": 2}
b = {"b": 1, "c": 2}
c = {**a, **b}
print(c)
@sharp timber :white_check_mark: Your eval job has completed with return code 0.
{'a': 1, 'b': 1, 'c': 2}
since 3.5ish
What I'm confused about is why asyncio.create_task doesn't use asyncio.get_event_loop
Unpacking in dict literals? It has always been a thing afaik
Yeah, but not two at once
Why should it? I think it'd be bad for it to implicitly be able to create a new loop.
I believe it has always been possible
Python 2.7.18 (default, Aug 4 2020, 03:44:25)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {"a": 1}
>>> b = {"b": 2}
>>> c = {**a, **b}
File "<stdin>", line 1
c = {**a, **b}
^
SyntaxError: invalid syntax
>>> c = {**a}
File "<stdin>", line 1
c = {**a}
^
SyntaxError: invalid syntax
>>> c = dict(**a)
>>> c = dict(**a, **b)
File "<stdin>", line 1
c = dict(**a, **b)
^
SyntaxError: invalid syntax
Fair enough
Hmm so they yeeted the unpacking in a comprehension part of the PEP, how sad
Maybe someone should restart the conversation 
Has both pllaning and approved label
can bot#1471 get approved 
I mean, we are aware that those PRs needs reviewing
They would already been merged if we had time to
And as far as I can see, none of those are time sensitive
I can understand that you want to see your feature merged quickly, but we are doing it as fast as we can
Yeah ik and hence I put it after a 2 week gap, one questions, for trivia quiz, what type of constants go in the bot/constants.py, since earlier there was total chances for wiki which was not something like ids or keys
Sounds like something that should go into the resources
No i mean like we have file constants and class constants and root level constants, how are they differentiated
don’t wanna add, just generally
Well, probably depends on what you wanna add
Uhh ok
@timid sentinel I left a couple of comments to your review
Thanks, will have a look in a minute
no rush
@cold island btw did you manage to confirm what the behaviour would be on the first start up in terms of currently nominated people ready for review?
Will check soon. It crossed my mind when I started working on this, and then for some reason I decided it was already handled.
In case it's not, the solution I had in mind is suppressing reviews when they're over a week overdue. Can't think of something more elegant
Actually one day overdue should work as well, no reason for the bot to be down for that long
What is last commit about?
Uhh, the last commit to the repo?
Is it like clickable?
Nope
Oh lol
But I prefer the new version overall
@sleek steppe what will it do if the repo doesn't exist?
👍
fixed
niiice, will have a look now
Do you think it's ready to push?
Maybe we shouldn't repeat the page name, but sure
Like The requested repo was not found. ?
repository sounds better imo
Repeating the input string doesn't look too useful
Yeah I took that out
I changed the cooldown to 1, 10 per user (because it was 60 seconds for and I had to test it), should it be changed?
sir-lancebot#632 is open.
@timid sentinel thanks! thoughts about whether the commands should use the nomination id or the user id?
Hmm, either is fine
user id might make more sense from a practical point of view, but from a technical point of view you're posting/marking reviewed a specific nomination
I think it's fine as is though
but... if you think user id would be better feel free to change it
could it maybe do both?
Hmmm
Honestly just user ID is probably fine. Every time I wanted to mark someone as reviewed during testing I had to look up the nomination ID
it's usually not the first bit of information you have available
user id please!
bot#632 needs review
That's closed.
sir-lance 632 ^
Oh.
👀 didn't stop typing
Discord is weird sometimes.
https://pythondiscord.com does not have a robots.txt or a terms of service for scraping.
@patent pivot seems like a bit of an oversight given the privacy policies and such.
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
We have an issue open for it
Here:
Site#354
It’s currently awaiting dewikification
Bot decided not to link it
it's not an oversight
no privacy policy means an implicit yes to scraping through robots.txt
if there is no robots file then the RFC recommends you continue
So we can add one, but it's a nicety rather than a requirement
In the github pr by ToxicKid, should this 🍴 be used rather than ⑂ for forks
⑂ seems more familiar as a "fork" to me in this context
but it is not that clear in the text imo
@whole forge The changes look good, could you fix whitespace error and I'll merge the commit into my branch
huh, whitespace error? yeah i'll take a look
!remind 3h do that
Your reminder will arrive in 3 hours!
👍 If you're doing it locally, you can do pipenv sync --dev && pipenv run precommit to install dev deps and install the pre-commit hook
pipenv run pre-commit will run the hook manually if needed then too
@sharp timber Since reactions purge is gonna be similar to clean, can i just add it to that group?
and its doc-string is misleading
The deleted messages are saved and uploaded to the database via an API endpoint, and a URL is returned which can be
used to view the messages in the Discord dark theme style.
this never happens
What doesn't happen?
what is said in the docstring, doesn't happen
What part though? It it uploads the log via the site api and sends an embed to the mod log with a link to the messages
it does, lemme see, couldn't find it
look for calls to mod_log.upload_log() and mod_log.send_log_message()
yeah, found it
well wherever I add it, it is gonna take the same amount of code, so I will just make a new file
Messages deleted via the clean command are stored, yes. This is because the clean command is generally used to remove messages that break our rules
Our privacy policy describes everything that we store on our members
i dont have pipenv installed, and i was working on my server through vscode-ssh because docker
i can figure it out tho
I've noticed in lancebot we're doing this sort of check within commands quite often
if some_optional_param is None:
await invoke_help_command(ctx)
ctx.command.reset_cooldown(ctx)
return
Would it not be better to mark the param as required, rather than optional, and let the error_handler deal with it?
Since our error handler excepts UserInputErrors and resets the cooldown itself
Yea, maybe we should make the error handler use your new help command
rather than a basic error embed
Yeah that makes sense
@whole forge
Here's your reminder: do that.
[Jump back to when you created the reminder](#dev-contrib message)
!remind 3h more time
Your reminder will arrive in 3 hours!
I'm guessing it's a bad idea to commit suggestions
It should be fine if the suggestions themselves are fine?
The trailing whitespace failed
Yeah the suggestion had a linting problem
It's fine to commit suggestions in general though
Alright
Ah, AFAIK someone said no robots txt implies no scraping
It implicitly means all scraping is allowed
that being said, you should probably also check out any available secondary resources such as the site's ToS or what not, just to be sure
(where is it pulling the forms description from 🤔)
meta tags
nice
what I am more confused about is how it is pulling a title out of this what the fuck lol
Smh you doubt my web design prowess
But yeah that's unexpected lmao
sadly didn't pull the description
lmfao
@whole forge
Here's your reminder: more time.
[Jump back to when you created the reminder](#dev-contrib message)
@short snow regarding https://github.com/python-discord/sir-lancebot/pull/632#discussion_r598082136 (old/new)
Should I specify timezone?
Does that use Timestamp?
if you use the discord native embed time stamp it adjusted
Alright pushed
Ah ok.
I wouldn't, for a few reasons. One is that it works differently, so there's reason for it to have some minor separation. Another is that the clean command itself is undergoing significant work, so we'd end up with a big merge if that was done
Yeah, i kept it different.
!remind 2h i thought i had time now but i dont
Your reminder will arrive in 2 hours!
Maybe bot#1471 should get a status: needs review label?
we dont have any "needs review" label or anything remotely resembling that
any PR needs to be reviewed as matter of a fact
Makes sense
1769 is not a valid duration string.
@vale ibex i've finally done the pre-commit checks
Did you install the dev deps? looks like the hook failed #dev-log message
looking for contrib review on https://github.com/python-discord/bot/pull/1478
literally a one line change to codeowners 🙂
wow scale so fast
wow chris so fast
okay should auto-merge once ci passes

tis easy when all you gotta do is make sure the username is spelt right 😛
you did that????

gotta keep that graph active
my graph fukin died over the last week
eeeee why does precommit not error out if its missing those

also, would it have been correct to make a PR for this, even though ultimately the changes are part of the same PR?
i thought that might over complicate things more than a manual merge, requiring reviews on changes for a branch that has open reviews on the same feature etc.
It's a PR into the branch my PR is based off
so it'll just be put into my PR as commits once merged
afaik anyway
right but before it can be merged, it has to go through the whole approval deal too.
and as im writing this, it was merged....
i was boutta say, that would be a good reason for me to just never touch any bot code at all
good
Should 404 pages have a link to the home page?
Seems more useful than a discord server invite.
yes I know they can coexist, just having a link to the top level page would be more beneficial than the invite
That's a good idea.
anyone here work for apple lol
Probably not
Wby doesn't the python bot have a translation cog? Because since people speak different languages it would help if there was a a translation cog
We don’t allow different languages on this server.
It’s not because English is the best language or anything
But because it would be quite difficult for us to moderate other languages if we can’t read it
Translation can only be so accurate, but we can lose meaning and context
@timid sentinel I agree with your comment, what do you think of this instead? ```diff
-[channels.add(channel.id) for channel in category.text_channels]
+channels.update(channel.id for channel in category.text_channels)
Yeah that's much nicer 👍
👌
I don't think so
What's until_message?
Oh you can use the after kwarg
@short snow a heads up, the clean command is in the process of some changes, so it might affect PR's related to it
The implementation should also take into account that functionalities such as fetching the the messages in a certain range already exist
Ok sure, I would wait for those changes 😄
I have a suggestion. Maybe add a note in the !code command about the pastebin, so that people know that that's another alternative for large code blocks.
It doesn't have to be large, just something that let's people know..
we have !paste for that
we could probably link it there
If your code is too long to fit in a codeblock in discord, you can see
!paste
I know that exists, but the people who use the commands often don't want to use both and cover the chat.
Maybe, but why not just do
For any long code block, please use paste.pydis.com
On the site, the name of the page is showing up at the top above the page description. I don't think that's supposed to be there.
It's showing up for a lot of pages.
Oh
I didn't realize that.
Also, can we update the images on the site for the help channel guide?
Some people may be confused about what the old names mean.
I tried doing that
but I literally have no idea what page you're talking about
can you link it lol
Dev log is awfully quiet today 👀
Thanks Scaleios!
not entirely sure of this but i heard elsewhere mentions of cloudflare issues, and iirc that webhook is behind a cf worker so that may be related
I think Mondays are just quiet in general 
https://github.com/python-discord/snekbox Anyone tried using snekbox before
I was like looking at it and I dont really get how to do it
It is quite simple actually, you can just send a POST request to /eval with a json body
In the body you need to give it the input key mapping to the code to execute
running?
uhhhh
I didnt really do anything to setup yet cuz idk what I needed to do
Ah, we don't run any public snekbox instance
We have a docker container
this?
Yep
do I run that command somewhere
On your computer, yes
cmd prompt?
Do you have docker installed?
I dont think soooo
if it doesnt come with anything then no, I never installed it by itself at least
Alright, Docker is a pretty big piece of software, particularly if you are on the Home edition, but it will be quite useful during your programmer journey
alr
wait if Im gonna like host my bot elsewhere not locally would I have to do something different
You'd usually dockerize your bot, put it inside a Docker container, to deploy it
But you will need to run snekbox on the same platform as your bot
how would I do that then
I mean
I need docker on that too right?
How would I get docker there
Yeah, you'd usually have your whole "stack" (the bot and snekbox, plus anything else you might need) in containers and deploy them on your server

During the docker installation there was some problem
it said uhh
this
the link was confusing
no
while its neat, its very early in development and probably better to go with the default vm
the
wait
do I reinstall now
😔
welp time to uninstall docker
wait
but the docker command works tho
should I reinstall it or no
I just clicked cancel on that one
if you want to try getting the wsl to work i recommend carefully following the isntructions it links to
is that necessary for snekbox
if you dont want to deal with that, the other option is reinstalling with a different backend
either should work
tho
be aware that docker on windows is not great, and you should run a deployment version of snekbox on a linux based server
hell no
docker is a really big piece of software meant to run on servers.
you could potentially run it on a rasberry pi
You could run a Linux VM through Azure.
which version?
3b or something
ah
Im gonna try running snekbox on pc rn as a test myb
docker: error during connect: This error may indicate that the docker daemon is not running.: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/create: open //./pipe/docker_engine: The system cannot find the file specified.
See 'docker run --help'.
😔
Snekbox won’t run on rpis
wut
Yep
k
I did get this error when running the snekbox command in cmd
I am not sure, I never ran docker on windows
Do a clean uninstall.
k
Sometimes large programs do weird things if you don't.
especially something as complex as docker for windows.
welp now time to install it again
So this time do I uncheck Install required windows components for WSL 2
not sure, there should be a option somehwere ot use a VM instead of wsl
Damn now the docker command doesnt work
before it worked when I checked the other thing
nvm it works
but yea i do get this error
but yea apparently I need the WSL 2 thing
@whole forge which one should I get
Im not quite familiar with these sorry
Are you familiar with linux?
not really
Otherwise I’d recommend debian
ok
are you sure you want to be running your own instance of snekbox though?
there are public APIs available out there which will evaluate code for you
google wandbox
yea that
i've also heard of piston
Ive heard of wandbox
I googled wandbox api
and a pypi package came up
but the readme on there was also not very clear
no documentation 
You don't need an api wrapper you can just make requests to the api
Especially because that probably uses requests which is not async
looking at the source code of that wrapper, it seems like they're making requests to 'https://wandbox.org/api'
and npm package
either ways, off-topic for this channel now
Also, what is coveralls?
It is a website giving you your test coverage percent, among other things
So... Trying to restore working snekbox after full software update, but getting 500 on every request to API, logs are:
2021-03-22 17:24:33,589 | 8 | snekbox.api.resources.eval | ERROR | An exception occurred while trying to process the request,
File "/snekbox/snekbox/api/resources/eval.py", line 75, in on_post,
Traceback (most recent call last):,
result = self.nsjail.python3(code),
File "/snekbox/snekbox/nsjail.py", line 181, in python3,
cgroup = self._create_dynamic_cgroups(),
File "/snekbox/snekbox/nsjail.py", line 96, in _create_dynamic_cgroups,
(mem / "memory.limit_in_bytes").write_text(mem_max, encoding="utf-8"),
File "/usr/local/lib/python3.9/pathlib.py", line 1274, in write_text,
with self.open(mode='w', encoding=encoding, errors=errors) as f:,
File "/usr/local/lib/python3.9/pathlib.py", line 1241, in open,
return io.open(self, mode, buffering, encoding, errors, newline,,
return self._accessor.open(self, flags, mode),
File "/usr/local/lib/python3.9/pathlib.py", line 1109, in _opener,
PermissionError: [Errno 13] Permission denied: '/sys/fs/cgroup/memory/snekbox-19ecdd18-49c4-4136-8ab2-5f26995421ef/memory.limit_in_bytes'```
It was working before updating, i tried some old images, but getting similar errors
in docker, via docker-compose
snekbox:
container_name: snekbox
ipc: none
privileged: true
restart: always
ports:
- 8060:8060
image: ghcr.io/python-discord/snekbox
deploy:
resources:
limits:
cpus: 0.25
memory: 256M
volumes:
- /home/fixator10/snekbox.cfg:/snekbox/config/snekbox.cfg```
same happens without resource limiting and volume mounting
with docker command from readme the same happens
yes
Tried restarting?
twice already
It also spawns a folder /sys/fs/cgroup/memory/snekbox-<uuid> for each request, which, in fact, cant be removed
https://moeka.is-a-good-waifu.com/7T11kn1.png
That’s normal I believe
That perm error may just require a recreation of the container, though I’m not an expert
drwxr-xr-x 7 root root 0 мар 22 19:56 .
dr-xr-xr-x 13 root root 0 мар 22 19:56 ..
drwx-----T 2 root root 0 мар 22 19:56 bpf
dr-xr-xr-x 12 root root 0 мар 22 19:59 cgroup
drwxr-xr-x 4 root root 0 мар 22 21:38 ext4
drwxr-xr-x 3 root root 0 мар 22 19:56 fuse
drwxr-x--- 2 root root 0 мар 22 19:56 pstore```
just recreated it again, still same
looking at another host with Ubuntu (the issue on Arch), seems like its not really normal
drwxr-xr-x 17 root root 420 Dec 25 13:07 cgroup
after setting w+, still same error
drwxr-xr-x 12 root root 0 мар 22 19:59 cgroup
maybe i should try setting w+ recursively for cgroup, but not sure if thats a good idea
As long as it is owned by root, you should be fine
Assuming that you are giving write only to owner
It's definitely an issue with the host. I don't know why it's this way. Consider searching or asking in the arch forums.
I guess, i will, ye. Just noticed that on ubuntu host there is memory in cgroup, but not on arch
I use this on arch too and I've had no problems. I haven't tried recently though.
You are not allowed to use that command here. Please use the #bot-commands channel instead.
It works fine on my manjaro install as of a couple of weeks ago
What was the problem?
yeah
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
Wait, not that one.
I mean the embed theat pops up when you paste code without syntax highlighting.
It won't show a Python code block if it can't detect with reasonable certainty that the code is Python code.
Oh
That makes sense.
That must've been what happened.
Thanks for letting me know!
No problem
So, apparently, im on testing repo of arch, and its switched cgroups to v2 by default
what is stream yard?
It's basically a livestream utility, fully in browser, that allows you to have several people connect to your stream
It makes it much easier to have multiple live on stream and it also allows you to stream to multiple destinations, like both YouTube and Twitch. We're probably not going to use that just yet, but maybe we'll find another interesting destination besides YouTube in the future.
For python-bot's docs command I was just looking through it: what exactly is self.inventory
like I would expect that it makes a request with the "symbol" as a param but instead it searches the inv dict for it not exactly sure what it does
it's an internal cache of symbols
it also provides the means of getting the data from the various docs, if the symbol isn't already in the cache
The inventories dict maps the symbols that can be searched by users here to the urls where their docs are located
Hey @patent pivot , I noticed you were using kubernetes to host a lot of the server services. What platform are you using, and how much does it cost? I'm looking for a cheap place to host some stuff
We're using Linode but on a fairly high costing plan of around $2k/yr. There are more affordable Kubernetes plans at Linode or Scaleway though, so have a shop around
okay, thanks! 2k is about 1750 bucks too much
😄
Ah ok
this video has been made private by the uploader https://github.com/python-discord/sir-lancebot/blob/a059eb2dc1caf2d8012629e311ac9b4a0b164692/bot/resources/easter/april_fools_vids.json#L21
There should be something like !pypi package1, package2, package3 instead of !pypi package1 !pypi package2 !pypi package3 because I feel like the first one is much easier, and looks much cleaner if it were all combined in an embed, let's say as a field not inline or something like that.
for the pypi command
just a suggestion 👀
cc: @vocal wolf 
I'm not sure if that's necessary as a feature, as we'd have to put a limit on it so it doesn't flood chat and/or spam pypi with a ton of requests
detecting spam wouldn't do too well
we can limit to <5
it would make it easier to spam pypi with requests
even if it doesn't trigger our spam filter
so it's a maybe, but I'm not too sure as of now
pretty good idea, but we'd have to find a way for it to not get abused
cooldown and limiting to number of packages can prevent that
I guess so, yeah
Thanks, PR opened!
should i add the riddle command with the quiz command?
since there is a issue open about it
and i don't see a need to copy paste quiz's code into riddle
the spelling of github should be GitHub right? in a doc string.
oh
I was thinking that
normally for these kinda search things
it would just directly make a request and then parse the html
so that kinda got me confused when i was looking through it
huh
The command calls get_symbol_embed, which calls get_symbol_html, which tries to get the url from cache then make a request to that url
The docs command is gonna be faster when that super big and old PR gets merged right?
Uhh, yeah
oh yea nvm
tru
nvm
it pretty cool that it can also get documentation from non built in libs tho
oh
not all of them
nvm
If the library provides somewhere we can get documentation, we can add it
I don't think we've had suggestions for any specific libraries before, but if you feel like something would be a nice addition, feel free to suggest it
heck
does python or snek or sir or anything color its stdout logger output?
because uh, im trying to do so and well, lol
I think we use coloredlogs
basically how im doing it is uh
logging everything twice
i figured out its when i do from bot import Bot in any cog it now starts to log everything twice
which is extremely annoying
We use coloroma in.. something
the import is for the class, to get typcasting
i'm not importing my bot instance ffs
if typing.TYPE_CHECKING:
import ...
that will only run when you're running type checking, so it won't actually import when running
rn im using a class that i stole took from another bot that took it from something else
hm, out of curosity what is the other option lol
like, what are you guys using
but, you do
huh, I guess we do lol
so
that worked
but wait
nope
it works to import it but not when trying to run it
yeah this is specifically if you want to type hint something
if typing.TYPE_CHECKING:
from bot import Bot
class SomeCommands(commands.Cog):
"""A couple of simple commands."""
def __init__(self, bot: Bot):
self.bot = bot
that works fine for writing but errors when running because Bot isn't defined
so its impossible to actually typehint
what is this?
try type hinting as "Bot"
you mean with the ""?
yeah
can you give a POC
it works fine on @stable mountain but not for me
I'm struggling to see what you want to do
class SomeCommands(commands.Cog):
"""A couple of simple commands."""
def __init__(self, bot: "Bot"):
self.bot = bot
trying to typcast the bot in the cog so i get completion from my editor
commands.Bot perhaps?
made a custom instance
the bot doesn't have an __init__.py file
i'm launching the bot directly from python3 bot.py
the issue is actually in the colorizer i believe
so im gonna try what joe linked
since uh this colorizer seems a bit odd anyways
yep
coloredlogs seems a bit easier
just a bit
down to coloredlogs.install(level='DEBUG') from like 15 lines to do it lmao
smh i forgot to import it
NameError: name 'coloredlogs' is not defined
One thing you can try to do is instead of adding a logging handler blindly, is to only add it if it doesn't exist. Alternatively add the code that needs to only be run once to a if __name__ == "main" block
Assuming coloredlogs doesn't do that
DID I FORGET
smh
god
oh wait okay
that was already a thing
if __name__ == '__main__':
bot = Bot(command_prefix='=', description=DESCRIPTION)
bot.create_http_pool()
bot.load_extensions()
bot.run(TOKEN)
whew
where is the logging stuff
in the
in the
why
its at line 67
above my constants
i uh
for one, i have no file structure
lol
it was like, "oh, i should put this here, i'll put it above where i use it"
WOW
THAT WAS THE BUG
sigh
~~now i realize this was more a help channel thing, oops
thanks for the help, @gritty wind….
as annoyed as I am at what the bug actually was
Lol
I'm guessing wrong bot
.issue is not
it is just one line, hence said
For lancebot too?
Core Devs is losing more and more permissions...
Or another way to look at it: pydis is becoming safer and safer lol
More permissions = better
Core devs used to have the permission to deploy code that could annihilate the entire server, which imo is not very good
I think that sentiment was shared by quite a few core devs when we made that decision
issue should be allowed here unless someone reverted it
PR made
#dev-log message what did scragly have in mind here?
cc: @crude gyro
I forget all the details but essentially we wanted an interactive graphical component sort of like this one:
where you could hover and click the channels and see little Python chats
maybe with duckies for avatars
so we'd move some stuff around to make space for this component
@glass pecan himself will have to explain the rest, but I'm super excited about this component
https://github.com/python-discord/bot/blob/15c1d321ccd8ff9c7c9b7802ea732e43fcffbf9e/bot/exts/moderation/verification.py#L139 why do we do *_ there?
just not mentioning any arguments there will also work fine
Hm
you can do that if you just define the function as
async def unsubcribe(self, ctx):
woah that sounds awesome, but lot of work
a lot of work indeed 
It could be better if there is place where all this is noted, so people could help out
this particular thing is probably a one-man job.
should maybe still be an issue, but it's no big deal.
it sounds really fun to work on and I might spend a little vacation time on it.
@glass pecan how's your time next week?
Peer coding for this could be fun
I have the entire week off, you see.
might be fun to jump in a stream together and work on it
It's not a coding thing 
but yeah lemon, happy to chat about it next week to get a solid outline
CSS is not the majority of the work for this
Yes, but it allows me to not be wrong
design is.
I think it's 50/50 style and graphical assets
and I'm happy to do either.
bet the two of us in a stream could make short work of it, though.
Looking forward to see the new design
I was thinking of seeing if we could make it a canvas element but that sounds pretty intense too lol
sounds overkill. I'd solve this with css, html and illustrator.
maybe, depends on the goal and functionality I guess. we'll see what we come up with in discussion
wanna set a time for a prelim voice chat about it?
It definitely looks css-able
css is definitely involved, yes
remember, we want interactive stuff
it'll be a bunch of annoying js too
There's a trick, if you've got a fixed size space--like this will have, I believe
You can use a bunch of position: absolute to force the elements on top of each other, then shuffle their z-index with the + selector to bring things to the front
I have a demo of this somewhere
yep, we do similar atm for the waves
that's just a simple version of it though
the canvas i mentioned before wouldn't make it overtly complex either lemon, it's still just html/css/js with graphical assets or css shapes
the only difference is that a canvas is a fixed positional area to work in while also having a bonus of low latency to any animations, as the browser will prioritise it
I'm open to it, I'd probably want to mostly do graphics.
ducky avys all over the place lol
yep! ducks and whatever you need, I'd be happy to produce that.
are we able to try make them non-same though or is that too much to ask for
like different poses and shiz
of course.
niiice
but seriously, we should put together a StreamYard session for this.
I think it'd be really fun
great content potential
hmmm
Having the duck pond animation on the front page would be sick
duck pond animation?
from the most recent video, I guess.
Yep
oh right
was thinking of the channel
i'm fine if you want to stream working on it yourself lemon, but I dunno if I want to personally be in a stream. so would that be ok
we'll figure it out.
probably on discord, so even others could join...
https://youtu.be/g9cnp4W0P54 at 0:55
lol more joining in is even worse
Eeeh allowing random users to join sounds like a good way to get platform banned
stream was just an idea. I wanna do pair programming streams this year and thought this might be a fun opportunity.
probs is, it's just two things i aint a fan of mashed together lol
permanent personal public exposure and pair programming
triple p expo
lots of p
as they say
haha
well in this case pair programming would be more like me doing graphics and you writing code
more like teamwork than formal PP
yeah i'm super self-concious about how badly I code so I never stream it lol
permanent personal public performance pair programming
nice
but not gonna pressure you into p6
i was looking at the thesaurus just now but that's good enough for me
howd you manage to both get different ways to represent that lol
My brain goes one way, yours goes another lol
I don't want to do any permanent personal public performance pair programming peer pressure.
dammit lemon
!otn add permanent personal public performance pair programming peer pressure
:ok_hand: Added permanent-personal-public-performance-pair-programming-peer-pressure to the names list.
hahahahaha
Oh no
that's sooo long
did it topple the other long one
will it even work
did we have a constraint that matches discords limit
Jetbrain editions?
yes
the constraint is user trust
discord's limit is actually really big
yep
its 127 chars I think
shame you can only ever see 10 of them
ikr..
I do bad things on my test server
wowzers
seems legit
goodness
time to otn that /s
how did you do that? wow
Help, I have been kicked by kutie's broom
The worst part is that nicknames can get really disturbing like that, since they cover half the screen (on some platforms)
But I think it’s best not to give people ideas
this is a good point
By the way, @vocal prairie, would you like to open a PR for the contributing tag?
Don't worry, I already given three or four stars for that nickname haha
Sure. I'll need to finish up some assets first though.
Cool, I'll assign you to the issue if that's fine with you
a nickname can't be more than 32 chars long...
Those characters were really long.
I have a comment left on bot#1154 , if someone could answer that.
It would be simpler to use a markdown file with certain links stored with keywords. It could also be a json or yaml.
Why reference an API when it's not needed?
It wouldn't be hard to add them quickly, would it?
you can't add star and fork count manually...
Do we need that?
It would be good to have them
lmao how did I not notice that
lmao
was recently added by @green oriole
I feel like scale is the true culprit
And secondly it is the BSD value for a connection error
EX_UNAVAILABLE (69) A service is unavailable. This can occur if a support program or file does not exist. This can also be used as a catchall message when something you wanted to do doesn't work, but you don't know why.
👀
uhuh
you put it where there would be connection issues and did it
👀 why does scaleios have a different color in that screenshot
Different to what
ikr, it's different each picture
What about a color command for Sir Lancebot?
I just made internal suggestion
hmmm
@cold moon let's migrate that discussion here
this is what we said internally
we have pillow to generate images, if we want to do conversions we have colorsys
colorsys is great for generating random (yet vibrant) colors with random HSV values rather than RGB
I guess the only thing that the color API gives us is the colour names
We could hardcode some color names.
We can get like color names, and then we can avoid using our resources for generating
Into a markdown, json, or yaml file.
+1 to colorsys. I'd rather rely on our resources than an API where we have to manage an API key and ratelimits
sir lancebot can be a glorified API wrapper
or we can actually write some cool shit like this 👽
and I think in the long run having stuff like
- color generator with pillow
- random vibrant colours with colorsys (which is really useful for all sorts of stuff!)
- color conversions with colorsys
like colorsys is totally underated, and I think this is a good usage of lancebot to help teach something new
I think it's better to give Lancebot full control over as much as we can (with being reasonable). So I think not using an API is better.
Can we cache color Pillow objects? So we don't need to regenerate them every time.
it isn't really an expensive generation, but if we have to we can look at caching to filesystem temporarily
I remember we had some issues with performance of image generation recently
We upgraded enough that it isn't a problem
lancebot can consume a whole CPU core and we're still sailing fine
Dang. That's some serious power.
I think Chris is working on ensuring image commands get queued rather than all run concurrently
we could also look into switching to pillow-simd
but yeah I think in general
where there are two fairly equivalent difficult solutions and one is an API and one is implemented by us
I think our own implementation would be a nice learning experience.
Especially if you involved multiple members of the community.
How did chris do that?
or he didn't do it yet
hmmmmm
Description We limit add a global limit of 1 concurrent command at a time to the image processing commands (easterifiy, pride avatar 8bitify etc.). We should also run them in an executor so they ar...
Yeah I mean, it wasn't planned haha
Scal asked what to put here, so I took my BSD manual out to check it out
Yeah I saw the PR
But I didn't see anything about queuing the commands yet
But I'm looking at the code and there's no queuing 
Not yet
Oh ok. That was what I was asking the entire time
ahh, yeah, nothing yet, that's why it's an issue + open PR
although queuing it is as easy as
@commands.max_concurrency(1, wait=True)
@commands.group()
async def pfp_modify(self, ctx: commands.Context) -> None:
or is it channel
The built in buckets won’t work for this because it needs to be one bucket for all commands
It won’t work because the bucket has to act on multiple sub commands
The sub commands would each get their own bucket
That only would happen if group.invoke_without_command = True
Which they are
This one isn't
They will hopefully maintain the current commands
Which don’t take a group
Also I’m not sure that’s true
We tested the built in buckets for this when the issue was originally opened
yea, wrapping the group with ```py
@commands.group(invoke_without_command=False)
@commands.max_concurrency(1, per=commands.BucketType.user, wait=False)
async def pfp_modify(self, ctx: commands.Context) -> None:
I think we're likely going to need to define our own bucket
I thought max_concurrency worked the same as cooldown but I guess they worked differently
Checks work on groups, but this isn't a check
Yea
I don't think it'll be a huge task to implement a custom bucket
I just haven't found time to investigate yet
With the change to naive timestamps, is the change to _channel correct here? https://github.com/python-discord/bot/commit/9f576bcf28aa228b6c7f7d57072bba3135047200
@vale ibex how are bot restarts/outdated caches handled now?
During init we use the fallback method, if either of the caches are empty we also use the fallback
could you elaborate, im not sure i understand?
When the bot starts up it needs to determine how long to schedule the close task for, in that case we use the fallback method (idle_claimant+last message timestamp)
once the init is done, it then uses the cached messages, unless either cache is empty for that channel, in that case it also uses the fallback
the cache wont ever be empty tho, since mark wanted us to not use cache clearing.
I guess it covers us for the upgrade path, and if redis does ever get cleared
i can't see any harm in having outdated stamps in the cache
@vale ibex why should we quote the username?
it's less that it's a username, but more the fact that we're giving user input control over the end of a url
so they could add query parameters on the end as an exmaple
oh right that makes sense
I'm not sure of an attack vector for that currently
I thought of that but didn't bother because .github already does that
Yea, it's not something specifically you've added, but something we should try to avoid where possible
I can't think of an attack vector atm, but it could mean users can request things we're not expecting
Also, is there a chance that github will return html escaped chars in the response?
if so we should unescape them
@tawdry vapor why did you use typing.Type?
Cause we're passing a type not an instance
Ah I see
@tawdry vapor Your point about the logic is good though, I could convert it to be easier to read, since inverse blocks like that aren't intuative
Yeah, if you want. I don't really like multi-line if statement either tbh.
By the way, you forgot to change this https://github.com/python-discord/bot/pull/1470/files#diff-98d86f9a906f1b90874af31869323482842592b0ff8f70df95eec2db8dc41903R53
You should just use message.created_at and get the timestamp from it
I think that function could be clearer in control flow too
update_message_caches()?
if not claimant_id:
return
if message.author.id == claimant_id:
...
else:
...
Thoughts about ```py
if is_empty or not init_done or non_claimant_last_message_time is None or claimant_last_message_time is None:
...
I think that's far clearer than ```py
if is_empty or not all(
init_done,
non_claimant_last_message_time,
claimant_last_message_time,
):
...
black formatted
if (
is_empty
or not init_done
or non_claimant_last_message_time is None
or claimant_last_message_time is None
):
pass
@vale ibex something like https://api.github.com/repos/python-discord/"bot" returns a 404 while https://api.github.com/repos/python-discord/bot doesn't
Sorry what's this in reference to? 😄
oh sorry 
Maybe check if there's a ??
I mentioned that for a similar reason as the other one, since users can add arbitrary query params
How are you quoting it? I'm not sure where those %22 are coming from
%22 is "
Yea, where are those coming from?
it just formats like that
Could you send the snippet of code?
Also, any core devs lurking please feel free to step in if you think this isn't needed
these are all of the parameters though
i could send a username of test/blocks or test/hovercard as an example and access arbitrary paths
which might cause weird behaviour/errors in the bot
!e !e ```py
from urllib.parse import quote as quote_url
ENDPOINT = 'https://.../user'
username = 'ChrisJL'
username2 = 'ChrisJL/blocks?some_random=param'
print(f"{ENDPOINT}/{quote_url(username, safe='')}")
print(f"{ENDPOINT}/{quote_url(username2, safe='')}")
@vale ibex :white_check_mark: Your eval job has completed with return code 0.
001 | https://.../user/ChrisJL
002 | https://.../user/ChrisJL%2Fblocks%3Fsome_random%3Dparam
alright, but how about .github repo command?
because it needs owner/repo
.src github repo
That's a new command btw
ahh ok 1 sec
ahhh I see, I'm not sure about that one then, since we want the user to enter a /
possibly 2 args, rather than a single one?
make sure repo.count('/') is 1?
I mean at this point we're getting quite far down a rabbit hole for a possible non-issue
maybe lol
I can just do this though
Yea, maybe just leave my comments there and see if the core devs reply when they review
Something like this is fine?
repo_data = await self.fetch_data(f"{GITHUB_API_URL}/repos/{quote(repo, safe='/')}")
And then add / to safe
safe defaults to / so you can skip that 😄
oh ok
Since you can't do datetime.min.timestamp() would setting the timestamp to 0 indicate that it's the smallest timestamp possible?
or is there an easier to read way to do that?
nevermind, got a better way that makes the flow make more sense.
does it need an owner?
if there's no owner, default to pydis?
@patent pivot was this reverted #changelog message ?
Nope
Why
If you visit https://paste.pythondiscord.com/iqapufisif.notapyextension it definitely redirects
yep, redirects
It redirected me
perhaps I have an extension or something that is somehow blocking it
Most likely something with your local browser
but its not redirecting with me
Nah probably just need a hard reload
this redirected
I’m guessing you made this one?
clearing cache with ctrl f5 worked