#dev-contrib
1 messages ยท Page 70 of 1
I'm sure you can write a PR body yourself
you can reference other prs that have been merged if needed too
doing that only
A lot of seasonalbot features follow the same outline, that's not really the case for the bot. The ticking stuff you do on seasonalbot should be handled with a properly installed precommit
We assume that you did everything written at the bottom of the seasonalbot PR template
[404] #1237 Issue/pull request not located! Please enter a valid number!
I think the file should be inside bot/exts/info/ instead of bot/exts/utils/
the package cmd file
but utility label is mentioned on it
thats y i added file there
i can move it if u wnt
ohk
utils sounds good
@cold island sure. I've had some work, but the cog has changed a lot in the meantime, so it's trashware now
I could also try add an option to display modmail logs, though I'll see how it goes with what's already outlined
@hardy gorge if it's saved to a specific branch I could take a peek for reference
@green oriole if u r free can i get my bug_ec merged i have two approval ๐
i have one question if someone approved my pr and again he/she gave review his/her approval get dismissed?
My review does not count I guess, we need another review from staff
They do count
@crude gyro I got idea about articles app: Currently this is loading all data over and over again from filesystem and last modified + contributors from GitHub every time when somebody visit article. But what about in
readyfunction inAppConfigfetching all guides, categories and GitHub data at once and store them to cache, because in order to modify article, this have to redeploy, what means this cache everything again.
@cold moon
Yes, implementing complete caching is part of the dewikification plan. I guess maybe I haven't made an issue for it yet, but the idea is that once we get rid of the API and the staff/deletedmessages, we can cache all the pages and only need to return cache. there are tools to do this for the entire site very easily.
for the github repository data, we actually already cache this for 10 minutes between every request.
we haven't discussed the implementation details yet.
maybe even higher level than that.
instead of implementing caching as code, we may be able to just use a middleware for it.
but let's get back to it later. one step at a time.
Implementing this is really really simple and when I currently implement caching as local memory cache, then later we just have to replace config, because interface stays same.
This interface apply to each cache engine and replacing cache engine means replacing engine in configuration
yeah, that's more along the lines of what I'm thinking
everybody gangsta until the owners start to talk
lol

