#dev-contrib

1 messages · Page 16 of 1

clever wraith
#

Sure, I'll ping you later if you'd like

cold island
dull swan
#

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.

cold island
#

Weird, I just opened a thread with no issues

#

And we're still getting new threads from other people

clever wraith
#

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

  1. Changing the definition of permanent (to either 0, which is epoch time, or the non reachable constant date in the future)
  2. Using the JSON approach.

I'm not sure we'd want to over-engineer this.

cold island
#

As much as I don't want to mix in JSON, it might actually be cleaner here.

clever wraith
#

Yep

#

I'll put that into writing

dull swan
cold island
dull swan
#

20 hours ago.

#

I'm US central and bad at math if that helps.

cold island
#

yeah I asked for the relative time so I don't have to do timezone conversions haha

dull swan
#

:p that would be 19 hours 40 minutes according to google.

cold island
#

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

dull swan
#

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.)

cold island
#

These aren't separate attempts to send a message? when it sends the timeout message it means it stopped listening to the reaction

dull swan
#

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 PepeHands I'll let you know if the issue persists and some better timestamps and more granular detail of troubleshooting.

fading galleon
#

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.

cold island
fading galleon
fading galleon
#

@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.

clever wraith
#

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

clever wraith
#

No need to namespace them for now

fallen patrol
#

@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

fallen patrol
#

yeah

cold island
#

yes, actions will have their own table

#

not sure I follow

clever wraith
#

It's kinda like an "event store"

fallen patrol
#

and was responding to that section

cold island
#

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

gritty wind
#

Why not use multiple columns instead of serialzing and deserialzing json

cold island
#

Because we can't use null for "not edited"

gritty wind
#

Would make typing nicer

gritty wind
#

Edited: bool

fallen patrol
#

postgres supports constraints across columns too

clever wraith
#

at least for now

cold island
#

there are multiple fields that can be edited though

gritty wind
#

But isn’t json just that but without proper typing

clever wraith
#

And we wanted to go with the least "meh" one

gritty wind
#

Like json is basically multiple columns combined into one field

#

And the db can’t handle it for you

fallen patrol
#

as someone who's done stupid database design before, json for this is gonna be a footgun

clever wraith
#

Sure, but the explicitness of a field not being edited is provided by its absence in the json keys

gritty wind
#

Which is not good design

clever wraith
#

Sure

gritty wind
#

Discord engineer mindset lmao

#

Literally how 90% of their api works

clever wraith
#

I don't like it either

#

and am open for any ideas

fallen patrol
cold island
#

I mean, I'm open to concrete alternatives

gritty wind
#

Have a column that makes this condition you describe explicit

cold island
#

what condition

gritty wind
#

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

cold island
#

I don't follow what condition you're referring to

clever wraith
#

At least, i think that's what he's saying

gritty wind
#

More or less

#

I’m not sure of the problem specifics

#

Why does nullity not work for this

cold island
#

because null expiration is used for permanent infractions

gritty wind
#

Alright, makes sense to have permanent field be separate

cold island
#

what does that mean?

gritty wind
#

One sec

#

Fields:
Expiry: optional[datetime]
Permanent: bool

#

What’s the second meaning to a null expiry?

clever wraith
#

null means unedited

#

or permanent

gritty wind
#

Alright that seems like it would work with this design

cold island
#

What would the expiry field contain when permanent is true?

gritty wind
#

Null

cold island
#

So null means unedited unless perma is true?

gritty wind
#

Yup, just like it would with the json

cold island
#

How is it the same as the JSON 🤔

gritty wind
#

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

cold island
#

There's no real reason to query actions that edit it to null

gritty wind
#

Sorry what do you mean?

cold island
#

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.

fading galleon
#

@clever wraith Just a gentle reminder can you resolve the reviews that have been adressed by a commit for bot#2446?

dusky shoreBOT
clever wraith
fading galleon
trim cradle
#

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".

wind ruin
#

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

trim cradle
vale ibex
#

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

stable mountainBOT
#

