#dev-contrib
1 messages · Page 153 of 1
Yeah, that was correct. I was more referring to the one in your bot config
But you're using the docker URL, so it shouldn't matter
Oh your config is old
Soyml site: &DOMAIN "web:8000"should beyml site: &DOMAIN "web:8001"?
Good catch, I got too caught up in it. I added a length check before stripping it off now
site_api: &API !JOIN ["api.", *DOMAIN]```
Change that to !JOIN [*DOMAIN, "/api"]
Yeah
It's migrating stuff I think
Okay, so the bot is running but it doesn't have the dm_sent field @gritty wind
Alright, what did you do where you saw it doesn't have that field
Could you send the logs from the site container again
Uh, what now
These are the only things running
bot_web_1
No errors or anything
Could you run docker build in the site repo again
Yep
bot_web should be the tag, bot_web_1 a container
you want a tag there, which should hopefully be site_web or just site
It is using site_web
web:
<< : *logging
<< : *restart_policy
image: site_web
command: ["run", "--debug"]
networks:
default:
aliases:
- api.web
- admin.web
- staff.web
ports:
- "127.0.0.1:800:8000"
tty: true
depends_on:
- metricity
environment:
DATABASE_URL: postgres://pysite:pysite@postgres:5432/pysite
METRICITY_DB_URL: postgres://pysite:pysite@postgres:5432/metricity
SECRET_KEY: suitable-for-development-only
STATIC_ROOT: /var/www/static```
It's using site_web
docker build -t site_web:latest . to rebuild
why not docker-compose build?
Less that can go wrong
docker compose start on bot, and manually verify the site is working without using bot. It's exposed on port 8001
I put it back to 8000 now
And it's working so 🤷
docker compose start on bot, and manually verify the site is working without using bot.
Socd ../botthendocker-compose upthen go to127.0.0.1:8000/api/bot/infractionsor something?
@gritty wind
Well, you can't just go to the URL unless you add your token
Do you have any http clients you can use
Just using CURL
That works
curl: (7) Failed to connect to 127.0.0.1 port 8000: Connection refused```
It didn't work
What did you run
It's port 800
lol
C:\Users\tizzy>curl -X GET https://127.0.0.1:800/api/bot/infactions -H "Authorization: Token badbot13m0n8f570f942013fc818f234916ca531"
curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
Can't remember
... or I just open my eyes and see it is trying to use SSL
It's because I was doing https
C:\Users\tizzy>curl -X GET http://127.0.0.1:800/api/bot/infractions -H "Authorization: Token badbot13m0n8f570f942013fc818f234916ca531"
[{"id":1,"inserted_at":"2021-11-12T15:14:37.005899Z","expires_at":"2021-11-12T16:14:36.931405Z","active":false,"user":407110650217627658,"actor":442244135840382978,"type":"mute","reason":"Testing x","hidden":false,"dm_sent":null}]
This has the dm_sent
So does my int e now
It seems to be fixed
To whomever deleted their message, that is a known issue. It happens when there's an idle help channel that was created by someone else's bot.
Your bot didn't track who created that channel, so it just has None for the user ID.
That's great! Let me know when you want me to review again
Go for it!
everything below 1024 is reserved by the sustem and requires root to bind to IIRC
*system
been looking at that....
it has some issues when closing the connection
Could we auto take GitHub orgs in #black-formatter and #pyqtgraph-sprint-chat channels, if None are specified.
Guys is there reaction role system in any of the bots in this server?
We've decided as a community we don't want that
It's been brought up a number of times in #community-meta so if you look you can probably find a better explanation than what I can give
Something you could do is convert the pagination system to use 2.0 buttons instead of reactions. I believe this is something we wanted to do
Maybe wait for a core-dev to approve first to make sure I'm correct
Cc @vocal wolf if you're around
I believe we wanted buttons
I see
First Page | Previous Page | Next Page | Last Page
Maybe with some logic for only displaying when needed
E.g on first page don't display first/previous
I see
I've not touched interactions so don't know if it's possible but I imagine it shouldn't be too difficult
But yeah, wait for a core-dev to confirm before working on it (just to be safe so that you don't start working on something we don't actually want)
Btw don't warn this time cause I used team word
Lol
I got warned due to this advertisement a hell lot time
Lol
Sure
aru has already opened an issue on that, they have already implemented it and are willing to put it here also IIRC... Don't remember the issue number
We didn't have unanimous agreement over that, not really high priority anyway
What do you mean by "auto take"?
you'd have to host it yourself, I don't think we'd be interested in hosting it publicly
We have limited resources, and it's something that could be potentially quite resource intensive with not that much benefit. Since the servers we used are sponsored for use running the server, it could potentially be unfair to use that for something not really related to the server (?) not sure on the details of the agreement though
Would require proper ratelimiting etc, and there would be an expectation that we could keep the service running even if demand increased (if it was used too much there would be a limit to how much we could scale it with the resources we have, and we'd then have to break stuff by taking down the service)
like it would default to the respective org if the message is in that channel
That would be pretty cool
Seems like a nice idea, although there should be a way to associate a specific channel with a specific github organization.
(Like an API endpoint?
)
file constant
more work for me
but yeah what wookie said
it is nice having all evaluations in server as well, since we can monitor if things break and see why
opening it up reduces our visibility into that
Hey! Just a quick question, httpx is BSD-3, is it compatible with MIT?
(It's a core part of the testing suite of API)
should be fine, just need to add the license with the notice
oh, or just use it if you don't actually take some code from there
Alright, thank you! 🙂
Hey! I ran into a bit of a problem while implementing the async test suite for the API.
The API uses pytest, and pytest-asyncio, and it seems like the async fixtures are run with a different self than the actual test methods.
(The corresponding issue: pytest-dev/pytest-asyncio#197)
Has anyone occurred something like that?
(I've come up with a solution, that circumvents this issue, but I don't think that it's the way to go)
it even supports yeethon thanks to you 
lol
!docs str.isupper
str.isupper()```
Return `True` if all cased characters [4](https://docs.python.org/3/library/stdtypes.html#id15) in the string are uppercase and there is at least one cased character, `False` otherwise.
```py
>>> 'BANANA'.isupper()
True
>>> 'banana'.isupper()
False
>>> 'baNana'.isupper()
False
>>> ' '.isupper()
False
whats that 4 doing there
oh, its a link to a footnote about cased characters, could use being superscripted tbh
should be simple to do if the href has some footnote class
Created: <t:1483877013:R>
Voice region: europe
Features: PRIVATE_THREADS, SEVEN_DAY_THREAD_ARCHIVE, THREADS_ENABLED, RELAY_ENABLED, VANITY_URL, NEWS, COMMUNITY, MEMBER_VERIFICATION_GATE_ENABLED, MEMBER_PROFILES, ANIMATED_BANNER, BANNER, ROLE_ICONS, PARTNERED, PREVIEW_ENABLED, INVITE_SPLASH, ANIMATED_ICON, DISCOVERABLE, NEW_THREAD_PERMISSIONS, THREE_DAY_THREAD_ARCHIVE, VIP_REGIONS, WELCOME_SCREEN_ENABLED
Roles: 92
Member status:
41,987
234,248
Helpers: 133
Moderation Team: 31
Admins: 15
Owners: 3
Contributors: 46
Leads: 13
Category: 30
News: 8
Staff: 76
Stage_Voice: 2
Text: 113
Voice: 11
MEMBER_PROFILES
neat
#bot-commands
bot/exts/info/information.py lines 179 to 185
# Server Features are only useful in certain channels
if ctx.channel.id in (
*constants.MODERATION_CHANNELS, constants.Channels.dev_core, constants.Channels.dev_contrib
):
features = f"\nFeatures: {', '.join(ctx.guild.features)}"
else:
features = ""```
Wdym can't? Does the command not work there?
see above snippet 😛
Ah ok gotcha
PR it
pr what
add features to bot-commands
ah
while I don't think it's necessary, I'd rather you spam commands there than here, so either we remove dev-contrib from the list or add bot-commands
I think the latter is fine
is there a line character count on bot?
not sure what you mean
sir-lancebot#901 is finally ready for review!
Also if someone could mark @static canyon 's requested changes as done, that would be great. Thanks!
Does anyone know where the error handling of Sir Lancebot is?
Cc @patent pivot maybe?
Thanks!

i don't think it's something that particularly needs a huge deal of testing
it's adding a constant to a list
its more, i need to ensure I pass pre-commit since i'm not sure if adding it would go over the line limit and im too tired to be testing that without flake8 telling me it'll pass or not
i'll just add it
emacs is so great, i did all of that from emacs from the editing to committing to opening the PR and i enjoyed every step
;-;
<@&267628507062992896> seems there's a problem with @stable mountain and github
the above link is not the problem
but python is not automatically embedding github code links
You mean the line number thing?
yeah
I don't really think that's ultra critical though to our infrastructure
no, but it seems like a sign of something else
So what other things have been going wonky with Python?
since there hasn't been any redeploys, it would be the same code, which means that the token could have expired, or the bot is being ratelimited or worse
it could also be a github issue tho
nothing yet? does there have to be?
magit forge?
I'll review it again later today
Altho something I noticed at first glance is you never got around ro restructuring the json file
RE site#621
The lint-test check is failing since the max-line-length is configured to 100. Should I fix this, or do we want to increase the max-line-length to 120 to be consistent with the other repos?
It is working now, although you should ping devops for this, unless it is a perm issue
ah
i pinged admins because that's what I remember being told last time
ohhh it was an admin fix issue tho because help channels
guys akarys is crazy
Hey! I ran into a bit of a problem while implementing the async test suite for the pydis. API.
The API uses pytest, and pytest-asyncio, and it seems like the async fixtures are run with a different self than the actual test methods.
(The corresponding issue: pytest-dev/pytest-asyncio#197)
Has anyone occurred something like that?
(I've come up with a solution, that circumvents this issue, but I don't think that it's the way to go, only a last resort idea to go with.)
Accessing the correct instance via a non-async-fixture. But, that's something that should be considered as a last-resort (or maybe not even that) idea.
sir-lancebot#842 should finally be finished, or close to it if someone finds anything else that needs tweaking
Apparently color is hard
Yes, I couldn't figure out what exactly I needed to do, however, I did add the TypedDict class in my program (actually, Bluenix did)
I probably should have asked but I've been quite busy and been focusing more on getting the game itself working, and then worrying about the nitpicks. Just want you to know that I'm not purposefully ignoring your comment, I was primarily focused on getting everything else to work before focusing on the nitpicks. Does that make sense?
Also as I said, I'm still not sure exactly what I need to do, so if you could explain a little more about how exactly you wanted me to restructure the JSON, that would be great. Either ping me here or add a comment on GitHub. Thanks so much!
Basically just instead ofpy { "templates": [ ... ] }you havepy [ ... ]
Literally that's it
Ohh ok lol
That was easy
I understand things more visually than reading things that's probably why I was confused
I still have a question, actually. Instead of this:
with open(madlibs_stories) as file:
return json.load(file)["templates"]
I would do this:
with open(madlibs_stories) as file:
return json.load(file)
Correct?
Hey @dim pelican, if that's fine with you, can I push a commit to your color PR and just merge it? I think you've spent enough time on that time 😄
Sure! What did you want to commit? Currently it's based on my fork
the JSON file is missing the copyright notice
I see, yeah give me a second to set you up
If you checked "allow edits from maintainers" I have push access to that branch
yep I do
I invited you just in case
I feel like I borked the file
looks good
I am capturing the first core dev I see to leave a proxy approval
Yeah
Is that on my PR or Brad's?
qwerty isn't a core dev and chris also committed to the PR lol
I'm getting this error when I try to commit. Does anyone know why?
I also got this error when I ran poetry run task precommit:
Did you run poetry install?
I had poetry installed for a long time I'm pretty sure
It's working now actually. Thanks Scale!
Anyone know why I'm getting this when I try to start up my test bot? (cc @dim pelican because I think this is related to your color PR)
I ran pip install coloredlogs and it's still not working
That's the colored trace logs
....ok, and? How do I get rid of the error?
are you running it via poetry or docker?
Docker
delete the image/container, then docker-compose up to rebuild it
How do I delete the container? Inside Docker?
mhm, through the docker desktop window/menu
Actually, can't I just run docker-compose up --build?
Instead of deleting the container?
I prefer deleting the container in most cases since sometimes caching within docker can do funky things
Gotta compose it down or delete it to rebuild the image right?
I tried this and the error went away
Also my PR was on sir-lance, not bot. And does not introduce anything related to logs.
Yes ik
Yeah coloredLogs has nothing to do with brad's color PR
@dim pelican is it over? Is it... done?
.color
IT LIIIVES
F I N A L L Y
I'm so proud of you
Lol love the enthusiasm, this command will be super helpful I'm sure
This was one hell of a PR
I'm assuming the bot auto updates when you push to main branch. How does that work?
It's a really good command, thanks for sticking with it brad~ (also pushing back on a lot of the scope creep >_>)
It's pushed directly to the k8s cluster from ghcr.io (https://git.pydis.com/bot/blob/main/.github/workflows/build.yml) via github actions https://git.pydis.com/bot/blob/main/.github/workflows/deploy.yml
On a totally unrelated note, I probably won't be PRing anything for a while. I'll just stick to reviewing and testing
Understandable. Take a break, please.
for your sanity
*what's left of it
lol
You got ~250 comments on your PR right?
That probably wiped a way a lot of your sanity
i have a diagram!!!! i have a diagram!!!!!
I don’t think we’ve been on azure since I joined the staff team ages ago lol
oh please say i still have it
You always do joe, it’s your speciality
it is not a great diagram as i drew it live during my talk on pydis infra (https://www.youtube.com/watch?v=00CW1y-O8YQ) but it gets the process across
Is that from the devops talk?
Yeah somewhere around there, and 139 reviews, 35 comments
i also have this one
for how traffic gets from user --> us
it's a bit simplifed though
My goodness
That’s a lot
the full on version is out of date now I think
Is it the most commented PR on sir lancebot?
oh damn
correct enough
the coredns/kubernetes api stuff is weird but the rest looks correct
it also omits that not all volumes are databases
services can have their own volumes
nginx ingress fetches the IP from the API, any other service, unless explicitly configured for kubernetes, fetches the IP from CoreDNS, which in turn fetches it from the Kubernetes API, so CoreDNS just wraps the Kubernetes API over DNS alongside resolving all external DNS queries (e.g. discord.com)
it just adds a .cluster.local. zone which it can resolve for
Who's gonna read and try to understand the whole diagram lmao
lol
lol can i submit a pr for the color command to whitelist #dev-branding
yeah
ok
which decorator is that for whitelisting a new channel in addition to the defaults??
bot.utils.decorators.whitelist_override
hmmm
should i add #dev-branding to the config, or just whitelist this entire category
Honestly this command seems like one that could be useful everywhere
Or at least in help channels and topical
Category seems fine for this specific change
But it might be worth opening an issue to see if it should be extended further after too
@vale ibex the docstring seems to imply that it will also keep global check https://github.com/python-discord/sir-lancebot/blob/dea39a46437227b1ca0ec94aa00376b4167f2f02/bot/utils/decorators.py#L283-L291
bot/utils/decorators.py lines 283 to 291
def whitelist_override(bypass_defaults: bool = False, **kwargs: Container[int]) -> Callable:
"""
Override global whitelist context, with the kwargs specified.
All arguments from `in_whitelist_check` are supported, with the exception of `fail_silently`.
Set `bypass_defaults` to True if you want to completely bypass global checks.
This decorator has to go before (below) below the `command` decorator.
"""```
If you want to enable it globally, set the role to everyone
The defaults part allows you to remove parts of the global whitelist, so you can disable certain commands in channels where they are otherwise enabled
ahhhh
I mean, chris said to make an issue for that, but I could allow it in all in this pr ¯_(ツ)_/¯
congrats 🎉 it's a really nice feature, well done! support for alpha values and color palettes is on my todo list :P
I am opening an issue on enhancing the colour command, RE (https://github.com/python-discord/sir-lancebot/pull/842#pullrequestreview-790596534). Want me to include Alpha values and colour palettes also?
holy fuck the color pr has 142 commits
@gritty wind are you okay.
I hate it so much
you know the definition of insanity right?
I was trying different things smh
force pushing multiple times and expecting different results
I wasn’t just pushing the same thing 10 times lmao
Force pushes are the new commits
It was expected to pass
It’s exactly like the final push
It’s just not a nice solution
ah
Scaleios just smashing that branch over and over again
🐍 🖐️ 
🌲 🔥
It’s a shit branch, deserves all the punishment
poor branch
no its not smh
that's my branches
i uh, i have several unpushed branches of code on my own project
+2
what's the deal with the wolfram command?
why is wolfram broken, any internal sentry errors on that?
Sounds good! If you run into any questions just let me know (but I'm sure you'll do just fine)
Can you give an example?
Yea the command was made a while ago, so that either didn't exist back then, or was ignored by the person who made it

Contribute to the open source bots we have
and not other things?
Like what other things?
Python Discord Project discussions. Don't forget to lint!
From the channel description
Don't forget to lint or... bad things happen
I believe you get murdered by lemon in some ways
I still think there is murder included
Right, so @crude gyro will throw his face into your face until you die and delete your internet
The latter being way worse than the former
Don't lie, you are still alive
I always lint before I push smh
Smh I haven't pushed that one! Ks did!
murder is such a strong word
sudo rm -rf life?
lemon will end up murdering me in due time, don't worry
That's good news for alizee, she will live longer life
not sure if that's how it works
Lmfao
If you are lacking context: https://soundcloud.com/lemonsaurusrex/lint-before-you-push
.
Oh wow
I've listened to that
Excellent
@eternal owl heeeey so took a look at the Events issue and what functionality is covered by Discord's new native events functionality... and yeaaaaaaaaaaah. The discord's event functionality does accomplish everything I listed in the issue. Thank you so much for working on it though!! I super appreciate it!!!
Well, haven't done anything specific since last time. We'll implement paralel testing later on.
For now, I'm waiting for @vale ibex 's PR to be merged, then I'll push my PR that adds the reminder endpoints, but now using the newest SQLAlchemy syntax, and an async driver.
If that PR gets merged, and tested, we can start migrating the rest of the endpoints, based on my "template", sort of.
All of them
I believe
Yeah, that's the one.
Just a few modifications and it's good to go.
Can we just merge it and deal with issues after if it's blocking
Since its not prod anyway
👉 👈 ... but if D0rs4n is blocked then I can maybe con convince him to do another event PR :D
Actually, it's just 2 characters and a space, and it's good to go. I can push the changes, I believe i have push perms.
Oh it's failing linting lol
Yeah it should be postgresql. 😄
Another event PR? 😏
peeerhaps another AoC one that shouldn't be too bad???
https://github.com/python-discord/api/blob/main/.github/workflows/lint-test.yml#L27
That's just a bogus value, will be changed in my PR. But your changed schema is refusing to accept this.
.github/workflows/lint-test.yml line 27
DATABASE_URL: postgres://pysite:pysite@postgres:5432/pysite```
Yeah, sure. It'll take quite a long time to get somehow my Reminder PR merged 😄
sir-lancebot#325
Oh, I see. It was not completed during October. 😄
yeaaaaah
Ahhh Yea didn't think of checking there, I'll sort it after dinner if you don't get there first 😅
I'll wait for you, this way I can approve it 😎
I see, last time I checked my session cookies did not work. Might have been a temporary problem will check.
So, I guess I can use the same dataset like the last time? 😄
(btw. How's the point system look like in AoC? 5 points each completed star? )
Wellllllllllll, that's where it gets a bit complicated to calculate
For N users, the first user to get each star gets N points, the second gets N-1, and the last gets 1
So if you have 100 people, 100 points is the max. If you have 200 people, 200 points is the max. It varies per day.
As people complete them, it changes how many points
which does give me an idea for the very end, recalculating points but only taking into account people who have completed all days
Just a quick question.
https://adventofcode.com/2019/leaderboard
Aren't those the points on the left? 😄
Mhm, but the global leaderboard operates differently than the private ones
Global only cares about the first 100 people who finish for each day. Those people get points, everyone else gets 0
It's also why AoC (and subsequently us) have a hard "no spoilers until global is filled" policy
I see, then I guess the issue description is wrong.
It says that you can just find yourself by searching for it on the site with CTRL+F
You can look on the private leaderboards which do work like that
So that issue is old enough that that's when we had a single community leaderboard
With multiple private leaderboards you can no longer do the ctrl+f
It seems like that the scores are automatically computed.
https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/events/advent_of_code/_helpers.py#L141:L148
I might be wrong, but that seems to be correct.
bot/exts/events/advent_of_code/_helpers.py lines 141 to 148
sorted_result = sorted(results, key=operator.attrgetter("completion_time"))
for rank, star_result in enumerate(sorted_result):
leaderboard[star_result.member_id]["score"] += max_score - rank
# Since dictionaries now retain insertion order, let's use that
sorted_leaderboard = dict(
sorted(leaderboard.items(), key=leaderboard_sorting_function, reverse=True)
)```
mhm! Ves has already done the score calculation and it recalculates each time the command is called. The !aoc mystats or whatever can just use the sorted leaderboard and provide some of that info in a nicely formatted way
Fixed the lints
It could be also a solution, to not create a distinct command but an argument that'll format the leadearboard like
You: x y
1st: x y
2nd: x y
That's just an idea. 😄
Thank you! 😄
<@&409416496733880320> I request your seal of approval on api#29
mmmm, not sure I'm getting. Could you show an example?
yessss
@patent pivot Any objections to me update the review policy in api so it uses the default?
well it's pushed now anyway
we can revert if he says otherwise
It would mean more reviews per PR, no?
but it won't take affect until it's in main
Sure, so... You request the scoreboard, and you provide a parameter like my_stats and 1.
And it'll format the output accordingly.
----------------------------------------------------------
(You) 21 | Xy #112312 | 95
1 | Anonymous #500370 | 123
2 | Mushinako | 121
3 | Square789 | 120
(Sorry I edited this by hand)
The default is 1 staff and 1 contrib, so like you’d just increase it
Nah, we're fine. :3
well two of them are draft lol
Is creating an init.sql and mount the volumes for them, a good way for creating the test database?
I had some problems with raw SQL queries. (I spent about an hour with them, and in the end the problem turned out to be an "unurlsplitted" url passed into the engine. -_-)
Which projects is this?
Yeah, cool.
So for now issue this command flake8 --config=tox.ini
yea, that's fine, it's how we do it on site
no opposition
Yeah, but how do we include it in the github.yaml?
Sorry, github actions.
.github/workflows/lint-test.yaml lines 42 to 43
- name: Run database using docker-compose
run: docker-compose run -d -p 7777:5432 --name pydis_web postgres```
Just need to update in lint too DATABASE_URL: postgresql+asyncpg://pysite:pysite@localhost:7777/pysite
Oh.. I actually went defining a service and such, since it was in the file. But that seems way easier.
I'll add it, and push my PR.
rule 47 of coding, there's a 95% chance someone has already solved the issue you are seeing 😛
I'll keep that in mind 😂
I have just rebased my branch, I hope everything's alright 😂
oh cute, yeah I like that. Is you just call my_stats or whatever would it compute it for all the days?
I'm not sure. I've gotta check it out.
Yeah, it seems so. The code iterates through the sorted result, and just assigns a score to a member in leaderboard
I did too, conflicts are meant to be (re)solved 
Yeah, it's a new line
It doesn’t matter, pick either, relock, and push
Lock files weren’t made to be handled by humans
You’re more likely to break it if you try to manually resolve it tbh
Also, just a quick question.
Since, sqlalchemy async is quite new, I had to use a source for setting up the tests, the one that Chris sent (https://rogulski.it/blog/sqlalchemy-14-async-orm-with-fastapi/#tests) Do I have to worry about licensing or something?
(Pardon my question, I'm not good with licenses)
you can't manually resolve it because of the hash
@thorny obsidian
There seems to be a problem here..
bot.exts.events.advent_of_code._helpers | ERROR | It seems like the fallback cookie has expired! I can't use my session cookie anymore. :/
uhhhh dev tools are disabled at my work, but I can get you a new one .. WAIT
YOU'RE STAFF NOW
Just join the staff board
If you join the staff board you can grab your own session cookie
Alright, how do I do that? 😄
give meeee one second and I'll send you the invite
How and why do you block dev tools 🤔
work being work
Lol
no one ever accused my employer of making sense
Anyways, could someone help me with that? I'm ready to push the API PR, that's the last thing on the list. 😄
Hmm, the code is in a repo with no license
Yeah, that's why I'm not sure. I mean I used it as a source for tests, documentation on that topic is pretty bad
Did you copy code verbatim?
I hope not? 😄
I just followed the logic most of the times. On some places changed on it.
I mean it's here: https://github.com/D0rs4n/api/tree/pr/reminderpoints
The only thing is the conftest there. That's all.
But there are things that are so straightforward you can't change them
Should be fine then I think
Yeah, I guess, I can't see how else I could yield an async httpx client 😄
I'll open an issue, just to make sure. 😄 That's the only and easiest way.
@static canyon i implemented the suggestions from the thing. you weren't originally a reviewer so i can't request your review (😔) ples check it out? 🥺
Google Parent Link does the same
It was a real pain because I was doing frontend at the time..
Couldn't even Inspect Element 💀
Hmm, quick question real quick, what do you all think of a command similar to CarlBot's highlight command, where you get a DM if a certain keyword was used
I think it could be useful for people who wanna help out somewhere or read a convo on a certain keyword (say, sockets) and they can customize which channels that would have watched, etc.
We had this proposal in #community-meta and ultimately decided not to
I can dig up reasoning from the meeting since I don't think we've closed the issue yet
That would be nice, thanks!
!remind 10h this
Your reminder will arrive on <t:1637055529:F>!
Tl;Dr too much spam at our volume (ratelimits!), there's a potential that too many people try to help at the same time (leading to a poor help experience) and then also how we would moderate what one can highlight.
Ah, gotcha
the worst thing is when multiple changes are made, but only half of them are staged, and then black and flake8 complain
I already love the command palette
Here's your reminder: this
[Jump back to when you created the reminder](#dev-contrib message)
Have just reviewed 👍
@static canyon I think MyPy looks weird, because official name is mypy/Mypy (#dev-log message)
bot#1959 exists now @short snow
Thanks for the issue 👍
I'd been putting that off for a while lol, and it was actually pretty easy
yep saw it, will try reviewing soon... same, I was supposed to create it about a month back
:p
Hence why I dislike precommit
lol i love pre-commit
Ideally each commit should conform to pre-commit checks. If you really need to have intermediary commits, and you have the intention to fix afterwards, then there's always --no-verify
honestly i try to make all of my commits conform to precommit checks and leave the program in a runnable state 😛 and have all tests fail
that doesn't always work out, but that goal means that any bugs will be easier to find which commit and therefore feature caused them
Yea. That's the preferable option.
yepp
by aiming for that, its not as bad when it doesn't happen
and it makes using git bisect a lot easier
Not all commits are 100% percent runnable, I think forcing you to follow these checks on the code before commiting leads to not commiting as often.
hi
They are just posting hello in every channel they can find
ikr right this akarys guy 🙄
Ohhh thats awesome. I guess they got banned and purged?
Their messages were purged, yes
you (or black) made some changes to the migration files
I suggested making those changes here too, so future auto-generated migrations get them automatically https://github.com/python-discord/api/blob/main/alembic/script.py.mako
Yea, I had assumed as much
We do want that yes. But also, might as well fix the parts we can in the mako file, so that it doesn't need to
👌
Legacy decision, Seb added it to the repo awhile ago
Do we still want it?
for migrations.. I had like to have it... it keeps them formatted otherwise you get them all in single line with no indentation. It could be manually done also though, as the initial migrations is done and other changes are going to be small ones
I don't think it really meshes, since we're planning on using API in conjunction with site and bot. That's going to be annoying to remember that just one service uses black and the others don't
I would personally not even lint migrations, but that's another problem I think
I agree with that, migrations are not something that should be looked at in my personal opinion.
some write migrations on their own... that includes me, yes.. I didn't know we can auto generate them and now just write it on my own
But I think we should be either yeeting black now or never do it
Hey @hardy gorge, what do you think about whenever we should keep black in the api or not?
I don't think we should write migrations by hand.
And I'm strongly against implementing such a process.
I'm strongly in favour of having black in all of our projects, if that answers your question.
There are some decent reasons to add some python code to migration
(But pls, from a new contributor standpoint, it's awkward when 3 services that are supposed to talk to each other don't use the same linting tools)
I really like having black, even if some of the style decisions it makes are different to my personal preference. I really hate spending time arguing over this or that style.
It's non-constructive.
I agree with seb here
Sometimes you have to actually migrate the data manually
Indeed, but the core part of the migration is auto-generated.
Yup
If you have to modify something, then feel free to do so, but I'm not gonna remove auto-generation in favour of linting 😄
huh? the inital migration is already linted
Maybe we could have a core dev + contrib discussion over using black in our projects? I think we shouldn't have a disparity in our projects
Yes, cool. I know, I did it.
Agreed
(I don't care what y'all use, my concern is that it should be consistent for different repos that communicate)
then, why would we need to modify it again?
I meant new migrations, not the current ones
Wasn't your point about running black on migrations to not have to care about linting?
yeah and we did that for the initial migrations
i thought he was talking about those, not the new oens
No, we're talking about future migrations. (Or migrations ported over from site)
I guess we can add it, but we still have time.
We have to migrate the endpoints and the test suite first, there shouldn't be too much migrations til' then. 😄
just add it as alembic hook, so they come auto formatted.. we won't need to run manually and edit them, like doublevcodes said
Sure, feel free to open an issue, and maybe later on a PR.
doublevcodes is alreayd doing that on his PR
that;s what you meant by "make alembic do it" right? Or i got it wrong
@molten perch consider yourself assigned
Alright, I can assign myself if you don't mind 😂
please do, I'm not logged into my personal github at work so I can't do it until I get home
Alright, so is the idea which I proposed yesterday fine with you? (The list where (You)'re the first and then it lists the actual top scorers)
yup!
Alright, I'll give it a try this weekend, shouldn't be so hard! 😄
that doesn't work with our multiple leaderboards
Ah yeah, but could the format be something like that?
That could probably be a thing for a future iteration. I like to see how people use the command and what kind of features they're after
Also we're 2 weeks away, so I want to keep the scope small since we're so close
👍 right, is there a basic mock/write-up on the current proposed format
I think somewhere above in this channel
I think that's it. 😄
I edited that by hand, don't mind the indentation.
uhh so it would jsut put your score on the top and rest remains the same?
rather than that, could we jsut add it to as the 11th line to the lb command?
Well, what difference would it make? This way they spot it easily.
They would spot easily on both cases imo... The embed is only 10 lines long
I don't think which one really matters, I'll just go with what d0rs4n prefers
The command is just gonna be a duplicate... But yeah for now it's fine as we aoc is in 2 weems
Lucky, that I do not plan to create a separate command. (Read the description of my message I sent above)
Mhm I didn't read that, it's ok then 👌
My eyes directly went on the codeblock
Yeah, add black as alembic hooks
yeah
First time I see someone saying oh cool at something hard-coded haha
It makes it easy, cuz I can just search for one of the other tokens and duplicate it
i go so far to not hardcode stuff
Can we get url unfurling before a new filter list? 
unfurling?
bit.ly/xxx --> the actual url
"unfurling" url shorteners
There's a bot issue for it but I can't remember the number off the top of my head
i mean, that's not going to always work
Yes, it isn't a direct redirect it won't work
yeah like this https://rroll.to/3txzi7
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.
But if they do end up doing that, fuck it tbh
perfectly legit link pls click it thanks
i'm more thinking about the attack above
one thing the first time you go to it and a different the second
I mean we aren’t trying to solve non-existent problems
The unfurl url issue has a very well defined scope internally because we need it for something specific
It’s also more or less ready to be pushed, but its 3 PRs, all which need reviewing
I’ll probably have xith bully the mod team
Merge conflicts 🥲
What am I conflicting with lmao
Either way it’s a one line change, so it’s relatively okay for me to recreate from scratch
the new schema
If we're migrating a chunk of the table it will need an update in the migrations of the other PR
Ah, I see
Well, I already committed another migration like a week ago lol
Anyways, I've made site#625 for now, it doesn't need to be merged until the bot PR is ready, and if the other PRs are merged by then, I'd be happy to remake migrations
Btw, while I have you here Zig, what do you think about this
I have a utility (separate of the filter itself), which allows you to invoke the unfurling manually through a command
Now technically, it's standalone of the filter work, but it's going to be helpful for working with the filter in cases where the filter fails
It's ready, so I can either include it in this PR and get it done with, or make a follow up PR so this one doesn't get delayed because of it
I'm very much in favour of running linting against migrations files. It's code which is reasonable to assume will be looked at to debug issues, and if it's code that needs to be looked at, it should be linted to our standards.
I think we can enforce that the style of those files is reasonable through code reviews, but we shouldn't be strict about it and have the contributor edit the file because of styling
why would the contributor edit it because of the styling? Alembic is running black against them so they are already partiallly linted
Why not? Especially if we can just have black ran against them.
Ok, just pushed the redirect filter PR, and it auto requested Akarys, joe, and Zig
Perfect
Black doesn't follow our code style though
In the case of the API it doesn't really matter I guess
@gritty wind about about domain_redirect? :3
I would be for simplifying the others, but i think this one should be explicit
Do you believe redirect is not clear enough? It would require making two more commits on two separate PRs :P
I can look at it tonight
700 lines diff dear god
it was supposed to be like 30 lines lmao
Half of it is tests for the service lol
smhmhmh
"While I have you here", said Scaleios half an hour after I wrote something 
Either way seems ok to me, if the functionality is the same
Time is relative to my sleep schedule
Didn't know time could go backward, because that's really how I feel sometimes with my sleep schedule
Nice, black on bot!
Just a test, not certain we'll keep it yet
Welp, celebrated too early
Lol
lol, yeah, it was just a "wonder what this'll do" thing
This is just to see what the diff would look like and whether we would want some of these changes.
lol
I was hoping the PR description would be enough lol
any further formatting decisions will be published as security advisories from private forks
CVE-2021-69420: Python Discord Bot was missing a trailing comma
with an accompanying CVE
Lmfao
you call 700 lines big?? wut
Since we’ve been doing tests on our repos
i guess i need to get better at smaller prs....
The silence PR was an eye opener for me
I opened it when I joined staff
And merged it as an admin
iirc I have a 600 line pr of just tests
because previously I did not write tests
(not for pydis)
Lmao
Was the silence PR that big
510 lines, not that bad
Wait, that one is by Num
Bot#1297
Hello, sorry for lame question. I wanted to play around wuith sir lancebot -> I created a discord server, created a bot, cloned a project, run docker-compose build and then up. Bot got activated but it doesnt respond to comments. I got such error msg when activating bot.
Traceback (most recent call last):
File "/bot/bot/bot.py", line 134, in send_log
devlog = await self.fetch_channel(constants.Channels.devlog)
File "/usr/local/lib/python3.9/site-packages/discord/client.py", line 1491, in fetch_channel
data = await self.http.get_channel(channel_id)
File "/usr/local/lib/python3.9/site-packages/discord/http.py", line 329, in request
raise Forbidden(response, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
Is this something wrong with .env ? Missing tokens?
It looks like your bot doesn't have permissions, what permissions do you have on the bot role?
need to check, brb
I believe the error here is you didn't change the ID of the dev log channel
Because a fetch will only fail if you don't have read permissions over that channel, which the bot most probably have
Bot permissions integer: 0 😅
So i should add read permissions for my channel only, right?
CHANNEL_DEVLOG variable in .env, right?
ok, I need to rethink that topic...
nice, got it working
now one more question:
bot reacts to command after ' (single quote) sign instead of . (dot) sign. Can I somehow change/fix it ?
(minus the token)
Im on it
30sec
omg
there is a PREFIX variable 😅
im sorry guys, learning is painful and sometimes teaching is even more painful
Don't be sorry about it 👍
there is no stupid question!
wat
Oops I think I removed requests for reviews instead of adding them 🤔 😅
I am confusion
It seems like @green oriole, @cold moon and @sharp timber have required changes that are blocking the merge right now.
The required changes aren't blocking it, you just need a core dev to actually press the button
Oh you're right, hmm, I am probably gonna stop using the GithHub app honestly.
The only benefit is being able to comment on multiple lines lmao
You can comment on multiple lines in github web
Just click and drag on the line numbers and then click the + on the last line
chris 🥺
Not on phone, that just scrolls
nope...i use the web to review
you can disable that, its somewhere in the settings
Nag that's a UI bug, you don't have write perms onto main, you cannot merge
someone merge enhance incidents PR 🥺
Dismissed my review
can the @stable mountain bot control slowmode by itself, without the slowmode command being ran?
like if the chat is really fast, can it make slowmode higher automatically
we have some stats for it now
My next pet project if I ever finish with the filters lol
the new filters system?
yeah
Hello folks! Here is a good first issue for y'all, if somebody is looking to get started with the bot, this would be a good jumping point! https://github.com/python-discord/bot/issues/1963
it would be good to include the additional frame which was skipped.
and you could probably add good first issue
umm did you just add it
I couldn't see it earlier... the last frame would have included the line (L408 prob) on which the deletion happens which may be helpful
no, like every command traceback the first frame is in discord.exts.commands.core
... that's so dumb, does the docs mention that
await delete_messages(messages)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Deletes a list of messages. This is similar to [`Message.delete()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message.delete "discord.Message.delete") except it bulk deletes multiple messages.
As a special case, if the number of messages is 0, then nothing is done. If the number of messages is 1 then single message delete is done. If it’s more than two, then bulk delete is used.
You cannot bulk delete more than 100 messages or messages that are older than 14 days old.
You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to use this.
Hey!
I get this linting error when trying to lint sir lancebot
And if I try to fix it isort will revert it 😄
Is there something that I don't know of, regarding this issue? 😄
run poetry install --remove-untracked
looks like flake8-import-order is still installed in your env
Oh, true. Haven't worked on lancebot for a while. My apologies. 😄
No worries 😄
Here we go again: sir-lancebot#949 😂
I would appreciate if someone could give it a look, it's a fairly easy PR.
(Hopefully)
bot#1663 also needs a review if anyone has a larger bit of time
uhm @vale ibex since when do workflows on the .github repo run on every repo
cc .github#9
I've looked into that before and they've never run on all repos
there's some apps that do it, but nothing native
unless, of course, that's changed recently
we might need to move them into .github/workflows, but yes, it's a thing.
so there would still need to be an action added to every repo that wants to use it
yes, but we're not ready to roll this out anyway lol
gotcha, should probably be detailed in the pr lol
it's fine as is
we're altering some policy, we'll publish that policy when we want to
i don't think we need to document the nitty gritty of rollout details on our .github repository, it's just unnecessary work
once we have policy in place we'll put it somewhere to explain what the label means
hmmmm
could the filter worker remove comments from prs before posting them? #black-formatter message
maybe
we’ve had pretty limited success with modification so far, seems discord do some level of validation at their end, but it’s worth a shot. downside is we then have to parse all bodies whiiiiich eh… not sure I want the hassle tbqh
it’s an edge case
I don't think black is behind a worker anyway
It is, for more control over what gets posted
github-filter/src/index.ts line 55
let isBlackNonMainPush =```
that's cool
Is there a feature that tells how many times a modmail thread is opened? (by some user)
yes, we can count that using ?logs
Can I know how many times I have opened a thread?
43 times
Thats more than I thought 😅
Is the @slow bone source that this server uses a open source?
?about
This is an open source Discord bot that serves as a means for members to easily communicate with server administrators in an organised manner.
28d 23h 22m 1s
101.10 ms
3.10.2
kyb3r, Taki, fourjr
DOCKER
Follow the installation guide on GitHub and join our Discord server!
This bot is completely free for everyone. We rely on kind individuals like you to support us on Patreon (perks included) to keep this bot free forever!
Checkout the people who supported Modmail with command ?sponsors!
It is right there https://github.com/kyb3r/modmail/
we have our own fork with CI over at https://git.pydis.com/modmail
Thx!
deleted
lol, let's not start advertising stuff in on topic channels
yeah 👍
@short snow it's merged 
Thank you for working on it and sticking with it for such a long time
That's the good stuff, thanks jason!

zig I am waiting for your review on modpings 🙃 lol and thanks!
That might take a while, there's a bit of a queue 😅
Yeah I noticed the amount of commits a moment too late. Not a big deal though
wow
!ban @short snow We've received reports that you have worked on incidents enhancement. thank
banning and thanking, odd combination, thanks!
Because it's in the middle of the message
Ah ok
If no one gets to 1964, I will get to it once i get my lance PRs done
btw 745 needs core dev approval, bluenix did the first one
not sure about 745
lol @vale ibex they fixed links on Android like 3 days ago, they work pretty well now
I'm a bit eeeeehhh on that issue, but if people want it why not
sir-lancebot#745 maybe?
cc @crude gyro to confirm, was raised in admins that they didn't work
oh you already pinged in core
I think it's good, even if links work. They take you out of the conversation
yeah those are the links, sorry forgot to include the repo
that's cool
yes, thanks to bluenix for bringing that up - thread support
I still have issues though 
Android 12 + discord beta up to date?
I don't count anything in beta as being an actual fix
well, at least a fix is coming\™️ soon\™️
yes i completely agree with you
SIKE#
I managed to patch the issue in this PR
sir-lancebot#949 , so I would love to have some reviews on it. 😄
!remind 14h review after you get your freshly cutted hair
Your reminder will arrive on <t:1637392469:F>!
I'll review it when I get home in like ~6 hours
it works for me on android 100% by the second time
Lol
Disregarding what a bad boy in need of punishment I am for having all these mute infractions, there are too many new lines in here.
You could drive a truck between "Reason:" and "If you would like to discuss or appeal ..."
I think that we could place that in the footer instead?
if ban description else footer?
I don't see the need to have it in two places
since we want to remove the new line anyway, for ban embeds
The bot has feature to link a github issue/pr etc sirlancebot#issuenumber, where could I find the src of it?
I think it is a webhook
Ah, thank you!
Hmm since when do we have three line breaks
That's a recent change, my last infractions don't have that
@vale ibex ban me from watching the TV
I'm watching small ant
😄
psssssssssst @trim cradle
WHAT
Sorry that was just the toxic masculinity leaving the body
lol
This channel got a bit off topic ngl
@trim cradle you commented and not approved lol
I was too late
ye
emacs is so great
yus but without evil it's nothing
Here's your reminder: review after you get your freshly cutted hair
[Jump back to when you created the reminder](#dev-contrib message)
!remind 2h learn how to calculate time
Your reminder will arrive on <t:1637402985:F>!
Here's your reminder: learn how to calculate time
[Jump back to when you created the reminder](#dev-contrib message)
hmmm
interesting
I believe I've found a bug with the paginator
and that explains why I've found it so slow at times
its a simple pr to fix it...
first and last line in this snippet, need to delete the top line in all four if branches https://github.com/python-discord/sir-lancebot/blob/dea39a46437227b1ca0ec94aa00376b4167f2f02/bot/utils/pagination.py#L215-L221
bot/utils/pagination.py lines 215 to 221
await message.edit(embed=embed)
embed.description = paginator.pages[current_page]
if footer_text:
embed.set_footer(text=f"{footer_text} (Page {current_page + 1}/{len(paginator.pages)})")
else:
embed.set_footer(text=f"Page {current_page + 1}/{len(paginator.pages)}")
await message.edit(embed=embed)```
while at it, should probably make them if/elif for the slight efficiency boost
seems like the easy fix is actually
applying this patch to that file https://github.com/python-discord/bot/commit/3cd4c92b1e24c8cfdae8c5c68c19607c62cc01ed
actually
there's a few other dupes in that file
bot/utils/pagination.py lines 431 to 441
embed.description = ""
await message.edit(embed=embed)
embed.description = paginator.pages[current_page]
image = paginator.images[current_page] or EmptyEmbed
embed.set_image(url=image)
embed.set_footer(text=f"Page {current_page + 1}/{len(paginator.pages)}")
log.debug(f"Got {reaction_type} page reaction - changing to page {current_page + 1}/{len(paginator.pages)}")
await message.edit(embed=embed)```
this message never got pinned by bot?
The first message was deleted (by the bot, probably because it was an attachment)
They sent a new message, which did not get pinned
okay, made a commit, prepped a pr, will submit if okayed 😄
@thorny obsidian aoc PR reviewed
What time classes can have a TZ set? I'm assuming datetimes and time?
I'm trying to update the discord_timestamp utility to accept times with TZs
I time has the tzinfo, yes
thank you!
merged
Welp, I had the wrong way around
It only works with aware timestamps
but datetime.utcnow does not set the tz.... why what's the point
just switched to datetime.now it's fewer characters lmao
Wait will datetime.now with the tz set get utc time, or local time and set UTC
Nah it's utc it seems
datetime.datetime.now(tz=datetime.timezone.utc)
datetime.datetime(2021, 11, 20, 16, 11, 56, 78825, tzinfo=datetime.timezone.utc)
nah, that likely means your container is utc then
I'm running on my system
well yea, that converts it
Ah, that's what I meant
Yea, giving it a tz will convert the local time to that tz