For anyone looking for a relatively simple review
https://github.com/python-discord/bot/pull/1212
#sir-lancebot-playground message
Anyone interested in figuring out why it did this
I get this error while booting up the bot. Is anyone familiar with it?
@sharp timber what are you referring to specifically? it seems like the message started with the correct answer
no, the multiple mentions of the same person
Is your local site up to date Zig?
@lime mural feel free to open an issue in the repo and ask to be assigned there
okay thanks :)
Looks like the cog just adds the authors of messages with correct answers to a list, so if someone answers multiple times they'll get multiple mentions
yep
Numerlor this might sound dumb but I'm still trying to wrap my head around what the bot image can and can't do without the site. Figured some things would just be voided instead of raising exceptions. I'll look into setting it up now ๐
It needs it for infractions, the syncer (which doesn't really count since that is only done to support other features that use the site), storing defcon settings, off topic channel names, deleted messages, and some other stuff I am forgetting
Reminders
Well, you can ignore the error, but you'll get exceptions from anything that tries to connect to the site if it's not up and errors like the above if it's missing needed features/changes. In this case it won't sync the members
Yeah, I understand what the site is for, I just thought that the errors would be when I try to run the commands instead of when it's trying to start
thanks
There are several startup tasks, like reapplying mute infractions, syncing the watch channel cache
A lot of them run as a part of the cog inits so those will error out if something's not right
I see
Never mind the mute infractions, those are just done when someone joins the guild
it should gather infractions to reschedule their pardons
ok so I guess this is the part that somewhat confused me: https://pythondiscord.com/pages/contributing/bot/#site-and-bot
Because that's the command I used
Should I be cloning the site as well? placing it in the same directory?
no, itโll pull the image from docker hub
Then theoretically it should have done so
what do you have as the site url and schema in the config?
let's see
site: &DOMAIN "web:8000"
site_api: &API !JOIN ["api.", *DOMAIN]
site_paste: &PASTE !JOIN ["paste.", "pythondiscord.com"]
site_staff: &STAFF !JOIN ["staff.", *DOMAIN]
site_schema: &SCHEMA "http://"
It worked without the site I just kind of ignored it because I didn't need it
like Numerlor said before, is your local site up to date?
try a docker pull pythondiscord/site
I rebuilt it so I figured it was enough
a rebuild should also suffice
yeah
okay, maybe not
lol
docker-compose pull
docker-compose up --build
got a bunch of warnings but otherwise seems ok
ok cool it works
thanks to all who replied ๐
i found this in the roles page:
This includes writing pull requests for open issues, and also for reviewing open pull requests (we really need reviewers!)
does that mean everyone is welcome to leave code reviews?
absolutely
You should be familiar with the environment of the project you're reviewing for before doing it though
Something doesn't seem right here
Here, we have snekbox's upload limit being set to 1k chars
https://github.com/python-discord/bot/commit/6dccbd38016b113983b195f15272a5f432df6dcb
This doesn't make much sense though, because this will only do an upload if theres a lot of newlines, but under 1000 characters, which doesn't apply to many files. In addition, there's a path here:
if lines > 10:
truncated = True
if len(output) >= 1000:
output = f"{output[:1000]}\n... (truncated - too long, too many lines)"
else:
output = f"{output}\n... (truncated - too many lines)"
elif len(output) >= 1000:
truncated = True
output = f"{output[:1000]}\n... (truncated - too long)"
if truncated:
paste_link = await self.upload_output(original_output)
that seems to expect to upload code to the paste service if we cross over 1000 characters. But if we do, no upload happens.
For a use case example:
import dis
def f():
try:
1/0
except Exception as e:
pass
return e
dis.dis(f)
returns ~1200 characters. Well short enough to reasonably upload to pythons paste, and still doable in a message, but the bottom gets cut off at the moment and it's not uploaded
@sharp timber this is a very old commit
yeah, and it hasn't changed since. Which confuses me.
because I don't recall the behavior
@sharp timber this seems to be the root https://github.com/python-discord/bot/blob/4255fdef8b7a75c59f45928abf9da250e24ddc00/bot/exts/utils/snekbox.py#L72
it's limited to 1000 characters
it might be outdated with the current pasting service, but it's something that joe can probably answer better
I'd say open an issue, afaik the limit is intended but the logic around it doesn't make all that much sense
it could be to prevent the service from being bombarded with large files, but it doesn't have to be 1000
We could limit it to say 2000, and if the output is still too great, then truncate it in the paste as well instead of not uploading it at all
I don't think it really matters but not truncating huge outputs for the paste service does exclude the amount of spammy while True print type things from it
During a staff meeting it was decided to leave it at 1000 even though I suggested something higher. I think all of the people involved overlooked the fact that it truncates at 1000.
There's also the nice opportunity to use the new line counting helper from the codeblock pr instead of count there
It was in voice so I don't remember what exactly was said over a year ago
I think the intent was to not overload the paste service but even 50,000 characters is only 0.05 megabytes
I think it's worth opening an issue about it a year later.. worst case it'll be closed again
At the time the limit was something like 100k character limit and 100 MB for content, which is why there's that comment about the 400 - you could spend a while uploading 100MB only for the server to send back a 400 minutes later cause there are too many characters
https://github.com/python-discord/bot/blob/master/bot/exts/help_channels.py#L858 where's bot.http.pin_message documentation? I cant find where it is defined either
it's not documented
Wut
everything under http is not documented
we probably used it to save an API call
oh, i remember, it was in a PR that had some controversy
let me find it
ok
yeah, it was to save an API call along with getting rid of some chunky code
Ah ok, ty
https://github.com/python-discord/bot/pull/1023#pullrequestreview-457166782 how about this, the reason i was looking at that code is because i was figuring out if theres a way to delete the 'Python pinned a message to this channel' message. Is it neccessary to remove it tho?
Now that people know the bot pins the first message
i wouldn't mind now, but it's a good idea to open an issue to get the thoughts of other people as well
Yesterday same thing happened ๐ with me
You should see that as an exercise to make your write proper documents 
I have to say, doing that helped me quite a lot
Oh well, discord doesnt help because now everytime i wanna type 'you' i type 'u' lol
@lime mural feel free to propose it in #dev-branding and possibly open an issue on the branding repo
what is the purpose of codeowners in pydis repos? are the requested people of a pr supposed to be the reviewers, or are they there just to show they are the code owners?
.pr 485
In pydis repos, we use them to make sure that at least 1 core devs approved the PR
.pr 479
1 approve from chibli and 1 approve from iceman is done
I think that explains it fairly well https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners#about-code-owners
It also lists the usage of it, which we do use in fact
@rapid igloo
You can use a CODEOWNERS file to define individuals or teams that are responsible for code in a repository.
I wonder which algorithm are we using for auto-assignment
For code review?
Yeah
Suggestions are based on git blame somehow afaik @green oriole
And github just uses those suggestions
Huh interesting
You can request a review from either a suggested or specific person. Suggested reviewers are based onย git blame data. If you request a review, other people with read access to the repository can still review your pull request.
Thatโs actually pretty smart
I just found out github has docs
Thats where I got the text above from
Well, I was looking at https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-organizations-and-teams/managing-code-review-assignment-for-your-team#configuring-code-review-assignment
Code review assignments clearly indicate which members of a team are expected to submit a review for a pull request.
Ah, cool
Load balance is quite nice
https://github.com/python-discord/bot/issues/1238 any thoughts on this anyone?
How it will silently pin?
And how bot will know what to pin if it doesn't pin the first message?
wdym? i'm talking about removing the pin notification (Python pinned a message in this channel), what it pins stays the same
like this one #help-croissant message
@green mesa you missed this suggestion made by chibli
Ahh
Just an idea when user will write the first message in channel we can ask what's your question and tell the user this will be pinned so others can check your question and after that user can put the question and then bot can pin
What u guys think
This way bot will pin the correct question
Well, after using the channels at least one you see that it'll pin the first message
Having an "Hello" or something pinned is fine by me, you can still use it to jump to the beginning of the chat
Ok
But don't u think we should try to make things more clear to our pydis community so, new people will also know what's happening
wat
it's pretty clear man
you're suggesting adding complexity for a thing that isn't really an issue at the moment
๐
yea I see the pin as more of a jumplink to where the session started
it doesn't necessarily be the question itself
often the question is spread across multiple messages anyway due to pictures or codeblocks
Ok
we do have contributor guides here: https://pythondiscord.com/pages/contributing/
have you seen them?
they should give you a good idea, but feel free to ask for help in this channel if something isnt clear
im stuck on the config
i downloaded the source code for the python bot and dont know how to run it
@lunar elmgit cloneis better than downloading the source code, so it would be a git repo, so you can commit and contribute(if you want)
see the guide, I think it's really good one
.pr 479
If anyone is free can he/she have a look? at this
but what is seasonal bot?
A Discord bot started as a community project for Hacktoberfest 2018, later evolved to bot that changes with the seasons
cool
@lunar elm Adding to that, we recently moved to a SeasonalBot that isn't as seasonal. Almost all commands are available the year around nowadays. It's mostly a project where we can get started with contributing to open source and a really fun bot to have on the server. We have a lot of games and fun commands on it. Type .help in #sir-lancebot-playground if you want a full list of its features ๐
We need to update dat description
is there a way to get link to official docs using !docs command
python
like I did !docs math.factorial
if I could get link to official docs for that method
The link is in the title of the embed, if you're on mobile it doesn't show up but it's there
Hey, guys. I am currently at my entry stage with my python and looking for a simple project to contribute, any ideas or projects?.
This channel is specifically for the projects of this community; from here seasonalbot is geared towards beginners https://github.com/python-discord/seasonalbot
.pr 479
Anyone
is that the embed
its one of the fields of the embed im working on
if you want the whole embed ill send a pic
I like the last one better
but the last one is a bit messy with the (1) numbers imo
and most ppl chose the 2nd so i used the 2nd
yeah ig then use that one ๐
heres how the whole embed looks like, some stats may not be accurate and im still working onit
borrowing joes lol
oh yeah thanks for reminding me
ios seems fine, but dont have a android device to test on ๐
sure that'll be great its the :tada: and :clock1: im using
Nah, I mean the layout might break on mobile, I'm sure emojis will be fine
oh ok, because on web theres ๐ช but on ios there isnt so i just wanna make sure
also yeah embeds are a bit messed up sometimes on mobile
oh thanks
but if a device doesnt have a particular emoji i dont think unicode will make it work
though
I mean you can check that here
but anyways im pretty sure they all have tada and clock
yeah i tried the coin unicode and on my ipad it shows as question mark
thx it seems android and ios should all support it
like compared to this https://emojipedia.org/coin/, coin has so little support
what are those emojis
defcon_disabled: ":defcondisabled:"
defcon_enabled: ":defconenabled:"
defcon_updated: ":defconsettingsupdated:"
hmm why doesn't discord keep ids
Theyโre for defcon. Itโs basically the current anti-raid system we have
Theyโre the emojis to symbolise the different states
but there's no emoji named defcondisabled
:defcondisabled:
I'm asking this for server conf, if I don't have emoji how am I going to add it to server
Use some placeholder emojis. The functionality is what is generally tested
we have separate emoji servers
is its emoji files stored in repo like branding?
There's only a few emojis that you'll need to set for it to function
To answer your question, I donโt think the icons are actually stored there
i've set them up
btw, the template that lemon sent is a bit outdated
where's verification channel?
not sure I sent a template..
we will keep our own test server updated, and generate new templates from that whenever we need to.
@crude gyro
uh sorry for ping
didn't mean that
@crude gyro Thatโs actually listed as one of the April fools jokes on https://database.pydis.com
@obsidian patio that link redirects to "https://www.youtube.com/watch?v=dQw4w9WgXcQ", is it supposed to do that?
Yeah. Itโs called a rickroll
I have heard that deployment backend will get rework, but is there any plans for deployment changes?
Hi, I have some problems with docker. I have installed it and it runs containers perfectly on wsl 2 linux containers. however, in your https://pythondiscord.com/pages/contributing/hosts-file/ guide you have mentioned that you need to run command docker-machine ip default, adn I have issues about it. first what is docker-machine second, it gives error docker-machine is not recognazible so I probably need to add something to Path but im not sure. I tried to search in docs of docker but there is no info about not recognized command docker-machine in https://docs.docker.com/machine/concepts/.
ah wait I haven't checked possible errors page, lemme check that real quick
I am not familiar with using Docker outside of linux, but their docs do state
The installers for Docker Desktop for Mac and Docker Desktop for Windows include Docker Machine, along with Docker Compose.
So, presumably you should have it somewhere, and it isn't on your PATH as you suspected
yeah but which folder I have to add to PATH
You need to run that on your host, not inside the container, to be clear
The IP you need is already in the hosts file for docker, you just need to copy it over to the pydis domains
what do I need to write in redirect_uri in the reddit app?
The IP you need is already in the hosts file for docker, you just need to copy it over to the pydis domains
okay, I am not configuring it yet, I'll see what i'll do when I configure that
@tawdry vapor Where did you find that? both the install pages on https://docs.docker.com/docker-for-... for mac and windows state
The Docker Desktop installation includes Docker Engine, Docker CLI client, Docker Compose, Notary, Kubernetes, and Credential Helper.
what do I need to write in
redirect_uriin the reddit app?
or do I really need to configure reddit app?
You don't need to set the redirect_uri to anything meaningful. You only need it for the reddit commands and posts like in #reddit
okay thanks
Not sure if that's just incorrect or they meant is as docker machine that's part of the docker desktop app because it doesn't seem to come with it as far as I can see
do I need to activate the virtualenv for docker-compose up -d?
yeah, docker-compose is not even in Pipfile
hey, me again, there's no "Run without Docker" section here https://pythondiscord.com/pages/contributing/bot/#run-the-project
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.
is it just pipenv run?
just a note that, you may include this to "Running with Docker section":
If your computer has only 4GB RAM and 5 years old, do not try to run 5 containers at the same time, the computer might crash
@harsh veldt would you mind commenting on meta#60 about that, please ? 
.issue 60 meta
uh, I'm having some issues with postgres. When I open psql shell, it asks password for user postgres, which I set when I installed it. But if I do psql from normal command prompt it asks for the user MyName. Which there's no such user, ran \du from psql shell, and the result is
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+---
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
so there's only user postgres but it asks for user MyName
I tried to change password for user, using
ALTER USER Murad PASSWORD 'newpassword';
but how can I change password of user if there's no user ๐
I want to add a helper function which will serve several cogs. Where should I write it?
In the utils most probably
That's where I'm looking atm, but can't find an appropriate file
What's your function for?
I want to add a function which will define what mod channels are. Because currently the checks for that are scattered and repeated, and it leads to bugs.
So I want to be able to import a function which will tell me if the provided channel is considered a mod channel
Sounds like it should be here https://github.com/python-discord/bot/blob/master/bot/utils/channel.py
Hmm that's weird, I don't see that file in my clone
I'll check what's going on on my end, thanks ๐
make sure you're on same branch
It's my own branch, but I created it a few days ago
Oh, I just have a bad case of blind
haha
unhandled exception in bot:
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
What does this means?
What's the full traceback?
How are you running the bot, outside of docker?
Or point it at the right ip/host if it's running somewhere
use_fakeredis or something similar, you need to set it to true
Doesn't matter for local dev
k
probably better to include it to contributing guide that you need to set use_fakeredis to true when you're running both locally
It doesn't have to be true if you're running redis through either wsl, docker or something else which would allow it. But I don't think the guides mention redis at all which would be helpful
I will try contributing once the guide is improved xD
@lime mural the guide is good enough. if you're contributing only bot just run the site and stuff with docker, I cannot run because my computer is not strong enough to run 5 containers at the same time, it's lagging. but i do not think there will be some issues with running docker
Why 5 containers? I count 5 for completely everything, half of which is not needed
Why 5 containers? I count 5 for completely everything, half of which is not needed
@brazen charm why not?
redis is optional, and you'll only need snekbox when working on it
personally I run the bot normally, and the site, postgres and redis in docker
So that'd be 2 running containers, although I'm not sure how much each individual container contributes to how much docker takes up
I seem to be failing one of the tests. Is there an easy way to see what the input to that test is?
Note that on windows a container will take more processing power than a native app because of the hypervisor, but not on Linux since it ks running as a native process, they are just a few restrictions on it
@cold island you can take a look at the source, or if it is a subtest there should be the test data in the output
The output message is pretty generic, and from what I see I'm already handling what it concerns, which is why I wanted to know the exact input
Well, source code then
That would be great if I was good with unittests lol. I'll see if I can figure it out
Haha, well, it should be pretty straightforward as for the I-call-the-production-code part
If you need anything, feel free to give me a little ping though 
no little pings left, only big pings
are those role pings?
lol
@green oriole I think I'll take you up on that offer
In tests\bot\exts\info\test_information.py
test_create_user_embed_expanded_information_in_moderation_channels
Fails on infraction_counts.assert_called_once_with(user)
AssertionError: Expected 'expanded_user_infraction_counts' to be called once. Called 0 times.
It seems like cog.user_nomination_counts is never called when making an embed in a mod channel
Note that on windows ร container will take more processing power than a native app because of the hupervisor, but not on Linux since it ks running as a native process, they are just a few restrictions on it
@green oriole even on WSL?
user_nomination_counts? don't you mean infraction counts?
wsl 1 doesn't use hyperv, but is slower in most aspects than 2
No it's not intended, and it shows the expanded counts when I invoke it in the test server
Can you add a dirty print to make sure that the command is properly detecting the mod channel?
No, this exact function, look https://github.com/python-discord/bot/blob/ff7c34aee21493efbc78a9b6521dd9c0f48d4a72/tests/bot/exts/info/test_information.py#L325
That's not the function being checked here though. That function is checked one line below
Oh no, the decorator ordering got me, it seems like
And the assertion error says expanded_user_infraction_counts. Or am I missing something?
Yes, it is
And since it shows me the expanded count in the test server it seems to work fine
I'll add a print there
Oh, I think I know why
The test is patching constants.MODERATION_CHANNELS to be [50], but I think we aren't using this constant anymore, are we?
Hmmm there is a line which uses it ctx = helpers.MockContext(channel=helpers.MockTextChannel(id=50))
or do you mean something else
why does API gives me 401 (unauthorized) status code?
Did you changed the API key on the bot?
Ok, and what do you mean by not using it anymore?
Did you changed the API key on the bot?
@green oriole no I didn't set
it's badbot blah i think
Ok, and what do you mean by not using it anymore?
@cold island can you check if the code is still using this constant to check if you are in a mod channel?
I am still using that constant, but I changed it so that it would include other criteria as well
Hmm
But it's not using less channels, so whatever is in there should still work
Did you configure the site values?
@green oriole if i don't set that in .env does that means it's not setted or it's default badbot?
Did you configure the site values?
@brazen charm
site: &DOMAIN "pythondiscord.local:8000"
site_api: &API !JOIN ["api.", *DOMAIN]
site_paste: &PASTE !JOIN ["paste.", *DOMAIN]
site_staff: &STAFF !JOIN ["staff.", *DOMAIN]
site_schema: &SCHEMA "http://"
I am not sure, I think you have to set it
okay lemme set it and reload
@cold island I'd suggest you to step through a debugger then, I don't know what could be failing
Yes, it needs to be set
Maybe your new conditions isn't correctly detecting the mod channel?
How does your code look?
That's the only plausible explanation, even though it clearly does ๐คทโโ๏ธ
First time setup of pybot is pain but after that it goes smooth
I just saw the comment of mbaruh in the issue. So there's pr from kosayada about improving !superstarify command(#1204). Should I wait for merging of pr then work on the issue #1224?
.pr 1204 bot
It seems like you want to wait first, yeah
@green oriole siiiiiiiiiigh I found it
smh
The test didn't work well because I imported the mod channels constant using a relative import
Which I did because another constant was already being imported that way
Ah damn
Which might mean that the other constant isn't being tested
Does it mean that I have to change it now because the PR tests will fail?
Either that or fixing the test but I have no idea how
@cold island oh no, the line continuation 
Why not putting parenthesis around the two conditions?
Hmm, they are valid cases for line continuations, I think
None that I'm aware of when we go to 3.9
I wouldn't need to break the line if I could just import the constant itself >:|
fixed
and now linting failed ๐คฆ
@cold island https://soundcloud.com/lemonsaurusrex/lint-before-you-push ๐
Hahah yeah
Can I run the precommit without committing?
just pipenv run lint
lmao it was a trailing whitespace
Hahah that happens
my duo is on so im chill
so... because there is a difference in line endings between windows and linux, it now wants to stage changes on every single file on the repo
Can I just revert the last commit I made? lol
You can append to it and force push, yeah
Should be able to just ignore that, but at this point I'd revert and replace the commit that added the \ and replace it with properly formatted parentheses
Nope, I reverted but linting still modifies all the files
you have to stage the changes
Don't lint then I guess, or configure the line endings for git
I think this is happening because one of the hook creates a windows ending, and so the mixed line ending hook wants to change everything to windows endings, or something like that
I force pushed but I don't think I did it right lol
Either way, it seems like pipenv run lint has different behavior than the precommit
Because the precommit actually handled it right
It looks okay
Ok yeah the commit history looks right
And the CI succeeded \o/
Anytime 
Would greatly appreciate reviews on this https://github.com/python-discord/bot/pull/1245
I think it's pretty simple
I'd like to kind of fast-track it so I can get to work on something else that was beginning to involve a lot of passing around of the bot instance.
loooking
Would patching it into builtins be too magical?
Right, it would be, didn't consider every checker that'd complain about it being undefined
I dont know how likely it is, but if an import chain is triggered before the bot is instantiated, it could also cause some other module to assign or try to use the placeholder None
that'd be a nasty thing to debug
maybe a singleton class would give it a clearer value
Did I do something weird in #help-falafel ? Got an odd output from using !e
can't handle text yet, so you go a syntax error with ``` which the bot refused to output
But I feel like I've used:
```py before and it's been fine
In other words, you canโt add any commends around the code block
print(5)
Some extra text
This wonโt be allowed
It's using the whole message as code
Huh. I figured it would only use what's in the code block.
Thereโs a PR about allowing that, though
And even having multiple code blocks like this:
# Some code
Some text ```py
Extra code ```
Final comments
You're welcome to review it so it can be merged 
I don't think my coding ability and standards are good enough to provide a review, otherwise I would
@cold island which pr is it, just wanna have a look
It takes 2 staff approvals
ohh ok
But others are encouraged to review PRs and give their opinions
only one core dev approval is needed afaik
It takes two staff approvals, at least one of which needs to be a core dev
yep, it's 1 core dev approval + 1 approval from anyone else (contrib/staff)
It does depend on the PR really
Yeah but are we talking about an automatic merge? Because a core dev can just merge if they want
Nothing's merged automatically, just don't have to do a force merge if it's two from the org
ah right, yeah, for GitHub UI to glow green it needs 2 core devs, but yeah, as Numerlor says, can merge at any point
Right, that's what I mean
@cold island Iโll have a look at it if I find the time
!remind 3d Ready to review Zigโs PR?
Your reminder will arrive in 3 days!
And in the future, Iโd recommend working on a feature branch, so you always have a clean master branch
ik, that's why I do usually, just kind of forgot with this one
@obsidian patio @green oriole I think my PR 475 is almost ready for review now, it would be good if you could have a look (when you're free) and help me test it? One big problem i have now is the amount of api fetching needed which slows down the response time, but i have tried to optimise it where i can. tysm
Alright, I'll try to
If we have some serious rate limit issues, we can always use a blank token to increase the limit
For me when i was running it locally i had to generate a token from github, but i dont know if a token is used in production
Actually, it seems like we have a GITHUB_TOKEN env var
Yup i used that and it worked for me
It should be set in prod ๐
@patent pivot All changes in Voice Gate PR made.
awesome stuff, will take a look later today
I think Python Discord repositories should have .editorconfig, because then most biggest editors will automatically get like end of line and indent type + amount.
i don't hate the idea
I think I have to find way to get Grammarly to PyCharm 
Fwiw PyCharm already checks for spelling errors
There's also the JB plug-in, Grazie
The config is fairly standard so I'm not sure if .editorconfig is worth it, but settings EOL though gitattributes would be nice if possible as there have been some problems with them and lint on win
Doesn't pre commit fix/check the line endings?
Yeah, but the fix part seems pretty broken, as it tries to change the line ending for every files in the repo haha
The precommit fix part seems ok, but pipenv run lint gave me hell yesterday lol
I had issues with the EOL fixer with pre commit on almost every commit (then a second commit after the files were changed passed), making things like merges a PITA; Mark suggested setting autocrlf to input and eol to lf in the config which seems to have fixed it, but I'm not sure what the gitattributes equivalent it or how it affects the files on other OSs
@patent pivot Voice Gate changes made. I made that now this only remove underscore for infraction only for visual side to not break anything.
yep โ that's what I was hoping for, sweet. will give it another test shortly
I think this review is final @cold moon
@patent pivot All suggestions applied
One approval left for Voice Gate... Nice...
@patent pivot Currently everybody can see voice channels, even without voice verified role.
intentional.
it's rolled out
we're just gating the speak permission, not the connecting.
Oh, so you can listen but not talk without role?
yep
Youโre right. Iโll fix that now
Probably worth going over the code and making sure everything uses the prefix var
You mean something like {CONSTANTS.bot_prefix} instead?
either from there or from the bot instance
Alright
@short snow should be fixed now
ok perfect :)!
So I have my DMs off for this server and I just tried voiceverify. It told me to check my DMs and I didn't get any sort of fallback response as per PR #1246
orly?
mhm, I only got the "check your DMs messsage"
i did test it myself and got the reply i expected
so lemme check logs
it still says "check your DMs" regardless though lol
I didn't see that second embed
I got removed from the channel before I saw it
ahh that'll be why then
thanks, that's not something i could test... kinda can't hide channels from me
Ha, yeah. That makes sense
thanks, that's not something i could test... kinda can't hide channels from me
@glass pecan you could view it as a person with the developers role
The new โview as roleโ feature
yeah, probs
@thorny obsidian when you lost perms, did you still see the channels last few messages?
Nope, it kicked me back out to welcome
hrm
whoops, time to force push
never tried to do a multiline git commit message via cli before, so that was fun and surprisingly simple
Really?
Most people do git commit and then use the editor, but there's also git commit -m "XXX" -m "YYY" -m "ZZZ"
All of the new message things will be new lines
And I use Sublime Merge/JetBrains IDE lol
git commit and then use the editor
yes this is what i did
i had to check though
as i've only ever used -m before, or a gui lol
vscode/pycharm commits
13 line diff review from any contrib? https://github.com/python-discord/bot/pull/1247
Done
just saying, this part seems repeated
try:
await ctx.author.send(embed=embed)
await ctx.send(f"{ctx.author}, please check your DMs.")
except discord.Forbidden:
await ctx.channel.send(ctx.author.mention, embed=embed)
intentional
ok
oh, do you mean because it is repeated for failure and success?
Letโs hope we didnโt the break the bot and now have to suffer
yeah @patent pivot
riiiight, yeah, I misread, whoops
haha
yeah, there would be less duplicated ways to go about that โ but it's not hugely critical
Any thoughts on https://github.com/python-discord/bot/issues/998 ?
hmmmm
what would the proposed implementation be there
saving the files and reuploading?
The bot would send them the text contents of the message (if any are present)
right, but for the "or an attachment" part
You can upload an attachment with a message, if the attachment doesn't pass through the filter the whole thing gets deleted
ahh right, so you're not suggesting reupload the attachment, right
@brazen charm I added my view on it now
We could keep the message around for a minute or two in case of disabled dms
Is that eventually close?
They are suggesting end of the year
hmm, I think keeping things around defeats the point of the filter
we recently had the filter catch actual malware
Oh, in memory, not in the channel
ahhhh
so delete, keep in a cache and then some user command could be used to retrieve it for a short period
riiiiight
Any chance this can be merged? since it has two reviews, one of which a core dev review.
I'd rather wait for it to be merged before I work on the next thing which might cause conflicts
@cold island approved. merge if you want.
any thoughts on this anyone? I currently have 2 yes and 2 no so im not sure: https://github.com/python-discord/bot/issues/1238
approved. merge if you want.
@crude gyro thank you, but I don't think I have perms to merge
any thoughts on this anyone? I currently have 2 yes and 2 no so im not sure: https://github.com/python-discord/bot/issues/1238
I didn't say no, I said "convince me" ๐
@cold island I added another comment. Itโs probably not worth removing
not sure if mark has anything to say, because i think he's the first to mention its presence
I'm indifferent
I would be happy if it was removed, but then again I don't use the pinned message feature
And I know it is there if I wanted to use it
I don't see any need to remove it.
gosh its october 20th already; not much time left. im worried that this pr wont be merged before hacktoberfest ends, because then its gonna be a waste of time ig, rules could be different next year ๐ฅบ reviews anyone? https://github.com/python-discord/seasonalbot/pull/475 atm it really hurts seeing people receiving not entirely accurate hackstats. i know it could extend until first half of november or so, but still
Should the functionality be correct now, so itโs actually filtering according to the rules?
Not sure how of a good suggestion this is, but: add a limit for !remind so people don't fill the db with unnecessary stuff (e.g. 50+ years) to avoid this
#bot-commands message
It doesnโt really add that much extra data. I think itโs fine from that aspect. It also doesnโt really get used that much (with strange times)
Yes, you have a limit
!remind @green oriole 9999999999y Well, itโs only the datetime failing and not an actually reasonable limit
Sorry, an unexpected error occurred. Please let us know!
ConversionError: (<class 'bot.converters.Duration'>, OverflowError('signed integer is greater than maximum'))
Isnโt that something like 4080 years as the limit?
Datetime has 9999y limit
9999y 12m 31d
So long its not passing into 10000
Max would be 9999-12-31 - current date
7980y few months few says
But didnโt you mute me for 7980 years because that was the limit?
Ah, okay
Gimme a sec
7980 would be the limit had it been 2019-12-31 @obsidian patio
!remind 251799076610s test
Your reminder will arrive in 7979 years, 2 months, 11 days, 3 hours, 56 minutes and 50 seconds!
Aah okay
Should the functionality be correct now, so itโs actually filtering according to the rules?
@obsidian patio yeah i believe the logic is according to the hacktoberfest rules now. but the only thing is that their source code also check for "spammy" repo/prs which i'm not quite sure about, but i don't think it's too much of a problem compared to the hacktoberfest topic, pr acceptance, etc
@obsidian patio
Here's your reminder: Ready to review Zigโs PR?.
[Jump back to when you created the reminder](#dev-contrib message)
Plz anyone check my pr bug emoji now it's seven day no one checked it
!pr 479
.pr 479
#reddit message the "I_m Joseph" post is messed up due to bold
.issue 475
There is one point about what I'm unsure:
When a PR is labelled invalid/spam but it is merged/approved, it will still be counted
@cold moon thats the hacktoberfest rules i guess, i asked in the hacktoberfest server and they said that if a pr was labelled invalid/spam but merged/approved, it will also be counted (which is what i said)
in the pr matt also said that invalid/spam labelled prs shouldn't be ignored so that proves my point
that links takes us to a blackhole (atleast for me)
sure here it is ignore the link then
Mine is still waiting ๐
[404] #1234 Issue/pull request not located! Please enter a valid number!
.pr 123
@surreal venture this channel isn't for playing with commands, you can do it in #sir-lancebot-playground
oh sorry my bad
Iceman isnโt staff, so weโll need another staff approval before the count is 2
Yes. We need 2
I thought we need only 1
Either way, it doesnโt look like youโve addressed the feedback given
the PR still has changes requested from 2 people
You need two explicit approvals from two staff members, where one of them is a core developer
Actually chibli approved it and after that he requested for feedback
That's y his approval got removed
But I addressed what he asked for
@nocturne hare can u pls look at the changes I made in https://github.com/python-discord/seasonalbot/pull/479 I have addressed all changes u requested for
#sir-lancebot-playground message a think this is a bug for the candy command, another bug
@eternal owl Why you closed user events management site PR?
I made a few changes to the API which were already commited, I will open new PR with cleaner commits
nvm, mb, not sure what I was thinking, lol, re-opened it
Rebase is always option
That would remove PR comments from what Iโm aware, but that doesnโt mean it shouldnโt be done
This PR don't have any reviews/comments
Okay. Then I donโt have anything against rebasing
If it is a draft PR, it is pretty fine, but don't forget that you can always force push the branch if no one commented on it yet, and start over without making a new PR
I have made changes to the model and I wanted to include it in a commit which I made in the beginning, hence I thought of making a new PR with new commits
if model changes, then tests, serializer, viewset also change, so more commits
Yeah, after any comments is added, it's not good here to rebase it, but I have contributed to some repos where force-push is required, as commit history have really specific guidelines.
๐ญ Reactions are disabled in #dev-announcements
@rapid igloo congrats for contributor role!
gratz!
Is there any way that Contributors can get reacting permission in #dev-announcements ?
Don't you already have them?
we do
Still waiting for my pr to get merged ๐
Have you addressed the requested changes?
Oh, they added it! 
Looks like you have one staff approval. Youโll need a second one as well
Whatttt one is required only right๐
this and
it would be better if the if statements were consistent
both of them accomplish the same but with diff conditions set
line 34 and 44
First one is for when dict have only 1 item
And second one is for if dict has more than 1 item
That's y I have two conditions
make the if statement condition same in the 2 chunks
just for consistancy
2 chunks
line 34 and 43
@eternal owl one is checking if condition is =1 and one is checking more than 1
If I use same condition code will mess up
I meant, mimic the if statement conditions in line 34 and 43
Is it making much difference๐
nop
2nd chunk is checking same thing as first just in oppo manner
uh, viewing on ipad discord embedded safari is like this
is it a youtube problem or...
it really depends on your browser
joe and i see them differently as well
i don't think there's much we can do
hgrnh that padding is not good
yeah lol
same result on chrome, just saying
wow leaked
SORRY JOE SORRY JOE
wait what apr 8
why not?
didnโt change the date on that pic yet
o
I'm doing a code exploration to wrap my head around what adding a timer to !watch would entail, but the idea is that you'd do !watch <user_id> <duration> <reason> and the user will automatically be removed from the watchlist after that duration
is there anywhere in particular I should be looking, other than bigbrother.py?
Not familiar with the code for it, but that would probably be most fitting for the scheduler from scheduling utils and some persistence from redis; I believe silence is merged now so you could take a look there
@brazen charm thanks!
.pr 479
Anyone plz
why is there a reddit command on both python and seasonal bot?
they seem to almost do the same thing
they are slightly different
the seasonalbot one needs a few fixes
Is there any reason we donโt simply merge them?
I know Akarys has brought up this topic before as well
Maybe, though I donโt think it quite fits @stable mountain. Does anyone else have a thought on this?
It's not a core feature. I think it belongs in SeasonalBot. I hate that it exists in both and we should absolutely merge it all into one place.
I think maybe should milestone page loaded dynamically from YAML? Then adding new entries will need only change YAML file, not editing whole HTML?
And currently there is this nice bouncing effect only when you are moving down first time. I think this should be changed that this like leave with this bouncing effect when this is going out from screen and then next time going back again with same effect.
I don't think I need either of those things.
These should be nice improvements, I think. Not something really-really important.
Is there anything else I need to change about this- https://github.com/python-discord/seasonalbot/pull/496 ?
Iโll probably have time to review it again tomorrow
@subtle kraken sorry if I sounds annoying can u plz check https://github.com/python-discord/seasonalbot/pull/479 if u have time
Sure though I might only just have time around tomorrow morning (in 12h or so)
Though will try to check it within 3h @green mesa
Ty
The token remover filter doesn't function on @stable mountain 's dms. While this makes sense from one perspective ( Bot dms aren't the server, so most moderation filters don't make much sense there ) I think for tokens it's a different matter?
Is DMs relayed to somewhere?
hmm, then tokens + webhooks should be catched.
In DM's you can't delete a message someone else sent, so this may be more difficult than it looks
#sir-lancebot-playground message and this #sir-lancebot-playground message, i guess this is another bug or some problem with the .candy command
I think it revamps the whole logic so it should fix those bugs
It changes a lot of the logic. Iโll probably review it a second time later today
minor fix - 15 lines total, https://github.com/python-discord/seasonalbot/pull/510 could anyone have a look?
(if i counted correctly)
fixed this issue with .hackstats #760857070781071431 message (thank you @near belfry ), this probably has higher priority than the one above. also it only has 5 line changes https://github.com/python-discord/seasonalbot/pull/511
Is there any reason we're running aiohttp integration for sentry? https://github.com/python-discord/bot/commit/5c0819890259e446273707ec2dbb4b8312c9e19f removed it since it was intended for servers, but was later readded in https://github.com/python-discord/bot/commit/93be87cea7cde7333042e2bb9529867723f567a7
Because lemon misunderstood its purpose
The integration is only useful when running an aiohttp server
yeah, it doesn't harm having it but it is redundant
@subtle kraken ๐ my pr
@green mesa can you post it here?
๐
hello, 5 line diff review anyone? its a fix for the hackstats command (for some users) https://github.com/python-discord/seasonalbot/pull/511
uh i don't get it, but thx
eh, it's hacktoberfest
the joke is lots of low effort prs going around, so i was just poking fun
it's fiiine
Looks alright, just some missing capitalisation in your description, no capitalisation in your commit message and the commit message could be more descriptive. Not worth correcting on seasonalbot, but worth making note of for future PRs.
shit
?
The code appears fine and the feedback is only minor feedback for future improvements. If it was shit, it wouldn't have been approved lol
Iโll have a look at it as well. Is it fine if I potentially approve the code of it without testing the feature? @glass pecan
@obsidian patio sorry, disappeared for a sec there. yeah that's fine, I've run the code
lol
yeah
but your comment is valid. it matched on mine, but I also haven't had a non-accepted pr yet
soooooo
So we merged a non-working PR?
we gotta confirm the issue first
Right
if so, then we just gotta make a fix, no biggy
it wasn't accurate before the merge either lol
Yeah, I guess
there is so much code in this module
there we go, so it wasn't a problem
thanks IPv4
don't know if the right channel, if it aint the tell me so but The silence or the shh commands uses overwrites right?
It got approved 3-4 days before but no one merged but u did finally ty
Yeah, this worked
It was tempting to just say yes and let you get worried though lol
hahaha
The stat tracking on !e looks a lil weird to me:
if ctx.channel.category_id == Categories.help_in_use:
self.bot.stats.incr("snekbox_usages.channels.help")
elif ctx.channel.id == Channels.bot_commands:
self.bot.stats.incr("snekbox_usages.channels.bot_commands")
else:
self.bot.stats.incr("snekbox_usages.channels.topical")``` This doesn't seem to cover all whitelisted channels/categories (esoteric, help_available, voice), so they would just get bundled as topical. And the topical help channels don't even seem to be whitelisted ๐ค
(https://github.com/python-discord/bot/blob/master/bot/exts/utils/snekbox.py)
Topical help channels aren't whitelisted, but staff members can use eval in those
Also #esoteric-python is a topical channel
Ah, true. So esoteric is treated correctly there then, but what about help_available / voice?
And separate question - why are topical help channels not whitelisted?
I guess you can call voice topical, but maybe it could have another category for the stats
I don't see how you'd run an eval in help available though
I agree, but the available category is whitelisted ๐
That's really weird
I guess you could start your question with an example
As for the second question iirc it was because they still considered the topical help channel shared, and people could disturb the conversation with evals
I'd like to consult the hivemind
I want the top-most function responsible for the !user command to know whether the user has infractions, assuming the command was invoked inside a mod channel.
Now, I could start searching inside the embed the function receives from its helper functions, for the exact format resulting from a user having infractions in a mod channel, but it sounds silly to search for information I already gained inside the helper functions, and it would also be volatile to any formatting changes.
That said, the idea of propagating a boolean value throughout the helper functions doesn't appeal to me too much either.
Thoughts?
I cooouuld change what each helper function does
yeah, that sounds alright
It works on my local instance. Maybe giphy API key is missing/not set?
Problem can be on API key. There was mess with YouTube API key too some time ago
Hmmm
Tested locally: Problem is on missing API key. Having key = no error, removing it shows exactly same error.
Have to be solved by DevOps team
.scarygif
That taco cat is terrifying. It frightens me
I think for https://github.com/python-discord/site/issues/385 it's better to add another template engine to site: Jinja2. Jinja have one big thing that Django own lang don't have: setting variables inside templates. This is really important thing for event pages, as this will make much much easier defining sidebars inside templates (these should be built with dictionaries, what building Jinja supports). This don't mean that everything have to use Jinja, as Django supports multiple engines too.
So you want to use jinja2 instead of jinja I'm guessing 1?
Yes, I said Jinja2 first, then I didn't included 2 anymore
I don't understand, which templating engine are we using right now?
Django Template Engine
Huh I thought we were using jinja2
I'm not opposed to adding it, but you should leave a comment on the PR issue to ask what others think about that
Also can someone assgin me to this issue?
Sure thing
@cold moon Could you explain to me why we'd need Jinja2 for that?
My view is that we can use DTL's include system for things like shared side bars
You have a main content area for the content area and all the pages that share the same sidebar include the same sidebar template
That would be the DTL solution for what we're trying to do
(It's the same as how all our pages include the same template for the top navbar area, just for a common side bar)
Including two different template systems into our app does not sound like the most straightforward solution, tbh
Okay, but then so there should be static sidebar from template, and then block that allow inserting page-specific sidebar blocks?
I think we don't have a common sidebar design that we can just insert a small bit of data
We want different kinds of sidebars for different pages, which means we'd need to have some kind of template for those anyway
If we want a common side bar, say for all events, we could insert context data for the template and render it that way
using template iteration
Actually yes, there isn't common elements for every page sidebar.
What do you mean?
Anyway, I much prefer to use one templating system instead of two in our relatively small web application
I thought that this upcoming event is in every sidebar, but it isn't.
That wouldn't be a problem with DTL, right?
Yes. My original idea was building sidebars with dictionary and for this DTL doesn't work
You can create template for an upcoming events box, make sure it has the context data to render the template, and include it
So own template for upcoming events, own template for relevant links etc?
And also, where should event pages be? In root templates folder or app templates folder?
Also, will event guides, rules etc. pages handled by content app or by events app?
content I would assume
But same time some of these pages is connected with specific event, like per-event rules?
Sounds like the distribution is basically something that is generally relevant over a prolonged amount of time, and something that is relevant only to a specific event
And they have sidebars too
Can't we just have subfolders? 
Yes, I plan using subfolders for events app
I don't see the issue then
any reason we are not sending the error response msg to the user?
if we make our site 400 responses consistent, we can parse them and send it
example:
all 400 responses can be of this format:
{
field: [error message],
field2: [...]
}
and then parse this on the bot site and send it in the channel
Huh, events dewikification was really simple.
there is some actual code at https://github.com/python-discord/forms-backend now ๐
I need reviews on this https://github.com/python-discord/bot/pull/1245
I'm concerned it's turning into bikeshedding
I have another PR to refactor help channels which is based on this
@tawdry vapor Sorry, I didn't see this ticket. In a branch I'm working on, I actually kinda already made an importable reference to bot from anywhere, but it's different from the proposal that you were laying out in your PR.
Since this is something you were touching already, I'll stop what I'm doing and discuss first.
For reference, the solution I was going to go with was a class attribute on Bot: literally Bot.instance
which would be redefined on __init__
I 100% agree though on the convenience of some form of importable reference to the instance, as it's stupidly annoying having to pass a single reference of bot around that will never change into a whole bunch of utility tools.
I assume this should be ready for merging now- https://github.com/python-discord/seasonalbot/pull/496
What is snoflake?
It is the way discord (and originally Twitter) IDs are made
๐ And events app is ready! Time to open PR.
Noiiice
I hope this get merged sooner than content app, as this don't have so much logic in views, basically loading templates.
You should mention it on the PR then
And I think events app issue is not worth advanced level. This was really easy to do.
The difficulty levels are just indicators, that's not an issue

it's merged