bot/exts/help_channels/_channel.py line 174

async def get_closing_time(post: discord.Thread) -> tuple[arrow.Arrow, _stats.ClosingReason]:```
vale ibex
#

sort of the opposite to the logic in here

fading galleon
#

I have also added unittests for the app command error handler, it is fine right? bot#2446

dusky shoreBOT
bleak temple
#

@tight sand Sorry to ping again, but is there still changes needed for: bot#2388

dusky shoreBOT
bleak temple
#

This isnt you? pithink

vocal prairie
#

that is indeed me

#

you pinged the wrong person in discord

#

i just happened to see it

bleak temple
#

Ah woops

#

Updated file for your request

vocal prairie
#

one last suggestion for clarity

clever wraith
#

@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

clever wraith
#

Them = that one and the closed dm issue

static canyon
dusky shoreBOT
static canyon
#

Idrm either way

#

Although if it's done as part of #1223 I guess Robin would have to do it

clever wraith
#

Ah yes shoot

#

It's Robin that's working on it

static canyon
#

Yeah, not me

clever wraith
#

For some reason I thought you were

#

Ok ok

static canyon
slim venture
#

in what part of the code are OT names formatted to be allowed by discord?

#

is it in the site api?

gritty wind
#

It’s handled by bot, but it can be hard to see if you’re looking at the source code

#

!src ot add

stable mountainBOT
#
Bad argument

Unable to convert 'ot add' to valid command, tag, or Cog.

gritty wind
#

!src ot

stable mountainBOT
gritty wind
#

The add command here does the conversion, with the converter defined in the function argument

#

That lives under bot/converters.py

#

!src OffTopicName

stable mountainBOT
#
Bad argument

Unable to convert 'OffTopicName' to valid command, tag, or Cog.

gritty wind
#

Yeah figured

#

It’s there anyway

thorny obsidian
stable mountainBOT
#

bot/converters.py line 370

def translate_name(cls, name: str, *, from_unicode: bool = True) -> str:```
static canyon
#

!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)

stable mountainBOT
stable mountainBOT
#

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:```
static canyon
#

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...)

cold island
#

And then the other condition works because len(lines) > max_lines

cold island
static canyon
#

It just seems weird to say the max is 10, but then allow 11

static canyon
cold island
#

only when you exceed 10 lines

static canyon
cold island
#

no I agree there's a bug

static canyon
#

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

static canyon
cold island
#

ok I think I'm following what you're saying

#

yeah I guess it should be 10 then

static canyon
#

Okay, cool

#

I'll write up an issue on the bot repo

cold island
#

thanks

static canyon
# cold island 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 lemon_sweat). If it does, can I please get an approval and I'll work on the PR 😄

dusky shoreBOT
slim venture
#

hello, can somebody review sir-lancebot#1240

bleak temple
#

How do I progress on bot#2388, I believe its ready to merge.

dusky shoreBOT
cold island
#

You can install the pre-commit hook to make sure you don't commit code that fails

bleak temple
#

linting for a tag?

#

Alright, ill fix tmrw thanks

wind ruin
#

!e 3.10 print('hello world')

stable mountainBOT
#

Sorry, an unexpected error occurred. Please let us know!

ClientResponseError: 400, message='Bad Request', url=URL('http://snekbox-310.default.svc.cluster.local/eval')

wind ruin
#

did we decide to drop support for 3.10 at some point? or did it just break

static canyon
#

It's just not properly handled right now

gritty wind
#

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

dusky shoreBOT
tawdry vapor
gritty wind
#

Thanks and no worries

tawdry vapor
#

If I'm blocking anyone feel free to give me a nudge

gritty wind
#

Not sure how to do the docker generation and such without it :P

tawdry vapor
#

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.

cold island
#

The bot is taking some time to connect 🤔

#

There you go

#

!int e import sys; print(sys.version)

stable mountainBOT
#
In [1]: import sys; print(sys.version)
3.11.0 (main, Oct 25 2022, 05:00:36) [GCC 10.2.1 20210110]```
cold island
#

