#dev-contrib
1 messages · Page 141 of 1
they did it at the CF level too, so all typing called just get 403'd
which means any command that triggers typing fails, since the typing call errors
Thanks now I need to make all of my commands that use typing catch it
I'm currently monkey patching d.py
this also means @slow bone just doens't work at all
so I'll port this patch over there
I think mine does right now lmao
Since I only listen for typing events on two places in one method
:)
You pushing this patch to pypi?
no, was just going to monkey patch it in bot
but now we're looking into dropping any requests that match https://discord.com/api/*/typing at the point of egress from our cluster
ah
that's annoying ngl
we can't do it anyway, or not quickly
we don't break tls by default nor do we have SNI filtering ready
we can only block IPs
that would work /s
just block discord's IPs
now you won't have any bugs
honestly this is probably related to facebook and whatsapp being down
ppl using discord because they can't use those
probably
If for the API, UTC is probably the most logical
Or you could be nice and use my TZ :)))
we should change out the template probably, make it a bit more pydis
oh uh, no, i'd keep those
Probably just set the formatter there to the one we use, and don't include root. Then in the actual program set up the logging for the project itself
Don't you need the models before? I mean it would make sense to have the models, and then set up the migration environment.
Oh, okay. Cool. 😄
So what are these loggers for
When are they used basically
Okay, in that case it doesn't matter much
The only real change you can make is set the formatting string from pydis projects, but that's not really necessary
as is is fine
@vale ibex there's a proper thing to check rather than 403s
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
40006
is that the code they are actually giving
because we've been getting cloudflare 403s
we can check that as well in future, but the error today which is the one we are targeting is not this.
It would be that code if it was actually the API returning that
Well
lol
If that's what you're getting
Then it should check if it was a cloudflare 403
It really doesn't matter
we aren't expecting a 403 anywhere else
it's fine as it is.
this is a fix to work around something discord deployed in a way they probably shouldn't have
It does, cf will ban bot temporarily if too many legit 403s
and that's why we've got a warning on it
That's why we're logging, also this is not something we're expecting to happen often
Especially not from the typing endpoint
If we're getting global 403s on all other endpoints, those will still work as normal
Ah
We migrate away from linode

The ban should be upp
at some point I'm pretty joe can just "yo... can you unban? kthxbai"
Tbh we can deploy another node super easily lol
Since they have 3 nodes, and bans last 30 minutes per IP
yeah i have a button that says recycle node
It takes like 5 minutes
we have as many nodes as we want lol
Ofc the second time it goes to 90 minutes
Is it like on your desk, under your bed, etc?
Oh true, there is recycle too
Don't ask how I know 👀
Big red button hidden behind a painting
Honestly I don't expect discord to actually unban Joe's IP in cloudflare lmao
where my image
@fallen patrol :warning: Your eval job has completed with return code 0.
[No output]
not as critical but probably at some point
Ok
Heh, I vote for letting sir lance be broken for now
Who cares, it almost doesn't use typing events
Even if it does, not a big harm
Set user_typing to 0.
lol
any idea why?
Bot uses a shitton of typing requests
?config set user_typing true
Set user_typing to 1.
alright we'll monkeypatch
Since you already have a fork, it's worth just patching it to not make any requests lmao
we just need to update our fork
Ye
or we copy the change from bot which is easier
I'd like, just patch the method to not do anything
Since the bot uses it in a crazy number of places
Actually
@patent pivot one sec, don't do anything
You can just monkeypatch with an eval command if you want
oh lol devops just merged a PR
Ah okay
The unofficial kyb3r modmail monkeypatch is this
from discord.context_managers import Typing
class MTyping(Typing):
def __init__(self, messageable):
...
async def do_typing(self):
...
def __enter__(self):
...
def __exit__(self, exc_type, exc, tb):
...
async def __aenter__(self):
...
async def __aexit__(self, exc_type, exc, tb):
...
def typing(self):
return MTyping(self)
async def e(*a):
...
discord.abc.Messageable.typing = typing
discord.abc.Messageable.trigger_typing = e
And that can just be evaled
Although that will work for any bot, actually
Who's familiar with our redirects apps
Need someone to help me debug the tests
As in, can you recall every single piece of it from memory
Nah lol
I have my work pushed on:
http://github.com/hassanabouelela/site-1/
pythondiscord.com - A Django and Bulma web application. - GitHub - HassanAbouelela/site-1: pythondiscord.com - A Django and Bulma web application.
if you have a look at apps/redirect/tests.py, I have that test skipped
If I remove the skip, the tests fail with:
Failure
Traceback (most recent call last):
File "pydis_site\apps\redirect\tests.py", line 54, in test_redirects
self.assertEqual(1, len(resp.redirect_chain))
AssertionError: 1 != 0
That * 37
It's probably something stupid like me forgetting to load the app or something
I wonder if the app has to be loaded before the others
Yeah that's exactly it
Okay I hate life a little right now
Lmao
Depends on the reviews 😄 So unfortunately, I don't.
Hi
alembic/versions generally
I’m not sure what you mean
I’ve never had to explicitly configure offline migration stuff with alembic
My review wouldn't mean anything, I hate sqlalchemy and have barely used it
Awful orm imo
incoming @fervent sage, but i dislike orms in general

