#dev-contrib
1 messages · Page 164 of 1
But requests has a body parameter in the request function
And more conveniently a json parameter
sir-lancebot#778 🥺
@last patio 👉 👈
Could a core dev please take a look at sir-lancebot#1000 and maybe approve? Thanks!
(Yeah ik what a milestone haha)
we probably can if nobody is using it, but at the same time it doesn't hurt
@fervent sage im thinking of switching the name of the avatarmod command because that is already used as a group alias, hows avatareffects?
im also considering removing that alias
I thought the avmod stuff was meant to replace the existing avatarmod stuff
indeed the avatarmod alias was added in the meantime because of the issue i made
should it?
do we normally say no permission to use this command
i forget
that makes more sense
ic, was just wondering if its implicitly used somewhere or sthn
err
if i'm a member of the org should i self-assign an issue
okay i see people have done that in past issues
that was a lot of setup for a 4 line PR
nice test scale
Notice that datetime.utcnow() is actually timezone unaware (yeah, I know), which could become a problem since you wouldn't be able to compare the timezone-unaware now_datetime to the timezone-aware duration. In practice this will never happen since duration should always have timezone information.
aaaa
It was meant to be made to my fork
Which I've been trying to archive for months now
I blame all the nsjail config and cgroup PRs for that
lol
Github making a PR to upstream by default is a bit misleading, I agree
It shouldn't have a default remote and make you select between upstream and downstream tbf
I gave it a review, I didn't look through the code but I thought the pull name was a little uninformative
Thanks, noted for next time
hi
Hey! Are you the Krish I assigned the issue to today?
yes
i have forked the repo
plz guide me how should i proceed
can i join any voice channel to talk
There are voice gates in place for voice chat, and I typically don't join there anyways. For the setup, after you fork the repo you need to clone it locally. If you wish to run the bot locally as well there are some other things to set up too (this is usually how people test their PRs)
This is a pretty good overview: https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/
A guide to setting up and configuring Sir Lancebot.
I would recommend using docker
is there any time limit for contribution !
Not at all
thank you because this is my first contribution i might take time to understand all this
We all started somewhere! Take your time and if you hit a wall just ask here, there are usually devs willing to help out
🔥
Approved the issue, good luck!
No worries, it's approved and assigned now 👌
@gritty wind smh
Was sup
forms forms forms forms dependabot
real reason: one of the repos on https://pythondiscord.notion.site/2021-Cumulative-cf310ce3d7c149d5a75fc9ff0d30096e is missing
A new tool for teams & individuals that blends everyday work apps into one.
It's there lol?
one of, not forms
I'd suggest comparing the list of repos on that page to the list of repos you get from github before having to click "load more"
Everything in that list is either there because it was on the main page, or because I remembered it
smh I mention patsy because I commited to it
so I remember it
either way, that makes sense
Smh the only comments I've gotten on that page where complaints, should've just kept it private lol
Anyways I'll add it
Just gotta unlock everything 👀
patsy#4 is a direct dupe of patsy#3 so you may or may not want to count it
99% of forms-frontend is a bot opening and closing the same PR
100% accuracy is not the goal lol
LOL
Quick question regarding in_executor in avatarmod, does it return another PIL.Image.Image?
It returns the return of the function, which if just a discord.File
Technically it returns a future, which when awaited returns the result of the function it's pointing to
Ah
I'm working on revamping avatarmod which will involve applying multiple effects to a profile picture
yes, albeit in may
sir-lunchbot#710
sir-lancebot#710
Hi everyone i just sported a bug in your documentation ( correct me if i am wrong )
in this documentation
under the section " Setting up a Bot Account "
point no. 6 " In the General Information tab, grab the Client ID. "
instead of " General Information tab " it should be " OAuth2 tab "
if i can improvise it do let me know i / community can create an issue and i / community can solve it.
How to get started with testing our bots.
I think it used to be in gen info but they updated the site and split it off into its own section
Yes, you can open a PR on the site and fix it
It's still there no?
IDK
But it's called application ID in there now
thats applicates id not client id
But the guide refers to it as client ID
I suppose we should change that
then we should change one thing
I wonder if we should recommend the generator instead
either the tab or name
nah it;s too complex
so that it removes doubt !
Feel free to PR it directly
For this? There's no appropriate template anyway.
And you don't need to open an issue if you want to fix this yourself. We're making an exception since it's a trivial change.
You were welcome to just PR it, but that's alright
I've assigned you and you can pr it now
how much time does this test takes
that check means someone has to review it
Hi is there any one who can help me run sir-lancebot on my test server without docker !
Sure, how far have you gotten
i have the source code on local machine and test server i have also created a bot account and i have my client id and token , i tryed using docker but i dont know why it is not working and my laptop is also not responding fast now so i thought of working on this project without docker ( i have python 3.x and an ide (pycharm) )
I’d still suggest docker if you can because it’s so much easier, but it’s up to you
Have you seen the instructions on the site
yes
Alright, what have you done
last 2 steps left
Right, right have you started on those steps
yes
i have all the token and id as stated in doc all server set i just need to run the bot but how !
Have you installed docker?
yes
Do you get an error when running docker-compose up?
yes
Did you create a .env file?
This explains it
Along with the linked page "Learn how to set environment variables here."
no
Cool, if you follow the steps on that page it should get you past this issue.
If you have further issues after that feel free to post here again
ok , ty
for the record I've found lance is easier not in docker
"docker-compose up " after running this command it has stoped/not responding over here , should i wait ?
Gateway Latency: 136ms
in my test server
Gateway Latency: 115ms
but i cant see any bot in my test server
I usually start people off with the ping because it’s guaranteed lol
But the dot is fine
You can’t see it at all, or it’s offline?
Might need to add it to the server, I think the last time I did it I went to the Developer Portal -> Applications -> OAuth2 -> URL Generator
Did you follow the steps for adding the bot to your server?
i just create a bot accout and a server
Okay, make sure to invite the bot to your server too
You can do so by following the steps bras suggested
Replace <CLIENT_ID_HERE> in the following URL and visit it in the browser to invite your bot to your new test server.
https://discordapp.com/api/oauth2/authorize?client_id=<CLIENT_ID_HERE>&permissions=8&scope=botOptionally, you can generate your own invite url in the OAuth tab, after selecting bot as the scope.
Ah how do I escape that hyperlink
Just quote it
Looks like it is online
Did you create that channel name and update the ID in the .env file?
ok so i should update all the id's
bingo i just sported the error in channel name i used " " insted of "-"
where can i find list of all sir-lancebot command
.help
every time i need to use docker-compose up or poetry run task start command to make my bot online
For testing changes you can just reload the cog (the script name) with .c r realpython
That would reload the realpython cog, and if you have made changes to it they would then be active
Were you hungry when you wrote this lmao
why is this not running
i have this error , why ?
Reddit uses an API, and you would need a special token for it
is it imp
<linkgoeshere> will escape it btw (or rather, prevent the embed which I think is what you meant)
In the quote it wouldn't let me escape it with <>
Since that particular one has placeholders to show where to insert the Client ID
ok
how much time does it takes for bot to respond
on an avg
.ping
Gateway Latency: 123ms
That many milliseconds, but when it is working with other services there can be a delay based on your connection
how can i reduce this !
basically, you can reduce the gateway latency by having a better wifi connection
fwiw, it's not that much of a delay (especially for a test bot)
ok
Do you have a role in that test server?
You should be an admin
how can i change that setting !
In the server settings I believe
ok done now its working
I think Roles -> Edit -> Manage Members
👍
just one last question for the day i have disturbed u guys a lot so the issue no #1001when we run this command .realpython it should show a url ( https://www.pythondiscord.com/ ) instead of this error
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.
I think it should show the Real Python homepage: https://realpython.com/
No, thank you!
Bump and also would like an approval on sir-lancebot#989
hi all
keeping in mind that the PfpEffects.apply_effect function returns a discord.File, how am i supposed to apply multiple effects to an image?
I guess you can make an effect that uses those effects
sounds good
You could also… edit that file or change the return type lol
thats probably a better idea
im gonna work on this a lot tomorrow
juuuust to confirm, #dev-log message is not intentional behaviour, is it
you can, I learned that the hard way. Trying to ban some scammers and put the date of the day first...
why is https://github.com/python-discord/bot/blob/main/bot/utils/scheduling.py#L68 the way it is 
bot/utils/scheduling.py line 68
If `time` is in the past, schedule `coroutine` immediately.```
IIRC the original implementation was like that. Furthermore, it's inspired by call_at from asyncio's event loop, which behaves in this way.
Also, it calls datetime.now() within the function. Not sure if the resolution is small enough to make a delay between creating the time argument and the function calculating the delay internally.
So the time argument is essentially saying "execute the coroutine no earlier than this time". In general, this makes more sense than erroring out because the time has already passed. If you had a case where you needed a coroutine to execute within a specific time frame, otherwise it's no longer relevant, then I think a more specialised function would be in order.
hmm
management.py uses the stdlib datetime
_scheduler.py uses arrow
cool cool cool cool cool cool cool
Well I guess I gotta give it up
okay there's only one other usage of datetime in management.py, should i upgrade it to arrow
I have a PR that moves a bunch of stuff to arrow. Been open since August last year.
I've kinda been curious to see how long it would take to get that reviewed without me mentioning it
TBH I got kind of screwed over by other PRs being merged after mine
aaa i can't even request reviews without misclicking
imagine if you banned someone like that
:hmm:
We have way fewer core devs than we need for the number of contributions we get, and a PR that migrates a bunch of stuff in the backend is big and not flashy.
That said, I’m willing to dedicate time to reviewing it starting next week if you want to start.
Re: bot#1960 @timid sentinel are both parts approved? In hindsight I should've made two different issues
I know
It is marked as low priority anyway
If anything I'm more annoyed at another PR getting merged that caused a lot of conflicts
Yeah both parts sound good to me
so how do i get the mention of the user from the Nomination object: https://github.com/python-discord/site/blob/main/pydis_site/apps/api/models/bot/nomination.py#L7-L37
Would nomination_instance.user.mention work fine? or is there something special about django models
pythondiscord.com - A Django and Bulma web application. - site/nomination.py at main · python-discord/site
ah, how exactly would I go about testing it btw
nominate someone
👌
@vale ibex @cold island how's this? or should I hardcode the actual expected dict instead? ```py
ctx.send.assert_called_once()
self.assertEqual(ctx.send.call_args.args[0],
'@LemonLemonishBeard#0042 :yay!: Return code 0.\n\n\n[No output]\n')
allowed_mentions = ctx.send.call_args.kwargs['allowed_mentions']
expected_allowed_mentions = AllowedMentions(everyone=False, roles=False, users=[ctx.author])
self.assertEqual(allowed_mentions.to_dict(), expected_allowed_mentions.to_dict())
Bump, again (sorry if I'm being annoying)
huh, getting this error when trying to start the Python bot locally
ERROR: for redis Cannot start service redis: driver failed programming external connectivity on endpoint bot_redis_1 (ef9c9fc0b3a5c962e8cce8e8026aa846ee5e7c7c81a9437c1c987581d3e0fab5): Bind for 127.0.0.1:6379 failed: port is already a
llocated
Means you already have redis running somewhere else I think
hmm, i started web first if that changes anything
@gritty wind Did you mean #sir-lancebot-playground instead of #bot-commands in your changelog message about Epoch?
nah
Isn't it on sir-lancebot though?
I'll let you in on a secret: sir-lance works in both
Ah
#sir-lancebot-playground was at one point meant to only be for lancebot stuff that wasn't spam, like games
It's kinda pointless rn
Ah I see, ok
Oh hi also cc @gritty wind
Do we actually need to test it? It looks fine though
docker was working a few days ago, guess it doesn't wanna work now
oh wait
is sir lance running?
oops
I could remove that bit entirely but that also checks that a message was sent and that it has the right contents
docker automatically starts on my computer on startup, that explains it 🤦♂️
Was talking about the latter allowed mentions bit, the first one is fine
You wrote it already, it's fine
You don't need to test it in all three functions though
Ohhh ok gotcha, will get that done soon
That's why, on almost every app that I have installed on my computer, I disabled the "start on login" option.
tada, bot#2041 tests passing now
doop doop, did you still want to write up an issue for this?
I was getting to this today, but I realized the traceback wasn't coming up anymore, probably since we're not in aoc season anymore
The Spooky and Candy guard should still show up since it'll show up wen we're not in season for that
idk don't blame me lol
@vale ibex ^^^^^^^
eh?
You wanted to see what the tests would look like for eval allowed mentions, now you can ✨ 🎉
oh, right
I'll give it a look when I'm at pc
github is telling me there are merge conflicts, but not where they are, so can't merge it
Weirddd, I’ll take a look on command line when I get home in like half an hour or so
wait
wtf has happened
The commits are in the history of main
yet the PR is still open
and no actions were triggered
@patent pivot @vocal wolf I see you're both online
can you please check I am not seeing things
I see it too and there’s even a merge commit 😂
which what where?
This PR https://github.com/python-discord/bot/pull/2041 seems to have actually been merged into main https://github.com/python-discord/bot/commits/main
but is still open
and no actions have been triggered on main
the fuck
I’m so confused
oh I thought that may have been bugged
arthur deploy restart bot
so I tried to merge
:white_check_mark: Restarted deployment bot in namespace default.
Like there’s even a merge commit lol https://github.com/python-discord/bot/commit/fe78ffcbc1eba6363ffa52f5583859c83866e598
uhhhhhh huuuuuuuh
ok, anyone have the thing that this PR was fixing?
joe we borked github
lets see if the change is actually in there
Yeah check bot commands in the test server
!e ```py
print("@\u0300" * 160 + "`\u0300`` <\u0300@196664644113268736>")
@vale ibex :white_check_mark: Your eval job has completed with return code 0.
@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@̀@@@@@@@@@@@``` @vocal wolf
did that ping you xith?
yes
Well that’s not good 😂
wait what how did that ping xith
since the build action didn't run
That’s what I’m fixing here 😂
xith did not run the command
even before the change, that should not happen
it's role pings, not member of role pings
by default member pings are true, if not set
It wasn’t limited to the person running yet, that’s what this PR is
in allowed_mentions
ahhhh
Previously just limited to mod roles and technically any users, now it’s just the one user
any chance you could add a blank commit to main to trigger actions?
uhhhhh
IG the other option is to wait, or manually build and push to ghcr
sick
yea no clue lmfao
Today I broke GitHub with a simple PR
I'm not sure how to trick the bot into thinking we're in season for aoc. I tried to set my pc date back but it refused to connect to the api with an ssl error
AOC_MONTH
unless this check was added some time when I wasn't paying attention because I see
bot.exts.events.advent_of_code._cog | WARNING | Could not find the AoC completionist role; cancelling completionist task.
Unless this is for something else
I'll give that a go
mm I don't see it anymore
does the docker compose file for site make the database have a volume so if the container is removed the database still has persistence
hello
No
The epoch command I did essentially nothing 🙂 - the credit is all bones’!
My guess is you were mentioned in #changelog because you were assigned to the original issue
So what you could have done if you didn't want to work on the issue anymore is unassign yourself, that way you won't be mentioned in #changelog
They were mentioned because they committed multiple times in the PR
I did commit - but they were both very slight if I remember
we had some good discussions
Nobody said they have to be coding contributions
haha also I was going to apologize for polluting your repo with random prs. I couldn't figure out how to push directly to yours 🤣
True
Lol
Dw
You should be able to do git push upstream branch
Not 100% sure tho
Aah and upstream might point to pydis’ copy anyway
Ahh
Fairly small fix to AoC join check sir-lancebot#1008
@brisk brook here, re your comment on modpings pr
Ah, right.
hi can i ask a doubt related to github ( this is a little bit of track not related to our repos)
can any one explain me how to solve this
Since it's not related to our projects, it's better to ask in #tools-and-devops Unfortunately I don't have the answer for you
Interesting edge case for code block detection in @stable mountain, it thinks you're using the wrong character for a block because of a docstring
For example, this:
def test():
"""
description here
"""
print(test())
? I don't get the same occurance
Oh weird, well here's the actual example that I first noticed triggering it:
def is_even_with_return(i):
"""
input: i , a positive int
return true if i is true , otherwise return false
"""
print("with return")
remainder = i % 2
return remainder == 0
is_even_with_return(3)
print( is_even_with_return(3))
okay, now i see it
Yeah I swear I was able to get it with that smaller example, maybe I was just too tired to tell 😂
Anyways not sure if this is even something possible to fix or worth it, just a little thing I noticed in pygen last night
I suppose a partial fix would be to see if it's indented
And if it is, then it's a docstring
The only thing is you can have non-indented docstrings (e.g. module docstrings)
But at least it would happen less
sir-lancebot#1010 is ready for review (i think)
i was thinking, since there's two regexes IIRC is to match both and check if the unfenced regex match is longer than the fenced match
I recall that when we tried to use a very complex latex, the bot would OOM because matplotlib tried to allocate a very large array to render it. Is this addressed?
Does it work if you try to render something like a matrix with lots of divisions? not sure if you have a way to replicate the memory constraint
sigh
matplotlib doesnt recognise \begin
The bigger problem we had was creation not clean up
Can you put mem limits on asyncio processes
any reviewers in chat 
Snekbox won't work for this (right now) because we don't have snekbox on lance, and it doesn't support spitting out files yet
Latex may just be doomed to fail, and maybe that's fine
well, the files can be solved with a b64encoded image stream
Now, for the other part, we can finally make an interbot system! this will be completely successful and not fail at all but can be used to make queries to snekbox and back
nO
lol
aren't we gonna end up with interbot for bk anyway
though i suppose we do not want to put snekbox and lance on that same relay
It’s not even about interbot
If we wanted snekbox on lance it’s about 1000x easier to do that
But we don’t want to add more to lance
yea
#dev-log message lance is mad about something
ok i really didnt want to suggest this but we can always just call into a third party web api like half the other lancebot commands lol
Yeah was gonna ask
That’s always been an option, but I’m not quite sure it’s worth it tbh. The justification for most things which are API wrappers and don’t have a real use on the server are that “people are interested in doing it, and they get to learn something from it”.
If you want to write a wrapper and can find a good api, go for it
don’t have a real use on the server
i mean, i've definitely noticed more than one occasion where someone would go to the math server to get the bots there to render latex and then copy/paste that image for a conversation here
and well
would using a web api be all that different from what i currently have
not like i'm doing the typesetting manually in either case
I mean, I assume the API will have it's own resource limits so our bots wouldn't OOM
It'd be nice if matplotlib could tell you in advance what array size it's going to try to allocate
A mitigating step could be to limit the length of the input, or parse the input into a tree and limit its depth
It'd probably have to be a combination of both, since you can have very small, memory consuming complex input, and very long, memory consuming simple input
When I was looking into it last, determining all that info before running seemed very difficult, but I have minimal experience in the world of latex. My research showed that enforcing limits its easier than testing though
If I could provide a latex rendering API would we be able to use it? I want to run one for the infrastructure management challenges of running services and to learn shit like nomad and terraform, so I'd be happy to host something useful rather than just another useless service only I use
Long ago I did suggest using an actual latex install
Apparently it's possible to make your own minimal distribution
Though some do exist as well
If it meets our general rules for using APIs (have proper licensing and instructions, be reliable), then sure
interbot for what?
oh black knight
moderation tooling between the two bots
neat
infractions
smh @placid ermine sir-lancebot#1009 was never approved
Keep in mind that hsp is a mod and I'm pretty sure mods are allowed to make PRs without an approved issue but if I'm wrong please correct me
No one is exempt from our wrath
except like tiny fixes, mostly if they're brought up here first and are like one line of code
I effectively approved it anyway. Maybe I wasn't formal or explicit enough about it
I think what arl was looking for is the approved label
Maybe
oh. Does that mean that I could work on bot#2022?
i've been waiting for explicit, but now i'm not sure if it was or not
Sure if you're not already working on too many other things
Well it was approved
You asked but sort of got ignored
!remind 30M
Your reminder will arrive on <t:1641869659:F>!
i mean, mark's comment was practically an approval anyway lol
That reminder has been edited successfully!
I think I touched that within 2 seconds of when it was gonna go off
Here's your reminder: Sure if you're not already working on too many other things
[Jump back to when you created the reminder](#dev-contrib message)
who is rf20008?
No, generally not. The team in charge of approval is the core dev team. Mark is a core dev
(And a damn good one at that)
Ah I see
huh re-requesting my review on bot#1721 removed Akarys's requested review somehow
Don't think that's anyone on staff I'm pretty sure
I've seen that username on GH but doesn't seem like it's anyone on staff
I am just asking in general
because akarys is not in the org anymore, you can't request reviews from non-org members and the way github works - it only "rechecks" the review request when it is edited (the pr is edited)
and that was the first edit since ak's leave
sir-lancebot#745 is needing one core-dev approval, would be awesome if someone can review it :D
Hey all, random issue I'm getting running locally. I've tried to pull from upstream and rebuilt docker with docker-compose up --build but I'm getting this message on a loop:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 672, in _load_from_module_spec
setup(self)
File "/bot/bot/exts/utilities/realpython.py", line 100, in setup
bot.add_cog(RealPython(bot))
File "/bot/bot/bot.py", line 81, in add_cog
super().add_cog(cog)
File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 551, in add_cog
raise discord.ClientException(f'Cog named {cog_name!r} already loaded')
discord.errors.ClientException: Cog named 'RealPython' already loaded
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/bot/bot/__main__.py", line 13, in <module>
bot.load_extension(ext)
File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 732, in load_extension
self._load_from_module_spec(spec, name)
File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 677, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'bot.exts.utilities.realpython' raised an error: ClientException: Cog named 'RealPython' already loaded
sir-lancebot exited with code 1
Does git status list any untracked files?
Looks like I had two realpython.py files
bot#2046, simple pr, explained in detail, the diff may look intimidating but its just a copy paste of code
Very small fix for something we found in #aoc-bot-commands sir-lancebot#1011 would appreciate a quick review
Done, at least placement_board is used for something other than the actual placement command 🙃
hah yea, it was a very nice format for what I needed
@static canyon I didn't notice the updated review on bot#2017, I've updated it..
and since I also just noticed the "p: high" here's an update message 😅
can some one help my why is this not working
i am trying to print a url on this command !
and when i am keeping other constaints optional the command is not responding
no response over here
amount is never None, you have set to 5 as default
oh in the second screenshot you keep it None
uhh
amount spelling in the if statement
which editor is that? it should have underlined it with red
vscode
you have configured the python extension and venv?
Here's your reminder: @molten perch seems like sir-lancebot#743 and sir-lancebot#968 are about the same, I'd like to work on aspects of 968, but some of it can be removed and return back to 743 if you are wanting to do them
If you aren't, I can.
[Jump back to when you created the reminder](#dev-contrib message)
welp 778 is still not merged so
!remind 1m
Your reminder will arrive on <t:1644732264:F>!
Hey @clever wraith!
It looks like you tried to attach file type(s) that we do not allow (.exe). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.
Feel free to ask in #community-meta if you think this is a mistake.
!remind 5h re-review after job interview
Your reminder will arrive on <t:1642080464:F>!
!remind 5h tell tizzy hope their interview went well
😄 🤞
@static canyon good luck! I'm sure you'll nail it
Thanks 😄
30M to go 🤞
good luck tizzy!
Does it work for looking up an article? Just from the screenshot below, keeping the amount of articles at the default of 5 is fine, but if the user_search is None, then the HOME_URL should be sent
@fallen patrol I'd like to get bot#1924 resolved soonish (say, by end of January / mid Feb). Do you think you'll be able to do that, or would you like me to look into it a bit and help out?
Here's your reminder: re-review after job interview
[Jump back to when you created the reminder](#dev-contrib message)
also tizzy, i would love a rereview on modpings enhancement pr
and how did the interview go?
I have nearly everything set up after a while for pixels but I still don't understand what kind of post request am I supposed to pass into /authenticate endpoint?
/authorize -> /callback will issue a refresh token
You then send your refresh token to /authenticate to request an access token
Which is then used with the other endpoints
So I have to pass some kind of headers to /authenticate
Not headers, but in the body of the post request
Like -> this?```py
data = {
"refresh_token": "token"
}
r = requests.post("http://127.0.0.1:8000/authenticate", json=data)
print(r.json())
Yea, that looks about right
ooh now I got it working
I kept passing headers ;-; and that's why it did not work
Hopefully well 🤞
I'll find out on Monday.
Can you give the PR number please
bot#2001
!remind 1h Re-review bot#2001 & bot#2017 after dinner
Your reminder will arrive on <t:1642098110:F>!
gooood luck 
Here's your reminder: Re-review bot#2001 & bot#2017 after dinner
[Jump back to when you created the reminder](#dev-contrib message)
!remind 1h
Your reminder will arrive on <t:1642101760:F>!
Here's your reminder: See referenced message.
[Jump back to when you created the reminder](#dev-contrib message)
hello guys sorry to interrupt, just wanted to ask, if i wanna get into game dev, should i go for C# or python (pygame), or C++
Hey this channel is for talking about this server’s projects. For general advice try the help channels #❓|how-to-get-help or the game development channel #game-development
disnakedev/disnake#224
!remind 4d look into why this has the draft emoji and not the merged emoji
Your reminder will arrive on <t:1642452569:F>!
Well, it may be because that PR is not on any PyDis repo? First of all I didn't even know that command works with PRs/issues outside of PyDis
bot/exts/utilities/issues.py lines 142 to 150
if pull_data["draft"]:
emoji = Emojis.pull_request_draft
elif pull_data["state"] == "open":
emoji = Emojis.pull_request_open
# When 'merged_at' is not None, this means that the state of the PR is merged
elif pull_data["merged_at"] is not None:
emoji = Emojis.pull_request_merged
else:
emoji = Emojis.pull_request_closed```
might need to move that first if condition below open/merged
awesome
lets... see
api also returns state "closed"
I don’t think you can merge drafts can you
and it returns a merged_at
correct, so might as well move the check down
Right
the api is returning a merged_at and closed_at, and state for the api request
although hmm
is the data also on https://api.github.com/repos/DisnakeDev/disnake/issues/224
Yes
i see it now
It doesn’t say merged or just closed does it
it does
& the api returns null for merged_at on prs that haven't actually been merged
aight I'll make a change to my bot which implements this feature and add it upstream once sir-lancebot#778 is actually merged 👀
thanks scale
since that linked PR already changes some parts of it, can't it fix the check as well?
no
I talked with chris about this, and have a seperate list of changes to make to the github cog
that one should just be merged, its been open for 6 months
sir-lancebot#968 iirc
Ah I see
👀
Yeah I noticed haha
!remind 15h Do it after your exam
Your reminder will arrive on <t:1642169683:F>!
ok , i am taking a lot of time to solve this issue 😅 form last few days i started learning how to make a discord bot , a bit about docker ..... my semester exam are lined up from next week so i might take some more time but i will solve this issue !😀
i just noticed that one of my PR on the site repo is still not complete ! issue no #639 PR no #640 , last few days i also reffered realpython web page over there also ig they have updated this change https://realpython.com/how-to-make-a-discord-bot-python/ under Adding a Bot to a Guild section
could you help? 🥺
between arrow and dateutil there's so many options that I can't make any choices
Sure, I'll look into it when I can 👍
!remind 6h maybe able to
Your reminder will arrive on <t:1642168349:F>!
Here's your reminder: maybe able to
[Jump back to when you created the reminder](#dev-contrib message)
Its ok, there isn't a timelimit to the PRs
Here's your reminder: Do it after your exam
[Jump back to when you created the reminder](#dev-contrib message)
@short snow have just reviewed bot#2001 👍
@fallen patrol bot#2017 looks good to me, but don't want to approve until I get around to testing
yes github exactly what I wanted to press
Bump
@timid sentinel at this point, I’m more or less convinced the latex command in its current form is doomed to fail. I’m going to close the issue tomorrow if no one has any further comments, and we’ll leave it closed until someone finds an api that just handles this for us
I’m not sure who the PR author is on discord
ShakyaMajumdar is hsp btw
That is weird. It doesn't seem to actually use much memory, but still seems to want around 1gb to run (at which point it can run pretty much anything). Almost feels as if it checks it has a certain amount of memory before doing anything, but not sure how that would be the case
@ 1 gb it’s 100% a no-go
We’d saturate our node lmao
But yeah, similar experience on my branch
It’ll try to claim a ton of mem to import matplotlib
And resources was breaking for some reason and propagating the OOM outside the process
The branch was scrapped, but kept for reference
I suppose you could start patching matplotlib to not claim the mem on import but at that point
God
AHA I think i've managed to patch matplotlib to not claim the mem on import
lmao
Came across this https://github.com/numpy/numpy/issues/10455
still seems to need around 200mb though
Do you think this is worth pursuing for this feature over an APi
well given the PR already exists I thought it was worth looking into. Adding
import os
os.environ["OMP_NUM_THREADS"] = "1"
means a 200MB mem rlimit would allow it to work (at least for me). If that's too much we'd probably just want to use some api, yeah
are you
can someone hit the merge button on this https://github.com/python-discord/sir-lancebot/pull/969
discussed on discord, using this implementation from zig:
closes #967
closes #966 (indirectly)
new embed:
Edit: did not link the discussion: https://canary.discord.com/channels/267624335836053506...
its been approved
all checks are passing
but kutiekat did not hit the merge button when she approved 🥲
this is extremely disappointing to me as i didn't notice for 2 weeks and hoped it would have been here a little sooner during aoc
kat... can't lol
oh well in that case
🤔 how does the ui work then, I thought that the green approved by github only show up if a person has push access?
not just staff, anyone really. @fallen patrol
I'm not a core dev, devops, or an admin. I don't have permission to merge, so I literally couldn't merge.
all staff have write access to the repo
not all staff have write access to the main branch
If your repository requires approving reviews from people with write or admin permissions, then any approvals from people with these permissions are denoted with a green check mark, and approvals from people without these permissions have a gray check mark. Approvals with a gray check mark do not affect whether the pull request can be merged.
all staff reviews will show as green, a green review does not necessarily mean they can merge a given PR, unless there is an enabled auto-merge, in which case the core dev who triggered the auto-merge will perform the merge action
Could also use a local latex installation instead of an API
Yeah that could probably work, although I'm not sure how large a minimal latex installation is, could be a bit heavy to bundle along with sir-lancebot. Could probably make it optional or something though, not too sure how these things work
IIRC it's like 80 megabytes
And yes, it can be optional. It'd just be installed in the Docker container.
If people don't want to use Docker, then they don't get the latex command, and that's not a big loss.
Some comments here https://tex.stackexchange.com/questions/13649/portable-minimal-distribution show that it can be as small as 10 MB or even 2 MB. Ultimately it depends on the packages and fonts we want.
Ah that would probably work pretty well then
how does the @everyone mention filter work? Surely the message is only deleted after the ping is sent
Users don't have perms to ping everyone or here
We delete on top of that to avoid the conversations that happen afterwards
Oh yes, of course. I somehow forgot about the whole permissions thing
@fallen patrol I've been working on implementing bot#1924 with regex and have had a fair amount of success
I think I've got almost everything but timezone support done
Currently the following works:```
year/month/day hour:minute:second
year-month-day hour:minute:second
year-month-day hour.minute:second
all of above without second
all of above without date (when time has passed today, does specified time tomorrow)
all of above with AM/PM specified```
Can you give me write access to the branch on your repo so that I can commit? Email is tizzysaurus@gmail.com
sir-lancebot#969 could a core dev merge this? it's approved, checks are passing, no review is necessary. just needs a lil merge commit made
ty!
i found a few APIs
im really sick rn but ill try to get an mvp running by tomorrow
We could use https://rtex.probablyaweb.site/
Bump @fallen patrol since I think you missed (I still needed to be given write access to the branch)
oh i was asleep
ikr? me sleeping at night?
Thanks
So if I want to push to this, do I need to clone it locally? @fallen patrol
should just be able to add me as a remote
like git remote
idk what that is
Nope
kk won't go that route
I just use PyCharm's git tooling
lmao i'm so bad at git's cli that i'd rather edit the git config
I either use the gh cli utility or would add this to my git config file
[remote "arl"]
url = https://github.com/onerandomusername/bot.git
fetch = +refs/heads/fix-issue-1924:refs/remotes/origin/fix-issue-1924
i don't know how to do it in pycharm ui
Yeah, that works
make sure that you don't call it remote "origin"
since you already have that
I updated the above to say "arl"
Right yeah
Thanks
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "arl"]
url = https://github.com/onerandomusername/bot.git
fetch = +refs/heads/fix-issue-1924:refs/remotes/origin/fix-issue-1924
[remote "origin"]
url = git@github.com:python-discord/bot.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
remote = origin
merge = refs/heads/main
[branch "incident-archive-msg-improvements"]
remote = origin
merge = refs/heads/incident-archive-msg-improvements
[branch "fix-bot-2034"]
remote = origin
merge = refs/heads/fix-bot-2034
```so this?
@fallen patrol
You can also do git remote add arl https://github.com/onerandomusername/bot.git
inside your bot clone DIR
I've already done the git config thing
then pull there branch as git pull arl branch-name
But gtk that's an option
Ah this is what I was after, thanks
Will it be under the remote ones?
yeah
local branches are what you have pulled locally
once you pull the remote branch of arl's repo
it would be showed in local branches
found it?
or if you are using pycharm, you can go to git tab on top bar and you will see an option named remotes
you can directly add the remote name and url in that
Yep, thanks
cool np
Errr
I made a boo boo
How do I undo a pull
I pulled into a PR instead of main
So I've now got 19 files with a diff
is the PR uptodate globally?
git log ; find the commit hash that you want to reset the branch to ; git reset --hard <hash>
git reset --hard HEAD~1 I think should work?
depends how many commits are pulled
you would actually want to use fetch here
Eh idk what I've done
pull is fetch + merge
git log --oneline says I'm on the head but I've got loads of unstaged changes
log only shows the commits, if you have unstaged it won't show there
you could just do git reset --hard HEAD
cool 👍
Thanks guys 👍
Just realised this code is in no state to be pushed because it's like not even in dpy format or anything, so I should probably change that first
btw, if you wanna use the pycharm UI to fetch and checkout to the branch, you could just find the branch in branches tab on bottom right corner, press the arrow and checkout, ig you already know this
Btw @short snow added some more details to one of my review points on bot#2001 along with a suggestion regex.
Most of the review is small nitpicks that aren't overly important, so feel free to ignore the ones you don't think are necessary
Thanks for the detailed review, will look into it :D
When would a new member upon joining the server not have the pending flag set to True? re:https://github.com/python-discord/bot/blob/230e49b2d72b40190c4081dd0afb3c9f0ab095e2/bot/exts/moderation/verification.py#L84
bot/exts/moderation/verification.py line 84
if member.pending:```
I believe that was only the case when discord was rolling out the gate feature so some people would get it and others wouldn't
bot/exts/moderation/verification.py lines 80 to 83
# If the user has the pending flag set, they will be using the alternate
# gate and will not need a welcome DM with verification instructions.
# We will send them an alternate DM once they verify with the welcome
# video when they pass the gate.```
now, every member that joins is set to true IIRC
Wookie include this also in your PR review drive lol sir-lancebot#745, needs one more approval
Ah, I might be able to do it today, if not I'll try and do it some point this week
could someone merge sir-lancebot#969?
it's approved, reviewed, ready to go
just needs core dev to boosh that merge button
Your reminder will arrive on <t:1642881796:F>!
i am trying to set up my own test server for bot, if i have any feedback or questions i can just drop them here?
my previous run-through of the setup guide was using the staff test server, so this time i'll be doing it using the server template.
to start with, i wasn't sure what to put here in the config.yml
the server template just gave an empty NEWS category
and what to put here for the webhook IDs?
For news, you can just leave it empty
why do you have missing symbols
You need to create the webhooks yourself, but you only need to create one
im just curious, why not use the staff test server?
(if you don't wanna answer dont)
plenty (maybe even a majority?) of our contributors aren't staff, and i only became staff a couple months ago. wanted to see what it's like for non-staff
also i like using the ! prefix
also what if i somehow completely fucked up the staff test server?
that would be not fun
My biggest recommendation, is making sure you generally use different channels and roles. Things like the incidents channel can go screwy if you set too many of the mods channels to the same one
Yup! I prefer my own testing server for very similar reasons. In my test server I can do whatever and don't need to be concerned about bot interactions, which can be an issue
i used the server template on the contributing guide, so it looks nearly? identical to the staff one
You need to be pretty deliberate to screw up the server beyond recognition, and there's nothing important there anyway
It would be a bit of an inconvenience, but there isn't anything of value on there besides the structure itself.
ok good
i didn't finish so will resume setup tomorrow
also why is yaml such a strange format?
I disagree. TOML is nice when something simple is needed.
it quickly gets out of hand
yaml scales pretty well even for large configs
though imo hcl is still my fav
hcl my beloved
is this supposed to happen?
I'm just going to school in ~5 minutes
I can try to find a moment to write a pr in there.
bot/exts/filters/antimalware.py line 22
f"Please use our [{URLs.site_schema}{URLs.site_paste}](paste bin) instead."```
and it's supposed to be (link)[text] instead, right?
Just PR
oh ok
@gritty wind so it should look like this instead ```py
f"Please use our paste bin instead."
Yeah that looks right
good, I'll try to write some kind of commit message and pr message for it
this is called "hyperlink", or smth?
yeah
"Fix pastebin hyperlink to use correct markdown syntax" could be good
also don't bike-shed upon commit messages a lot, think once, if it fits the rule and is understandable, commit it
The current commit message looks like this ```
Fix pastebin hyperlink to use correct markdown syntax
Fixed format from [link](text) to [text](link) so that the link will
be formatted as it should be.
Seems good
I had to create a new branch to commit the changes, right instead of the main branch
Yeah
what should it be called as there is no issue number I can link to it
That's fine, you don't need to name your branches after issues
the name is mostly meaningless, you could try something like fix-hyperlink
mostly
smh
I actually learned that if you use / in a name you can't make a branch name of only the part at the beginning
which makes sense
probably why people use their own names
yeah
just please don't use whatever the default branch is as your pr branch
What? Merging main into main isn't hip anymore
Best is merging main into master :3
am I surprised that I fucked that up? not at all.
botcore is heeeeere
woo
Need some more reviews for bot#1602, thanks!
When can the returncode be None here? Looking at snekbox I didn't see that being returned anywhere https://github.com/python-discord/bot/blob/2f64912bf4fd0d8bf1f55cf97cb4d4aef5ea81a3/bot/exts/utils/snekbox.py#L91-L100
bot/exts/utils/snekbox.py lines 91 to 100
@staticmethod
def get_results_message(results: dict) -> Tuple[str, str]:
"""Return a user-friendly message and error corresponding to the process's return code."""
stdout, returncode = results["stdout"], results["returncode"]
msg = f"Your eval job has completed with return code {returncode}"
error = ""
if returncode is None:
msg = "Your eval job has failed"
error = stdout.strip()```
snekbox/nsjail.py line 180
return CompletedProcess(args, None, "ValueError: embedded null byte", None)```
According to https://docs.python.org/3/library/subprocess.html#subprocess.CompletedProcess the 2nd arg is the returncode
ah didn't notice that one
https://github.com/python-discord/snekbox/blob/2f70b8b0460b3368955f63a025b03b1f84324874/snekbox/nsjail.py#L184-L190 looks like this one too, which seems more likely
snekbox/nsjail.py lines 184 to 190
except UnicodeDecodeError:
return CompletedProcess(
args,
None,
"UnicodeDecodeError: invalid Unicode in output pipe",
None,
)```
this happened in a modmail thread
the reminder didn't go off?
mods+ only: #932633338072670338 message
I think there's a PR from scal to deal with reminder issues
that looks great
the one i was looking at only does pdf
How is this PR going? If you are getting stuck on anything just let me know 👍
@timid sentinel @gritty wind i rewrote it to use an external api https://github.com/python-discord/sir-lancebot/pull/1010/commits/a10c07a85a2387a26103aafcabb7bd3e789624c3
Are there any plans to move @stable mountain over to slash commands?
most likely when we move to a new framework, but we aren't really in a hurry to do so yet
But majority of commands will likely not migrate to slash commands
new framework? so rewriting the entire bot?
No. Most likely moving to one of the maintained forks.
Yes i am try out some stuff , right now i have my end term exam ( final third semester exam ) so i am a bit busy with that that's why i have not done any thing on my issue since last 4 days after exam i will get this done ( i need some more time 😅 )
I'm trying to clear some things up, are you gonna do anything with https://github.com/python-discord/site/pull/624 ?
it hasn't got any traffic in 28 days
same for site#482 although I can understand this one more
well I'd like to get all the pydis stuff out of the way, so if someone can look at site#624 I'd appreciate it
It's WIP, waiting for bot-side implementation.
I assumed
what about 624
it is a really simple PR and has been stale for like a month
Indeed, but as of now, there is nothing more to add. When the bot side implementation is done, (or at least partially) it will be continued. (I'm planning to do so)
I thought you were talking about 482. 😅 Can't read.
we're going through site backlog at some point in the next month, I'll make sure we cover this
There are review comments on this though looking at it, so they need addressing
Yes, that's why I'm saying it has been going stale :P
Right, sure, but it's stale waiting for updates from the PR author
So we're probably not going to do anything with it until review comments are addressed
poke poke @hoary haven
poke poke bot#2039
also @timid sentinel i think your "requested changes" review is blocking checks from running on the rewrite (sir-lancebot#1010)
It'll be the merge conflicts blocking the actions
dependabot bumped pillow up due to a vuln
I usually just git rebase main choose the version in main as correct, then relock, commit and squash that commit to the commit that originally edited poetry
<<<<<<< HEAD
content-hash = "6e2fd70bb8b92763ee3bd93f5eef323a96179e8e04de4d6c2ace5f6fa3a4042d"
=======
content-hash = "e824a5fa909d43e861478178ad7e77ee04be05a60cd3028bda8bd4754c848616"
>>>>>>> dc8c63fa92fbf8b74aafb17b5f58d67e079633b4
what am i supposed to yeet and what am i supposed to keep 
keep which ever hash is the one from main
you could git rebase main --theirs poetry.lock
error: unknown option `theirs'
oh, is that not an option on a rebase
lemme look
Ah, its --theirs on git merge aparently
it's -Xtheirs on rebase
but that might apply to the whole rebase, rather than just the poetry lock
if you do a plain git rebase main and then get to the conflicting part with poetry.lock
you can choose all current changes, rather than incoming
that will trash all of your changes on poetry lock
you can just copy paste the poetry.lock from main
its much simpler
mpl isn't needed now right?
it is not
i need to set up site on my work machine so i can actually view the effects of my PR and see if the page is still cohesive as a whole, as you can lose sight of that when reading the same paragraphs over and over again. i also converted this PR to a draft because while it's important, it's not urgent and i wanted to make changes that would make sense and not have to be changed again soon down the line @patent pivot
went to tag lauren but she's no longer on the server?
Sure, draft PR makes sense for this. You could also close the PR and reopen it in future if you didn't want people to comment on the progress as it's still WIP
also, let us know if you need help setting up site.
Is going through message.channel.pins a nice way of getting the claimant's message inside this https://github.com/python-discord/bot/blob/230e49b2d72b40190c4081dd0afb3c9f0ab095e2/bot/exts/help_channels/_cog.py#L556 function? for context: bot#1960 cc:@tawdry vapor
bot/exts/help_channels/_cog.py line 556
async def notify_session_participants(self, message: discord.Message) -> None:```
Is this for getting the claimant's original message?
yep
_caches.question_messages will have the messageID for the original question in each channel
ah, and then I can just run a fetch_message, yeah?
I'd try a get first, but yea
since it's likely to be in the cache if the session is still active
ic ic, ty
isn't there a get fetch message utility function?
whelp yeah, it is for members
Is there a high-level abstraction for getting a message from the cache?
All I could find was bot._connection._get_message
I'll just call the MessageConverter manually
Yea that'll work. Or you can discord.utils.get(bot.cached_messages, id=search_id)
bot.cached_messages is the list of cached message objects
I'll use the message converter since it handles both cases
My PR is close to the bottom so it's easy to miss, but I'm waiting for reviews on bot#1602 😄
For editing the help dm messages after the help channel is closed I'll need to keep track of the message ids, I was thinking of storing userid-messageid
Do I make a new redis cache for that or repurpose the session_participants cache to actually store those messages ids
The only difference is in readability and ease of access I suppose
If I understand the question correctly then, I would say, that a separate cache would be better.
As far as I know, session_participants are meant for different purposes.
session_participants is currently being used to keep track of the members we've already sent the help dm message to
That would still be achievable by storing userid-messageid, we'll just have to do some extra parsing to get the userids
Yes, but it keeps track of them by using the help channel's id as a key and the user id's as values.
if I understand correctly, you would change this structure to instead of using the help channel's id, it uses the user id as a key and message_id as the value.
I wouldn't remove this structure, otherwise how would unclaming a channel would look like?
(I might have misunderstood your approach though. 😄 )
ah, no I'd map the help channel's ID to a string f"{userid}-{messageid},{userid2}-{messageid2}"