oh, why is it 3.11.0 🤔

tawdry vapor
#

I guess @vale ibex needs to update the base image

gritty wind
#

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

last patio
#

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

stable mountainBOT
#

.coveragerc line 17

pydis_site/apps/home/views/home.py```
last patio
#

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

vale ibex
#

Unless scale beats me to it

trim cradle
#

@clever wraith you've been on fire lately 😄

clever wraith
#

Thank you, it's also thanks to alot of good feedback and critiques 😁

tawdry vapor
tawdry vapor
vale ibex
dusky shoreBOT
vale ibex
#

I left the package there in my namespace just so nothing broke

cold island
#

I think it's waiting for a devops team member

vale ibex
#

yea it is

gritty wind
vale ibex
#

speaking of which, here's one now

cold island
#

yeah what are the odds

vale ibex
#

fellow owl-corp member too

#

please approve important pr

gritty wind
#

I don’t see any unit tests; can’t approve

vale ibex
#

unit tests are upstream

#

trust

gritty wind
#

Bet

cold island
#

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

vale ibex
#

lol

gritty wind
#

Lmao

#

It’s the pydis way

cold island
#

how do I put several ifs in the review policies yaml. I don't see anything like that in the spec

tawdry vapor
#

I can try to play around with a n image and see if I get a smaller size

gritty wind
#

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

vale ibex
#

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)

tawdry vapor
gritty wind
#

Sorry, not anymore

tawdry vapor
gritty wind
#

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)

bleak temple
dusky shoreBOT
cold island
#

@clever wraith httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://discord.com/api/v10/guilds/1090928968842084452/roles' when trying to run botstrap pithink

cold island
#

OH

#

nevermind.

static canyon
#

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.

clever wraith
#

From the template

static canyon
#

But I checked some of the config values and they seem correct (even though there were Forbidden responses from some of the webhooks requests)

clever wraith
static canyon
clever wraith
#

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

static canyon
clever wraith
#

At least with this context

#

ah

static canyon
clever wraith
#

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

static canyon
#

Do I need site to do reminders?

clever wraith
#

docker compose up --build --pull always

#

you always need site for bot

#

Since we have a healthcheck at startup time

static canyon
#

I don't remember needing to run site locally before 🤔

clever wraith
#

It might be because site was already running

#

if you have built it before

static canyon
#

Yeah, maybe, idk

#

So I need to clone site and run it?

clever wraith
#

no

#

Everything is inside the compose file

static canyon
#

Right, but I can't run the comopose file

clever wraith
#

docker compose up --build --pull always

#

why not ?

static canyon
#

Lemme try

static canyon
clever wraith
#

What does the error say again?

static canyon
#

Err, it doesn't output any error

#

Just says there was one

vale ibex
#

try DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose up --build

static canyon
#

That seems to be working

#

It's downloading stuff

vale ibex
#

Cool

#

you can add export DOCKER_DEFAULT_PLATFORM=linux/amd64 to your .zshrc file to do this by default

gritty wind
#

Ayy did Mac break our docker flows again

vale ibex
#

we should probably try to build for multiplatform

#

We're limitted by available wheels though

static canyon
#

Okay, so it built but then I got failed to connect to site again in bot

cold island
clever wraith
#

Ah ahahahha

static canyon
#
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
gritty wind
#

I’ll talk to Bella about that today

gritty wind
#

What does your .env look like

static canyon
#

Oh wait

#

I'm blind, it says http

clever wraith
#

The guide needs to change

static canyon
#

Looks like the bot it starting now, thanks 😄

clever wraith
#

it's still waiting on bot#2489

dusky shoreBOT
static canyon
#

Is there a way I can isolate logs from different services into different consoles?

clever wraith
#

You can run each service on its own

#

That's the primitive way

gritty wind
#

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

clever wraith
#

Compose bundles them for you

gritty wind
#

Yup

#

Or my preferred method, installed docker desktop and don’t learn any docker commands beyond compose up -d

static canyon
gritty wind
#

Not sure if it supports accessing with just the name, but yeah that’s the syntax

#

Might need container ID

clever wraith
#

It should be container name only i think

#

yep

gritty wind
#

Give it a shot either way

static canyon
#

How do I know the container ID?

gritty wind
#

docker container ps

static canyon
#

Oh, it is bot-bot-1

gritty wind
#

That’ll list out all the containers and their ID

clever wraith
#

It's doable with the name

static canyon
#

Is there a way to keep it live-updating?

clever wraith
#

wdym ?

static canyon
#

--follow?

#

The docker logs --follow command will continue streaming the new output from the container’s STDOUT and STDERR.

clever wraith
#

ag

#

ah

#

yes

#

Are you on windows ?

gritty wind
#

I think this just uses normal journalctl commands

static canyon
clever wraith
#

Ah okay

#

Because docker desktop has very cool ways to do all of this from the interface

#

View logs, access the shell, etc.

gritty wind
#

Docker desktop now supports all platforms more or less

#

Including Mac

clever wraith
#

I never used it anywhere other than windows personally

static canyon
static canyon
#

bot#2089, bot-core#137 and bot-core#141 are all in need of reviews; any feedback is appreciated 😄

static canyon
#
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`.
vale ibex
#