granted i really only played with them in rust not so much in python, but still
horrible experience
we have a policy here that all projects have to be able to migrate themselves so generally no raw sql unless we use an sql migration manager as well
he's joe's outsourced prom dev
it’s why we added an orm to pixels
I haven't done this yet
but will before we run the next event lol
fair enough, though you can write migrations by hand
joe does not need to be a human migration tool
Why can't there be any good orms lol
(You got time... .... but not too much time)
its really really really (really) hard
yea, we had always planned for it to be a recurring event
it totally isn't based off sql alchemy
We even have pixels tentatively scheduled~
you would be correct
yeah, it’s generally less work to use an orm though, as kat says the policy is no Joe as human migration tool
I am honestly curious how the hand-crafted SQL used for Pixels will be with SQLAlchemy...
I'm curious too lmfao
Nah joe memorized all the code and types it out by hand on demand
we can do raw sql migrations
the view is what I'm worried about
went through a few revisions to make sure it was performant
That's exactly what I was thinking about
I don't even know where to start with it haha
It might be alright with numpy
or some thing like that
hmmm that loses a lot from the init of the cache though
yea, needs more thought lol
Ah, true. How does SQLAlchemy handle ON CONSTRAINT? Will we have to have a try/except?
I think so, yes.
Bruh
https://615b32be1025c010fb532b0e--pydis-static.netlify.app/pages/guides/pydis-guides/contributing/bot
Gives me "page not found"
I’m aware of most things not working, just thought that one did
ic
Interestingly sir-lance stuff is a folder unlike bot
Okay brb
@cold island omgomgomg that observation seems to have fixed most things
Pushed the fix, so unless anyone finds anything else that's broken, the only thing left is CI
Did you mean to use the main branch or mine?
right, so I have to deploy manually, forgot to deploy yours
Ugh are all events links broken
Alright, I think I know where to go
Oh yeah I did zilch on events lmao
Wait where are the event pages on the repo
uuuh sec
pydis_site/templates/events/pages/
but... how do those urls even resolve
Lmao
https://615b790fb7ab6715673660c2--pydis-static.netlify.app/
How's this
Also preach y'all for being my dedicated QA
I don't even
Brb again
Um
Where did you find that link
It seems to be a redirect, which wouldn't work with this
Alright, that's a tougher challenge
Getting redirects to work statically hmm
For sure lol
Here's your reminder: Test sir-lancebot#860
[Jump back to when you created the reminder](#dev-contrib message)
btw @gritty wind how are you actually doing these
Which aspect
the whole shazam
The static building is distill_django which does basically what you had in mind
interesting
I'm not sure if making redirects is worth it or not
On the one hand, they are used on the site
On the other, I can't even begin to fathom how they work
Also the library I'm using doesn't support 301, so I have to handle them by hand
I think for now being able to view the right page is good enough
@trail pilot
I keep getting this error when trying to get Sir-Lance running from the docker file (I did poetry install and have the added dependencies)
sir-lancebot | discord.ext.commands.errors.ExtensionFailed: Extension 'bot.exts.utilities.challenges' raised an error: ModuleNotFoundError: No module named 'bs4'
sir-lancebot exited with code 1
When you did docker-compose up did you add --build?
In most of our projects we define volumes within the docker compose. This means any code changes don't require you to rebuild docker images.
However, changes to dependencies or the Dockerfile itself still require you to docker-compose up --build to rebuild the image and get those changes in
C:\Users\Brad\Desktop\python\programming\sir-lancebot>docker-compose up --build
Building sir-lancebot
[+] Building 0.0s (1/2)
=> ERROR [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 786B 0.0s
------
> [internal] load build definition from Dockerfile:
------
failed to solve with frontend dockerfile.v0: failed to read dockerfile: error from sender: open \\?\C:\Users\Brad\Desktop\python\programming\sir-lancebot\lib64: Access is denied.
ERROR: Service 'sir-lancebot' failed to build : Build failed
That's not good
Do I need to compose down?
Same error (it was stopped and built down)
Never seen that one before
I just swapped back to my wtf-python branch and built it back up
Can you link the pr?
sir-lancebot#860
I was trying out the gh pr checkout 860 command to test things locally
Huh can't see anything that should cause an error like that
I'm on mobile, so can't trouble shoot too much
I can look tomorrow if you're still having issues
Yeah its pretty weird. I can run it just fine with my own branch
Even the docker-compose up --build
chown $USER . 
@kindred oriole Check out this message in particular: #dev-contrib message
If you're still confused about anything after reading that, go ahead and ask here.
Hi. Are there any projects/repositories on the Python Discord GitHub that are designed to help introduce someone with intermediate level experience to contributing to open source software projects? I have 9 years experience coding in Python but little experience actually writing functioning code. I want to learn the ropes, but don't know where to start, and was given the advice to join a project on the Python Discourse GitHub. Sorry for being so long-winded. Thanks in advance!
Ok I didn't see that, I already wrote my comment.
Haha, no worries.
I guess I got my answer, it says what projects are for Beginners etc.
@timid sentinel did you try this?
would that fix the circular import problem? I think that would still cause contants.py and services.py to be ran before logging is set up
we setup the log in the init right?
Ah, I think I can see the issue now
not sure if this fix would deal with that or not
To be clear, the "level" is about knowledge of Python and some specialized frameworks. For example our site uses django extensively. But if you see something on the bot repo that interests you more than on lancebot (for example), there's nothing preventing you from trying your hand with one of the issues there, we'll help you set up the project anyway if you need it.
The contributing page mentions our three "main" repos, but we have other repos as well which might interest you more depending on your knowledge. You can browse them at https://git.pydis.com
I've been advised to start learning d.py at first, I will look at that, then bot creation, then look at the project. Thanks!
It could be a sensible thing to do anyway, although as the logging relies on constants.py I don't think we could have logging there unless we make logging just read any config from env vars directly or something.
With the stuff in the utils folder it's a bit weird as logging doesn't actually need most of it, but by accessing the one file it needs runs some others as a side affect (because the utils/__init__.py is run)
Actually, if we definite get_logger in the bot init file that might fix it, rather than importing it
wtf
That was it
WSL2 😎
That's a possibility yeah
Assuming you mean moving from bot.utils.logging to bot.__init__
Maybe even having it in bot.log?
Maybe defining in bot.log and then importing in bot.__init__? bot.log already gets imported
That way there wouldn't be any circular imports
that should work, yeah. sounds good. whether we want to import get_logger from bot or bot.log I wouldn't mind. I don't think it would make any difference technically. Defining it in bot.log sounds good regardless though.
And then just remove all logging from constants.py, or replace them with simple prints?
Haha, perfect
I'd probably replace them all with print
Will work on that later (probably tonight)
Is there a specific way to mark a python file as having compatibility with only a certain python version?
I can't just do it using a package or poetry or whatever because it's just a utility script sitting along side the main project
Not sure I understand the situation
What happens if the Python version is incompatible
Well, the file may not run. If someone adds a walrus to it, it will just error out where it's used because walrus isn't valid in 3.8
I have no control over the environment it will be run in, that's managed
I left a comment at the very top of the file saying as much, but I'd like an enforcement method if possible
Check sys.version and exit if it isn't right?
Hm, not a bad idea
Though it will only stop developers that actually test it
which is never a guarantee
If the project depends on it, that means the project is incompatible with 3.8 isn't it?
You can also add version specifiers in poetry
It's a utility script that lives alongside the project. Let me explain better:
Site uses 3.9
Netlify uses 3.8
I need to run a python script on netlify, which I need to keep in the site repo
walrus was introduced in 3.8
Oh lol
Uhh... just think of any 3.9 features haha
Anyways, it's probably okay as is
list[int]
😱
It will raise value error?
TypeError
@patent pivot what's the process for updating snekbox to 3.10 (or really any new python version)? I would expect it to be a PR after testing locally to make sure the packages are happy with 3.10, but I feel like I'm missing something else.
We discussed it this morning in a mod channel
The first main blocker is that 3.10 hasn't been released on docker hub yet, so we'll have to wait for that.
In terms of what needs actual testing, we'll want to try out the libraries. Most of the errors are probably going to happen during installation, so they're easy to catch. Some libraries just won't have wheels, and for those our best option is either to drop them, or halt the entire upgrade process
why did it come up in a mod channel in the first place 
mod-channel -> modmail thread
and the answer to that is because someone opened a modmail for it lol
as scale said:
- wait for docker
- see if deps install (right now I think we rely on wheels for almost all deps, not all of them will have 3.10, so we might have to have some workarounds)
- upgrade docker image and run tests, no actual snekbox functionality should change with this
RE: sir-lancebot#842 I am just a bit lost on the re-structure
I can take a look if you like
Go for it, there is a decent conversation chain too.
Also for the docker issue last night, got that fixed.
ah nice
.
For reference
Did you mark is so that contribs can edit?
I can try lol
I started the PR before I was a helper so it is on my fork
When you edit the PR you have a button "Allow edit from maintainers" to do that
It gives people with write access to the target repo write access to your fork on that specific branch
So there you go
Chris should have write access
python
From origin or upstream
yea, have you got anything locally that isn't pushed?
Started a color 2.0 to sketch out my thoughts, but not worth keeping. No commits or anything to push
kk cool
I've made edits directly on your branch
on your fork
so you should just be able to git pull -f
From https://github.com/brad90four/sir-lancebot
* branch color-677 -> FETCH_HEAD
Merge made by the 'recursive' strategy.
.gitpod.yml | 5 +
README.md | 1 +
bot/constants.py | 3 +-
bot/exts/core/extensions.py | 2 +-
.../events/hacktoberfest/hacktober-issue-finder.py | 8 +-
bot/exts/fun/hangman.py | 182 +++++
bot/exts/fun/quack.py | 75 ++
bot/exts/holidays/halloween/spookyreact.py | 8 +-
bot/exts/holidays/valentines/lovecalculator.py | 3 +-
bot/exts/utilities/bookmark.py | 13 +-
bot/exts/utilities/emoji.py | 4 +-
bot/resources/fun/hangman_words.txt | 877 +++++++++++++++++++++
12 files changed, 1164 insertions(+), 17 deletions(-)
create mode 100644 .gitpod.yml
create mode 100644 bot/exts/fun/hangman.py
create mode 100644 bot/exts/fun/quack.py
create mode 100644 bot/resources/fun/hangman_words.txt
cool, that looks like it
you should be good now
I've rebased your branch onto sirlance main
Alrighty
fwiw I didn't make any code changes on your cog, so you might need to update it for the new paths to things
Should be ok, still have the referenced color name / hex color file in the PR that hasn't been added yet
But what I was hung up on was how to restructure the color.py file based on LX and Bluenix's recommendations. I can't wrap my head around what to restructure in a sensible way
ohhh, when you said restructure, I thought you were referring to the restructure we did to lance recently
Haha no, I got that one handled earlier 👍
I wish it was that one, would definitely make my life a bit easier
I find the cog fairly okay-ish organized
i think what the suggestion is for there to be one group command color
What could help is:
- Separate color transformation into another file
- Use a dictionary to select the right function
- Make use of colorsys when available
and then have each mode be a subcommand of that
Oh, I thought it was about the code 
Rather than have this ```py
if mode.lower() == "hex":
await self.hex_to_rgb(ctx, user_color)
elif mode.lower() == "rgb":
rgb_color = self.tuple_create(user_color)
await self.color_embed(ctx, rgb_color)
elif mode.lower() == "hsv":
await self.hsv_to_rgb(ctx, user_color)
elif mode.lower() == "hsl":
await self.hsl_to_rgb(ctx, user_color)
elif mode.lower() == "cmyk":
await self.cmyk_to_rgb(ctx, user_color)
elif mode.lower() == "name":
If we convert this to a dict, it will be waaayyy less duplicate code
Like, multiplying subcommands is way more copy paste than that
at that point you wouldn't have the functions though
the functions would be the sub commands
"Main" color command: parses user input with regex -> goes to sub command?
match case 
so you'd have !colour be the parent group command
and then have commands under that for each conversion
The PR clearly says it is !color
Color with an alias for colour
!colore
time to request changes to change the command to !colour and auto-ban for !color /s
@commands.group(aliases=("colour",))
async def color(self, ctx: commands.Context) -> None:
await invoke_help_command(ctx)
@color.command(name="hex")
async def hex_to_rgb(self, ctx: commands.Context, hex_string: str) -> None:
...
@color.command(name="hsv")
async def hsv_to_rgb(self, ctx: commands.Context, h: int, s: int, v: int) -> None:
...
each color.command is a subcommand of color
Oh
hello docstring copy pasting
lol
So instead of static methods or class methods they would be sub-commands. Would they get called directly from when the user uses the color command or would it be able to be called from the "main" command?
Calling .color would just show the doc string of the group command
calling .color hex would call that function directly
Like if the user does .colour rgb(255,0,0) I will need to regex that to match the "mode" and parse it to get the rgb values
Well, I'll need to handle all of the cases
yea, each mode would have it's own sub command
exactly
Ahh
How would I handle sending the user's input to the correct sub-command?
Negatory
the fuinction args of each subcommand become the accepted input
Discord handles calling the right arg, and will error if the user input doesn't match the args
EG in this case you would do .color hex FFFFFF and .color hsv 255 0 0
and discord.py would just work
That is sorta what I have with my "modes" if/else structure
LX brought up the point to handle rgb(100,100,100) or rgb (100,100,100) or rgb 100,100,100 or rgb 100 100 100 etc
yea, so in this case, you would force the last one with sub commands
the good thing about doing it this way, is that the help text gets automatically generated with what the input should look like
!mute 3
Could not convert "user" into UnambiguousMember or UnambiguousUser.
3 is not a User mention, a User ID or a Username in the format name#discriminator.
!tempmute <user> [duration] [reason]
Can also use: mute
*Temporarily mute a user for the given reason and duration.
A unit of time should be appended to the duration.
Units (∗case-sensitive):
y - years
m - months∗
w - weeks
d - days
h - hours
M - minutes∗
s - seconds
Alternatively, an ISO 8601 timestamp can be provided for the duration.
If no duration is given, a one hour duration is used by default.*
!tempmute <user> [duration] [reason] describes the interface
and the stuff below that is the docstring for that subcommand
you cant perma mute
!src tempmute
Temporarily mute a user for the given reason and duration.
Ok, good stuff to chew on
Might need to break a lot of things before they are working again
@elder belfry CC for you, had a convo about the PR
Starts here
Using python3.9 (3.9.7)
installing dependencies from lock file
No dependencies to install
Even though it says no dependencies to install I am getting discord.ext.command.errors.ExtensionFailed: Extension: 'bot.exts.fun.typerace' raised an error: ModuleNotFoundError: No module named 'markovify'.
Why?
We're able to edit a mute to be permanent, but not permamute directly If I remember correctly
site#594 needs reviews
Should the shell commands be swapped? Need to add the remote and then rename it right?
No, you rename the pydis origin to upstream and then add your own origin
Copy, since you are assuming someone is following this the first time and has forked & cloned the repo locally
markovify exists in poetry.lock as well
Try poetry update
I still get the same error
Ty brad
Is this a bot that you have running in Docker?
yes
Have you reloaded the cog in your test server?
wdym?
Or stopped the docker container and then started it again since you did your poetry install
.c r <your command you are testing>
Is what you would run in your test server to reload the cog (assuming this is universal and not just for sir-lancebot)
The error happens when I run the bot itself
Hmmm, is this for a PR? I don't see that file in the main branch.
I don't see a typerace.py there
yes cause well its in my forked repo?
import urllib.request
import markovify
import discord
from discord.ext import commands
from bot.bot import Bot
I think it involves docker, but I have no clue. I don't think there is anything wrong within the edited files.
Are you sure markovify is in the poetry.lock? Did you run poetry add markovify?
Well I deleted the images and ran docker compose up and now its working
Yes
I have no clue what was happening before
if you change dependencies, you need to do docker-compose up --build
oh
Damm Chris I was gonna say that 😦
I usually use docker-compose build though. I don't remember if I managed to get that to work honestly
build works too
the message I just pinned explains why
You would think that Helper you explained that to would be able to help others with the same problem 😅
Depends how complex it is
Yea that seems like most of it would go by making it a sub command
Alr
Wait I am confused, wasn't Brad working on this?
All good, doublev has volunteered to help out
I have been struggling with getting the new structure "on paper"
Sweet, LX had mentioned maybe pulling those out of the class and into the module level, so that way we can remove the staticmethod calls.
I guess those would then need to be moved back called in to the subcommands?
Would it return a tuple explicitly from the "if all 0" check?
Uh where is that
That will later be used to look up a color name, so it is good to have the "#" there
Hey! I would really appreciate if someone could take a look at api#17 , it still needs a "few" reviews.
How can I "undo" pushed commits, without locally deleting the changes made? I'm wanting to split a commit into two commits to make it tidier and not sure how to do this
uh u can use soft reset using head
so something like git reset --soft HEAD~1 which will remove your last commit.
Thank you
And I'm guessing HEAD~2 will revert last two commits?
ye
Did you see my comment here, and the comments that followed it? https://github.com/python-discord/sir-lancebot/pull/842#issuecomment-927134556
Has the plan changed?
yeah that worked perfectly, thank you very much 👍
That's a lot of god damn conflicts
Could anyone who can dismiss the reviews on sir-lancebot#860 which requested changes since I implemented those changes?
Ah right, I see. So the plan now is to use command arguments for the colour components, and not to support e.g. ```
.color rgb(0, 0, 0)
👍
How do I resolve conflicts when I can't even see them? 🤔
I think it's like 90 conflicts
bot#1831
I'm happy with that. It does negate the need for parsing the input yourself with regexes, which can be a pain 😄
It's probably just merging in the restructure nvm it's bot not lance
Although, can we get a comment on the PR stating this explicitly? So that anyone contributing/reviewing can see what the intended behaviour is.
Someone please help lol
Do it locally
Which PR is it?
How though? I don't know how to view the conflicts in PyCharm
This PR ^
Hey Blue, is your recent comment regarding limiting the length of the user input?
Huh, interesting that you got so many conflicts
I think you should simply rebase from main. If there are conflicts Git will walk you through them
uh can't see u those conflicts using git?
Its says can't show in editor
How do I do that?
Can't tell if it is a bug or a feature 🤣
I'll add a minimum certainty too
Which PR is this?
bot#1831
my god
uhhhhhhhhh
I can't even see what the conflicts are
is it even worth it to continue with this specific PR?
Well it depends on what the conflicts are
I can't even see the conflicts at the moment
These?
It could literally just be because I'm changing the import or something
@static canyon I thought you already looked into them, that's why I made this comment
Looked into what?
the conflicts
As I keep saying, I can't even view the conflicts
I'd guess it's from a PR like this one: https://github.com/python-discord/bot/pull/1825
smh Numerlor 😤
I understand, I just thought you had previously been able to look into them. I hope everything goes well here, prob best to make a backup branch locally.
I don't think I'm explaining myself properly because no one seems to understand.
I need to know how to view what the conflicts are. How can I view them?
Hey Blue, I currently have the certainty set at 50, I'm thinking to bump it to 75?
There really isn't a how?
When I click on the pr at the bottom it just shows the conflicting files
There is a how
oh there is
You can see my testing in the testing server. Maybe give it a try with the same inputs?
I'm not asking what the conflicting files are.
I'm asking what the actual conflicts within those files are
I think how I used to do it in pycharm is just pull main and then it'll tell me all the merge conflicts and I manually went through it, but there was a much better way than that
I think a git gui has a much better way
Just wanted to drop this cause thought it might be helpful: https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts
iirc if you try git rebase -i origin/main after git fetch you should be able to go through the conflicts, might not be the best way to do it though if you want to just view them
So git fetch, then git rebase -i origin/main?
ye
Thanks, I'll try that
this would be more for resolving conflicts though
Yeah, I'm wanting to resolve them
25 conflicts, and they all seem to be easy fixes
Yeah so what that will do @static canyon since you haven't worked a lot with Git is that it re-applies the commits onto the new head.
That means that when the branch originally branched off (also called based on) will change. Moving the whole thing by re-comitting the commits.
Essentially what Git will do is take your changes and apply them on the new base/head (which you decide is the newest commit of main). As if you would commit the same changes there again.
This of course can have conflicts because Git is working with old commits, which is exactly what we want. You will have to force-push after this though
Did ya break it
Right yeah, that makes sense. Thanks for the explanation 👍
Add this after line 66:
buffer.seek(0)
I don't think you need the await on line 67
noice
Could you test it with
.colour rgb (100,0,0)
.colour rgb(100,0,0)
.colour rgb 100, 0, 0
.colour rgb 100 0 0
But should it?
Lmao
@cold island ziggy zig zig more pings for my favorite zebra.
I did a thing:
https://github.com/HassanAbouelela/site-1/pull/8
I still haven't looked into redirects, but the guides should be live and building automatically
Alrighty, I was under the impression to be as flexible as possible when it came to handling the user input
Lol
Yea, that seems about right
It's not my branch lol
It might be worth looking into using inline fields, so that you use more width, rather than making a long embed
hm?
Yeah
Haha it's a bit confoosing
Very cool 👌
You want to add that to the site repo?
I think it will confusing with so many numbers
Is there a sixth mode we can add, so the columns are balenced?
it would make the embed look better
YIQ? lol
@static canyon very nice job on fixing conflicts.
That's the idea once I hammer out a few bugs
not sure about the brackets though, we should probably keep those
very nais
I just found more missing urls
When someone has time could they merge site#594? All checks and approvals are there
I have site#599 blocking my changes for static previews. It's just updating http links to https. Would appreciate a review :D
I need a review from an admin or Kat
That sometimes makes things look neater.
ty 😄
And thanks for the assistance with viewing them
hmmm can you try with code blocks and brackets?
@clever wraith where are you testing this?
I've got a feeling a lot of people are gonna try .colour hex b00b69
Is this not currently supported?
bot#1798 and bot#1806 seem to have fallen through the cracks unnoticed. I opened them just over a month ago, and they never got the second required review. Would appreciate any reviews anyone can give 👍
Ohhh right 😄
No it is
Nevermind
The sixth should be the name
Just oblivious as always 😄
I wonder what colour that is though 🤔
Ah
Quite a nice colour actually.
Kind of fuchsia.
YIQ is a float
Alright, that sounds like a good idea 👍
which is why it's weird
IE its 0.0-1.0
maybe just round to 2 d.p and it'll be fine
You can just multiply by 255 and round it
Prob mine too ngl
Go do your homework
damm congrats on becoming helper 
Thanks! Sorry for the delay lol
@gritty wind so for how long does the netifly link work
It's supposed to be a permalink
Is there like... a limit?
From forms experience, they basically work forever
interesting
It should create a link only when site content changes I think
And not API stuff
That granularity really isn't feasible, but creating deployments doesn't cost anything
alr
Either way, it'll eventually be moot once we separate API out
yeah
Just flexing on you poor, non preview-having peeps at this point 🦾
hi - super quick review https://github.com/python-discord/site/pull/601
Preparing for our move to www.pythondiscord.com
just adding www.pythondiscord.com to ALLOWED_HOSTS, literally one line
actually might need to change PARENT_HOST as well, cc @gritty wind does that change stuff you're doing?
So what’s allowed-hosts used for
ALLOWED_HOSTS is just a django filtering step to control what hosts can be used to access django
PARENT_HOST i'm not sure about, but we need to change it from pythondiscord.com to www.pythondiscord.com
PARENT_HOST isn’t easily available during build time, so I use a mock value, which is string replace after the compilation is done
I don’t think hosts are enforced with the static build
pydis_site/settings.py line 201
PARENT_HOST = env('PARENT_HOST', default='pythondiscord.com')```
Okay that should be fine
alright sweet
uhhh once i change this yea
Why are we going to www anyways lol
Bump
me and chris read https://www.yes-www.org/why-use-www/ and it sounded about right
Nice
It’s missing a review from a core dev Kronifer
Oh is it just content
Alright you’re good to go
Did something break Joe
lol nah
chris told me i was wrong
hmmm
so
https://www.pythondiscord.com/ works fine
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
the links are all built without www
Yeah parent host sets that lol
iirc parent hosts would also mean subdomains get put under www too
if we put www in there
do we use CommonMiddleware?
if so, we can set PREPEND_WWW to true
I’ve only had bad experiences with django host tbh when do we remove sub domains smh
seems about right
cc @vale ibex @gritty wind https://github.com/python-discord/site/pull/602
Is any of this actually testable

Could deploy it on my own domain, buuuuutt it’s easier to just approve and see if it breaks
it entrely breaks dev lol
since it pushes to www.pythondiscord.local/*
IG we just need to get contribs to add www. to hosts?
like we do for other sub domains
I guess, or we conditional in development
I'd rather deal with hosts, rather than conditional it
hmm yea
if you set this up does it work as intended
gives me django auto docs
yea then it works
nice
ah, yea 😄
yeah that's fixed the links
just did to
is there some rollout delay?
cache
try now
hmmm it's 302'ing
i want 308
What's the difference between a 302 and a 308?
oh ok
I think 308 also means search engines replace their indexes too
yeah
Oh that's interesting
alright I think banks has found the answer
need to put on some 80s pop to write nginx configuration

Yea I have no clue with nginx ingress lol
Should read up on it at some point
But I'm in bed now, so today is not that day 
lmfao
i will resolve this i will do everything it takes
oh I know why
forgot a location block around it
alright solved it I think
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/auth-tls-verify-client: "on"
nginx.ingress.kubernetes.io/server-snippet: |
location ~* / {
return 308 https://www.pythondiscord.com$request_uri;
}
nginx.ingress.kubernetes.io/auth-tls-secret: "kube-system/mtls-client-crt-bundle"
nginx.ingress.kubernetes.io/auth-tls-error-page: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
name: www-redirect
spec:
tls:
- hosts:
- "pythondiscord.com"
secretName: pythondiscord.com-tls
rules:
- host: pythondiscord.com
http:
paths:
- path: /(.*)
pathType: Prefix
backend:
service:
name: site
port:
number: 80
that was the answer
pretty clean in the end tbqh
Nice nice
writing a #dev-announcements about the hosts recommended changes
hmmm i'd hang fire on that for now, me and volcyy might get subdomain removal through in coming weeks which means we don't need to care for this
Ah nice
okay I checked google docs, the 308 should be enough to indicate content move
What is everyone's thoughts on changing out reactions to a view for some games in sir-lancebot
Sorry, I don't understand. Could you please rephrase it a little maybe?
Instead of reactions doing the pagination, having different views in a dropdown type thing?
Oh oh ok yeah that would look a lot better
I was more thinking using views for stuff like tic-tac-toe and the likes
What do you mean by "views"?
views are discord's new UI
Hello
I am interested in contributing. Is there something I can help with, or somewhere I can read up on what needs assistance?
@patent pivot why migrate to using www?
me and chris read https://www.yes-www.org/why-use-www/ and it sounded about right
Me is joe
I just see a 404 no sign of a 308 for this url: https://www.pythondiscord.com/rules
@patent pivot 
It's /pages/rules
But yeah, /rules used to redirect to /pages/rules
Redirect from /guides to /pages/guides etc. are also broken
Alrighty, thanks
Makes sense, even though I love the clean look of not using www
I think we broke the short urls, didn't we
Okay, it just doesn't use short urls on www.pydis.com, @patent pivot might want to add a CF route for that one
apex domains go brr
uhhh
those are in app
I did what this message said to try: #dev-announcements message
aaaaaaaaaa @patent pivot you made me have an iternal debate about www or no-www again
I don't get why redirects aren't processing
The redirects app is black magic
Is it imaginable that we drop them in the future
I really don’t like the idea of having to maintain them forever just to keep backwards compatibility
why dont you just do a pagerule that redirects non www to www
The redirection in general already works
But we have separate dynamic redirection rules which are not designed with that in mind
And seem to be unable to parse the links with www
Default redirect is working, but short links aren't working on www.pydis.com, which makes me think the worker has a misconfigurated route
I can make them work
why doesn't /rules work on pythondiscord.com, I could have sworn it did
Unless it is some form of caching on my device
The rules of our community.
This works without problem
https://pythondiscord.com/rules has never been a thing
The problem is https://www.pydis.com/rules does not work
ah right
not sure if the www rules apply for short url domains
Currently it doesn't, but I think it should
why
you get none of the advantages and a longer url
unlike the normal domain where there's technical advantages
Well, I could see some people trying to access it using that url
it doesn't hurt to support it here too
Morning all!
P0 approval needed: https://github.com/python-discord/bot/pull/1859
merged
I actually wonder why it took so long to connect
I don't even see the startup sequence in the logs
In the grafana log
You done this?
Ah it's no problem. I can do it, if you like?
Great stuff 👍
more or less
Unfortunately, it is not. At least 2 approving reviews are required by reviewers with write access. :/
However, there's a reason to those checks. 🙂
No, you don't.
Or.. be patient. 😄
It has to be reviewed thoroughly, anyways. 🙂
@molten perch @clever wraith Contributors count
The check where contributors count has not been setup on the api repo, as far as I see.
Yes, it uses the GitHub branch protection rather than the policy bot check
o rly
The API repo? I don't know anything about fast API
^ Or how to test it
Oh, could any of the members on sir-lancebot dismiss a few stale reviews?
on sir-lancebot#860
Because I implemented the changes on both of them
Actually, you can. However, not the API itself, but the SQLAlchemy models. 😄
you mean @timid sentinel and @static canyon right?
yep
I implemented the changes for both those reviews
You should ask @hardy gorge
I've dismissed both reviews so they won't block the PR @trail pilot
Thank you!
uhhh… like all our other projects lol
Now all that's left is an approval from a core dev
Sounds good
hello migrating I am dad
arthur cj trigger blackbox
:tools: Pick a CronJob to trigger
🌬️ Spawned job blackbox-895401745872715807
Why did @radiant merlin 's avatar change to a sun??
it's the KA icon
Oh it is? I remember it used to be a photo of King Arthur
👋
I didn't know about that. However, I still believe it would be more convenient.
arthur deploy ls
Deployments in namespace default
+----------+------------------------+------------+
| Status | Deployment | Replicas |
|----------+------------------------+------------|
| 🔴 | bitwarden | 0/0 |
| 🟢 | black-knight | 1/1 |
| 🟢 | bot | 1/1 |
| 🟢 | code-jam-management | 1/1 |
| 🟢 | forms-backend | 2/2 |
| 🟢 | ghost | 1/1 |
| 🟢 | grafana | 1/1 |
| 🟢 | grafana-image-renderer | 1/1 |
| 🟢 | graphite | 1/1 |
| 🟢 | h-asgi | 1/1 |
| 🟢 | hastebin | 1/1 |
| 🟢 | king-arthur | 1/1 |
| 🟢 | logcord | 1/1 |
| 🔴 | metabase | 0/0 |
| 🔴 | metricity | 0/0 |
| 🟢 | modmail-bot | 1/1 |
| 🟢 | modmail-web | 1/1 |
| 🟢 | mongodb | 1/1 |
| 🟢 | olli | 1/1 |
| 🔴 | pixels | 0/0 |
| 🟢 | policy-bot | 1/1 |
| 🟢 | postgres | 1/1 |
| 🟢 | prestashop | 1/1 |
| 🟢 | public-stats | 1/1 |
| 🟢 | quackstack | 1/1 |
| 🟢 | redis | 1/1 |
| 🟢 | sir-lancebot | 1/1 |
| 🔴 | site | 0/0 |
| 🟢 | snekbox | 1/1 |
| 🟢 | thread-bot | 1/1 |
+----------+------------------------+------------+
PG 14 is out? I feel like 13 was released 3 months ago
Even though it's been like a year
yes
README.md?plain=1 line 10
CI Tested PostgreSQL versions: `9.4`, `9.5`, `9.6`, `10`, `11`, `12`, `13````
emacs backward is scame
yo, can I get a quick approval on bot#1862
Could a core-dev look at sir-lancebot#860 when they're free? I think a core dev approval is the last one it needs before it can be merged
that bothers me so much
Oh that's switched now
The dropdown is above the button
Sorry lol I didn't read the whole PR
You're fine!
I can, but it wouldn't do anything lol
anyone who authored a commit is skipped by policy bot
Why would he do reviews when he can tell people to do them and they just happen
electric boogaloo
just from that screenshot no
what repo?
What are you trying to do?
not too sure
I'm not familiar with that repo
probably best off asking Seb
or just try adding it back and see if you run into issues
pre-commit isn't even in the deps
So there might have been something Seb was trying to check in a pre-commit hook that wasn't working
seems like a pretty similar setup to our other repos
I imagine it would just work if you copied from python or lance and added black.
one is guitar hero, the other is the best public transport the world has ever seen
The arrows show where there was a diversion in the tree
So from one branch to another
Dots are commits
arthur deploy restart bot
:warning: Please confirm you want to restart deploy/bot in default
:white_check_mark: Restarted deployment bot in namespace default.
no more hosts file 🎉
Anybody got something in need of reviews
Have you reviewed api#17? I've heard it's a big one rn
sir-lancebot#859 should be ready to test again (RE: matching anything, I have now set if a user query is over 50 characters it will not match, but the limit on the score from rapidfuzz needs to stay around ~60 for things to not break)
Are you sure that's the right number- nvm
No no that is definitely sir-lance with the problem, not me with a typo
Are those... metro lines?
tube map lol
What's the difference 
What the French call the métro we call the tube/underground. They're basically the same
Why the heck do you have so many lines wtf
Yeah, there's a lot lol
tube map is very cool
Da heck
I can't review what I can't test
...or can I?
If you have some experience with SQLAlchemy or with ORMs overall, you can test out the validations. It'd a huge help.
I've added Postgresql to the compose file, so it should work just fine.
¯_(ツ)_/¯
Time to learn SQLAlchemy I guess...
I can review content, but without really testing I would leave my review as "comments" rather than approval. I think it is a more robust review that way
That'd be the best. It's not that hard, I believe.
I appreciate the optimism in my abilities 
Nope, mods and higher
!otn s rick
What are you looking for?
I'm guessing if he has any ot names
Just a note for your functional review: relationships, and the embed validations are number one priorities. 🙂
Pretty sure that was there for a long time
@vale ibex can you pls check the cache length? I have an idea on why the cache isn't fully populated
len(guild.members) iirc
we've been checking it every so often, it's fine now
it must have been a one off issue


