#dev-contrib

1 messages ยท Page 122 of 1

static canyon
#

Yep

brisk brook
#

PS: You probably want to add labels

static canyon
brisk brook
#

To the right

#

I think it's a low-priority, enhancement, frontend change?

static canyon
#

Thanks

#

I think that's right @brisk brook

#

It has passed flake8 so rest of linting should work

brisk brook
#

Now I am confused again, why did this cause ghost pings?

Because you need to confirm the trashcan icon, so you will know where the ping came from?

static canyon
#

It deletes the ctx.message as well

#

So you've now got a ghost ping

#

The point of this is to only delete ctx.message if it DOESN'T have pings

brisk brook
static canyon
#

lol

#

So does it look good?

sleek steppe
brisk brook
sleek steppe
#

cool

static canyon
sleek steppe
#

Is it supposed to delete the error_message after the timeout?

static canyon
#

No

#

Only if it doesn't timeout

brisk brook
#

It's a bit different. You see wait_for_deletion() puts both the wait_for() and message.delete() inside the same supress(). Meaning it won't get deleted if it timed out, the old code deleted the message if it timed out, do we wish to keep this behaviour?

static canyon
#

Meaning it won't get deleted if it timed out
That's what my intention was

brisk brook
#

Hmm, good point. It looks weird if someone did !doc and it looks like they got no response (but it's just that the failure message that got deleted)

#

You should clear the reactions then, because like this looks like they will stay? Which again can make the bot look unresponsive if someone tries it after the timeout.

static canyon
#

Yep, good point

#

Hmm

#

There's no real way to know if it got deleted though

#

I guess try to remove it and just suppress the error if we get NotFound

wide elm
#

Hi :D

#

I can ask questions related to different aspects of pydis project source codes here, right?

brazen charm
#

yes

wide elm
#

ok

wide elm
#

so I was wondering, so with how pixels implemented ratelimits, does it just check if a user has a cooldown or how many requests they had remaining through redis each time the user requested an endpoint?

brazen charm
#

When i was initially adding the automatic deletion of the invocation and the error message, the reason was because of some people just trying out the command, or (unsuccessfully) trying to find some symbol, leading to a chain of lookup errors as it's rarely cleaned up, but I guess it is a bit confusing in lower traffic channels

static canyon
sleek steppe
#

NotFound

static canyon
#

It says that's if the reaction is invalid

#

So is it just both?

sleek steppe
#

If you add a reaction to a message that is deleted then it will 404

static canyon
#

Aight, thanks

wide elm
#

ok

#

So they just checked through redis each time someone requested an endpoint?

sleek steppe
#

pretty much yeah

brisk brook
# wide elm So they just checked through redis each time someone requested an endpoint?

It generates a key with the user ID (gotten from the token they authorize with) and looks this up in Redis. Redis handles expiring the keys: https://github.com/python-discord/pixels/blob/3346f31f74d18b40c50a1aa8c239b770a41a3651/pixels/utils/ratelimits.py#L278-L323

GitHub

Pixels is an introductory API from Python Discord for painting on a collaborative canvas. - pixels/ratelimits.py at 3346f31f74d18b40c50a1aa8c239b770a41a3651 ยท python-discord/pixels

vale ibex
#

Yup Redis is real quick

stable mountainBOT
#

pixels/utils/ratelimits.py line 115

request_id = next(self.request_id)```
vale ibex
#

we couldn't do in-memory since we have multiple workers

#

and even 2 versions of it running (k8s replicas)

brisk brook
#

self.request_id is a itertools.count

#

It's not garuanteed unique across the deployment (for example if they restart).

#

But the chance of someone:

  1. Making a request with a low request_id (insert into redis)
  2. Causing it to restart
  3. Doing another request and get the same request_id
static canyon
brisk brook
#

All without the key from step 1 expiring, is so extremely low that we can consider it unique.

molten perch
#

Hey! I think my draft pull request is ready to โ€œgoโ€. What should I do? Is there a standard protocol that I have to follow?

sleek steppe
#

Are you talking about bot#1678?

dusky shoreBOT
molten perch
#

Yes, I am, I think itโ€™s ready to be formally reviewed.

sleek steppe
#

You should mark it as ready then

molten perch
#

Alright, Thanks. Iโ€™ll do it soon then, Iโ€™m away from my computer right now.

green oriole
#

why do I get two thousands emails about bot#1664

dusky shoreBOT
green oriole
#

haha

vale ibex
molten perch
static canyon
#

I responded to your comment by the way @brisk brook

brisk brook
#

Yes I am going to take a look, sorry I was eating.

static canyon
#

No worries ๐Ÿ‘

#

Just pinged because I didn't know if you were like me and didn't really check GitHub

static canyon
#

Can I get two more reviews on bot#1694 please?

dusky shoreBOT
viscid coral
static canyon
#

The idea is to say the code's okay

#

And if you go to the "files" page there should be a thing in top-right

#

Gimme a few minutes and I'll show you

viscid coral
#

Show me how?

static canyon
#

Screenshot

#

Just not on laptop right now

#

This is it @viscid coral

#

Although I think only staff can Approve

#

There's "Comment", "Approve" and "Request Changes"

brazen charm
#

anyone can approve, it just won't directly count towards the approvals required for a merge

viscid coral
#

So I should comment?

static canyon
#

If you're approving the code (saying it's good quality etc.) then you'd "Approve"

If you're asking for a change to be made (e.g. adding a comment or whatever) then you'd "Request changes"

If it's neither, and you're just posting a general comment or question (e.g. "This might not work how you expect it because ...") then you use a "Comment"

#

You can approve if you'd like to, just it doesn't count towards the required 3 approvals since you're not staff/core-dev(which is what Numerlor was saying). Still good to do though

viscid coral
#

What is the else for? Which statement?

#

Oh if it wasn't found?

static canyon
#

Which else?

#

The bottom one (bottom of screenshot)?

viscid coral
#

Yeah i think I got it

#

If there is a correct search

static canyon
#

It's linked to the if doc_embed is None:

viscid coral
#

Oh ok

#

Why not just do if doc_embed or something? Even tho it's the same

static canyon
#

That's just how the previous person wrote it

viscid coral
#

Well the code seems okay to me, I'll try to press the approve review or how it's called

static canyon
#

Generally as long as you aren't flipping a condition (not) first it's fine

stable mountainBOT
#

bot/exts/info/doc/_cog.py lines 341 to 350

if doc_embed is None:
    error_message = await send_denial(ctx, "No documentation found for the requested symbol.")
    await wait_for_deletion(error_message, (ctx.author.id,), timeout=NOT_FOUND_DELETE_DELAY)
    with suppress(discord.NotFound):
        await error_message.clear_reaction(Emojis.trashcan)

    # Make sure that we won't cause a ghost-ping by deleting the message
    if not (ctx.message.mentions or ctx.message.role_mentions):
        with suppress(discord.NotFound):
            await ctx.message.delete()```
viscid coral
#

Is that ok? Anything else I should add?

static canyon
viscid coral
static canyon
#

Yep, perfect ๐Ÿ‘

viscid coral
#

Submitted

static canyon
#

Even though your approval doesn't count towards the 3-approval requirement, it's still good to get the extra feedback, and can be good practice for you too

#

So it's definitely still worth doing

viscid coral
#

Yeah

#

Just happy to help!

static canyon
#

(Also why your tick isn't green)

#

But thanks ๐Ÿ‘

viscid coral
static canyon
#

The reason it's not green is because you don't have write access (because you're not staff/core-dev)

viscid coral
#

Oh ok

static canyon
viscid coral
#

I think it was approved

static canyon
#

Nice

viscid coral
#

Test it on me lol

static canyon
#

!d @viscid coral

#

nice

#

!d @viscid coral

stable mountainBOT
#
Fat chance.

No documentation found for the requested symbol.

static canyon
#

And if you don't react it should remove the reaction

viscid coral
#

!d discord.ext.commands.Bot.blahblah @static canyon

stable mountainBOT
#
Not gonna happen.

No documentation found for the requested symbol.

static canyon
#

Nice

viscid coral
#

Yap

static canyon
#

Gone are the days of ghost-pings in docs command

#

let's test if it works with role pings (don't actually lol)

viscid coral
#

Yap, unless someone does it on purpose

viscid coral
static canyon
#

no lol

#

The !pypi command has the same issue, so should I code the same thing for that? Or would it make more sense to make it a util function?

viscid coral
#

It'll make more sense to make it a util function yeah

#

Open a pull request or something ig

brisk brook
static canyon
#

I mean it's a bit more than that

static canyon
#

To change in pypi command would be like 5 lines of changing code I think

viscid coral
#

Yeah it's a bit more, I think you should do it a util function

static canyon
#
if error:
    await ctx.send(embed=embed, delete_after=INVALID_INPUT_DELETE_DELAY)
    await ctx.message.delete(delay=INVALID_INPUT_DELETE_DELAY)
```would become```py
if error:
    error_message = await ctx.send(embed=embed)
    await wait_for_deletion(error_message, (ctx.author.id,), timeout=INVALID_INPUT_DELETE_DELAY)
    with suppress(NotFound):
        await error_message.clear_reaction(Emojis.trashcan)
    # If won't ghost-ping when deleting message 
    if not (ctx.message.mentions or ctx.message.role_mentions):
        with suppress(NotFound):
            await ctx.message.delete()```
viscid coral
#

Makes the code look better and that it dpesn't repeat itself

static canyon
#

@brisk brook ^

#

Or```py
async def delete_message_if_no_pings(message: discord.Message):
"""Checks whether message pings any users. If it doesn't, will safe-delete it."""
# If won't ghost-ping when deleting message, delete it
if not (message.mentions or message.role_mentions):
with suppress(NotFound):
await message.delete()

...

in command

if error:
error_message = await ctx.send(embed=embed)
await delete_invocation_if_no_pings(ctx)```

brisk brook
#

That's not a fair comparison, the latter codeblock does not do the same thing

static canyon
#

Right my bad

#

lemme fix

#

I think actually we should just make wait_for_deletion remove the reaction. Then it'd be the same

brazen charm
#

wait_for_deletion usually deals with timeouts where it really isn't necessary to remove

static canyon
#

Would it be bad to make it remove though? I can't really see any downside to it

#

Would mean changingpy with contextlib.suppress(asyncio.TimeoutError): await bot.instance.wait_for('reaction_add', check=check, timeout=timeout) await message.delete()topy try: await bot.instance.wait_for('reaction_add', check=check, timeout=timeout) except asyncio.TimeoutError: await message.clear_reactions() else: await message.delete()

#

There's also the fact that if the message still has reactions, but isn't listening for reaction_add anymore, then it makes it look like the bot isn't working when someone clicks a reaction

brisk brook
#

Might be good to research the use of wait_for_deletion()

static canyon
brisk brook
#

Could be a deal-breaker for some code

brisk brook
static canyon
#

How do I search the repository?

#

Can only search for a file

brisk brook
#

You can search locally in whatever editor you use, I am pretty sure all editors have this option.

Otherwise you could use sourcegraph or similar online options. Sourcegraph is pretty cool!

static canyon
#

Just had a look and it won't break anything anywhere

#

Wouldn't even have to touch the other files using it

#

The only case it'd break is if you tried to remove the reactions without suppressing which is never done (only place that tries to remove is my PR, which uses contextlib.suppress so wouldn't raise an error)

#

@brisk brook ^

brisk brook
#

I see, well in that case sounds good

#

!eval print(0)

stable mountainBOT
#

@brisk brook :white_check_mark: Your eval job has completed with return code 0.

0
static canyon
#

That doesn't timeout but I can always only remove when a timeout is specified

#

(Logic would be in same function so have access to the timeout)

brisk brook
#

How long was the time? It's like only a few minutes right?

I think this is a nice QoL, because eventually this message here won't delete when I click ๐Ÿ—‘๏ธ. If we clear the reaction when this happens means we don't break any user-made assumptions.

static canyon
#

In fact that does have a timeout

#

It's the default, 60 * 5 (5mins)

#

I think this is a nice QoL
QoL to make the change I'm suggesting?

brisk brook
#

Yes, please change this to remove the reaction.

static canyon
#

Will do ๐Ÿ‘

#

Are you cool with me @ing you in the GitHub issue?

viscid coral
#

What is QoL?

static canyon
#

Quality of life

brisk brook
static canyon
brisk brook
#

It's so small there's probably no issue if you do both the remove the reaction change as well as adding that usage to the command

static canyon
#

I mean I've already created the issue now lol

#

But yeah you're right, probably could've done in the same one

viscid coral
#

How come none of you have the contributors role? I mean ya'll do a lot

static canyon
viscid coral
#

It doesn't have to only be on github tho(I think), you also help a lot about the server in community-meta

static canyon
#

It's GitHub only (or more specifically dev-ops If I remember correctly)

brisk brook
static canyon
#

Wanna make sure I'm not missing anything stupid

brisk brook
#

It's not a big change, so it should be good.

static canyon
#

I did the wait_for_deletion() as its own issue

#

So I guess I can just make it solve both issues?

brisk brook
#

Yes but the PR to fix it can do both

static canyon
#

Right okay

static canyon
#

I am not sure how to interpret what you said?
Is that the only change needed for the wait_for_deletion update?

brisk brook
#

They're quite related

brisk brook
static canyon
#

Only want to clear the reactions when we don't delete the message though

#

To save the error

#

Hence I changed to try/except/else

brisk brook
#

Ah, yes that code looks correct

static canyon
#

๐Ÿ‘

static canyon
#

@brisk brook ^

brisk brook
#

I mean I may not be one to have complete control over that, but I don't like it. It's like 1 line saved?

static canyon
#

2 lines each time you use it, and I'll be using it at least twice

brisk brook
#

3 lines of code vs (usage + import). 2 lines

static canyon
#

Right yea true

#

I mean it saves duplicate code again

brisk brook
static canyon
#

Yeah true

#

I agree

#

Think I'll leave that

brisk brook
#

Sounds good

static canyon
stable mountainBOT
#

bot/utils/messages.py lines 98 to 103

try:
    await bot.instance.wait_for('reaction_add', check=check, timeout=timeout)
except asyncio.TimeoutError:
    await message.clear_reactions()
else:
    await message.delete()```
static canyon
#

@brisk brook ^

#

Don't think I need to

#

Yeah, I shouldn't need to

brisk brook
#

The original code didn't suppress anything other than TimeoutError so no

static canyon
#

Only case it might is if there was no reactions but the function returns before this line if that happens so no issues

#

Let's see if I can remember how to do the PR lemon_grimace

viscid coral
#

I think I did something weird once about forking the project, changing what neeeded, and submitting it

static canyon
#

Does this look right? @brisk brook

viscid coral
#

I think it looks ok, but not 100% sure

static canyon
#

Slightly reworded

#

I wonder

#

nvm

brisk brook
#

You won't be correctly linking both issues

static canyon
#

They seem to both be linked

brisk brook
#

GitHub doesn't understand "and"

static canyon
#

Both display though?

brisk brook
#

It links the issue so that you can click it. But it won't show "This issue will be automatically closed when this pull request is merged"

viscid coral
#

So just:
Solves #1695
Solves #1624?

static canyon
#

Or this?

brisk brook
static canyon
#

Wording doesn't really matter, as long as it makes sense

#

I'd rather not ducky_bike like we did with the docstring tag earlier lol

#

Also is the "Can't automatically merge" an issue?

#

@brisk brook

viscid coral
#

It says you can still open PR, I wonder what it's cause

static canyon
green oriole
#

You have conflicts to solve

static canyon
#

God damn it

green oriole
#

Just create the PR for now, we can solve them later

static canyon
#

Alright

brisk brook
#

This is probably because you have changes from your old PR on that branch

#

You should always create a new branch when making a PR so that this doesn't happen.

YOU/main should preferably always be up-to-date python-discord/main

green oriole
#

You should work on the pydis repo though

static canyon
#

Think I did anyway

#

God damn it

#

Linting has gone back to being the bane of my existence

#

Doesn't even say the error lemon_grimace

thorny obsidian
#

Trailing whitespace

static canyon
#

Again lemon_exploding_head

viscid coral
#

lol

brisk brook
#

It's in the comment I think?

static canyon
#

Yeah I fixed one in a comment

brisk brook
#

Since you removed this code: await error_message.clear_reaction(Emojis.trashcan) you no longer need to import Emojis

static canyon
#

Right

brisk brook
#

from bot.constants import MODERATION_ROLES, RedirectOutput

static canyon
#

Don't think that's what you linked to though?

#

Unless me/GitHub is just messing up

brazen charm
vocal wolf
#

what is going on over here?

green oriole
#

Fisher is fishing resources

vocal wolf
#

nais

#

have fun

#

and also someone review that PR Numerlor linked

twilit juniper
static canyon
#

Hopefully this time ๐Ÿคž

#

Finally ๐ŸŽ‰

#

bot#1696

dusky shoreBOT
viscid coral
#

Seems ok to me

static canyon
#

@brisk brook can't figure out how to do the docstring

#
    """
    Wait for up to `timeout` seconds for a reaction by any of the specified `user_ids` to delete the message.
    If user doesn't respond in time, will clear all reactions to indicate option to delete has expired.

    An `attach_emojis` bool may be specified to determine whether to attach the given
    `deletion_emojis` to the message in the given `context`.
    An `allow_mods` bool may also be specified to allow anyone with a role in `MODERATION_ROLES` to delete
    the message.
    """```did this but it failed linting because it needs a blank line between summary and description (considers 2nd line as description rather than part of summary)
brazen charm
#

multi line docstrings should be laid out with one line at the top, an empty line, and then the more verbose description

#

You should either condense it into one line, or move it to a more fitting place

static canyon
#

move it to a more fitting place
What do you mean by this? @brazen charm

brazen charm
#

I think in this case a newline between the first two lines would be the nicest

brisk brook
#
    """
    Wait for up to `timeout` seconds for a reaction by any of the specified `user_ids` to delete the message.

    If user doesn't respond in time, will clear all reactions to indicate option to delete has expired.
    An `attach_emojis` bool may be specified to determine whether to attach the given
    `deletion_emojis` to the message in the given `context`.
    An `allow_mods` bool may also be specified to allow anyone with a role in `MODERATION_ROLES` to delete
    the message.
    """
#

Just put it in the description

brazen charm
#

I'd leave the newline after it in place

static canyon
#
    """
    Wait for up to `timeout` seconds for a reaction by any of the specified `user_ids` to delete the message.
    
    If user doesn't respond in time, will clear all reactions to indicate option to delete has expired.

    An `attach_emojis` bool may be specified to determine whether to attach the given
    `deletion_emojis` to the message in the given `context`.
    An `allow_mods` bool may also be specified to allow anyone with a role in `MODERATION_ROLES` to delete
    the message.
    """```so this?
#
"""
Wait for any of `user_ids` to react with one of the `deletion_emojis` within `timeout` seconds to delete `message`.

If `timeout` expires then reactions are cleared to indicate the option to delete has expired.
...
"""```think this is more descriptive actually
#

Committed for now since going to bed in a minute

#

Going to bed now, bot#1696 just needs 2 more reviews and then botโ€‹#1624 and botโ€‹#1695 should be able to be closed

dusky shoreBOT
trim cradle
#

For the new resources system, we need something that reads all the resource yaml files and aggregates certain data from them. I want this to run once when the site launches and then cache that information. How should I approach this? Do TemplateViews have an "on launch" event?

vale ibex
#

Might be easier to cache it into redis on the first hit

#

then subsequent hits can just check for that key first

#

I'm not sure if we already have a pattern like this setup in site or not

trim cradle
#

CC @blazing magnet

blazing magnet
blazing magnet
green oriole
#

Eh, using Redis comes with a lot of problems due to race conditions. How intensive would be this computation?

static canyon
#

Can I get 2 more review on bot#1696 please? It closes bot#1695 and also bot#1624

last patio
#

I'll take a look after trackmania

static canyon
#

Thanks ๐Ÿ‘

eternal owl
last patio
#

isn't it missing a push?

#

i requested a re-run but i don't think it's going to change anything

eternal owl
#

I thought I forgot to make migrations for a model or so, but I have everything migarted

#

everything is pushed

#

maybe I should just update the branch and see

#

updated the branch rn

last patio
#

yeah, the django error about migrations still pops up:

CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0070_auto_20210519_0545, 0071_increase_message_content_4000 in api).
21
eternal owl
#

right

#

trying to run those commands and fixing it

#

should hopefully fix it now

last patio
#

@green oriole do you mind if i request you in for a few reviews

eternal owl
#

passed \o/

clever wraith
#

@lime sluice

exotic ember
#

@static canyon re:ghost pings, go for it, I think it's how it used to be too

green oriole
last patio
#

ah you're already requested in one of them (site #526) as code owner

#

i'll throw in another

green oriole
#

Sounds good

viscid coral
#

!user

stable mountainBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

viscid coral
#

I think joined should be used this format: x years, x months, x days ago(unix timestamp here of joined date) because if the user language is not English it isn'y understandable

vocal prairie
#

If they hover over it, they can see the exact time

#

It's a feature of Discord handled by your client (so it should be your own language)

#

Looks like this when I switched my discord language to french

gritty wind
tawdry vapor
#

For sentry

weary pumice
#

why is the main folder containing the application files for sir lancebot called bot instead of src, is this some convention to make the src folder be more informative?

patent pivot
#

src is not a convention in python

#

because when you come to run your application, you use python -m my_module

#

so in our case, python -m bot

weary pumice
#

i see, thx joe

peak monolith
#

hey guys

#

I'm getting this error when pushing my git

#

I will send a ss

#

can anyone welp

#

this

brisk brook
#

So if your branch looks like this: ```
A -> B -> C -> D


Your repository looks like this: ```
A -> B -> C -> D -> F

What type of changes have you made? Do you know why your repository has the F commit, but you don't?

cold island
#

Is this about one of our projects? this channel is for conversations about the development of our projects.

brisk brook
gritty wind
#

So, yes technically we do use LF, and it used to be enforced using pre-commit

#

The thing is, it isnโ€™t really all that convenient for most beginners and unaware people (particularly windows, where git by default clones in CRLF, and checks in with LF)

#

Ultimately, it doesnโ€™t make any actual difference for most purposes

#

And it is still enforced to some extent using gitattributes

#

The repos that donโ€™t have it, youโ€™d have to specifically want and know to commit non-LF ending

#

So itโ€™s mostly ignored

viscid coral
#

@old shard

old shard
viscid coral
brazen charm
brisk brook
#

@vale ibex what the hell

vale ibex
#

lmfao

#

picking up an old branch

#

was quite out of date so I did a merge commit

#

rather than dealing with the endless conflicts with rebasing

brisk brook
#

What will happen when you're gonna merge it into main?

vale ibex
#

they won't be duplicated

brazen charm
#

It'll have a merge commit

vale ibex
brisk brook
#

Ah yeah, that's true haha

vale ibex
#

the 3rd from last will be in the history

#

I'm not actually sure what's best practice tbh

#

I think we mostly do merge commits from what I've seen

brisk brook
#

Yeah I think it seems so

#

There the commits brought from the merge is shown, so I thought those would also be added onto main ๐Ÿ˜…

vale ibex
#

lol yea, luckily not

cold island
#

Yeah we just do merge commits

sleek steppe
steel isle
#

I had this idea of storing roles on leaving

  1. It allows for temporary leaves and rejoins
  2. On tempban, it allows for regaining of roles

The main argument against this is storage.

This is my counter-argument:

Say a user can have max 15 roles.
That's a max of 16 bigints (User ID + Role IDs)
A quick google search tells me that each bigint = 8 bytes of storage
so that would be 16*8 bytes or an 8th of a kb

Say we have 200k members
that would be 200k * 1/8 kb or 25k kb or ~25 mb

A generalized formula:
m = number of roles
n = number of members

Total Storage = (m+1)8n bytes

This is not much storage at all - Much smaller than anticipated!
I suggest removal of roles after some time like a month to save space anyway

hardy gorge
#

What kind of roles do we want to persist?

#

We're already persisting the Muted-role, which is the most important role to persist

steel isle
#

something like the pixelators role

#

the reason is that I would like to leave the server temporarily

hardy gorge
#

That's a temporary role, right?

steel isle
#

it is?

hardy gorge
#

Typically, if someone gets a role here, they get a role for a reason

#

If they leave the community and come back, we typically want to decide whether or not they should have the role back

steel isle
#

okay

hardy gorge
#

I'm not sure, but we typically don't have vanity roles or the like

#

We typically have temporary roles for an event for if we want to do things like an event announcement

steel isle
#

ah okay

#

even then, 25 mb is a stupidly small amount of storage to store all roles
I expected it to take more

tawdry vapor
#

I don't think storage is the main concern like you purport. Every user's role is already being stored (except it's deleted when they leave).

#

A similar system already exists, but it's only for mute roles.

#

However, I think that relies on infraction data (which is not deleted) rather than the saved roles.

steel isle
#

cosmetic roles would be nice too

tawdry vapor
#

It's a niche situation. There are few people with "cosmetic" roles and it also seems rare to leave and then come back.

#

Rare enough that there's likely the capacity to handle it on a case by case basis.

#

There may also be user privacy concerns with retaining that data when they leave, especially since the DB schema is designed to tie the roles to the user object. I am not familiar with privacy stuff though.

hardy gorge
#

In addition, when it comes to roles that grant someone permissions, I doubt we will ever create a system that would grant that role automatically when someone rejoins the guild. If someone leaves by accident, it's not too much work to give them back the role manually.

steel isle
#

ah okay

#

I see

viscid coral
#

A few days ago, TizzySaurus made a PR and an issue to avoid ghost pings in docs and pypi commands. Shouldn't it be reported in #changelog ?

tawdry vapor
weary pumice
#

ah sry

tawdry vapor
#

No problem

gritty wind
#

Yeah, itโ€™s usually just whenever someone with perms get around to it

viscid coral
#

Yeah I asked chris and he said to send it here

viscid coral
#

So isn't there someone with perms?

brisk brook
#

There's probably nobody with time atm

green oriole
#

I'll relay it in #dev-core, someone will probably come around and do it

viscid coral
#

Ok thanks

green oriole
#

I don't have perms to post anymore if that's what you are asking

#

lol

brazen charm
#

doesn't feel like a very noteworthy change

thorny obsidian
#

An admin will get around to it at some point. It's not exactly urgent or that big of a change.

green oriole
#

Yep

#

Even if it is changelogged in a week, who is counting tbh

patent pivot
#

our k8s or generic k8s? feel free to post here

#

ahh lol

viscid coral
#

Isn't it better to not do if channel is None and do: if not channel? Or better yet, just channel = channel or ctx.channel

#

I can see it is used many times in code

left flume
#

i think ill tell it here

#

the bookmark command cannot bookmark msgs from other channels

#

could the ability to bookmark msgs from other channels be added to lancebot?

vale ibex
#

That's because just message ids aren't enough to get the message, you need channelid and messageid

#

Due to this fact, we assume the channelid is the current channelid none is specified

left flume
#

ohhh okay

cold island
viscid coral
#

Oh ok thanks

cold island
#

In this case if not channel seems equally fine

#

In other cases however an object can have a defined state of false-iness. For example an empty list is evaluated as False.

if not my_list will be true in all cases in which it's False, while if my_list is not None will only be True in a single case

rigid rain
#

Can some tell me what is "pre commit Failing after n seconds" in github?

gritty wind
#

Well Iโ€™m assuming thatโ€™s the lint action, on the pre-commit step. Pre commit runs a bunch of linting tools like flake. You can expand it to see the specific error

rigid rain
gritty wind
#

Can you send a link to the workflow?

cold island
#

Or just the pull request

rigid rain
#

@gritty wind

gritty wind
#

The failing action is black (make sure to lint before you push)

#

(From the actions tab)

#

Well thatโ€™ll depend entirely on the project youโ€™re working on. If they have a contributing guide, make sure to go over it. Linting is just making sure you follow the style guidelines

rigid rain
#

oh ...i understand

gritty wind
rigid rain
#

sorry for using wrong channel

gritty wind
#

Itโ€™s fine

shut aspen
#

threads are here, how is python bot handling that

thorny obsidian
#

It's not because d.py 2.0 hasn't been released yet. No part of the current stable release of d.py can handle threads.

shut aspen
#

the d.py server seems unbothered by thsi massive breaking change

thorny obsidian
#

Danny's been working on it since the api docs got released but it takes time

shut aspen
#

it always does, but for discord to drop this so suddenly

#

kinda opens servers up to all sorts of issues considering libraries arent ready for it

thorny obsidian
#

So threads are opt in. For us threads are locked to certain staff roles and to internal channels.

gritty wind
#

Also discord gave 2 months heads up

shut aspen
vale ibex
#

You've got it the wrong way around

#

2.0 is because of threads & interactions

#

the Discord v9 gateway brings in breaking changes, so a breaking change was also required in d.py

green oriole
gritty wind
#

@patent pivot hi no questions just wanted to say hi

green oriole
#

Let's go

patent pivot
#

approved

green oriole
#

joe_salute is now our new shipit

shut aspen
vale ibex
#

discord.js and discord.py are the two most used libs, so they want to get it right, and have to worry a lot about backwards compatibility, and maintenance

shut aspen
#

ya ive been following it, afaik no date of arrival tho

#

unless i missed that

vale ibex
#

nope, because they don't want to commit to a date, since it's all in their free time

shut aspen
#

such is the pain of relying on open source i suppose

green oriole
last patio
green oriole
#

lol, yes

#

The curl guy is quite nice though

green oriole
#

About the snekbox issue: line numbers are super useful on mobile to distinguish between line wrapping and actual line breaks

remote wigeon
green oriole
#

I know, right

brisk brook
#

There's not much to gain from removing them

fallen patrol
brisk brook
fallen patrol
#

it must be [isort] in tox.ini

#

i have tested this very thoroughly

fallen patrol
vale ibex
fallen patrol
#

anyways

#

:)

#

really really really learned this the wrong way!

#

as evidenced by the failing workflow :)

fallen patrol
#

Yay I'm now a KA contributor too :)

patent pivot
#

lul

fallen patrol
patent pivot
#

uhhhhhhhh

#

yes

fallen patrol
patent pivot
#

lol

#

winner

fallen patrol
#

why 4 embeds smh

#

kinda tempted to add the status embed code flushball

patent pivot
#

lol go for it

#

chris added it to k8s repo earlier today

sleek steppe
#

returning a message when the annotation is None squint

vocal wolf
green oriole
#

I would like to ping this but we are in a public channel and gotta look like serious people pithink

thorny obsidian
vale ibex
#

Very professional

fallen patrol
viscid coral
#

Why can't I send there messages noooo

toxic token
toxic token
toxic token
patent pivot
#

we don't run multi-node Postgres

#

we don't need any ordering

toxic token
#

ah noobthink

#

ok CheemsSmuggle

patent pivot
#

in future it's possible we'd look at multiple Postgres instances, but they'd be uniquely tied to the service they are responsible for

#

so still not a huge appeal for statefulsets

toxic token
patent pivot
#

we do use statefulsets around and about, but really our two workforce units are just regular deployments and daemonsets

#

we use daemonset for ingress, log accumulation and a few other things

toxic token
patent pivot
#

sts does power our log accumulator primary but not by choice lol

#

helm install

gritty wind
#

Ooh speaking of

#

Are the helm installs and config listed anywhere in the repo

#

If not, might be a fun thing to try and document

#

For my own installs, I just list the names, versions, and the settings that have to be changed ๐Ÿคก

green oriole
#

Right

green oriole
patent pivot
green oriole
#

We could have full deployment steps, how to bring the infra to zero to what it is now, that'd be a fun thing to do

mellow hare
#

Feeling dumb. Can someone remind me how to do the like... relative to you time stamp/humanized time?

patent pivot
#

it's just unix timestamps with some format designators

#

one second

patent pivot
mellow hare
#

Cheers

patent pivot
#

<t:1234:R> <t๐Ÿ”ขR>

#

wow

mellow hare
#

HA

patent pivot
#

nice one discord

mellow hare
#

That's amazing

patent pivot
#

<t:12345:R> <t:12345:R>

#

there we go lol

mellow hare
#

I appreciate it

vocal wolf
stable mountainBOT
#

bot/utils/helpers.py lines 36 to 44

def join_role_stats(role_ids: List[int], name: str, guild: Guild) -> Dict[str, int]:
    """Return a dict object with the number of `โ€‹members`โ€‹ of each role given, and the `โ€‹name`โ€‹ for this joined group."""
    members = []
    for role_id in role_ids:
        if (role := guild.get_role(role_id)) is None:
            raise BadArgument("Unable to fetch role data, the specified role does not exist.")
        else:
            members += role.members
    return {name: len(set(members))}```
vocal wolf
#

(Looking at BadArgument)

brazen charm
#

Not sure, but at least something like ValueError feels more fitting when it's not because of argument conversion from the discord side.

vocal wolf
#

I agree, that does seem more fitting

green oriole
#

BadArgument is handled by the error handler though, and will display a proper error message

#

Ah, I see the context

#

Yeah, okay, that error shouldn't be caught by the handler

vocal prairie
#

For embeds such as !user I think we should use the timestamp style that displays the exact date and time rather than how long ago it was. The former is much more descriptive at first glance and you don't have to hover over it to get detail.

cold island
#

We use it for moderation, and it's more convenient to get the relative time at a glance.

brisk brook
#

What's wrong with didplaying both?

cold island
#

Takes more space, and you already get the date by hovering over it.

#

I've been actually toying with the idea of splitting off the user command as used by the mods

brisk brook
#

Could have the bot detect moderator and display it differently? Or create a subcommand that shows it differently..

Hmm...

cold island
#

The command is already doing something else in mod channels

#

But I'm not sure if absolute time is preferred over relative time, maybe other people have a different opinion. Technically speaking, the relative stamp offers you more information than the absolute one.

brisk brook
#

Well the thing is that eventually it becomes "X years", and at that point it's rather unhelpful when you want to be more precise.

molten perch
#

Hey!
Just out of pure curiousity,
In that issue https://github.com/python-discord/api/issues/7
current database schema as the actual deployed one, or the literal python-discord/api schema? (that doesn't seem to exist just now.)
(I know it's already assigned, I just like to go over issues and find a solution, sometimes develop one on my own.)

GitHub

Set up the Alembic project for migrating the database, and create an initial migration to bootstrap the database based on the current API database schema.

cold island
#

I believe it's the deployed one

#

I think this project leaves most of the API unchanged, it just decouples it from the site and rewrites it in FastAPI.

molten perch
#

Yeah, but the deployed one uses the Django ORM whereas the API uses SQLAlchemy with Alembic. (That is strictly for sqlalchemy as far as I know)

cold island
vocal prairie
#

!server too

stable mountainBOT
#
Server Information

Created: <t:1483877013:R>
Voice region: europe
Features: THREE_DAY_THREAD_ARCHIVE, PARTNERED, VIP_REGIONS, VANITY_URL, SEVEN_DAY_THREAD_ARCHIVE, NEWS, MEMBER_VERIFICATION_GATE_ENABLED, THREADS_ENABLED, WELCOME_SCREEN_ENABLED, RELAY_ENABLED, PREVIEW_ENABLED, PRIVATE_THREADS, BANNER, DISCOVERABLE, INVITE_SPLASH, COMMUNITY, ANIMATED_ICON
Roles: 88
Member status: status_online 51804 status_offline 181727

Members: 233531

Helpers: 122
Moderation Team: 33
Admins: 15
Owners: 3
Contributors: 39

Channels: 300

Category: 32
News: 8
Staff: 75
Stage_Voice: 1
Text: 176
Voice: 8

cold island
#

tbh I'd rather show the manual relative time we had there before

brisk brook
#

There may be a better format than R?

#

Where could I read all of them again?

#

<t:1483877013:t>---------------------<t:1483877013:T>----------<t:1483877013:d>----<t:1483877013:D>--<t:1483877013:f>--<t:1483877013:F>-<t:1483877013:R>
<t:1483877013:t> <t:1483877013:T> <t:1483877013:d> <t:1483877013:D> <t:1483877013:f> <t:1483877013:F> <t:1483877013:R>

brisk brook
#

I mean, I kind of liked: <t:1483877013:D> (<t:1483877013:R>) - <t:1483877013:D> (<t:1483877013:R>)

brazen charm
#

I don't think that brings much benefit over the hover

brisk brook
#

What's to loose? I think it's much nicer to view it like that, and it's not like it will cause that line to wrap or something similar.

fallen patrol
fallen patrol
molten perch
hardy gorge
#

Yes, although there are reflection options to help with the generation of the models

cold island
molten perch
#

Yeah, I see now. SQLAlchemy has this Automap functionality.(Alternatively, sqlacodegen that actually generates the models in respect of PEP8)

celest charm
#

!source int e

stable mountainBOT
#
Command: internal eval

Run eval in a REPL-like format.

Source Code
brazen charm
#

I think there was supposed to be something to replace the current implementation that would be less hacky, no idea on the status of it though

glacial veldt
#

Y no PyCF_ALLOW_TOP_LEVEL_YIELD

#

Nobody likes Twisted :(

fallen patrol
#

๐Ÿฅบ

granite plaza
#

IS there anything in the code that makes sure everything in the database exists. EX: If a column is not there it creates it?

#

Ping me thx (probly wont respond till towmarro tho)

steel isle
#

this might be preposterous, but what about tags for !github, !wsl, etc

#

or atleast an faq channel

#

!source docs

stable mountainBOT
#
Command: docs

Look up documentation for Python symbols.

Source Code
steel isle
#

I see I have killed chat

#

but I do think this is a valid suggestion

gritty wind
#

Iโ€™m not sure what you have in mind

#

What would those tags contain?

gritty wind
#

Though thatโ€™s currently changing over to alembic I believe?

fallen patrol
#

thanks joe for whitelisting it

last patio
viscid coral
#

cool

cold island
#

How can I open the website locally after launching site from docker?

brazen charm
#

should be on localhost:8000

cold island
#

Thanks

#

Hmm.. whenever I press I link it tries to open it through pythondiscord.local

#

Ok, I found the line that changes it. Am I supposed to provide an env file or something?

vale ibex
#

recommended to change your hosts file

#

Are you on windows?

cold island
#

yeah

vale ibex
#

put ```
127.0.0.1 pythondiscord.local
127.0.0.1 api.pythondiscord.local
127.0.0.1 staff.pythondiscord.local
127.0.0.1 admin.pythondiscord.local

#

c:\Windows\System32\Drivers\etc\hosts

cold island
#

tnx

viscid coral
#

Can I ask questions about stuff the python bot do?

#

Like how did they do it

vale ibex
#

Sure

viscid coral
#

How does python take github link and show it's code?

vale ibex
#

There's an on message listener in the issue cog

#

On mobile so can't get you a link to it right now

molten perch
stable mountainBOT
#

bot/exts/evergreen/issues.py line 213

async def on_message(self, message: discord.Message) -> None:```
viscid coral
#

!source issue

stable mountainBOT
#
Bad argument

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

viscid coral
#

Oh ok thanks

molten perch
#

But in the future it'll be probably moved to the GithubInfo Cog, and the issue command will be removed.

brazen charm
molten perch
#

Oh, right lol. Nevermind it's a message listener too ๐Ÿ˜„

viscid coral
#

Yeah I see it, thanks

cold island
#

But I already have it thonking

#

When trying to do poetry install

tawdry vapor
#

I had that issue for a long time..I had visual studio but it wouldn't detect msvc..one day I decided to try again to install build tools and that time it actually started detecting it

cold island
#

Hmm odd, it worked before on this computer

vale ibex
#

Is it on your path?

tawdry vapor
#

I don't think that's how it detects it

#

Iirc it has its own environment variable

#

Don't know if python uses it

cold island
#

Tried reinstalling, didn't help

cold island
green oriole
#

get it again and blame poetry for its poor deps handling

#

I can probably do that

#

should I amend and force push?

cold island
#

Either is fine I think

green oriole
#

Will amend then

cold island
#

tnx

green oriole
#

now we have a fancy commit because Git wanted to sign it

viscid coral
#

How did you do the GitHub updates?

gritty wind
#

Hmm strange

#

Iโ€™m not sure why youโ€™d need build tools

#

You reallly shouldnโ€™t because the docker image is working

vale ibex
viscid coral
#

Likes this

vale ibex
#

That's a webhook from GitHub, rather than in a bot

viscid coral
#

webhook from GitHub?

#

I mean I know it's not a bot

vale ibex
#

if you goto the settings of a github repo you have admin access to, there is a webhook section

#

you can then add a webhook there

#

here's a guide I found

#

That's how most of the events come into #dev-log

#

are custom github actions

viscid coral
vale ibex
#

No worries ๐Ÿ™‚

fallen patrol
#

@patent pivot is pydis sponsored by honeycomb or do you have the base plan?

vale ibex
#

We're on the free plan

#

it's pretty generous

fallen patrol
#

well

#

that's just gonna be more effective imo

#

thanks

patent pivot
#

hoeycomb free is generous

vocal wolf
#

Thank you @sleek steppe for throwing that command into the sun so quickly lol

green oriole
fallen patrol
#

wdym

fallen patrol
#

@green oriole^

green oriole
#

It is just very broken

#

It wrongly detects the Python version and does some stupid stuff

fallen patrol
#

are you using pyenv with it?

marsh jewel
#

i make website in Django i already host after..........I am facing big issues on Websurfer ISP.
I'm just buying Hosting Domain.
Everything is ok but I canโ€™t open my website from Websurfer ISP
From my mobile network it can access like Ncell , NTC, World link and other network but can't access from
Websurfer ISP
Any Solution Please..

vocal prairie
toxic token
#

how do you handle prometheus huge data mhm

patent pivot
#

how do we store all prom data?

toxic token
#

prometheus scraps a lot of data which needs a big storage to store, and by looking at the manifests in the repo you have a 20GB volume noobthink

patent pivot
#

20GB volume

#

yeah

#

we can provision volumes of any size

toxic token
patent pivot
#

yeah just checked

#

up to 10,000 GiB lol

#

we currently use uhhh

#

4.6G

toxic token
#

hmm

#

how much has it been running? hmmGe

patent pivot
#

this volue actually got reset a little bit ago since I changed how we deploy prometheus

#

9 days

#

we retain for 15 days

toxic token
#

oh ok thx, i thought i was going something wrong, the volume got 75MB in less than a min mhm

patent pivot
#

that sounds about right

#

part of that is just basic data dir stuff

toxic token
#

yeye thanks for help

#

@patent pivot if you don't mind me asking, since when have you been into devops peep

patent pivot
#

hmmmmmmmm

#

I started with Kubernetes about a year ago

#

June 26 2020 was when I moved personal stuff there

toxic token
patent pivot
#

we created the pydis cluster on the 14th November 2020

toxic token
#

the first time i tried kubernets was 2 months ago ๐Ÿ˜„

#

it is really nice how it works mhm

patent pivot
#

we were finished with migration by the 21st it seems

#

last non-crit services migrated 29th though

toxic token
#

i am managing 2 clusters rn, one of them with average 7k requests/hour noobthink

#

are you the only one who manages the devops in pydis? smilecat

patent pivot
#

pydis sees 10k/hr peak

toxic token
patent pivot
#

there is a devops team, I'm the lead of that team

#

Akarys, Sebastiaan and Scragly are also on my team

toxic token
#

nice

patent pivot
#

and @radiant merlin

toxic token
#

hahaha

toxic token
patent pivot
#

wholesome

timid sentinel
#

Any idea why i'm getting this error https://paste.pythondiscord.com/lifecohamu.py whenever I send a message (I think) running @stable mountain locally. I've heard other people say they were getting the same error but am not sure if the discussion went anywhere.

#

oh

#

I think i'm just missing the channel in the config

green oriole
#

How is it going to work when you turn auto reviews back on?

#

Is it gonna drop every reviews it has been holding onto?

timid sentinel
stable mountainBOT
#

bot/exts/recruitment/talentpool/_review.py line 73

# If it's over a day overdue, it's probably an old nomination and shouldn't be automatically reviewed.```
timid sentinel
#

That was from when we first introduced the system to prevent review-spam, and I thought the easiest option was just to make use of that here

#

So old ones will need to be posted manually with !tp post_review or actually manually

green oriole
#

Right

viscid coral
#

I think I just made a bad comment on bot#1702

dusky shoreBOT
viscid coral
#

What is venv anyway

gritty wind
#

There are usually very few bad on-topic comments

#

Virtual environments, basically an isolated version of your โ€œglobalโ€ site packages (packages that you install through methods such as pip). Usually used so you can have things like different environments and packages for each project

fallen patrol
#

<@&831776746206265384> above. they (@gritty wind) sent in every channel too

#

just realised now the second person was answering them, not spamming

gritty wind
#

I did probably send in every channel at some point, but I think I have good excuses for most ๐Ÿ™ƒ

fallen patrol
#

i wonder if there's any channel you haven't sent a message in from what i can see

fallen patrol
gritty wind
#

๐Ÿ˜„

sterile grotto
#

hello

viscid coral
#

Hi

sterile grotto
#

hi

#

where do you from

static canyon
#

Please use #python-discussion for general chatter. This channel is for contributing to one of our many open source projects @sterile grotto

brisk brook
#

Is there any PR needing some review love (that may have been forgotten), I may have some more time to review anything today.

thorny obsidian
#

@brisk brook persist in that most recent comment on the tag PR is referring to persisting the cooldowns across bot restarts, not persistent storage.

brisk brook
#

Are those not the same thing?

#

If we want it to persist across restarts, then we need to store it persistently on disk (PostgreSQL)

thorny obsidian
#

Redis will keep state even if the bot restarts, we just can't rely on it to have that data forever. So it will persist even if the bot restarts, but it's not permanent storage.

brisk brook
#

In that regard, because of it being in another Docker container, yeah.

brazen charm
#

It's also backed up to disk, I believe the redis instance used for the server is configured to do that on every write

thorny obsidian
#

Yeah, our redis does write to disk. But it's still not permanent storage to us since we'll dump it when needed.

brazen charm
#

But other than that I don't see any benefit over a normal python dict for the cooldowns like I mentioned in the comment

thorny obsidian
#

Yeah, unless there's a strong benefit to using redis I don't see why we should try to use it everywhere

brisk brook
#

Alright sounds good!

remote wigeon
#

im saying this cause it was mentioned by staff sometime ago, but you have considered an automated slowmode for @stable mountain, is that right?
i would be willing/interested in contributing something like that, but i'd obviously wanna get approval for that to begin with

viscid coral
#

You mean like after a spam of messages the bot will automatically set a slowmode delay?

thorny obsidian
#

It would take some fine tuning in terms of what data would determine the slowmode. Also for me I would need to see a demonstrated need for it. I know we were roughly collecting data to look into what are the consistent factors that we could use to determine when slowmode is needed, but it's pretty low priority.

viscid coral
#

Yeah but it can some in handy sometimes, it is pretty easy to make as well

thorny obsidian
#

I think you're underestimating finding the right criteria to base the slowmode off of and also the maintenance cost. Right now it's very easy for us to adjust slowmode.

#

It's something we're interested in and have discussed previously, but it's very low priority for us

green oriole
#

We do record the current slowmode of a few of our channels, so we should have some data to play with if we ever want to look at it

remote wigeon
#

oh fair

tough imp
#

Would the approach be something like analysing historical data to see what kind of traffic / msg throughput usually results in a slowmode bump in each specific channel, and the having the bot detect that threshold in a live situation?

#

Its an interesting problem

#

Probably lots of possible variables too like amount of active speakers, msg length, etc

remote wigeon
#

i mean you could run a nn on the typing events and messages sent and their corresponding slowmodes

#

would be actually quite interesting

thorny obsidian
#

mhm, there are a lot of factors at play like # of total messages, # of speakers, # of messages/speaker, message length, duration of the timeframe that we'd be looking at. Only recently have we even begun to receive typing events.

#

It would also have to play nicely with our existing antispam

cold island
#

Honestly I doubt an nn is necessary here. Some regression model should do fine

remote wigeon
#

true

tough imp
#

an ML / statistical approach could be used to only analyse the historical data; find the relevant variables, perhaps the thresholds

#

for the sake of transparency & easy configuration the rule can then probably be enforced via more standard means

viscid coral
tough imp
#

Xith already opened a PR for the issue but some were missed?

#

if that's the case it's probably best to leave a comment on the PR and point out what you think should be changed

viscid coral
#

wookie already did earlier

tough imp
#

oh so you'd just like to help make the changes?

viscid coral
#

Yeah but I have no permissions and there is not point opening a PR for the same purpose

tough imp
#

you can leave a comment on the PR offering your help

#

the way you'd do it technically is make a PR targetting Xith's branch

#

it'd then be merged into Xith's branch and appear in the PR into master

#

however you probably shouldn't work on it without coordinating with Xith first

#

it may be unnecessarily complicated

viscid coral
#

How should I contact him

tough imp
#

comment on their PR or ping them here ๐Ÿ˜„

#

however if its just a capitalisation issue I'd leave it to them to resolve

#

unless it's a complex feature that requires coordinated work of multiple people, or the PR author cannot continue working on the issue, it is best to just give them time to make the changes

#

sometimes people just get busy and it may take a while

viscid coral
#

Yeah ok

#

Thanks

hoary vessel
#

How do the Sir Lancebot's creators host this bot?

#

I am just wondering on what should I do to make my bot online all the time!

vocal wolf
hoary vessel
vocal wolf
#

yes

hoary vessel
hoary vessel
vocal wolf
#

afaik

hoary vessel
green oriole
#

You can take a free tier on popular hosting platforms, but it won't get you really far

fallen patrol
viscid coral
#

bot#1709 I was correct, it's discord.HTTPException?

dusky shoreBOT
viscid coral
#

Xithrius, need help with the py_topics python(s) caps?

patent pivot
#

repl.it, heroku and similar are fine for hobbyist development, not prod workloads though

viscid coral
#

Does replit even allow hosting?

patent pivot
#

It does have some functionality yeah

viscid coral
#

Where is the code that sends the message when a user opens a channel?

stable mountainBOT
#

bot/exts/help_channels/_message.py line 95

async def dm_on_open(message: discord.Message) -> None:```
viscid coral
#

I mean when the channel is opened

#

Not the dm, the process

gritty wind
#

Can you give an example

timid sentinel
viscid coral
#

Yeah I got what I need, thanks

#

I just saw many people open help channels and the original message was deleted, probably by them

timid sentinel
#

Yeah usually that's because the person who opened it deleted their message, it could also happen if it was deleted by antispam/a bot filter, but that's less likely

#

In those cases the channels should close faster

tawdry vapor
#

Sentry has 380 issues of ConnectionRefusedError ๐Ÿ˜’

#

We have to look into a better way to catch ConnectionRefusedError, OSError, DiscordServerError, ClientConnectorError, and ServerDisconnected cause those just spam Sentry.

patent pivot
#

a few of those may have been (inadvertedly) me

#

when we routed API traffic directly to Django from bot the server would sometimes randomly drop the connection

#

leading to ServerDisconnected

#

we now route internally through NGINX which seems to just... not do that

#

it could be worker restarts, unsure

tawdry vapor
#

What do you think of telling sentry to just ignore those errors?

#

I guess we would have to filter that via Python since Sentry's website doesn't give us powerful filtering.

#

Granted, it is nice to know when there are network issues, but I'd rather we aggregate them into a single custom webhook than spam Sentry with new issues.

vale ibex
#

there's some decent filtering we use at work in sentry, but it's a paid tier

#

not sure what tier we're on

tawdry vapor
#

Yeah we don't have access to that

#

I think we need to intercept the logging before it gets to sentry sdk

#

Or maybe the sdk has a filter

vale ibex
#

Yea, there's a before_send kwarg you can pass a filter func to when you init the sdk

#

you can make it return None to drop the event entirely

#

or you can make it do smarter things like add or strip data to the event

tawdry vapor
#

A problem we have is that sometimes exceptions are caught and logged without the exception object, making it difficult to filter out.

#

The idea with that is that the traceback isn't useful for those exceptions, so it's omitted.

vale ibex
#

the filter gets given the full event payload, along with the exception if there is one

tawdry vapor
#

I think the stdlib logging lets us attach arbitrary data, so we could use that.

vale ibex
#

so in theory we could filter on certain event types

tawdry vapor
#

But if I do log.error then how will it get the exception?

vale ibex
#

it won't in that case, it'll just get the data you see in sentry

tawdry vapor
#

Well that's my point. It's difficult to filter those out.

vale ibex
#

Yea, so would you propose filtering it lower down, in the logging module?

tawdry vapor
#

No. I think we just need to modify those places to also include some data with the log message.

vale ibex
#

The sentry filter would allow us to fiter specific errors exceptions we don't want to send, but as you say it won't give us everything we may want

tawdry vapor
#

Ideally we could attach all the exception info but tell the logger not to output the traceback.

#

So we don't see it in stdout or log files

vale ibex
#

Hmm yea

tawdry vapor
#

I think it lets us attach any data so maybe we could do log.exception("blah", silent=True) and then have a custom log handler for stdout which doesn't send the traceback. (silent is a bad name but it's just for an example)

tawdry vapor
#

Their API does not document the response encoding

#

I just made an issue for it bot#1713

dusky shoreBOT
vale ibex
#

huh I missed that one

#

I thought aiohttp automatically decodes the content from the server, so I guess something went wrong there

#

I think it was some odd unicode char in a user's name that caused it

#

utf-8 could be safe to assume

#

I might give that one a go now, since I can test it with my creds

#

๐ŸŒ•โ„ณโ„ดโ„ดํ“ทํ“ฒโ„ฏ๐ŸŒ• this caused the issue

#

!charinfo ๐ŸŒ•โ„ณโ„ดโ„ดํ“ทํ“ฒโ„ฏ๐ŸŒ•

stable mountainBOT
tawdry vapor
#

Yeah it detected the wrong encoding

#

chardet isn't 100% accurate

#

It detected it as Windows-1254

vale ibex
#

ah, makes sense

#

forcing utf-8 seems to have done the job

#

I'll commit and pr now

tawdry vapor
#

Thanks

vocal wolf
vale ibex
patent pivot
vocal wolf
#

@patent pivot review pls thanks joe_salute

#

Thank you joe

vale ibex
#

Lol I was really expecting you to leave it at a comment

vocal wolf
#

I was too

#

"did I just troll myself or did joe troll me?"

patent pivot
#

command+enter did me dirty

vocal wolf
#

lol

#

ok

#

now it should work

#

.so Python doesn't recognize newly imported package

dusky shoreBOT
patent pivot
#

hell yeah

vale ibex
#

.so Discord emoji not working when I don't give id

dusky shoreBOT
#
No search results found for Discord emoji not working when I don't give id
vale ibex
patent pivot
#

.so quit vim

dusky shoreBOT
#

Here are the top 5 results:

Why argument like q not mentioned in vim manual?
How to remap ESC key to CAPS LOCK in VsVIM in Visual studio
How do I exit the Vim editor?
TMUX: how to make new window stay when start shell-command quits?
Is it possible to prevent vim from quitting from the status of QuitPre autocommand? (e.g. prevent close on syntax issues)
patent pivot
#

lmfao

vale ibex
#

.so why is ed the best editor

dusky shoreBOT
vale ibex
#

PHP first result

patent pivot
#

true true

vale ibex
#

oof

tawdry vapor
#

This is fucked on mobile

timid sentinel
#

Yeah, should probably just be the titles that are the the links tbh

gritty wind
#

The upvotes, views, and comments all fit on one row for me (iPhone 8)

#

It could probably be cleaned up a bit by removing the tags, or pushing them to a new line

#

And yes 100% clean up the links haha

brisk brook
#

For me, my phone detects it as a phone number. Like sometimes happens with the Reddit page thing

gritty wind
#

Hmm those just seem like the emoji IDs

brisk brook
#

Yup

vocal wolf
#

oh god

gritty wind
#

Iโ€™ve seen people post that before, but Iโ€™m not sure thereโ€™s anything we can do there

#

I guess other than not use emojis

brisk brook
#

Time to call reddit_post_text

green oriole
#

I wonder if putting the markdown in a different order or adding spaces would fix it

viscid coral
#

While making the source command, and the bot doesn't find the source, it sends two messages. Why not make button for each response to delete it?

vale ibex
#

!src not-a-cog

stable mountainBOT
#
Bad argument

Unable to convert 'not-a-cog' to valid command, tag, or Cog.

#
Command Help

!source [source_item]
Can also use: src

Display information and a GitHub link to the source code of a command, tag, or cog.

vale ibex
#

I think this is similar behaviour to a lot of places where we raise a userinputerror

#

we send the error embed, then the help for that command

#

I think having the error embed delete_after a few seconds would be fine

molten perch
#

I thought the handle for UserInputError puts the error and the help content into the same embed.
Like.

viscid coral
#

If I have a suggestion about the help-channels, should I open an issue ir PR.

static canyon
#

PR is the coded solution

#

Issue is the proposal

viscid coral
#

Ok

vale ibex
#

We're working on something at the moment that may solve this long term, but for now I'd suggest you raise an issue if you want to solve it

viscid coral
#

Anyone care to review bot#1717

dusky shoreBOT
molten perch
vale ibex
#

bot already has a handler for it, it would be a proposal to change that handler to only output 1 embed

molten perch
#

Yes, thatโ€™s what I meant. Sir Lancebot already has a proper handler.

#

Shall I open an issue? If I may.

viscid coral
vale ibex
vale ibex
viscid coral
#

Yeah ok

#

Thanks

tulip marsh
#

Do you guys think it would be beneficial to close help channels after a period of time if their pinned message is deleted and there's no longer any activity? Because there have been several occurrences of people thinking the help channels are bugged as they see it's occupied but there's no messages there

#

Although, the more I think about it the less beneficial it seems

thorny obsidian
#

If the first message is deleted and there have been no other messages it'll close in 5 minutes usually. Otherwise it'll be 10 minutes after the last non-op response and 30 after the last op response.

vale ibex
#

Yea, I think Jack's proposal is to close after 5 minutes even if there are messages from non-claimants

timid sentinel
#

If nobody is working on https://github.com/python-discord/sir-lancebot/pull/558, could I take it over? And if I were to take it over, should I just finish it off, or would it be ok if I rewrote it to implement some improvements (namely, including a markov chain implementation, since that's cooler than using a module that does it for you, and also generating the markov chain backwards so you can start with the rhymes, meaning it can run in a fixed amount of time so you don't have to implement timeouts and stuff in case it doesn't finish in time).

cold island
#

I'd check whether the author has any plans of finishing it