Are you running under docker?

#

If so, those env vars are correctly set in the docker compose file, so shouldn't need overwriting

outer oasis
#

plus1 I had the same problem last night
Under Docker yeah

static canyon
#

Fwiw the error says 172.23.0.4:80 but the env is set to http://snekbox:8060/eval

outer oasis
vale ibex
#

possibly the ports need updating in the compose file then

static canyon
#
  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
```![Shrug](https://cdn.discordapp.com/emojis/1004163436474794016.webp?size=128 "Shrug")
vale ibex
#

Yea, so update the url in the bot service to have :8060 in the url

static canyon
#
    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
outer oasis
vale ibex
#

it'll be :8060 not 8065

#

8065 is the port exposed on the host

outer oasis
#

Tried that first

static canyon
#
```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```
vale ibex
#

what's the error in the snekbox container?

static canyon
#

Err not sure

vale ibex
#

a 400 error suggests that it hit snekbox but it was refused

static canyon
#

How do I check?

#

docker logs {snekbox-container-id} doesn't show anything

vale ibex
#

docker logs <snekbox-311-id>

stable mountainBOT
#

docker-compose.yml line 70

image: ghcr.io/python-discord/snekbox:3.11-dev```
static canyon
outer oasis
#

Should it be the default snekbox image?

vale ibex
#

not sure what the current state of those images are

outer oasis
vale ibex
#

try it and see :D

#

Can't look into it myself right now

outer oasis
#

I'm at work
@static canyon please do the needful

static canyon
#

I can do it if you tell me what "it" is

outer oasis
static canyon
#

Wait

#

nvm, snekbox is but not snekbox-311

outer oasis
#

Ye

#

And 311 is the one that's getting hit

static canyon
outer oasis
#

Yeah

static canyon
#

Right, building

outer oasis
#

We're guessing that the 3-11 tag wasn't updated to include snekbox#159

dusky shoreBOT
outer oasis
#

Or something similar

static canyon
#

Now it won't connect to site lemon_pensive

#
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}```
outer oasis
#

firEyes
softFeels but firHmm

#

Is the site up?

#

If you give it a second can it connect?

static canyon
outer oasis
#

Is snek?

static canyon
#

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```
outer oasis
#

Nice

#

Be sure to PR so I can steal all your progress when I get home

static canyon
#

Just need to figure out what's going on with NsJail

#

Which I know absolutely nothing about

dusky shoreBOT
static canyon
atomic ivy
#

are you on macOS? pithink

gritty wind
#

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

static canyon
static canyon
atomic ivy
#

snekbox was broken on macOS even before the files PR

gritty wind
#

Huh really?

static canyon
gritty wind
#

Do you roughly know when that happened

static canyon
atomic ivy
#

before last year I think

atomic ivy
#

