#dev-contrib
1 messages · Page 16 of 1
@clever wraith Whenever you're available https://github.com/python-discord/site/pull/861#discussion_r1140457844
I just answered !
Sorry I'm on zombie hours. Yeah, reacting immediately. The checkmark properly takes and then the process hangs. But it's pretty consistent at this point.
Weird, I just opened a thread with no issues
And we're still getting new threads from other people
Re.
I honestly don't know at this point.
I thought of just changing the definition of what permanent means, which is a date that's so far in the future that no human being will reach.
One other approach was to represent each modification in its own row, with a before & after state, and related actions on the same infraction would have some sort of correlation id that'll later be used for aggregation.
To recap, the easiest solutions would be
- Changing the definition of permanent (to either 0, which is epoch time, or the non reachable constant date in the future)
- Using the JSON approach.
I'm not sure we'd want to over-engineer this.
As much as I don't want to mix in JSON, it might actually be cleaner here.
Here's the history of it more or less. Figured I'd draw attention to it. I realize that it's not a PyDis bot, so the solution might just be deal with it.
When's the last time it happened, relative to now?
yeah I asked for the relative time so I don't have to do timezone conversions haha
:p that would be 19 hours 40 minutes according to google.
hmm yeah nothing useful in the logs. Maybe trying to react again would work next time it happens
It either doesn't register the reaction event or it fails silently
Well those are chains of reacting several times in a row.
I can physically see the reaction take, it'll hang for a bit then just give me a timeout message.
(By see the reaction, I mean two green check marks, one mine one modmails.)
These aren't separate attempts to send a message? when it sends the timeout message it means it stopped listening to the reaction
Oh, sorry I misunderstood. I don't believe ticking the react does anything but I'll try again next time.
My brain is squishy from my current projects
I'll let you know if the issue persists and some better timestamps and more granular detail of troubleshooting.
I am going to resume development on adding an error handler to bot#2446 as I will be going inactive(just for coding can still click the buttons like commit suggestion and reply to reviews) after 4 days and I don't think we will be able to merge bot#2436 and bot#2439 before that. Wookie will need to rebase his prs onto mine if my one gets merged before which is what I am expecting.
Sounds good. We'll resolve the conflicts one way or another
Okay, I updated the pr and added it.
@clever wraith are sure about the namespace thingy for stats? Like they work how you described it? If yes, I am committing the requested changes for the stats.
No I'm not, which is why I said I haven't really worked with them before.
I'm not sure how we aggregate the results for later usage and whether we want to have this level of granularity but i guess not.
I'll confirm this later when I'm on my pc
You can keep it as errors.
No need to namespace them for now
@cold island @clever wraith shouldn't interaction audits be in their own table pointing to the interaction? so every time it's update a new table is inserted into the interaction audits table
Do you mean infraction ?
yeah
That's what we had discussed in the issue.
They will have their own table, and both will act as a source of truth, e.g. we can construct the infraction state out of the action iterations that took place on it
It's kinda like an "event store"
I only was reading the part about json in this channel
and was responding to that section
JSON is to record what fields were edited, since they're dynamic and we can't use null for "not edited"
but it'll be a field inside the action record
Why not use multiple columns instead of serialzing and deserialzing json
Because we can't use null for "not edited"
Would make typing nicer
Sure make a column that says that
Edited: bool
postgres supports constraints across columns too
We discussed that
The thing, all the things we thought of were "meh"
at least for now
there are multiple fields that can be edited though
But isn’t json just that but without proper typing
And we wanted to go with the least "meh" one
Like json is basically multiple columns combined into one field
And the db can’t handle it for you
as someone who's done stupid database design before, json for this is gonna be a footgun
Sure, but the explicitness of a field not being edited is provided by its absence in the json keys
Which is not good design
Sure
have you seen soundboards
I mean, I'm open to concrete alternatives
Have a column that makes this condition you describe explicit
what condition
The one that’s marked by existence in the json
Instead of determining the logic by a key existing or not
Make that property a bool field in the database
I don't follow what condition you're referring to
^
This field
whether it's been edited or not
What scale is saying is that the reason/expiration can have null values, and next to them, there's another column that says it's been edited or not
At least, i think that's what he's saying
More or less
I’m not sure of the problem specifics
Why does nullity not work for this
because null expiration is used for permanent infractions
Alright, makes sense to have permanent field be separate
what does that mean?
One sec
Fields:
Expiry: optional[datetime]
Permanent: bool
What’s the second meaning to a null expiry?
Alright that seems like it would work with this design
What would the expiry field contain when permanent is true?
Null
So null means unedited unless perma is true?
Yup, just like it would with the json
How is it the same as the JSON 🤔
Json would require two conditions: does the key exist and is it null
Two fields would require two conditions: is it permeant, else is it null
But you get the support of the db engine when dealing with the field
There's no real reason to query actions that edit it to null
Sorry what do you mean?
You're saying two conditions, but we don't need to check them at any point. It's beside the point though. This is one of the ideas that floated yesterday that we didn't know if they were any good. But you're right that we should avoid JSON if possible.
@clever wraith Just a gentle reminder can you resolve the reviews that have been adressed by a commit for bot#2446?
I'll try to get to later this evening
Sure, thanks
I'm working on a new bot feature to ping the OP of help threads if it closes for inactivity and no one else replied. For the second condition, would it be sufficient to just check the thread's check_members method returns a list containing no one other than the OP and the bot, or should I iterate through all the messages?
there might be edge cases where someone else does get involved, and then manually leaves the thread. but I feel like iterating over all the messages wastes API calls. or maybe I'm placing too much value on API calls.
there's also the Thread.member_count attribute, but the docs say that this is "approximate".
I feel like just message count == 2 should suffice?
(discord.Thread.message_count)
it says it's approximate, but I'd hope for it to at least be accurate for n < 10 or so
sometimes (often) people ask their question over multiple messages, so I don't think that would be reliable enough.
There's logic in there to determine if no one else sent a message after opening a thread. It's how we determine whether to close the thread after 5 mins or not
Can find the function for you later when I'm at pc if nine else does first
Would just need to change it slightly to also support ignoring messages from the OP
bot/exts/help_channels/_channel.py line 174
async def get_closing_time(post: discord.Thread) -> tuple[arrow.Arrow, _stats.ClosingReason]:```
sort of the opposite to the logic in here
I have also added unittests for the app command error handler, it is fine right? bot#2446
@tight sand Sorry to ping again, but is there still changes needed for: bot#2388
(wrong dawn)
but i still would personally like to see https://github.com/python-discord/bot/pull/2388/files#r1089570481
This isnt you? 
that is indeed me
you pinged the wrong person in discord
i just happened to see it
one last suggestion for clarity
@static canyon for sir-lancebot#1179
You could combine them both since you're working on the issue and it's quite simple for a fix
Them = that one and the closed dm issue
Do you mean with sir-lancebot#1223? I was thinking that but someone said in that issue that it should be dealt with separately since #1179 exists
Idrm either way
Although if it's done as part of #1223 I guess Robin would have to do it
Yeah, not me
It was me
I'm working on sir-lancebot#1229, bot#2089, bot-core#137 and bot-core#141 if you fancy reviewing 
[sir-lancebot] #1229 Correctly handle when the movie API doesn't return any movies
[bot] #2089 Feat: add reminder snoozing & show new expiry / mention count when editing reminder
[bot-core] #137 Add check_rerun_command util to commands.py
[bot-core] #141 Migrate all message utils from bot and sir-lancebot.
in what part of the code are OT names formatted to be allowed by discord?
like Supine Protoplasmic Invertebrate Jellies to #ot0-psvm’s-eternal-disapproval
is it in the site api?
It’s handled by bot, but it can be hard to see if you’re looking at the source code
!src ot add
Unable to convert 'ot add' to valid command, tag, or Cog.
!src ot
The add command here does the conversion, with the converter defined in the function argument
That lives under bot/converters.py
!src OffTopicName
Unable to convert 'OffTopicName' to valid command, tag, or Cog.
bot/converters.py line 370
def translate_name(cls, name: str, *, from_unicode: bool = True) -> str:```
!e Shouldn't this not upload to the hastebin? The content shown on Discord is the same as what's on the paste```py
for x in range(1, 12):
print(x)
@static canyon :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
006 | 6
007 | 7
008 | 8
009 | 9
010 | 10
011 | 11
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/ukapanored.txt?noredirect
bot/exts/utils/snekbox/_cog.py lines 267 to 273
if len(lines) > 1:
if line_nums:
lines = [f"{i:03d} | {line}" for i, line in enumerate(lines, 1)]
lines = lines[:max_lines+1] # Limiting to max+1 lines
output = "\n".join(lines)
if len(lines) > max_lines:```
Looks like the issue is that we limit to max_lines + 1 but then check > max_lines. I'm guessing we should be limiting to max_lines instead?
Although actually, shouldn't the limiting be done after we see if it's too long? Otherwise we shorten it to a sufficient length first and so won't ever upload anything
And since we limit to 10 lines (the value of MAX_OUTPUT_BLOCK_LINES) the line count can probably be formatted to 2 digits instead of 3 (01, 02, 03, etc. instead of 001, 002, 003...)
it should be max_lines+1 if we stick to the way it worked before
And then the other condition works because len(lines) > max_lines
technically yes but I feel like this was discussed already in the past
Seems like a logical error to allow 1 more lines than MAX_OUTPUT_BLOCK_LINES. I imagine it was originally supposed to result in a maximum of 10, not 11
It just seems weird to say the max is 10, but then allow 11
But... it means you get a message saying it was too long, when it wasn't
only when you exceed 10 lines
Like here. It uses 11 lines, which is allowed, so the paste is the exact same as what's on discord
no I agree there's a bug
which is ^
But that seems the wrong way to fix this
Surely we want the maximum output to be 10 lines, as per the variable
By doing what you're suggesting we allow 11 lines, which means simply reading the variable gives the wrong impression
I don't get what this shows btw. Although I do notice that for max_chars we do [:max_chars] and not [:max_chars+1] (which seems to prove what I'm saying if anything) https://github.com/python-discord/bot/pull/2326/files#diff-578c89688caf1d45de35421fc8343ffa1d3e675aeda44a6d476d11a3ff286322R133
thanks
bot#2492
Not sure I explained it very well but hopefully it makes sense (it's too late for me to be doing this
). If it does, can I please get an approval and I'll work on the PR 😄
hello, can somebody review sir-lancebot#1240
How do I progress on bot#2388, I believe its ready to merge.
linting failed
You can install the pre-commit hook to make sure you don't commit code that fails
!e 3.10 print('hello world')
Sorry, an unexpected error occurred. Please let us know!
ClientResponseError: 400, message='Bad Request', url=URL('http://snekbox-310.default.svc.cluster.local/eval')
did we decide to drop support for 3.10 at some point? or did it just break
The prior
It's just not properly handled right now
I’ve started work on a snekbox PR to make it much easier for us to support more eval versions, so maybe we will keep 3.10
Remains to be seen
Speaking of @tawdry vapor did you have a chance to look over the last comment on snekbox#175
Sorry, haven't been active on here lately. I just responded.
Thanks and no worries
If I'm blocking anyone feel free to give me a nudge
Do you think we shouldn’t list the python binaries out in the code?
Not sure how to do the docker generation and such without it :P
Is it not feasible to include multiple versions in one image
Dump all binaries we want to make available into one image, update nsjail config with appropriate mounts for them, update readme to list the binaries. That's how I envisioned it.
The bot is taking some time to connect 🤔
There you go
!int e import sys; print(sys.version)
In [1]: import sys; print(sys.version)
3.11.0 (main, Oct 25 2022, 05:00:36) [GCC 10.2.1 20210110]```
oh, why is it 3.11.0 🤔
I guess @vale ibex needs to update the base image
Kinda, kinda not
We’d end up with a very long build time for an image, but I figure this is a base image anyway it doesn’t matter
What’s more difficult is I can’t seem to get it within a reasonable size
I tried installing dependencies, installing with pyenv, then uninstalling build deps but it just leads to a super bloated image
Well not all dependencies, mostly things like gcc and anything not directly used by python
The current solution is kinda hacky but surprisingly it solves all 3 problems
There’s actually going to be a little more going on in that script too, we need to list out the versions in the deployment dynamically as well
Since that will need to go through and call pip install on each
did github add something that if you view an email for a notification it removes it from the notification center
I don't understand. Why is my PR reducing coverage
file was ignored it seems https://github.com/python-discord/site/blob/main/.coveragerc#L17
.coveragerc line 17
pydis_site/apps/home/views/home.py```
oh my god I actually searched for that earlier because I was thinking exactly that
site-py3.9jc@zulu:~/workspace/pydis-site$ rg home/views
site-py3.9jc@zulu:~/workspace/pydis-site$
i think ripgrep just ignored it for some reaon
god damnit man, thank you
Base image should be up to date, just ran CI recently. Will have a look after dinner to see if there's some caching issue or smth
Unless scale beats me to it
@clever wraith you've been on fire lately 😄
Thank you, it's also thanks to alot of good feedback and critiques 😁
Yeah that's fine with me since it's the base image.
Which versions were you including and how big did it get?
it was still using the old repo name bot#2496
I left the package there in my namespace just so nothing broke
I think it's waiting for a devops team member
yea it is
To start I included 3.9,10,11 and it was somewhere over a GB, j don’t remember the exact number
speaking of which, here's one now
yeah what are the odds
I don’t see any unit tests; can’t approve
Bet
and you say we don't have enough reviewers. We have so many we get 4 reviews for a one line change. People are standing in line to review
lol
how do I put several ifs in the review policies yaml. I don't see anything like that in the spec
I assume that some things just don't get cleaned up. Cause there's no way the python.interpreters themselves add that much
I can try to play around with a n image and see if I get a smaller size
Yeah please do
I know they probably don’t add up to that much, I’m just not sure what to actually delete
Maybe pyenv keeps a cache or something that I had to delete, so maybe we just forego pyenv and build manually
try doing du -h <dir> 2>/dev/null | grep '[0-9\.]\+G' in a few dir and see where the space is at
(this will only list dirs >1G)
Do you have the image code still around? Would probably save me some time to start with that
Sorry, not anymore
But also, do you agree with this and my response in the PR? Does anyone else have thoughts (PR has context for this discussion)
I don’t feel too strongly about it. I think the hardcoding solution would be easiest for end users, but I agree that this system is more flexible for power-usage
We can just move that version.json file into bot and update the other files by hand for now
The mounts already work mostly dynamically, we just have to pass the appropriate version string
(Of course that’s only true for python, to make it work outside python is hm)
bot#2388 should be passing now, anything else I need to do?
Merged!
@clever wraith httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://discord.com/api/v10/guilds/1090928968842084452/roles' when trying to run botstrap 
I'm trying to run my own instance of @stable mountain on my Mac M2 (linux/arm64) but can't seem to get it working. I successfully ran botstrap to get the config, but now can't get the bot to start.
I've tried directly building & running the Dockerfile (with the VSC Docker extension) and docker-compose run bot, neither of which are working (the Dockerfile fails to connect to site, and the command just says pulling web and snekbox3-11 failed).
NB: I get a no matching manifest for linux/arm64/v8 in the manifest list entries message, but not explicitly as an error.
Did you make a new server?
From the template
What was it?
Nope, pre-existing (the staff testing server)
But I checked some of the config values and they seem correct (even though there were Forbidden responses from some of the webhooks requests)
That'll always happen the first time
Fair enough
Because they weren't configured, so it uses the ids of the prod one
This the 403
Since the token doesn4t have the necessary permissions
NB: I get a no matching manifest for linux/arm64/v8 in the manifest list entries message, but not explicitly as an error.
This doesn't seem related to botstrap itself
These are the two errors I get fwiw
Yeah, not botstrap, actually running the dockerfile
it needs to be
docker compose up --build
when you do run bot
it'll run the bot image only
and site isn't on
so it won't be able to connect
Do I need site to do reminders?
docker compose up --build --pull always
you always need site for bot
Since we have a healthcheck at startup time
I don't remember needing to run site locally before 🤔
Right, but I can't run the comopose file
Lemme try
Still getting the web error
What does the error say again?
try DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose up --build
Cool
you can add export DOCKER_DEFAULT_PLATFORM=linux/amd64 to your .zshrc file to do this by default
Ayy did Mac break our docker flows again
we should probably try to build for multiplatform
We're limitted by available wheels though
Okay, so it built but then I got failed to connect to site again in bot
I didn't invite the bot lol
Ah ahahahha
bot-bot-1 | 2023-03-30 10:46:43 | bot | INFO | Attempting site connection: 3/3
bot-web-1 | code 400, message Bad request version ('\x00\x04\x03\x00\x01\x02\x00')
bot-web-1 | You're accessing the development server over HTTPS, but it only supports HTTP.```also noticed this
This is something that will eventually be handled by botstrap hopefully
I’ll talk to Bella about that today
Seems you don’t have the correct env vars set
What does your .env look like
I set URLS_SITE_SCHEMA and URLS_SITE_API_SCHEMA to https:// because that's what the guide sadi
Oh wait
I'm blind, it says http
without the token, obv
The guide needs to change
Looks like the bot it starting now, thanks 😄
it's still waiting on bot#2489
Is there a way I can isolate logs from different services into different consoles?
When starting up make sure to run docker compose with the -d flag
Then you can access any of them with the docker logs command
Compose bundles them for you
Yup
Or my preferred method, installed docker desktop and don’t learn any docker commands beyond compose up -d
docker logs bot-bot-1?
Not sure if it supports accessing with just the name, but yeah that’s the syntax
Might need container ID
Give it a shot either way
How do I know the container ID?
docker container ps
Oh, it is bot-bot-1
That’ll list out all the containers and their ID
Is there a way to keep it live-updating?
wdym ?
--follow?
The docker logs --follow command will continue streaming the new output from the container’s STDOUT and STDERR.
I think this just uses normal journalctl commands
MacOS
Ah okay
Because docker desktop has very cool ways to do all of this from the interface
View logs, access the shell, etc.
TIL
I never used it anywhere other than windows personally
Yeah, I actually have Docker Desktop (but like to use commands anyway)
bot#2089, bot-core#137 and bot-core#141 are all in need of reviews; any feedback is appreciated 😄
bot-bot-1 | aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host snekbox-311:80 ssl:default [Connect call failed ('172.23.0.4', 80)]```what do I need to do to get snekbox working? I've set `urls_snekbox_eval_api` and `urls_snekbox_311_eval_api`.
Are you running under docker?
If so, those env vars are correctly set in the docker compose file, so shouldn't need overwriting
I had the same problem last night
Under Docker yeah
I've unset them and still get the same error
Fwiw the error says 172.23.0.4:80 but the env is set to http://snekbox:8060/eval
Well... they show port 80 and snekbox is exposed on port 8060
possibly the ports need updating in the compose file then
snekbox-311:
<< : *logging
<< : *restart_policy
image: ghcr.io/python-discord/snekbox:3.11-dev
init: true
ipc: none
ports:
- "127.0.0.1:8065:8060"
privileged: true
```
Yea, so update the url in the bot service to have :8060 in the url
environment:
API_KEYS_SITE_API: "badbot13m0n8f570f942013fc818f234916ca531"
URLS_SITE_API: "web:8000/api"
URLS_SNEKBOX_EVAL_API: "http://snekbox/eval"
URLS_SNEKBOX_311_EVAL_API: "http://snekbox-311/eval"```looks like a port isn't set
I just gave up and went to bed
But I did the https://deploy-preview-885--pydis-static.netlify.app/pages/guides/pydis-guides/contributing/bot/#with-docker
Then I commented the variables in the compose file
Then I tried some stupid stuff trying to connect manually just for fun, and... nothing
Tried that first
```py
bot-bot-1 | Traceback (most recent call last):
bot-bot-1 | File "/opt/poetry/cache/virtualenvs/bot-TFcQMFAJ-py3.11/lib/python3.11/site-packages/discord/ext/commands/core.py", line 229, in wrapped
bot-bot-1 | ret = await coro(*args, **kwargs)
bot-bot-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot-bot-1 | File "/bot/bot/decorators.py", line 133, in inner
bot-bot-1 | await func(self, ctx, *args, **kwargs)
bot-bot-1 | File "/bot/bot/exts/utils/snekbox/_cog.py", line 585, in eval_command
bot-bot-1 | await self.run_job(ctx, job)
bot-bot-1 | File "/bot/bot/exts/utils/snekbox/_cog.py", line 530, in run_job
bot-bot-1 | response = await self.send_job(ctx, job)
bot-bot-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot-bot-1 | File "/bot/bot/utils/lock.py", line 108, in wrapper
bot-bot-1 | return await func(*args, **kwargs)
bot-bot-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
bot-bot-1 | File "/bot/bot/exts/utils/snekbox/_cog.py", line 336, in send_job
bot-bot-1 | result = await self.post_job(job)
bot-bot-1 | ^^^^^^^^^^^^^^^^^^^^^^^^
bot-bot-1 | File "/bot/bot/exts/utils/snekbox/_cog.py", line 207, in post_job
bot-bot-1 | async with self.bot.http_session.post(url, json=data, raise_for_status=True) as resp:
bot-bot-1 | File "/opt/poetry/cache/virtualenvs/bot-TFcQMFAJ-py3.11/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
bot-bot-1 | self._resp = await self._coro
bot-bot-1 | ^^^^^^^^^^^^^^^^
bot-bot-1 | File "/opt/poetry/cache/virtualenvs/bot-TFcQMFAJ-py3.11/lib/python3.11/site-packages/aiohttp/client.py", line 643, in _request
bot-bot-1 | resp.raise_for_status()
bot-bot-1 | File "/opt/poetry/cache/virtualenvs/bot-TFcQMFAJ-py3.11/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
bot-bot-1 | raise ClientResponseError(
bot-bot-1 | aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('http://snekbox-311:8060/eval')```
```yml
URLS_SNEKBOX_EVAL_API: "http://snekbox:8060/eval"
URLS_SNEKBOX_311_EVAL_API: "http://snekbox-311:8060/eval"```new error```
what's the error in the snekbox container?
Err not sure
a 400 error suggests that it hit snekbox but it was refused
docker logs <snekbox-311-id>
It's still that image https://github.com/python-discord/bot/blob/main/docker-compose.yml#L70
docker-compose.yml line 70
image: ghcr.io/python-discord/snekbox:3.11-dev```
Yeah, doesn't show anything (that's relevant -- logs are from multiple minutes before I invoked the command)
Should it be the default snekbox image?
not sure what the current state of those images are
Did Ionite's files PR that breaks backwards combability get added to that temp 3.11 tag; or only to the main tag?
I'm at work
@static canyon please do the needful
I'm at work too
I don't understand what needs to be done anyway 
I can do it if you tell me what "it" is
https://github.com/python-discord/bot/blob/main/docker-compose.yml#L70
- image: ghcr.io/python-discord/snekbox:3.11-dev
+ image: ghcr.io/python-discord/snekbox:latest
Just bumping that container to the latest
Mine is already latest
Wait
nvm, snekbox is but not snekbox-311
And I still need to add a port (8060), right?
Yeah
Right, building
We're guessing that the 3-11 tag wasn't updated to include snekbox#159
Or something similar
Now it won't connect to site 
bot-web-1 | Starting server.
bot-web-1 | Watching for file changes with StatReloader
bot-web-1 | March 30, 2023 - 13:41:26
bot-web-1 | Django version 4.1.7, using settings 'pydis_site.settings'
bot-web-1 | Starting development server at http://0.0.0.0:8000/
bot-web-1 | Quit the server with CONTROL-C.
bot-bot-1 | 2023-03-30 13:41:30 | bot | INFO | Attempting site connection: 2/3
bot-bot-1 | 2023-03-30 13:41:35 | bot | INFO | Attempting site connection: 3/3
bot-bot-1 | 2023-03-30 13:41:35 | bot | CRITICAL | {connrefused}```
Restarted and it's working now 
Is snek?
Progress 🎉
bot-snekbox-311-1 | 2023-03-30 13:44:00,946 | 13 | snekbox.nsjail | INFO | Created file at PosixPath('/memfs/8e9477d4-05d2-46c0-9520-4bb53ebd2d36/home/main.py').
bot-snekbox-311-1 | 2023-03-30 13:44:00,947 | 13 | snekbox.nsjail | INFO | Executing code...
bot-snekbox-311-1 | 2023-03-30 13:44:01,173 | 18 | snekbox.memfs | INFO | Checking main.py (orig_time=1680183840.945931, new_time=1680183840.945931)
bot-snekbox-311-1 | 2023-03-30 13:44:01,174 | 18 | snekbox.memfs | INFO | Skipping 'main.py' as it has not been modified
bot-snekbox-311-1 | 2023-03-30 13:44:01,185 | 13 | snekbox.nsjail | INFO | Found 0 files.
bot-snekbox-311-1 | 2023-03-30 13:44:01,186 | 13 | snekbox.nsjail | WARNING | clone(flags=CLONE_NEWNS|CLONE_NEWCGROUP|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET) failed: Invalid argument
bot-snekbox-311-1 | 2023-03-30 13:44:01,187 | 13 | snekbox.nsjail | ERROR | Couldn't launch the child process
bot-snekbox-311-1 | 2023-03-30 13:44:01,188 | 13 | snekbox.nsjail | INFO | nsjail return code: 255```
Just need to figure out what's going on with NsJail
Which I know absolutely nothing about
bot#2498
Yeah, I've got no clue how to fix this NsJail error. Anyone have any ideas?
are you on macOS? 
We don’t/can’t test snekbox on macOS unless someone volunteers to test things, so it’s possible things broke in the files PR
Yes
I'm more than happy to help test things whenever I'm around (although I know nothing about how nsjail works)
snekbox was broken on macOS even before the files PR
Huh really?

Do you roughly know when that happened
So I guess I just can't do any snekbox related PRs (on my Mac laptop)?
before last year I think
yeah, I'm afraid not
but if you get time to debug it, I can help as well
Unfortunately by the looks of it the GitHub action runners don’t support Apple silicon yet, so we can’t even test it in CI at least
With most of us lacking access to hardware, I think you guys might be a little SOL for the moment
If you want to develop with snekbox, you can still use a remote server running on a Linux box or something, but I don’t know how to fix the issues atm
Do you know what the easiest way to "run a linux box" is?
I usually rent a VPS for the duration of what I want
I use DO which offers an image with docker so I start from that, run the container, and open the port and I’m done
Hmm, okay
I've got the time but I wouldn't even know where to begin on debugging. I know nothing about arm64/M1/M2 architecture or NsJail 
No worries, it's one of our more difficult project
I'm thinking maybe we can have a communal snekbox instance for developers, given our current infrastructural situation
I'll bring it up with devops, see what they think
Yeah, that would be pretty cool if it's feasible
@static canyon @atomic ivy I talked with devops, and now we have https://snekbox.pythondiscord.com
If you want to test snekbox features, that will work for now
Hopefully eventually we'll get it to work with Macs, but this now exists as a resource for devs
thanks!
Amazing, thanks! 🎉
!remind 15h30M
Your reminder will arrive on <t:1680248115:F>!
Thanks 👍
So do we set it to https://snekbox.pythondiscord.com/eval?
Lol that's the standard api response
So we don't need to specify port 8060?
Also thanks non-sarcastically 😛
The port forwarding is handeled internally, you just specify https
🎉
Failed to connect to paste service at url http://paste.localhost:8000/documents, trying again (1/3).```
Now... how easy is it to get the paste site working?
There's nothing in the docker-compose about the paste site (from what I can see)
Oh you just set that to prod
Bella has a PR open to document that
Set URLS.paste_service to https://paste.pythondiscord.com/{key}
Ah actually that isn't configurable directly yet, you can configure the base variable
{key} is a literal
It's substituted in the code
You can instead set uhh
Make sure urls_site is not set in your .env file
That just needs to be prod, which is the default value
Right, I had it set to localhost:8000
Yeah we need to rename this to avoid the confusion
It's only used by pastebin and logs, and obviously no one is hosting a hastebin
bot-bot-1 | File "/opt/poetry/cache/virtualenvs/bot-TFcQMFAJ-py3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
bot-bot-1 | raise client_error(req.connection_key, exc) from exc
bot-bot-1 | aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8000 ssl:default [Connect call failed ('127.0.0.1', 8000)]```
Sometimes restarting fixes it so will try that
Seems it's trying https?
Yeah, think I had other envs set that shouldn't've been. Working now
Awesome
Yeah the site thing is deffo confusing. We'll try to get to it tonight and be done with it flr good
it looks like off-topic names didn't reroll at UTC midnight
Did you see #dev-alerts message ?
(Not that I have any idea what it means — just pointing it out)
no
looks like it might have rejected a char
which is weird
I'll edit it to what it was supposed to be
Do you know which char?
well then... that's a reason
uuuh
I'm not sure which part it refers to? lol
swallow. The word that's not allowed is swallow.
What a random word to block
I mean I understand the possible innuendo, but it's... so specific
I gave it a new name in any case
Here's your reminder: @static canyon @atomic ivy I talked with devops, and now we have https://snekbox.pythondiscord.com
[Jump back to when you created the reminder](#dev-contrib message)
There's loads of words that are blocked which are kinda... "specific" (although also with logical too ofc)
Doesn't look like the actual list is public though, so we can't prevent adding the name in the first place (only handling the error when it arises)
:(
do i not exist to you
is swallow blocked in thread names?
Only one way to find out
that's not in this discord, though
Ah wait
it matters that it's this discord server and not a different lol
Why ?
I think it's whether it's a matter of the server being a community one
Not sure tho
context is up here
anyways I thought it was partnered and not server discovery
just checked and servers in discovery can make threads with swallow in the name
Oh, true
swallow can also be in the description
though when I'm on PC I have an idea to be able to validate this
@clever wraith hmm for some reason I'm getting 400 when trying to make the server a community, not sure why. Worked fine yesterday
not urgent, I also need to take a break
👀 we only cater to non-maschosists
oh yeah that reminds me i probably need to update token regexes again
so are OG Helpers still part of the staff and able to view staff channels?
❓ and yes
bot/exts/recruitment/helper_utils.py line 73
"""Load the OffTopicNames cog."""```
Lol
omfg
I just realised
its the april fools joke
which explains why the implementation felt so incomplete
its not supposed to give permissions
?userinfo
@timid sentinel (Discussion here is faster 😛 ) Idk if you've seen my last comment, but I've reconsidered my choice about keeping it simple, as the other approach isn't necessarily not simple xD
There are 2 things I want to discuss tho
- First, the name, obviously
- Do we require people to set this at all times in setup ? ( It's not really needed anywhere except for the logs like I mentioned) Or do we put it in some sort of an optional section in the guide ? and i we ever move towards having it needed in multiple places, we can remove that section & have them set it always as it's litterally one line ( or do it now )
I'd not realised that there had been some discussion on it before, given that it's only used for logs (and I don't see any other places on the bot that would really benefit from it right now) It might be best to leave it as-is, at least for this PR.
I think having it not logs-specific is a bit neater though and is the correct separation between what should/shouldn't be configurable. I think site_public would be a fairly clear name - if the contributing guide doesn't say it needs to be set then people would probably not notice it exists so it shouldn't cause confusion. I think it would make sense to say what it does and what to set it to in an optional section somewhere though.
we can remove that section & have them set it always as it's litterally one line ( or do it now )
What value does it actually need to be set to for different configurations (e.g. does site in docker vs site not in docker). I've never had a good idea of how docker networking and stuff works lol. If it's more complicated than a single constant value than it probably wouldn't be worth getting people to set it as a requirement.
I think it would make sense to say what it does and what to set it to in an optional section somewhere though.
We will surely have it in the full env vars appendix
What value does it actually need to be set to for different configurations (e.g. does site in docker vs site not in docker).
The networking in docker is mostly done for the site_api, as it's not exposed, and we use the container name ( as a service ) to access it from another container (bot in this case. And I think it's done by a bridge network, not entirely certain tho)
Long story short: It's the only thing exposed, so when using bot locally (docker included), it shouls be set to http://localhost:8000 in the .env file since we have a 8000:8000 port mapping from the outside world to the web container where the site code is running, and we copy the entire root folder content into the container, so it'll also be configured to that value inside docker
@gritty wind and @cold island took part of the discussion as well, so pinging you for the context that stars here
#dev-contrib message
I don’t think it warrants putting this much effort either in design or asking contributors to set it when it’s not something we’ve used for the entire duration of its existence
Which considering I’m pretty sure I had it in my original config file
Is well over 3 years
Ok, the only thing bothering me was how long its value is, and it looks "too specific".
I don't think contribs will have to play with or use it anywas, as it's only for mod purposes.
So i'll go with having it as an optional section just in case, and we can always open up discussion in the future in the structure of the bot changes
I meant
🔨 ?
C:\Users\17032\development\pydis\bot(swfarnsworth/ping-on-thread-close)
λ poetry env info
Virtualenv
Python: 3.11.1
Implementation: CPython
Path: C:\Users\17032\AppData\Local\pypoetry\Cache\virtualenvs\bot-hSl-sM1s-py3.11
Executable: C:\Users\17032\AppData\Local\pypoetry\Cache\virtualenvs\bot-hSl-sM1s-py3.11\Scripts\python.exe
Valid: True
System
Platform: win32
OS: nt
Python: 3.11.1
Path: C:\Users\17032\AppData\Local\Programs\Python\Python311
Executable: C:\Users\17032\AppData\Local\Programs\Python\Python311\python.exe
I have this
but if I do docker-compose up, I get Current Python version (3.10.8) is not allowed by the project (3.11.*). repeatedly
Do docker compose pull then docker compose up --build
With a space, not a hyphen
Hyphenated docker compose is deprecated
thanks devops bb
i don't understand the point of this
why not just use discord.Message
the python codebase is so inconsistent with this
If it's used a lot in the file it's easier to just type Message, and it looks cleaner too. Sometimes however it might just be personal preference. I don't think this is something that demands consistency.
in that case, you should also ask the question of "why not use discord.ext.commands.Cog ?
It tends to become very unreadable when you do that
We don't necessarily need the namespace here, as there aren't things that collide
And it shortens the amount of text you'd need when you'll be annotating things later on
if I had two packages/modules that export a class called Message, then it'd be a problem. But that isn't the case for us
nah
they aren't comparable
arguably it should be from disnake.ext import commands
because you'd be importing modules rather than specific objects
and as ext.commands is a namespace module which also isn't imported by default, you'd still need to do import disnake.ext.commands (or whatever lib you use)
Both statements are importing a class only, hence the comparison
That's when you'll be using that namespace to use multiple objects from it
Which doesn't apply here
@timid sentinel RE bot#2498 fyi I'm currently rewriting the description to make the actual output changes much clearer and say what the differences are
I've also got some changes to the code that I've not pushed yet (hence I've left it in draft still), which do make it a bit cleaner
EDIT: Have now pushed and updated the PR description
Hey, I was catching up with my GitHub notifications and saw two PRs closed due to staleness. According to what I remember, both these PRs were complete from my end and were requiring a second review, just wanted to let u guys know. So I think they could be pretty simple PRs for anyone to finish, if any changes are required.
sir-lancebot#930 and sir-lancebot#745
Are you saying that you want other people to finish working on them, or do you want to do it?
If you think you've addressed the reviews, you can ping the reviewers on Github and here.
The head repo was private/nonexistent thats why we closed. AFAIK there was no way of continuing development on your bot prs
I don't follow, which head repo ?
Their forks I guess
Ah, I looked in a completely different direction
For bot#2446 it is complete and open to reviews.
Also @clever wraith I see you haven't resolved some of the simple addressed reviews. Is there a reason?
No reason a part from the fact that I didn't get the time to check it yet, I'll try to do that today
others, and I had already done that
oh okay got it, but if incase it gets approval it would not be a problem, right?
I have to decrypt a text with Caesar, I have to find the most present letter, how do I do it? can someone help me
vous forcez les gars
This is the wrong channel to ask these kind of questions, please refer to #❓|how-to-get-help for that
And please use English as language
@clever wraith are you familiar with this error? this time I made sure the bot is in the guild and everything
oh maybe the bot token is incorrect
yeah that was it
Don't forget to forward it to me for cross validation, thanks
Is there some way to make PyCharm understand that discordpy's cached_slot_property acts like a property?
Unfortunately I haven’t found a way to get it to work out of the box. If it bothers you, consider creating a .pyi file in your local folder and override the type with a normal property
The exact details of the property are an implementation detail that isn’t relevant to the typing
Unfortunately Interaction.response is a cached_slot_property, so using methods of InteractionResponse make my code look like this
That aside from not having autocomplete
So I guess I'll need to look into pyi files
Seems like the typing solution doesn't actually work
Pycharm's parser seems to hardcode the property behavior to the property decorator, and possibly a few others, so even literally setting dpy's property to the builtin property won't fix it
Thanks
help!!
This is the wrong channel to ask python help related questions, please refer to #❓|how-to-get-help.
@clever wraith I am busy, if you want you can take over my pr because I won't be able to continue. Atleast tag it up for grabs if you can't take over.
You won't be able to continue at all you mean ?
It's not urgent, so you can get back on it whenever you want/can, unless you want to abandon it then it's another topic
If you guys can wait 4-6 months(#dev-contrib message) then ok, else mark it up for grabs.
That's up to our triage lead @vocal wolf
Can we have reviews on site#885, so that we have an up to date guide for any contribs?
Thaaaank you :B
I'll look at it again
Thank you!
almost!
In your .env.server file:
- If you wish to work with snekbox, set the following:
urls_snekbox_eval_apito"http://snekbox:8060/eval"urls_snekbox_311_eval_apito"http://snekbox-311:8060/eval".
At this stage, set redis_use_fakeredis to true. If you're looking for instructions for working with Redis, see Working with Redis.
How does that look, wording-wise
The reason I worded it the way I did is because not everyone will know what redis is or whether they're supposed to be working with it
sooo
^updated
👍
pushed!
oh, you lost the * in your edit
await self.bot.wait_until_guild_available()
channels = (self.bot.get_channel(channel_id) for channel_id in CHANNELS)```is it safe to assume that none of the channels will be `None` since there's the `wait_until_guild_available()` call?
What is this about?
I'm doing bot#2500 and noticed this code already exists
My real reason for asking is that I'm wanting to add mod_meta_channel = self.bot.get_channel(Channels.mod_meta) but need to know whether I need to use the try_get_or_fetch_channel util instead
When the guild is available, it should load all the channels in cache
So I think that if you do that as soon as the guild context & everything was loaded, get_channel will return the appropriate channel indeed.
Unless you have an invalid/non-existent id
One sec
it should load all the channels in the cache
Right, but can you guarantee that:
- "should" --> "will"
- the channel is in the cache
Idk what wait_until_guild_available does under the hood, let me look at that first
I think it's safe to assume the channels specifically are cached
We have had issues before with caches not populating properly even after guild available is set
Probably a d.py bug. Infamously unreliable caches
Don’t worry about a channel not existing at all or something if it’s defined in the constants
That’s not a bot code issue
So should we be checking that the channel isn't None even after wait_until_guild_available()? Because it still might not be in the cache?
Unclear
In theory it should guarantee it, especially if it’s like a text channel
If handling the None case is trivial, might as well
Or use get_or_fetch which will handle that for you
Yeah, that's what I was thinking
I might as well use it
@cold island ```html
...
</ol>
<p>
The current path, <code>api/bot/filter/filter_lists</code>,
didn’t match any of these.
</p>
</div>
<div id="explanation">
<p>
You’re seeing this error because you have <code>DEBUG = True</code> in
your Django settings file. Change that to <code>False</code>, and Django
will display a standard 404 page.
</p>
</div>
</body>
</html>```I'm getting this log in bot when I'm trying to start up my bot since your new filter system PR was merged. Is there some config I need to change?
You'll need to rebuild the images
Are you running site & bot separately ? Or are you using the bot's compose file ?
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose up --build -d && docker ps
I am doing the --build though?
Pull the latest image
How?
Bot's compose file (i think)
docker compsoe pull
docker compose down -v
docker compose up --build
voila
Thanks
I'm testing out ot channel renaming (bot#2500) and need to know:
Does this mean I need to run site separately / customise somehow (to pool the names)?
How can I easily trigger the rename logic that's supposed to only run at midnight UTC?
uuuh you could int e
How would that work?
you would call the routine that should be run at midnight
docker compose pull gives ⠿ web Error for when it tries to pull web (same for snekbox but don't need that)
How do I get it though? get_cog(...).coroutine()?
yeah that sounds right
^ it's not actually pulling the web/site btw
It could be because I'm on macos but hope not
bot, guild, ctx, and discord are in the namespace if you need them
just for kicks, what if you use docker-compose with a hyphen
Ah, DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose pull seems to have worked
This pulls snekbox but not web 
But yeah, seem to have it working with this
Why don't you just set this as a env var in your system
You're not gonna type that each time, are you ?

I don't type commands anyway lol
I just use the arrows keys
yeah
But yeah, I probably should lol
But next time, you'll come asking for the same question
Because I remember this happening to you
Will setting it in the bot project .env work?
I don't think so
.env is just a layer built to facilitate passing env vars to your app
It's not used by your os
Wdym?
I meant that we use docker images for loads of work stuff, and idk if setting DOCKER_DEFAULT_PLATFORM globally will mess with any of the work-related docker stuff
Docker supports parsing values from .env files to pass them as env vars to your app
Here, the app that needs that env var is docker itself
the binary
It doesn't look there
It looks in your system's env variables
🤔
Where's "there"? The project's .env file?
Yes
Right, but if I set it in the system's env variables it might mess with the other docker stuff I do at work
You're not getting these errors in the other stuff you do at work for not setting the default platform ?
Nope. I'll get the warning message but stuff still works
Will the stuff still work with the env var? Because it might just remove the warning and then you even got something out of it for work
Will the stuff still work with the env var?
That's what I don't know, and don't really want to have to mess around to find out
Yeah, I'll probably do this
Would the uh.... --platform=linux/amd64 in https://github.com/python-discord/bot/blob/main/Dockerfile#L1 set the sme thing?
Dockerfile line 1
FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:3.11-slim```
How would I see the log.info() etc. outputs?
Do I have to replace stdout or something?
Yeah, looks like that works
Nvm, don't think it does...
You can alternatively add a temporary command
def custom_info(*args, **kwargs):
print(*args, **kwargs)
cog = bot.get_cog("OffTopicNames")
cog.log.info = custom_info
await cog.update_names() # the log.info() inside the cog calls custom_info
```apparently it was as simple as this
2023-04-07 16:43:15 | discord.http | WARNING | We are being rate limited. PATCH https://discord.com/api/v10/channels/476196547324018688 responded with 429. Retrying in 391.80 seconds.```oops. Might've gone a bit *too* overboard with the testing 😅
bot#2089, bot-core#137, bot-core#141, bot#2498 and bot#2520 (oldest to newest) are all in need of feedback; would appreciate some reviews 🙂
[bot] #2089 Feat: add reminder snoozing & show new expiry / mention count when editing reminder
[bot-core] #137 Add check_rerun_command util to commands.py
[bot-core] #141 Migrate all message utils from bot and sir-lancebot.
[bot] #2498 Eval output improvements
[bot] #2520 Handle off-topic channel names that are invalid for servers in Server Discovery
does python discrod site use react?

Most recent one I see is hours ago
disnakedev/disnake#722
!d
aw no sentry issue
but anyways yea
someone should run
!d r
!d cleardoccache disnake
!d r
!d cleardoccache disnake
Successfully cleared the cache for disnake.
!d disnake.ext.commands.Bot
class disnake.ext.commands.Bot(command_prefix=None, help_command=<default-help-command>, description=None, *, strip_after_prefix=False, **options)```
Represents a discord bot.
This class is a subclass of [`disnake.Client`](https://docs.disnake.dev/en/latest/api/clients.html#disnake.Client "disnake.Client") and as a result anything that you can do with a [`disnake.Client`](https://docs.disnake.dev/en/latest/api/clients.html#disnake.Client "disnake.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://docs.disnake.dev/en/latest/ext/commands/api/prefix_commands.html#disnake.ext.commands.GroupMixin "disnake.ext.commands.GroupMixin") to provide the functionality to manage commands.
👍
we refactored the docs to make it fast to load
so that's why it was broken for your bot
Which project was it that used multi-staged builds together with environment variables to have a production and development versions?
All our apps, but I’m assuming you’re looking for the dockefile in snekbox?
That’s the only one with different targets, the others handle differences within the app itself
Hey I want to start contributing to opensource. But have no idea how to start. I would be grateful if anyone of you mentor or guide me.
!contribute
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!
Projects to Contribute to
• Sir Lancebot - our fun, beginner-friendly bot
• Python - our utility & moderation bot
• Site - resources, guides, and more
Where to start
- Read our contribution guide
- Chat with us in #dev-contrib if you're ready to jump in or have any questions
- Open an issue or ask to be assigned to an issue to work on
on this website https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/linting/ it says to run poetry run task precommit although when i run it i get ```cmd
❯ poetry run task precommit
Command not found: task
im trying to install this for sir-lancebot fork
Have you run poetry install?
no i did not it works now thanks
No worries. It seems like the guide doesn't say to do so if you're using docker, we should probably fix that.
Also im looking for something that i could add to the project but i cannot seem to find anything easy for start do i need to figure out some idea and implement it ?
You can check out any open issues that haven't been assigned, or review some of the open PRs
!contribute
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!
Projects to Contribute to
• Sir Lancebot - our fun, beginner-friendly bot
• Python - our utility & moderation bot
• Site - resources, guides, and more
Where to start
- Read our contribution guide
- Chat with us in #dev-contrib if you're ready to jump in or have any questions
- Open an issue or ask to be assigned to an issue to work on
No clue what I did, but I've had an eval job running for >4 minutes now, and the job is definitely still running because the bot is still typing & I can't start another (says I already have one) #1096552458039337110 message
I did a job, edited the message and re-ran
Finally crashed #1096552458039337110 message
!sf 1096557059937423440 1096558363912966144
1096557059937423440
Created at 2023-04-14 22:06:16.134000+00:00 (<t:1681509976:R>).
1096558363912966144
Created at 2023-04-14 22:11:27.026000+00:00 (<t:1681510287:R>).
Looks like it might have been due to a bot restart? Altho I'm not sure because the bot was showing as typing the entire time which I don't think can happen when it's restarting #dev-log message
If it is because of the restart, is there anything we can do in terms of handling this?
Heya.
I wrote a message for the bot for !in
I read through the !contribute bit but not too sure how to submit. If there’s a different way to do this, please let me know.
Feed back is of course welcome and highly appreciated.
I have another message regarding the use of a condition in if. Let me know if I can post that here as well or should do something else with it.
========= start of message ====
in
used to see if a is part of b.
a in b
return a boolean True/False.
Where b is an iterable.
Example
a = 'foo'
b = ['foo', 'bar', 'baz']
c = ['bar' ,'baz']
print(f'{a} in {b}? ', a in b)
print(f'{a} in {c}? ', a in c) ```
The result of the function can be used directly to enter an if statement.
Rather do this:
```py
if a in b:
pass
Than this:
if a in b == True:
pass
====== end of message =====
Potentially also part of the message, although I’m not too sure if it is the best way to do things:
=== optional ====
If a is a list we have to use all():
a = ['foo', 'bar']
b = ['foo', 'bar', 'baz']
# Checks if all elements of a are in b.
print(all([c in b for c in a]))
==== end ====
Hey!
This is usually done through an issue, that'll be an enhancement for a tag.
It's better to do this there as context is preserved since people here can evoke multiple subjects and thus make it hard to follow.
I suggest you open an issue with a brief explanation of what you want to do and why, and we'll carry on there.
(I'm explaining the usual '' flow '' of things)
!in
» indent
» intents
» inline
» in-place
» if-name-main
Oh, we don't even have that tag in the first place
Yeah. I wanted to use but saw you didnt have. Then someone tagged me in #community-meta and I said I’d be happy to formulate a message. So here it is 🙂
Okay. So I’ll open an “issue” on the Python bot part in contribute page and type the same yeah?
Yes!
Basically you'll say that you want to add a new tag, and then if it gets approved (which is fine by me), you make a pr with the content of the new tag
I'm surprised we don't have one for that
Maybe it goes by a different name ? 🤔
I didnt want to spam the bot trying to look for it.
I feel it might be part of the !or in a way.
I’m about to hop on a plane so will do after.
It’s the last suggestion in !or
@patent pivot I now understand even more why not to use codecov after what codecov did today, even forgetting their previous security issues this was just handled so badly and such a massive security hole lmao
wait what happened now?
I see

unfortunately they straight up deleted it
rather than yanking all releases or publishing a package that doesn't work
We should have worked with the PyPi team ahead of time regarding the deprecation steps and the custody of the package name; this would have provided a better transition between the package’s active and deactivated states. Regardless, the codecov package name has been locked by the PyPi team in order to prevent any squatting on the name by malicious actors.
For a period of time, the codecov package (a top 1% of all python packages) did not exist, yet many CI workflows were still trying to install the package.
I'm not sure that codecov understand how much of a massive security problem was fixed by pypi maintainers by blocking the name, before someone published a malicious package
Wait -- This package that was "deprecated and not maintained" was in the top 1% of the entirety of PyPI??
yes, number 1357 over the past 30 days
… I don’t think that’s what “rarely-used” means…
Wow. The more I hear the worse it gets.
for reference, I believe it was rarely used in actuality
just a lot of ci still had it as a dependency, whether it was being used to upload or not
lmao
!contribute
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!
Projects to Contribute to
• Sir Lancebot - our fun, beginner-friendly bot
• Python - our utility & moderation bot
• Site - resources, guides, and more
Where to start
- Read our contribution guide
- Chat with us in #dev-contrib if you're ready to jump in or have any questions
- Open an issue or ask to be assigned to an issue to work on
@drowsy ravine I'll transfer that issue to the meta repository.
It's where all tags should actually go to gain more traction
👍🏻 perfect
meta#211
Thanks for that. 🙌🏻
Sure thing
can anyone help me?
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!
Projects to Contribute to
• Sir Lancebot - our fun, beginner-friendly bot
• Python - our utility & moderation bot
• Site - resources, guides, and more
Where to start
- Read our contribution guide
- Chat with us in #dev-contrib if you're ready to jump in or have any questions
- Open an issue or ask to be assigned to an issue to work on
I look into contributing to open-source but I have never done that previously... how do you suggest I start and find a project to support?
I'm free if anyone needs help !
You can contribute to one of Python Discord's projects—that's what the embed above is all about.... or you can contribute to #black-formatter or #pyqtgraph which have a presence here. I'd recommend choosing one of Python Discord's projects though as the barrier for contribution is much lower.
More generally, you should look at projects you use frequently (libraries, tools, etc.) and see whether they have any tasks they'd like help with (by exploring their GitHub). Look for projects that seem active (so it won't take 3 months for someone to respond to your PR) and have contributing docs.
I am learning python and what really got me interested in the first place what is machine learning? I’m trying to figure out where to look to find projects to help with our contribute to.
[python-discord/bot] Pull request opened: #2546 updated mutability.md to link Nedbat's talk - look; it's me!
xD
Fwiw we recommend not doing PRs until after the issue has been approved & assigned to you. Otherwise it's just wasted effort if we decide we don't want it, or that we want it implemented differently to your PR
For something as small as this it's not a huge deal though
yeah. if it was big, I wouldnt have done that
bot#2522 is so beautifully buggy
Your reminder will arrive on <t:1681775712:F>!
I think I found three or four ways to abuse it that I don't think existed in the previous method
but basically you're trying to emulate discords link highlight
Here's your reminder: lol
[Jump back to when you created the reminder](#dev-contrib message)
@cold island so basically discord link parsing is so whack and also different on both the backend and the client :)
i can't remember how its different on the frontend and backend atm but here's some examples of weird highlighting:
https://example.com
https://example.com>
https://example.com>
https://example.com/.hi
https://example.com/.
https://example.com[
https://example.com]
https://example.com]h
https://example.com
https://example.com>
<https://example.com>>
https://example.com/.hi
https://example.com/.
https://example.com[
https://example.com]
https://example.com]h
👀
on that regard, we can get this invite https://discord.g g/disnake/python (both without the spaces)
but also this invite https://discord.g g/disnake./python
Alright, I'll comment a couple of possible fixes, but won't be able to address it myself soon. I don't foresee people exploiting it so I don't consider it urgent, but we should plug that hole
i don't know what regex they use for link highlights but i've been looking for it myself for my own bot
keep an eye on https://gh.arielle.codes/monty, i'll be committing it there if/when i find it
and perfect, that's an example of the backend fetching a different link
it fetched https://gh.arielle.codes/monty, for the preview but the frontend highlights https://gh.arielle.codes/monty
i hate this platform.
here's that proof for the embeds being different on the front and backend
https://duckduckgo.com/hi]
https://duckduckgo.com/hello)
DuckDuckGo. Privacy, Simplified.
DuckDuckGo. Privacy, Simplified.
lmao
In what exactly
in python
we have floor division with //
why cant we make it easier to ceil divide by making a ^/ operator or something like that
Hello,
I'm afraid This isn't the place to discuss this.
This channel is for discussion related to contributions to one of our projects.
Please refer to #❓|how-to-get-help, to open up a help post and ask all your questions.
@dim pelican greetings, was this a part of april fools, or is this an actual PR? I can't tell lol
sir-lancebot#1245
It was part of the April fools, it could be nice to have the April Fool's Helper color be commemorated in the color command
I'm up for changing the color name too
@cold island I've updated the pr to simply run a null check on ctx.message
hi, regarding site#949, the extra spacing is gone if I use this: https://paste.pythondiscord.com/raw/obodurihiz
(disclaimer: I'm not good at flexbox)
but in that case the two items, dropdown and the editgh link, are stacked vertically
if that helps - (cc @timid sentinel and idk jchrist's discord sorry)
or like this: https://paste.pythondiscord.com/raw/fikomezugi
just to clarify, none of the two are real solutions since for both cases the space is eliminated but I'm not knowledgeable in CSS enough to fix the alignment of the two items
(jchristgit is @last patio iirc)
I just tried to bookmark the last message posted in #python-community and got this -- didn't we end up bringing the .bm command back on Lance because the context menu wasn't working for some people when it first rolled out and also doesn't work in read-only channels?
thanks!
Sorry, it hasn't been merged (yet).
PR is awaiting response from author sir-lancebot#1223
cc @sharp crag mayhaps
Huh. I thought that was merged already. Oh well
I'll work on the reviews today, thanks for bringing it to attention 👍
Hi @midnight jasper! Just checking on if you're still planning on doing the message content intent tag as part of site#695? If not, no worries and I can assign it to someone else
Actually I feel like we could probably consolidate both of these into one tag
I think Python is frozen in #1101145389287100478. All I did was tell it to test if 69 was a prime number.
I had the same thing ~2 weeks ago #dev-contrib message
Except this time there wasn't a bot restart so no clue what's causing it 
Seems like snekbox response timed out, not too sure why
so now that new markdown has been released, what's the plan here for inline links like this?
if that doesn't render for you, reload your client as they just went to 100%
@atomic ivy
I mean, wdym what's the plan?
they seem useful
plus Discord clients warn you of external links on mobile and desktop by way of a popup
yeah
I've always found pydis to be incredibly long to adopt new features tho, and they cannot turn this one off
as examples
- threads
- forum channels
- timeouts
well, we could selectively block messages that have this formatting
if it gets annoying enough
For good reason on most of those, discord’s rollout on all of them was quite shit
Regardless, mods will handle it as necessary, and users will adapt to it eventually. Not a major problem
if anything it's very easy to parse, given that it needs to be valid markdown
overall seems to be beneficial for bot messages
HAH
you make a lot of assumptions with discord's markdown parser, and also what "valid markdown" is
@fallen patrol fyi you are pinging the mods
lol seems like bad design
if someone is doing spoiler spam, they're usually spam-pinging someone. we'd like to know. seems reasonable to me.
like, you could also check if message.mentions has items in it, or take automated action against it, eg timing out the user for a few seconds
Yes. Shit sorry I totally forgot. I will do it right now.
my bad
How do I get the page?
Also, it wants me to explain why to not use @bot.event with on_message ... ive never heard that, that is taboo.
https://github.com/python-discord/bot/tree/main/bot/resources/tags tags go here
Check the other files in the same folder for the format
Right. Most tutorials tell users to do something like this:
@bot.event
async def on_message(message):
# do something with message
But neglect to tell users that this will cause their commands to stop working (without await bot.process_commands(message))
So a quick little tag explaining that would be great
https://discordpy.readthedocs.io/en/latest/faq.html#why-does-on-message-make-my-commands-stop-working it's in the official doc's FAQ too
@midnight jasper After further feedback I've decided to just keep these two separate - if you could just do the first one (message content intent) that'd be great
Try to keep it short and sweet, link to other documentation and tags as necessary
Yep Ill do that.
Oh I had no idea that did that lmao
Awesome, thank you so much. Feel free to reach out if you need help with anything or to request a review
np. so i clone the whole repo, add in the md and make a pr?
Heh, case in point. Not a very well-known issue but one many people run into almost daily
That's up to you
---
embed:
title: "Message Content Intent"
---
Discord regulates data being sent to an application via a specific number.
This number represents different permissions A.K.A. intents.
The message content intent is what determines if an app will receive the content of an `on_message_create event`.
Disabling or enabling this feature will allow or disallow this data to be received.
Can you PR this and request my review so we can go through the appropriate flow?
Yep.
What branch do I do the pr from @sharp crag
Whichever branch you commited your changes to
Unless you explicitly made a new branch it'll be main
aight. i forgot bc i mostly just push onto my own directory. but i added and commited it on my local branch. how do i do the pr in github again?
Did you push from your local to remote?
it said i lacked perms
If you run git config --get remote.origin.url what does that give you?
Looks like the remote is the actual repository, rather than your fork
oh
You can git clone <your_fork_url>.git to clone your fork, rather than the actual repo
aight
Then commit your changes, push to your fork, and PR upstream
(you can just add/change a remote URL, so you don't have to completely replace the repo and lose your local commits)
@sharp crag https://github.com/python-discord/bot/pull/2566
Awesome, thanks. I'll leave a review
✅ please address the reviews at your leisure
They are good. Do we now want to state what the intents actually are?
Not sure I'm following - what do you mean "state what the intents actually are?"
Like how the intents are just a number bit shifted to accomodate other permissions.
And how that relates to message content
I don't think that's particularly relavant here, we just want a really short tag explaining why their commands may not be working and how it might be a message content issue without going into much detail about how exactly intents work under the hood
1<<15 is message content
Ok. I think ur reviews are good. Now do we wait for an admin?
but that isn't how most people will be using intents, I don't think it's relevant here
Have you addressed the reviews? Not sure if you may have forgotten to push
Oh I have to repush?
Also, I think it should say somewhere that privileged intents have to be enabled in the dev portal as well
Ye, but sometimes those fun facts are very helpful for the future when going more in depth.
True ill add that
ah i recommited
partially I agree
it really depends on how that data is exposed
haven't read, no plans to
I think it should be up to themselves to research it if they want to go deeper, tags are supposed to be quick gotchas for common problems and it won't involve how intents work under the hood most of the time


but