but if you get time to debug it, I can help as well

gritty wind
#

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

static canyon
gritty wind
#

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

static canyon
#

Hmm, okay

static canyon
gritty wind
#

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

static canyon
gritty wind
#

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

atomic ivy
#

thanks!

static canyon
#

Amazing, thanks! 🎉

stable mountainBOT
#
Aye aye, cap'n!

Your reminder will arrive on <t:1680248115:F>!

static canyon
#

So do we set it to https://snekbox.pythondiscord.com/eval?

gritty wind
static canyon
cold island
#

Also thanks non-sarcastically 😛

gritty wind
static canyon
static canyon
#

There's nothing in the docker-compose about the paste site (from what I can see)

gritty wind
#

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}

static canyon
#

Where exactly?

#

And what's {key}? the badbot thing?

gritty wind
#

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

static canyon
#

Right, I had it set to localhost:8000

gritty wind
#

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

static canyon
#
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)]```![lemon_sentimental](https://cdn.discordapp.com/emojis/754441881743786104.webp?size=128 "lemon_sentimental")
#

Sometimes restarting fixes it so will try that

gritty wind
#

Seems it's trying https?

static canyon
#

Yeah, think I had other envs set that shouldn't've been. Working now

gritty wind
#

Awesome

clever wraith
#

Yeah the site thing is deffo confusing. We'll try to get to it tonight and be done with it flr good

trim cradle
#

it looks like off-topic names didn't reroll at UTC midnight

outer oasis
#

(Not that I have any idea what it means — just pointing it out)

cold island
#

looks like it might have rejected a char

#

which is weird

#

I'll edit it to what it was supposed to be

outer oasis
cold island
#

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.

outer oasis
#

What a random word to block

cold island
#

I mean I understand the possible innuendo, but it's... so specific

#

I gave it a new name in any case

stable mountainBOT
static canyon
#

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)

fallen patrol
clever wraith
fallen patrol
#

yes I know

#

but unless you can create threads, that's not helpful

clever wraith
#

Seems like it is

fallen patrol
#

that's not in this discord, though

clever wraith
#

Ah wait

fallen patrol
#

it matters that it's this discord server and not a different lol

clever wraith
#

Why ?

#

I think it's whether it's a matter of the server being a community one

#

Not sure tho

fallen patrol
#

anyways I thought it was partnered and not server discovery

#

just checked and servers in discovery can make threads with swallow in the name

clever wraith
#

Oh, true

fallen patrol
#

swallow can also be in the description

#

though when I'm on PC I have an idea to be able to validate this

cold island
#

@clever wraith hmm for some reason I'm getting 400 when trying to make the server a community, not sure why. Worked fine yesterday

clever wraith
#

Can you break there & log the response's message ?

#

Or just log

cold island
clever wraith
#

No I mean, print(response.json())

#

inside the client

#

I can get to my pc in a bit

cold island
#

not urgent, I also need to take a break

clever wraith
#

found it

#

There we go, fixed

#

__getitem__ in SilencedDict was missing a return 😅

gritty wind
fallen patrol
#

oh yeah that reminds me i probably need to update token regexes again

fallen patrol
#

so are OG Helpers still part of the staff and able to view staff channels?

stable mountainBOT
#

bot/exts/recruitment/helper_utils.py line 73

"""Load the OffTopicNames cog."""```
fallen patrol
#

lmao

inland rapids
#

Lol

fallen patrol
#

omfg

#

I just realised

#

its the april fools joke

#

which explains why the implementation felt so incomplete

#

its not supposed to give permissions

inland rapids
#

?userinfo

clever wraith
#

@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

  1. First, the name, obviously
  2. 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 )
timid sentinel
# clever wraith <@493839819168808962> (Discussion here is faster 😛 ) Idk if you've seen my last...

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.

clever wraith
# timid sentinel I'd not realised that there had been some discussion on it before, given that it...

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

gritty wind
#

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

clever wraith
#

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

#

🔨 ?

trim cradle
#
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

vale ibex
#

Do docker compose pull then docker compose up --build

#

With a space, not a hyphen

#

Hyphenated docker compose is deprecated

trim cradle
#

thanks devops bb

slim venture
#

i don't understand the point of this

#

why not just use discord.Message

#

the python codebase is so inconsistent with this

cold island
#

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.

clever wraith
#

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

fallen patrol
#

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)

clever wraith
clever wraith
#

Which doesn't apply here

static canyon
#

@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

dusky shoreBOT
static canyon
#

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

opal pilot
#

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

clever wraith
fading galleon
clever wraith
static canyon
clever wraith
#

Ah, I looked in a completely different direction

fading galleon
#

For bot#2446 it is complete and open to reviews.

dusky shoreBOT
fading galleon
#

Also @clever wraith I see you haven't resolved some of the simple addressed reviews. Is there a reason?

clever wraith
opal pilot
opal pilot
bronze torrent
#

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

clever wraith
clever wraith
cold island
#

@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

vale ibex
#

:)

clever wraith
cold island
#

Is there some way to make PyCharm understand that discordpy's cached_slot_property acts like a property?

gritty wind
#

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

cold island
#

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

gritty wind
#

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

late wren
#

help!!

clever wraith
fading galleon
#

@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.

clever wraith
fading galleon
clever wraith
#

That's up to our triage lead @vocal wolf

clever wraith
#

Can we have reviews on site#885, so that we have an up to date guide for any contribs?
Thaaaank you :B

cold island
#

I'll look at it again

clever wraith
#

Thank you!

cold island
#

almost!

clever wraith
# cold island almost!

In your .env.server file:

  • If you wish to work with snekbox, set the following:
    • urls_snekbox_eval_api to "http://snekbox:8060/eval"
    • urls_snekbox_311_eval_api to "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

cold island
#

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

clever wraith
#

sooo

cold island
#

👍

clever wraith
#

pushed!

cold island
#

oh, you lost the * in your edit

clever wraith
#

I'm going to cry

#

Ahahhaha

#

JK

#

Fixed ! :B

static canyon
#
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?
static canyon
dusky shoreBOT
static canyon
#

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

clever wraith
#

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

static canyon
clever wraith
#

Idk what wait_until_guild_available does under the hood, let me look at that first

cold island
#

I think it's safe to assume the channels specifically are cached

gritty wind
#

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

static canyon
gritty wind
#

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

static canyon
#

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?

clever wraith
#

You'll need to rebuild the images

#

Are you running site & bot separately ? Or are you using the bot's compose file ?

static canyon
clever wraith
#

Pull the latest image

static canyon
#

How?

cold island
#
docker compsoe pull
docker compose down -v
docker compose up --build
static canyon
#

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?

dusky shoreBOT
cold island
#

uuuh you could int e

static canyon
cold island
#

you would call the routine that should be run at midnight

static canyon
static canyon
cold island
#

yeah that sounds right

static canyon
#

It could be because I'm on macos but hope not

cold island
cold island
static canyon
static canyon
static canyon
clever wraith
#

You're not gonna type that each time, are you ?

static canyon
#

I don't type commands anyway lol

#

I just use the arrows keys

clever wraith
#

yeah

static canyon
#

But yeah, I probably should lol

clever wraith
#

But next time, you'll come asking for the same question

#

Because I remember this happening to you

static canyon
#

Will setting it in the bot project .env work?

clever wraith
#

I don't think so

static canyon
#

Ugh

#

Don't really want it global because it might mess with my work docker images

clever wraith
#

.env is just a layer built to facilitate passing env vars to your app

#

It's not used by your os

static canyon
#

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

clever wraith
#

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

static canyon
#

🤔

static canyon
clever wraith
#

Yes

static canyon
clever wraith
#

You're not getting these errors in the other stuff you do at work for not setting the default platform ?

static canyon
clever wraith
#

Whatever works for you then

#

You can set an alias

cold island
static canyon
static canyon
outer oasis
stable mountainBOT
#

Dockerfile line 1

FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:3.11-slim```
static canyon
#

Do I have to replace stdout or something?

#

Yeah, looks like that works

static canyon
cold island
static canyon
#
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
static canyon
#
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 😅
static canyon
#

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 🙂

broken topaz
#

does python discrod site use react?

gritty wind
#

We use django like pure blooded pythonistas

#

At least for the main site 😛

fallen patrol
#

hm

#

I'm 99% certain I'm about to cause a sentry issue on @stable mountain

outer oasis
#

Most recent one I see is hours ago

fallen patrol
#

disnakedev/disnake#722

fallen patrol
#

!d

stable mountainBOT
fallen patrol
#

aw no sentry issue

#

but anyways yea

#

someone should run
!d r
!d cleardoccache disnake

cold island
#

!d r

stable mountainBOT
#
Inventories refreshed
cold island
#

!d cleardoccache disnake

stable mountainBOT
#

Successfully cleared the cache for disnake.

cold island
#

!d disnake.ext.commands.Bot

stable mountainBOT
#

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.
cold island
#

👍

fallen patrol
#

we refactored the docs to make it fast to load

#

so that's why it was broken for your bot

brisk brook
#

Which project was it that used multi-staged builds together with environment variables to have a production and development versions?

gritty wind
#

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

jaunty dune
#

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.

dim pelican
#

!contribute

stable mountainBOT
#
Contribute to Python Discord's open source projects

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

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
clever wraith
timid sentinel
clever wraith
timid sentinel
#

No worries. It seems like the guide doesn't say to do so if you're using docker, we should probably fix that.

clever wraith
#

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 ?

dim pelican
#

You can check out any open issues that haven't been assigned, or review some of the open PRs

opal kiln
#

!contribute

#

!contribute

clever wraith
stable mountainBOT
#
Contribute to Python Discord's open source projects

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

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
static canyon
#

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

#

!sf 1096557059937423440 1096558363912966144

stable mountainBOT
#
Snowflakes

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>).

static canyon
#

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?

drowsy ravine
#

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 ====

clever wraith
#

(I'm explaining the usual '' flow '' of things)

#

!in

stable mountainBOT
#
Did you mean ...

» indent
» intents
» inline
» in-place
» if-name-main

clever wraith
#

Oh, we don't even have that tag in the first place

drowsy ravine
#

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 🙂

drowsy ravine
clever wraith
#

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 ? 🤔

drowsy ravine
#

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.

drowsy ravine
fallen patrol
#

@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

fallen patrol
outer oasis
#

I see

fallen patrol
outer oasis
fallen patrol
#

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

outer oasis
fallen patrol
outer oasis
#

Wow. The more I hear the worse it gets.

fallen patrol
#

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

opal kiln
#

!contribute

stable mountainBOT
#
Contribute to Python Discord's open source projects

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

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
clever wraith
#

@drowsy ravine I'll transfer that issue to the meta repository.
It's where all tags should actually go to gain more traction

drowsy ravine
#

👍🏻 perfect

clever wraith
dusky shoreBOT
drowsy ravine
#

Thanks for that. 🙌🏻

clever wraith
#

Sure thing

patent pivot
#

saves us from things like this

upper marten
#

can anyone help me?

austere hornet
stable mountainBOT
#
Contribute to Python Discord's open source projects

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

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
queen dawn
#

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 !

full fractal
#

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.

flint geyser
#

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.

grim prairie
#

[python-discord/bot] Pull request opened: #2546 updated mutability.md to link Nedbat's talk - look; it's me!

#

xD

static canyon
#

For something as small as this it's not a huge deal though

grim prairie
#

yeah. if it was big, I wouldnt have done that

fallen patrol
#

bot#2522 is so beautifully buggy

dusky shoreBOT
fallen patrol
#

will report bug and STR using official channels after dinner

#

!remind 1h lol

stable mountainBOT
#
Sure thing!

Your reminder will arrive on <t:1681775712:F>!

fallen patrol
#

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

stable mountainBOT
fallen patrol
#

@cold island so basically discord link parsing is so whack and also different on both the backend and the client :)

#
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
slim widget
#

👀

fallen patrol
#

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

cold island
#

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

fallen patrol
#

i don't know what regex they use for link highlights but i've been looking for it myself for my own bot

#

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.

fallen patrol
fallen patrol
#

test

#

aw

fallen patrol
#

lmao

bold spindle
#

we need ceil division

#

smth like ^/ ig

bleak temple
bold spindle
#

in python

#

we have floor division with //

#

why cant we make it easier to ceil divide by making a ^/ operator or something like that

clever wraith
# bold spindle in python

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.

vocal wolf
#

@dim pelican greetings, was this a part of april fools, or is this an actual PR? I can't tell lol

sir-lancebot#1245

dusky shoreBOT
dim pelican
clever wraith
#

@cold island I've updated the pr to simply run a null check on ctx.message

rapid igloo
#

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)

dusky shoreBOT
rapid igloo
#

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

vocal prairie
austere hornet
#

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?

rapid igloo
subtle kraken
dusky shoreBOT
subtle kraken
#

cc @sharp crag mayhaps

sharp crag
#

Huh. I thought that was merged already. Oh well

#

I'll work on the reviews today, thanks for bringing it to attention 👍

sharp crag
#

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

dusky shoreBOT
sharp crag
#

Actually I feel like we could probably consolidate both of these into one tag

fallen patrol
#

eh

#

probably best to have seperate

#

also explain bot.listen

white light
#

I think Python is frozen in #1101145389287100478. All I did was tell it to test if 69 was a prime number.

static canyon
#

Except this time there wasn't a bot restart so no clue what's causing it Shrug

subtle kraken
fallen patrol
#

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

fallen patrol
#

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
atomic ivy
#

well, we could selectively block messages that have this formatting

#

if it gets annoying enough

gritty wind
#

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

fossil veldt
#

overall seems to be beneficial for bot messages

clever wraith
#

In any case

#

It'll be caught by the filters

fallen patrol
vocal prairie
#

@fallen patrol fyi you are pinging the mods

fallen patrol
#

lol seems like bad design

vocal prairie
#

if someone is doing spoiler spam, they're usually spam-pinging someone. we'd like to know. seems reasonable to me.

fallen patrol
#

fair

#

still a weird design to ping like that

fallen patrol
midnight jasper
#

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.

sharp crag
sharp crag
#

So a quick little tag explaining that would be great

still comet
sharp crag
#

@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

midnight jasper
sharp crag
#

Awesome, thank you so much. Feel free to reach out if you need help with anything or to request a review

midnight jasper
sharp crag
midnight jasper
#

for the md file

sharp crag
#

That's up to you

midnight jasper
#
---
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.
sharp crag
midnight jasper
#

What branch do I do the pr from @sharp crag

sharp crag
#

Whichever branch you commited your changes to

#

Unless you explicitly made a new branch it'll be main

midnight jasper
sharp crag
midnight jasper
sharp crag
#

If you run git config --get remote.origin.url what does that give you?

midnight jasper
sharp crag
#

Looks like the remote is the actual repository, rather than your fork

midnight jasper
#

oh

sharp crag
#

You can git clone <your_fork_url>.git to clone your fork, rather than the actual repo

midnight jasper
#

aight

sharp crag
#

Then commit your changes, push to your fork, and PR upstream

outer oasis
midnight jasper
sharp crag
#

Awesome, thanks. I'll leave a review

sharp crag
midnight jasper
sharp crag
midnight jasper
#

And how that relates to message content

sharp crag
#

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

fallen patrol
midnight jasper
still comet
#

but that isn't how most people will be using intents, I don't think it's relevant here

sharp crag
#

Have you addressed the reviews? Not sure if you may have forgotten to push

midnight jasper
still comet
#

Also, I think it should say somewhere that privileged intents have to be enabled in the dev portal as well

midnight jasper
midnight jasper
#

ah i recommited

fallen patrol
#

it really depends on how that data is exposed

#

haven't read, no plans to

still comet