#dev-contrib

1 messages · Page 129 of 1

desert vessel
#

im not able to commit nor stash changes nor pull

#

and i have an open pr

tawdry vapor
desert vessel
#

the linitng broke the commit system that i had

#

i recloned and it works now 👍

vocal wolf
#

@vale ibex nice branch name lol

severe tangle
#

Lmao

tawdry vapor
#

Yes. A lack of bug fixes and support for breaking API changes may affect it

desert vessel
#

@vale ibex my existing pr is taking longer than i anticipated to be approved to rejected, can i wait for it to be resolved ?

#

so i can start on the issue you assigned me to

gritty wind
#

If you think you can manage it, you can work on multiple things at the same time, otherwise feel free to take as long as you need

brisk brook
desert vessel
brisk brook
#

Ah I see, that is not very old. It usually takes a few days

#
GitHub

The community bot for the Python Discord community - bot/hatching.py at 9f5f0cef5000f741e22734d8537683d1c607995b · python-discord/bot

cold island
#

And the top teams got their cogs added to the bot

crude gyro
#

that is correct

frozen galleon
#

May I ask here what will be happening with the bot since discord.py will no longer be maintained and was archived? Do you plan on switching to another working fork once it's made or another language rewrite? Or is there something else you plan on doing?

cold island
crude gyro
#

people are getting a bit carried away after that announcement. There's no reason to panic.

frozen galleon
crude gyro
#

by the time it actually affects us the market will look completely different. Putting together a plan right now would be a waste of time.

cold island
crude gyro
#

we're not worried, you shouldn't be either.

cold island
#

Is there a way to have an optional string argument to a command, and have it not match in favor of an argument that comes afterwards?

#

For example if I have two arguments Optional[str] and Optional[TextChannel], if I input #algos-and-data-structs I want it to be in the second argument

cold island
#

Ugh, I guess I can force a specific pattern in the string

brisk brook
gritty wind
#

I implemented something like this for the silence command

#

Basically, it’ll accept one of two data types as the first argument, both of which can function on their own. If someone wants to pass it both, there’s also a second argument which will the accept the other type

#

The command then tries to take in all the provided input, and create meaningful context from that

cold island
gritty wind
#

What are you working on?

cold island
#

The clean command

gritty wind
#

What’s the desired interface?

cold island
#

I want to take both a regex pattern and a one of (a series of channels | an asterisk to denote all channels)

#

Since I want the asterisk, I can't use Greedy

#

So I used a positional only argument instead

#

So channels must be the last arg

#

And both the pattern and the channels are optional

gritty wind
#

So like
!clean [regex pattern] [channel or *]

?

cold island
#

yes

gritty wind
#

Hm

#

My recommendation is to drop the star, and instead make it its own command

#

!cleanall [regex]

#

I can’t think of a clean way to do this

cold island
#

I solved it by enforcing a pattern of r'<pattern>'

cold island
#

None of this would be an issue if Greedy was a type instead of an object

#

Since then I would just do Union[Greedy[TextChannel], Literal["*"]]

#

But I'll open the PR and we can scratch our heads once you see everything in context

brisk brook
#
string = "A_B*[ <0-9 [#dev-contrib](/guild/267624335836053506/channel/635950537262759947/)"
regex = ""
converter = discord.ext.commands.TextChannelConverter()

for arg in string.split(" "):
    try:
        channel = converter.convert(arg)
    except BadArgument:
        regex += arg
    else:
        break
else:
    # We exited the loop without breaking, meaning we didn't resolve a channel
    raise BadArgument("Could not resolve a channel mention")

# We now have access to `channel` as well as `regex`:
# channel: "[#dev-contrib](/guild/267624335836053506/channel/635950537262759947/)"
# regex: "A_B*[ <0-9"
#

What about something like that?

#

@cold island ^

#

Hmm, right, we can't make a converter out of this because discord.py doesn't let you hook into the argument system like Greedy does

desert vessel
#

@brisk brook, is this good enough?

brisk brook
#

Hmmm, I am not sure. Do we want the text? Without it the logo won't make sense, but ehhh..

#

Can you post that in the PR?

molten perch
# cold island But I'll open the PR and we can scratch our heads once you see everything in con...

I managed to make a converter(It's a wild idea, and implementation) , combined with Greedy, (Yes, I know it sounds insane) and it seems to work. Apart from two things. If in the case of!clean [regex] is provided then it'll be a List of 1 (It's always, assured, because of Greedy, but that shouldn't be a huge problem.). Also, another thing. It assumes that you provide only one regex string, otherwise it won't work as expected, but could be solved with additional checks.
https://paste.pythondiscord.com/ofojiwuyuf.py
(Also.. I apologise in advance 😄 )

desert vessel
#

we are following the py joke

brisk brook
desert vessel
#

where baby python gives the py logo

cold island
cold island
desert vessel
#

i can crop the pic to only the logo if you'd want

brisk brook
cold island
#

yes

#

🙂

desert vessel
#

how can there be multiple channels as an input tho-

brisk brook
# cold island yes

Oh, well then the only option is "myregex[#the-pydis-mass-layoffs-lounge](/guild/267624335836053506/channel/464905259261755392/)" I see now

desert vessel
#

sup bluenix and zig btw

brisk brook
cold island
brisk brook
#

!command <search that may contain a channel> <*channels>

#

Is that 2 channels, or channel in the regex?

cold island
#

Lol yes, the more we discuss it the more I see that there has to be something that separates the regex

desert vessel
#

let me try 🤔

cold island
#

Even if I could use Greedy on the channels it would have the same issue

cold island
#

Because a string argument breaks once a space is hit

#

You have to include quotes if you want spaces

brisk brook
#

Right, but in our imaginary convert situation

cold island
#

Undefined

molten perch
cold island
brisk brook
molten perch
cold island
desert vessel
#

can someone help with with git auth ;-;

#

i got a new computer

#

and now git got screwed

#

how do i login from cli-

molten perch
cold island
#

Which is why I ended up enforcing a specific form the regex needs to be specified in

molten perch
cold island
#

The request is not possible. You can't have two optional arguments that can have the same value and skip the first argument

#

So you have to make the possible values for each argument different

fallen patrol
#

@desert vessel are you trying to authenticate with github?

clever chasm
#

P

desert vessel
slow steppe
#

On line 56 of nominations.py (in @brisk belfry) why not just get a role object from constants.Roles.mod_team and use role.mention? Sure the current option works but it's usually not very good practice

austere hornet
#

Lol

desert vessel
#

what are your inputs ?

tawdry vapor
#

Maybe the data that needed to be migrated had nullable reasons

stable mountainBOT
#

pysite/views/api/bot/infractions.py lines 137 to 145

CREATE_INFRACTION_SCHEMA = Schema({
    "type": lambda tp: tp in INFRACTION_TYPES,
    "reason": Or(str, None),
    "user_id": str,  # Discord user ID
    "actor_id": str,  # Discord user ID
    Optional("duration"): str,  # If not provided, may imply permanence depending on the infraction
    Optional("hidden"): bool,
    Optional("expand"): bool
})```
tawdry vapor
stable mountainBOT
#

pysite/views/api/bot/infractions.py lines 189 to 195

def post(self, data):
    deactivate_infraction_query = None

    infraction_type = data["type"]
    user_id = data["user_id"]
    actor_id = data["actor_id"]
    reason = data["reason"]```
tawdry vapor
#

Maybe it was to support data from rowboat?

#

Are there actually any infractions with null reasons in the db now?

stable mountainBOT
#
Aye aye, cap'n!

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

gray geode
#

error running snekbox on windows

#

should i try wsl

short snow
#

I don't see any error in the screenshot

#

And it should work perfectly fine on windows if i am not wrong

gray geode
#

didn't show up

#

i mean its running

#

but status

short snow
#

Umm, it does show gunicorn.error but its running, does the api work?

gray geode
#

umm ye it shows up

#

have you setup snekbox on windows ?

#

before

short snow
#

Nope, no I mean does the using the snekbox work like with requesting it

gray geode
#

umm , how can i test the api

#

this is the endpoint iirc

#

imma try on my wsl anyway

#

it has some problems on windows ig

stable mountainBOT
#

bot/exts/utils/snekbox.py lines 59 to 64

async def post_eval(self, code: str) -> dict:
    """Send a POST request to the Snekbox API to evaluate code and return the results."""
    url = URLs.snekbox_eval_api
    data = {"input": code}
    async with self.bot.http_session.post(url, json=data, raise_for_status=True) as resp:
        return await resp.json()```
short snow
#

I think scal runs it on windows

brisk brook
#

I run it on Windows as well, though I haven't played around with it

gritty wind
#

Gunicon.error is the default logging handler

#

Which is a terrible name that I don’t understand

#

It’s not an error though

green oriole
#

@brisk belfry randomcommand

brisk belfryBOT
#

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

CommandNotFound: Command "randomcommand" is not found

green oriole
#

We should fix that haha

tawdry vapor
#

@brisk belfry `@tawdry vapor

brisk belfryBOT
#

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

CommandNotFound: Command "`@tawdry vapor" is not found

tawdry vapor
#

Okay at least that is fine

desert vessel
vale ibex
#

&```@tawdry vapor

#

cool, that's fixed

brisk belfryBOT
desert vessel
desert vessel
# vale ibex &src

btw im still waiting for something to happen to the pr, im really sorry chris :( i'll start as soon as something happens to that pr

vale ibex
#

There's no rush with any of our issues 🙂 Things take time

desert vessel
#

ah alright :)

#

i can work on another branch but im known for screwing the entire repo trying to make a branch

#

so nope

vocal wolf
#

@vale ibex it's dev time

#

I got my environment up and running on macos

#

you ready to review stuff?

vale ibex
#

Depends what you want reviewed lol I've got 30 minutes

vale ibex
vocal wolf
#

yes

#

with the power of the m1

vale ibex
#

Did manjaro burn you?

vocal wolf
#

nay, just needed a laptop

#

I still have arch/windows on my main rig

vale ibex
#

Ahh cool

vocal wolf
#

das 4 u

vale ibex
#

60 lines

#

this'll take me hours

vocal wolf
vale ibex
vocal wolf
#

lmao

#

wtf

#

site not building because I don't have gcc?

vale ibex
#

lol what

#

Do you know which dep?

#

I'm guessing they don't have mac wheels

#

Also, when did GitHub change their approve colour?

#

These are definetely more faded that I'm used to

vocal wolf
#

@vale ibex they be changing stuff again

short snow
#

yeah

vocal wolf
#

@timid sentinel thanks for review lemon_hearteyes

short snow
#

even discord i think, atleast i see colours being more darker today

desert vessel
#

call me anytime and i'll be there

#

heh

vocal wolf
#

what for?

desert vessel
vocal wolf
#

just general questions about the m1?

#

ah

desert vessel
#

oof i cant send a screenshot here

vocal wolf
#

I've re-figured out macos, I shall be fine. Thanks!

desert vessel
#

oh wait i can

desert vessel
#

cool*

#

i reinstalled macOs today

#

a py model broke macOs yesterday

#

lmao

#

Chris, i can start with the pr now

#

@vale ibex are you guys accepting pr's for sir-threadaveare too ??

vocal wolf
#

@vale ibex should I close this PR lol it's been literally 2 years

desert vessel
vocal wolf
desert vessel
#

ah

vocal wolf
#

we haven't approved your issue

desert vessel
#

kk

#

like ater that i meant-

vale ibex
desert vessel
#

after*

vale ibex
#

oh, lol @vocal wolf

vocal wolf
#

?

vale ibex
#

I commented 10s after you

vocal wolf
#

lmfao

vale ibex
#

alr breakfast time

#

later

vocal wolf
#

cya

desert vessel
#

byee

#

i just realised that we are on diff parts of the world

#

its 5 pm for me heh

brisk brook
#

No Chris is just weird

desert vessel
#

xDD

brisk brook
#

It should be like 10 am there

desert vessel
#

ah

#

&help

brisk belfryBOT
#
BotSource:
  source Display information and a GitHub link to the source code of a comman...
​No Category:
  help   Shows this message

Type &help command for more info on a command.
You can also type &help category for more info on a category.
desert vessel
#

yikes, wrong channel

brisk brook
desert vessel
vocal wolf
#

k I'm closing this 2 year old PR

desert vessel
#

Finally-

brisk brook
vocal wolf
#

lmfao

#

you have no idea

#

I once updated a PR and 3k commits merged into it

#

that's when I found that the webhook caps at 1k commits

desert vessel
#

/Users/urmom/Library/Caches/pypoetry/virtualenvs/thread-bot-CQnFdfHJ-py3.9/bin/python: No module named thread_bot

#

help :)

#

im running poetry run task start in sir-threadevere

gritty wind
#

Which directory are you in?

desert vessel
#

inside the sir-threadevere dir?

gritty wind
#

Never mind, the task is just wrong

desert vessel
desert vessel
gritty wind
#

Use this instead:
poetry run python -m bot

desert vessel
#

thanks :)

#

time to debug yikes

vocal wolf
#

@vale ibex @timid sentinel thanks y'all for the reviews and stuff. I go bed now.

desert vessel
#

discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Bod

vale ibex
desert vessel
#

yikes-

#

its something to do with env i believe

vale ibex
#

Did you update your config.yml to the right values for your server?

desert vessel
vale ibex
#

the last 3 role IDs are the same

desert vessel
#

its just me in the server, so im using the same role

#

but i'll change it and try again

vale ibex
#

yea, we make a list rather than a set, so it can contain duplicates

desert vessel
#

ah

#

kk

#

gg,it works

#

what are extensions exactly ??

vale ibex
#

those are the cogs loaded

desert vessel
#

oh

#

last thing : we may have to clean this message up

#

its not making threads smh

vale ibex
#

What are you trying to do?

vale ibex
brisk belfryBOT
#

:x: Could not find the extension asdasd.

vale ibex
#

fixed

short snow
#

even your discord colours become darker? I thought there is some problem with my discord again 😛

desert vessel
#

Cool*

short snow
#

whats the zero width space code?

vale ibex
#

200B

short snow
#

Ok thanks, what I am doing wrong here?

question = question.replace(word, len(word) * "*\u200B")
brazen charm
#

What's the goal?

#

Looks like it could be the Markdown or something

short snow
#

to replace it would the same amount of *

#

so to escape the markdown, I added zero width spaces

brazen charm
#

Why zwsp instead of escaping it normally?

short snow
#

🤷‍♂️ I just went ahead with that

#

ok normal escaping works, nice

dim pelican
#

Regarding Sir-Lancebot#610, do I need to link a new branch to the PR?

Since the original PR has a different author I am thinking I need to set up a new remote based on their current branch, make a local branch / clone from that and then push my commits to my local branch. Then link my local branch to the PR. Does this sound sorta correct?

dusky shoreBOT
stable mountainBOT
brisk brook
dim pelican
#

Ahh shucks

desert vessel
dim pelican
desert vessel
fervent sage
#

hmmm

desert vessel
#

hehe

dim pelican
#

sir-lancebot#816

dusky shoreBOT
thorny obsidian
#

It was us making fun of k8s during yesterday's staff meeting

fervent sage
#

im too lazy to change mine back KEKW

desert vessel
#

btw

#

did u guys take a look at sir-threadevere ?

fervent sage
# dusky shore

@vale ibex slight issue with this being merged, it wasnt done correctly

#

akarys said to remove the check entirely so it could be used everywhere, but that never happened

desert vessel
#

thats this

fervent sage
#

ah

desert vessel
#

its open

#

im just waiting for the other dude to accept it or tell no

#

i cant pr cuz chris asked him first

vale ibex
#

no point pausing that one just to wait for the new reqs to be done

desert vessel
#

yep

vale ibex
gritty wind
#

I'll never understand how discord managed to make such a terrible API. Why is the type """null""". I can't actually get the API to give me that field, so what I'm assuming is you only get that field if the object has premium, otherwise you don't get it.

You know what the sane thing would've been? Just using a fucking boolean

#

Now I've gotta figure out how to represent this with pydantic models

brazen charm
#

could be a not so great way of cutting down the size

brisk brook
fervent sage
#

so size wouldnt be the consideration

#

@celest charm and myself have been using the api docs a lot over the last 2 days and i think our collective conclusion is "wtf"

brazen charm
#

is a date string larger than a timestamp when text encoded?

fervent sage
#

no clue

#

but it also includes the id of the pin

#

and IDs are just timestamps on steroids

brazen charm
#

ah then yeah that just seems like bad design if you can get it anyway

fervent sage
#

user objects also have 2 values, i cant remember their names, which is the colour of their profile as an int, and then then the colour of their profile but a #hex string

#

including the #

celest charm
#

I can confirm that the Discord API is absolute nonsense and poop and bad and so on

#

okay maybe I exaggerated a bit

fervent sage
#

i mean

#

A large portion of it is next level "seriously why the fuck?"

patent pivot
brazen charm
#

How often does the api change? I could see those as bad decisions early on and then keeping backwards compatibility but that could be removed when the api changes

fervent sage
#

we've gone from v6 to v9 in a year

#

with v10 soon™️

patent pivot
#

well, v7 was skipped

#

v8 didn't make a load of changes

fervent sage
#

it wasnt skipped

#

just in the client

#

bot devs still went "ooh shiny" and used it

patent pivot
#

it was skipped from a documentation point of view

celest charm
#

For example, this is the breakdown of the Channel object into subtypes. There's nothing wrong with the API per se, but the way it's documented (just a giant list of optional fields) is beyond horrible
https://paste.pythondiscord.com/raw/nujupuwoke

fervent sage
#

sometimes the api docs just completely neglect to include any sort of info about what an endpoint returns at all, so i guess we should be glad for what we do get

brisk brook
celest charm
#

yeah

brisk brook
#

Ah okay

thorny obsidian
celest charm
patent pivot
#

lmfao yeah apparently so

cold island
#

!note 212644551926611969

stable mountainBOT
#

:ok_hand: applied note to @thorny obsidian.

celest charm
#

!note @cold island

stable mountainBOT
#

:ok_hand: applied note to @cold island.

fervent sage
#

can i be null noted 🥺

celest charm
#

we don't joke infract helpers lemon_pensive

fervent sage
#

its a note not an infract

thorny obsidian
#

we don't joke infract non-mods/admins

fervent sage
#

the note could just mean "h" but expressed via null-ness

celest charm
#

!h @fervent sage

patent pivot
#

oh yeah it could be joke infrs

fervent sage
#

wait we dont have an h command I must create an issue

gritty wind
#

here is another nice idiocy. Left is the name, right is the description. So I thought: cool, let's look at the hyperlink

#

all of these are in fact delivered

cold island
#

I find it weird that we can note outside of mod channels

fervent sage
#
class h(Cog):
  @command(name="h")
  async def h(self, ctx) -> None:
    resp = await session.get("https://h.pydis.com")
    await ctx.send(await resp.text())
gritty wind
#

Failed linting, banned

brisk brook
celest charm
#

Yeah, let's add pydis-style docstrings

class h(Cog):
  """The h cog"""

  @command(name="h")
  async def h(self, ctx: Context) -> None:
    """Perform the h"""
    resp = await session.get("https://h.pydis.com")
    await ctx.send(await resp.text())
gritty wind
#

There is no way to see where a model is used, but for this endpoint, yup

#

Still failed linting

#

Class name should start with a capital

celest charm
#

oh right

patent pivot
celest charm
#
class h(Cog):  # noqa
  """The h cog"""

  @command(name="h")
  async def h(self, ctx: Context) -> None:
    """Perform the h"""
    resp = await session.get("https://h.pydis.com")
    await ctx.send(await resp.text())
cold island
#

Also no period at the end of the docstring

gritty wind
#

Violated pre-commit

#

no blanket noqas

celest charm
#

I give up

gritty wind
#

lol

vale ibex
#

NameError: name 'session' is not defined

gritty wind
#

Pydis Roast™️ but it's just code

vale ibex
#

New event idea, spend an hour going through my PRs and roasting my code

dim pelican
#

I don't want to interrupt the discussion since its awesome, but how would I go about getting the .rp search command enabled in more channels than just #bot-commands ?

timid sentinel
#

Is it just me or have backticks for codeblocks started rendering really weirdly in github, e.g. typing ```hello``` looks like this

gritty wind
#

You can use the whitelist decorator, but have you gotten any other channels approved?

brazen charm
#

there should be a decorator to override the whitelist global check

timid sentinel
#

shows fine in the preview though

gritty wind
#

link wookie?

dim pelican
timid sentinel
gritty wind
#

Usually we don't want to enable these commands everwhere

#

For instance, SO command was deliberately disabled in help channels

dim pelican
#

Yeah that could get really spammy

gritty wind
#

Yeah, and because we don't want people just going into a help channel, copying the question into the command, and leaving

#

If someone wanted google, they could go to google

#

What channels did you have in mind?

gritty wind
dim pelican
#

Ot, help and general. But there is a lot of spam potential for 2/3 of those...so maybe its fine the way it is. Just wanted a soundboard to bounce the question off someone else

gritty wind
#

OT sounds fine, but I'd be against help channels and general

thorny obsidian
#

I'm going to advocate specifically for help channels, that's where RP could help the most

#

Also, I'd like to keep a "enable everywhere (except pygen) until proved noisy)" policy

gritty wind
#

I believe it'll have the same problems that we discussed when opting to not enable the stackoverflow command

brisk brook
#

I think that's different though?

thorny obsidian
#

real python is not a "just search your answer here", they are tailored articles to introduce subjects

#

It's a fundamentally different service

brisk brook
#

But I can see legitimate uses

#

For example

#

!decorators

stable mountainBOT
#

Decorators

A decorator is a function that modifies another function.

Consider the following example of a timer decorator:

>>> import time
>>> def timer(f):
...     def inner(*args, **kwargs):
...         start = time.time()
...         result = f(*args, **kwargs)
...         print('Time elapsed:', time.time() - start)
...         return result
...     return inner
...
>>> @timer
... def slow(delay=1):
...     time.sleep(delay)
...     return 'Finished!'
...
>>> print(slow())
Time elapsed: 1.0011568069458008
Finished!
>>> print(slow(3))
Time elapsed: 3.000307321548462
Finished!

More information:
Corey Schafer's video on decorators
Real python article

gritty wind
#

But why would you need to search it if you are giving someone something specific

#

If you have an article you think someone should read, you can link it

thorny obsidian
#

Like, if someone wanted to ask for async help like "should I use threads or async?" what would make it faster?"
then I would do .realpython concurrency and bring up the articles already

#

.realpython concurrency

dusky shoreBOT
#

Here are the top 5 results:

Speed Up Your Python Program With Concurrency
Async IO in Python: A Complete Walkthrough
Hands-On Python 3 Concurrency With the asyncio Module
brazen charm
#

what's the interface of the command? If it's a search command that you have to interact with then I don't think it fits into a help session

thorny obsidian
#

So it's right there, and they can see what's available

gritty wind
#

I don't see how this won't be abused

#

As the person that asked the question

#

This has gotten me no where

#

You've just given me 5 random links

#

No idea if you've vetted them or not

thorny obsidian
#

"Hey, check out this real python article like the 1st and 3rd, they'll explain what you need"

gritty wind
#

No idea if they will answer my question

#

If you already know the articles

#

Why do you need a search

brisk brook
#

I do agree that someone may ask to get a personal explanation

thorny obsidian
#

Because it's easier than exiting out of discord, doing the search on google, then coming back and linking it

brazen charm
#

Doing that in a separate channel and then sending the appropriate link themselves seems like it'd make more sense to me

thorny obsidian
#

Because why have this only be available in bot-commands. Then it's the same as not having it at all and just using google to me.

gritty wind
#

I don't think that's true, especially considering that your topic may not be in the top 5, especially for a really broad term

#

Someone said that exact same thing for SO

#

That exact same argument

thorny obsidian
#

RealPython is a fundamentally different service than SO. I don't think the same arguments hold.

gritty wind
#

But we still pushed on through with it, because we had people that wanted to implement it, and we weren't harmed by having it

#

I don't see how that's true. Sure, the format of info is clearly different, but fundamentally it's just giving you a bunch of links to random text

#

I can make your exact same argument for SO

thorny obsidian
#

I mean RealPython itself, not the command.

gritty wind
#

Q: "How do I solve file not found?"
A: SO link to answer that explains it

thorny obsidian
#

RealPython are tailored articles, written with a specific purpose in mind. So if you're searching through it to link something, it's far more than just a "plug in your question into SO and nothing else"

brisk brook
#

Q: How does decorators work?
A: Tag that explains it

thorny obsidian
#

It's a "hey, this service has written this better than I could, take a read through this"

brazen charm
#

half of the links from the search above aren't even articles that you could easily make sure are correct for the given question

gritty wind
#

An SO answer can technically answer something much better than a helper here

brisk brook
gritty wind
#

And linking to that answer can help someone understand something

gritty wind
#

Which both SO and RP are

thorny obsidian
#

The .so search command abuse was because people would just assume it's a normal stack overflow search and plug in the question wholesale. I don't think people would do that with RealPython because it doesn't strive to answer broad questions.

gritty wind
#

You need to know what the tags are, and you need to know their content

thorny obsidian
#

I don't think the avenue for using the command against the spirit of the server is there enough to warrant pre-emptively denying it in help channels.

gritty wind
#

We could put it up to a vote, but I believe the same fundamental problems that exist with SO, will exist here

dim pelican
gritty wind
thorny obsidian
gritty wind
#

and fwiw

#

.RP should I use threads or async?

#

what's the actual command?

#

.realpython should I use threads or async?

dusky shoreBOT
#

Here are the top 5 results:

Speed Up Python With Concurrency › Speed Up Python With Concurrency (Overview)
Speed Up Python With Concurrency › Speed Up Python With Concurrency (Summary)
Speed Up Python With Concurrency › CPU Bound Workloads
Speed Up Python With Concurrency › Multi-Processing Version
Hands-On Python 3 Concurrency With the asyncio Module › What Is Concurrency?
gritty wind
#

Just fed it that question

thorny obsidian
#

But who would think to do that with RP?

#

It's article-based, not question-answer-based

brazen charm
#

what does doing it in a help session offer over doing it in in bot commands and then posting a single link in the session offer?

#

There's no rush to get it to the person that's being helped, and is less confusing

gritty wind
#

Don't know why that distinction matters? RP has so many articles you can probably stick any question that you can in SO and get a result

thorny obsidian
#

Because why introduce that extra friction that would essentially mean it won't really see it being used because people don't know it exists. It's just burying this command.

brisk brook
thorny obsidian
gritty wind
green oriole
#

What's the context?

gritty wind
#

The main RP site has a search bar, people must be using it, right?

green oriole
#

I actually never used it

#

Always google search

dim pelican
gritty wind
gritty wind
thorny obsidian
#

I'll step out, but I just don't like us pre-emptively denying usage of useful commands without a strong reason. I don't think "people could abuse the .realpython search command by just plugging it in wholesale" is enough of one. When I search on RP, I search for general terms to find specific articles I have in mind.

timid sentinel
#

If the disagreement is just over whether people will abuse the command and we do think there's a valid use case, could we not just try it out and see if that's the case. Would be easy enough to revert?

green oriole
#

Hmm, that's a complex one since it is different from SO. I would say we can trial it

fervent sage
#

Yeah, you dont know how people will use it before they use it :P

brazen charm
#

even if it's not abused, imo the UX for the person that's being helped is not great

gritty wind
#

Because it can hurt the experience for people that do experience that abuse. I don't think it's utility is great enough to warrant doing that

green oriole
#

But I'm afraid it will be the same problem

dim pelican
#

I think we all agree that there is a potential for abuse though, just different strategies for how to avoid that?

gritty wind
#

And like Numerlor mentioned here and earlier

green oriole
#

There is a difference between "Hey, look at that article: $link" and dropping a search command in front of the user

#

Same problem as SO

thorny obsidian
#

Did we stop SO from being used in help channels because of bad UX or because we think people will just drop a "I dunno, search SO <search and leave>"

gritty wind
#

We could put it up for a vote, but I'm not in favor

thorny obsidian
#

Where is that documented?

gritty wind
#

It isn't, because we don't document everything

#

It's in this channel

green oriole
#

But we don't know that's actually what will happen. Our policy is to trial more perms and reduce if it problematic.

timid sentinel
#

The main good use case I would see is when you see a common topic, for which you know a realpython article exists, and just want to reference it, e.g. "for more on that you can check out this realpython article on lists, !realpython lists, take a look at the first link there".

thorny obsidian
#

Because I thought our policy was a "we'll enable everywhere then limit if it becomes problematic" and this feels like a significant departure from that policy. So it'd be nice if that reasoning and discussion was documented somewhere.

green oriole
gritty wind
#

I'm willing to trial a lot of things, but in my mind I don't see all that many great use cases for this command, and I think it can be a significant harm.

#

That combination, along with one of our most core systems

#

Yeah... don't like it

dim pelican
#

Just spitballing, what if it returned a single link based on which channel it is in? Could lead to more problems though

timid sentinel
#

.realpython lists

dusky shoreBOT
#

Here are the top 5 results:

Linked Lists in Python: An Introduction
Reverse Python Lists: Beyond .reverse() and reversed()
Lists and Tuples in Python
Using Python Optional Arguments When Defining Functions
timid sentinel
#

Third one there works

green oriole
#

Anyway, this conversation seems quite heated and we aren't very much listening to each other, how about we solve this with a poll? We can always go back and change it later

gritty wind
#

With the ever changing nature of articles (new articles come, old go), wouldn't it make more sense for you to vet them first and return the one you want

dim pelican
#

I'm good with keeping it where it is, just figured I'd ask how to go about having it elsewhere 😅 First contribution so I guess I would like to use it more places haha

timid sentinel
patent pivot
#

@short snow I believe Dorsan is waiting for Sebastiaan

short snow
#

for his approval?

#

he has approved it iirc, lemme find the link

molten perch
#

Well, I don't think so. I never got assigned :/

#

I've set up the environment but never generated the models.

short snow
#

Ayy wookie, fast boy

dim pelican
#

@brisk brook just made a PR for the issue you opened

#

sir-lancebot#830

dusky shoreBOT
tawdry vapor
brisk brook
dim pelican
brazen charm
#

looks like an old base branch

dim pelican
#

I tried to make a new branch for the fix, since I read that was a good way to handle separate issues

brisk brook
short snow
#

wookie, should I make the hidden * bold?

timid sentinel
#

@short snow wdym by "replacing all punctuations would space could spoil words I guess", I think it would be OK if we just replace it in the title, maybe soemthing like

for word in re.split("\W+", title):
    extract = re.sub(word, "\*"*len(word), extract, flags=re.IGNORECASE)
timid sentinel
short snow
#

like if any of the title has ' in the title, and then we remove it, like can't becomes cant but i think rapidfuzz can detect that

timid sentinel
#

oh hmm in that case my solution just there would remove all cans and ts from the results though which isn't great lol. I guess we could just not split by some characters like ' or ", lemme try something out.

green oriole
#

I mean, this is the rabbit hole we probably don't want to fell into haha

short snow
#

Ok rapidfuzz can guess that nice

#

we can ignore those

green oriole
#

This is natural language processing, fuzzy matching will of course not provide any great result

timid sentinel
green oriole
#

That, or we lock recruit @trim cradle in a cave to make the algorithm perfect

trim cradle
#

Wa

#

Natural language processing. Yes, I nominally know about that

short snow
#

wookie mail, co-authoring you

brazen charm
#

you can check a commit from them

trim cradle
#

Why is there wookie mail

green oriole
#

When co-authoring I just go to a random commit from the user and copy paste their author line

timid sentinel
#

I think we can just go for, split by characters that separate words, e.g. whitespace or -, then strip punctuation from the edges, and then sub

green oriole
#

For real though, @trim cradle, would you know any tips and tricks we could use to make the quiz command detect correct answers better than blindly fuzzy matching the message?

dim pelican
green oriole
#

Is there like a better algorithm than fuzzy matching more adapted to this?

timid sentinel
#
for word in re.split("[\s-]", title):
    word = word.strip(string.punctuation)
    extract = re.sub(word, "\*"*len(word), extract, flags=re.IGNORECASE)

Ok that's perfect nobody can convince me otherwise 😎

trim cradle
#

@green oriole I can look into it later

green oriole
#

Sounds good, thank you

#

Have fun!

timid sentinel
#

All we really want to do is split a sentence into words so we can substitute them out of a text

short snow
#

how is \W different from \s

timid sentinel
#

hmm actually we should only sub out full words rather than parts of words

short snow
timid sentinel
#

so basically \W contains punctuation, \s doesn't

short snow
#

oh

green oriole
#

W stands for word characters

timid sentinel
#

Ok,

for word in re.split("[\s-]", title):
    word = word.strip(string.punctuation)
    extract = re.sub(rf'\b{word}\b', "\*"*len(word), extract, flags=re.IGNORECASE)
short snow
#

@timid sentinel done

desert vessel
#

Heyyy wookie 😀

vocal wolf
#

alright

#

I'm awake

trim cradle
trim cradle
#

"By adding variables as attributes to your bot" isn't misleading per se, but the variable itself is something that can be deleted after the object it refers to is given another reference via bot, but the actual object will still be there.

vocal wolf
#

I don't know their username on Discord unfortunately so we can't talk to them directly

#

unless

vocal wolf
#

oh right

brisk brook
vocal wolf
severe tangle
#

Hm?

trim cradle
brisk brook
trim cradle
#

8 is 8 might work coincidentally because of how certain integers are pre-allocated when the interpreter starts, but that's just an optimization. It's not part of the spec.

brazen charm
#

it is a constant in the same way 8 is, but constants is not really a term for objects in python beyond the few builtin constants

trim cradle
# severe tangle Hm?

Yes, thank you for your contribution! Would you be open to substituting the changes I suggested verbatim?

severe tangle
#

sure

trim cradle
#

!e print(10_000_000 is 10_000_000)

stable mountainBOT
#

@trim cradle :white_check_mark: Your eval job has completed with return code 0.

001 | <string>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
002 | True
trim cradle
#

huh

brazen charm
#

immutable literals compiled together are fetched from code constants

trim cradle
#

dank

severe tangle
#

so, what do u want me to change in the md file now?

trim cradle
#

Though it might be later today that I take another look

severe tangle
#

ah, ok. I will just accept them. That is fine with you?

trim cradle
#

I only left them as comments in the original PR. I can't go back and add them as proper suggested changes because that PR is closed.

severe tangle
#

Ah, I will manually do it then

trim cradle
#

Sorry about that. I don't really do code reviews very often except for language-related stuff.

severe tangle
#

ah that is fine

#

there

#

I have fixed that

trim cradle
#

I think I can take a look this evening

severe tangle
#

Sure

vocal wolf
#

@vale ibex lmfao that PR timed out

#

I tried trolling you and I got hit with karma

#

the god damn coverage report timed out

vale ibex
#

lmfao

#

leave the trolling to the professionals

vocal wolf
#

@vale ibex ok we're good

vale ibex
#

Nice

#

Now I have one for you @vocal wolf hyper bot#1794

dusky shoreBOT
vocal wolf
vocal wolf
#

@vale ibex have you tested this?

vale ibex
#

Yea, we've been testing it for weeks in lance too 😄

vocal wolf
#

ah

#

nais

#

then I see no reason to not approve

stable mountainBOT
#

.github/workflows/build.yaml lines 11 to 13

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true```
vocal wolf
#

yah

#

approved

vale ibex
#

👌

dim pelican
#

What are your opinions on the .gitmessage templates? I could see them being useful for newbies like me

brazen charm
#

is that a template for commit messages?

dim pelican
#

Yup! I am trying one out locally that is kinda nice, includes the 50 and 72 character limit lines, place to include an issue etc

patent pivot
#

is it a standardised format?

#

ah I see, it pops up with git commit?

dim pelican
#

Yes

patent pivot
#

interesting

dim pelican
#

And the format can be standardized based on what you save it as. Just have to make sure that the config is set that way

#

This is mine right now:

# 50 characters                                 #
# Subject 
# (If implemented this commit will ___)

# 72 characters                                                       #
# Problem
# Problem, Task, Reason for Commit
# Solution
# Solution or List of Changes
# Note
# Special instructions, testing steps, rake, etc

Issue #
#

git config --global commit.template ~/.gitmessage.txt

molten perch
#

Hey! Could someone take a look at site#369 ? It seems to be a high priority issue. 🙂

dusky shoreBOT
green oriole
molten perch
#

I believe so, yes.

green oriole
#

Alright, sure, that can work

#

I don't have access to github from here though, do you wanna get assigned?

molten perch
#

Yes, I do! 😄

green oriole
#

Cool cool, if there's a staffer around who can do it

brisk brook
#

Just grab the GitHub Mobile app©®™ :p

green oriole
#

I need to log onto that device for at least three months by now

#

I just always forget about it

fallen patrol
tawdry vapor
#

Something to note is that the GPL licence is most likely of no concern since we're not distributing snekbox with it. It's only installed in the production env.

#

But if you just prefer rapidfuzz's features over fuzzywuzzy then sure

patent pivot
#

hm, I think fuzzywuzzy is the wider used one

#

I'm fine with it as is — as Mark mentions there isn't a licensing concern

fallen patrol
tawdry vapor
#

You can just add both

#

I am personally not strict at all with adding new packages unless it's just for a meme or something, or would have no practical use given snekbox's restrictions (e.g. something for making network requests)

fallen patrol
#

right

tawdry vapor
#

Also there is something to be said about the development activity on rapidfuzz vs fuzzywuzzy

fallen patrol
#

yeah?

patent pivot
#

someone proposed adding scapy today which I'm for as well

tawdry vapor
#

I don't know what that does but if it doesn't go against what I wrote above then sure

patent pivot
#

building network packets

fallen patrol
#

seeing that toml is in there, tomli too :))

thorny obsidian
patent pivot
#

yeah it's just packet building with a pythonic interface

#

you use / to encapsulate IP in an eth frame and whatnot, neat for teaching networking

patent pivot
fallen patrol
#

is compatiable with the 1.0 spec

#

toml only is compatiable with 0.5

#

you can get more info from pip and black devs, having had to move since 1.0 toml spec pyproject.tomls were breaking their tools on toml IIRC

patent pivot
#

yeah having a look, not opposed to adding that

tawdry vapor
#

So is there any point in keeping toml around too?

fallen patrol
#

well, tomli needs a seperate module if you want to make toml

tawdry vapor
#

I kind of doubt anyone actually uses toml in their eval anyway, but whatever

fallen patrol
#

yeah lol

patent pivot
#

I wonder if we can remove packages lol

fallen patrol
#

I personally use atoml 🙃

patent pivot
#

dep caching might make that weird

tawdry vapor
#

Doesn't look like it would remove it.

brisk brook
tawdry vapor
#

snekbox code never imports it

#

It's just there available in the eval env. So it is the user code that imports it

fallen patrol
#

^ you commented on using it for the tools in python which are never imported by the code

#

ex flake8 plugins

#

pydis code never imports it, yet you're still worried about their licenses

tawdry vapor
#

@fallen patrol I comment on that? I do not remember that.

fallen patrol
#

uh a specific pr

#

bot#1779

dusky shoreBOT
patent pivot
#

@plush narwhal yeah, but I think this is distinct from that, that has a much tighter tie to our stack, but snekbox evaluations don't, I'm not sure where the actual line is drawn though

fallen patrol
#

wrong user ;-;

tawdry vapor
#

Yeah I didn't forget that but I didn't specifically mention tools like flake8

patent pivot
#

ah, whoops, one char off

tawdry vapor
#

I don't licences of tools generally matters, but I am no expert on this matter

#

Well, they do matter but things aren't typically in such manner that restricts use of the binary

tawdry vapor
patent pivot
#

hmmmm yeah AGPL is just if you use a service you're entitled to source code right?

tawdry vapor
#

Maybe something like that. After yesterday's conversation I don't really wanna dig into licences anymore.

vocal wolf
#

@patent pivot join us in vc

#

wait crap nvm I've forgotten what I've needed to tell you

patent pivot
fallen patrol
#

oh nice dev-voice got opened to all

vocal wolf
#

yeah but you can't unmute yourself unless you're a contrib or staff person

fallen patrol
#

right

patent pivot
#

sure

#

don't reimplement a lot – just needs to call the command

#

we will need to get that command in the container though

#

bind9-dnsutils

clever wraith
#

.\reverse hasn't been changelogged yet huh

#

Damn couldn't escape it

tawdry vapor
cold island
#

Why is it necessary for the classes to have names?

tawdry vapor
#

It's a way to map them to their infraction types. The goal is, when having some infraction data from the API, to avoid a big if-else to instantiate the right class.

#

Though that reminds me that for create(), that should be changed so it's able to infer the type rather than requiring it to be passed explicitly

cold island
#

It's a bit odd to me to be able to search all user's infractions with Ban.search

slim widget
#

Mind if I join VC to see what you're working on? 👀

patent pivot
#

for sure xith is doing some programming

tawdry vapor
slim widget
#

Joe, have you tried Kakoune? 😄

#

Erm, similar to vim.

#

One nice feature is it has a client-server model. So you can use your own window manager, instead of having to learn two sets of shortcuts.

cold island
#

But otherwise yeah, the search function doesn't seem actually tied to the class

tawdry vapor
#

Yes, in practice working with dictionaries has not turned out to be nice. I suggested years ago that we should wrap the API but people weren't feeling it.

tawdry vapor
cold island
#

get is the same I think

#

I'm a bit fuzzy on class method inheritance and not in front of a computer. Won't calling Ban.from_data set cls to Ban?

tawdry vapor
#

Yes it will

#

I didn't really intend for it to be used that way

cold island
#

Why not? If you call Ban.create that'll call Ban.from_data

tawdry vapor
#

I wasn't using Infraction instead of cls because I was playing around with an abstract subclass for expanded versions of expansions, which may have needed their own set of concrete subclasses. I didn't really like how it was turning out but I never changed it back to Infraction.from_data

cold island
#

Hmm. cls seems fine here though, you don't need to look for the right class in from_data then

dim pelican
#

So I tried to take over another's PR that was assigned to me...I somehow added all of my previous commits to the PR. The changed file is there though, and is ready to start the review process again. Sir-Lancebot#832
@brisk brook I think I got it half way right, I was able to pull his remote branch into my local

dusky shoreBOT
tawdry vapor
#

Maybe. My concern is that it is using the _types defined on Infraction. I guess it should be since the subclasses don't override that

#

If the point you're trying to make is that the _types is redundant cause the cls gets set, I was trying to say that if you receive a response from the API you won't know which class to use so from_data takes care of creating the correct class.

cold island
#

Sorry I'm not sure I'm following. Reading the code, my impression is that the ban command will mainly become

infraction = Ban.create(...)
infraction.apply(...)

In that case I'm not sure why cls can't be used

tawdry vapor
#

Think about what needs to happen when you get a response from the API and need to create a class (e.g. get or search)

#

Yes, these are classmethods that are accessible on the concrete types, but that was never the intention.

fallen patrol
tawdry vapor
#

The idea is that if you just have an infraction ID, no idea what the type is, you get a response and it has a "type" as a string, and now you need to find the class that corresponds to that "type" string.

cold island
#

Hmm I see

#

It can be optional in that case, but that doesn't really matter

#

But yeah, create and from_data seem fine as class methods

short snow
#

hellllo

#

oh

#

right

#

hmm

#

yeah

#

maybe add a another embed for the edited embed

#

to see the two differences?

#

or just add another field to the embed

#

ah yeah

#

no edits?

#

yeah

#

idts

#
def shorten_text(text: str) -> str:
    """Truncate the text if there are over 3 lines or 300 characters, or if it is a single word."""
    original_length = len(text)
    lines = text.count("\n")
    # Limit to a maximum of three lines
    if lines > 3:
        text = "\n".join(line for line in text.split('\n')[:3])
    # If it is a single word, then truncate it to 50 characters
    if text.count(" ") < 1:
        text = text[:50]
    # Truncate text to a maximum of 300 characters
    if len(text) > 300:
        text = text[:300]
    # Add placeholder if the text was shortened
    if len(text) < original_length:
        text += "..."

    return text
#

haha yeah

#

okay mr. webscale

tawdry vapor
short snow
#

any other functionality to be removed?

tawdry vapor
#

Maybe from_data is still confusing as a classmethod since it doesn't return the same type

short snow
#

xithhh which icons extension do you use

#

yeah

#

incidents webhook

#

you made it

#

lol

cold island
#

You could get the right class in the search and get functions

#

Instead of inside from_data

tawdry vapor
#

What I mean is that if you do Ban.from_data it doesn't necessarily return a Ban. It could be any type. It makes sense when used as Infraction.from_data but it technically works on any subclass too.

#

Maybe not that confusing to use it, but if you're reading it, it might lead you to believe it's a ban that's returned

#

And there's no way to enforce that it's only called from Infraction

cold island
tawdry vapor
#

Yeah I guess it can be removed entirely or just be made private. I don't really see a reason for someone outside the class to be dealing with raw API data.

cold island
#

Ah yeah, if you do that then it's just an init wrapper

slim widget
#

Tbh, that would be useful. I use fan-noise to tell if there's an infinite loop in my code lemon_sweat

#

@patent pivot

tawdry vapor
cold island
#

Yeah I mean if you export the class fetching then it doesn't do anything but call the init

#

At which point you can just call the init

short snow
#

what, are these some new stuff

tawdry vapor
#

Right. I was speaking in terms of either doing your idea of fetching the glass in get and friends, or keeping it in from_data but making it private

short snow
#

nope we don't ignore

#

in tox.ini

cold island
short snow
#

lemme see

#

whose venquatil on discord?

#

Mr.Webscale your task has finished incident_actioned

vocal wolf
#

classic

cold island
dim pelican
short snow
#

your volcy has a pr up mr.webscale

tawdry vapor
# cold island Out of curiosity what did you notice yourself?
  • Using an overload so I can easily get kwargs has the disadvantage that it defers validation completely to the API.
  • Type annotations don't have the Unspecified type, but it's so ugly if it's added 😦
  • The time parameters could accept anything that arrow.get accepts, which can be implemented once my time refactor PR is merged
  • Not sure how to add some of the other infraction metadata (e.g. the icon, the pardon text)
  • Don't know how to implement support for expanded infractions
  • The dataclass has to be separate from the abstract class because mypy complains (I don't remember if it otherwise works or if Python also crashes)
  • Converting timestamps to arrow.Arrow in the dataclass is hacky since the dataclass is frozen. It also makes the __init__ a bit confusing since it's supposed to take strings but that isn't clear from type annotations
slim widget
#

Ohh nice Xith. I use Amethyst.

#

It's great.

short snow
#

Alright cya, bye guys

cold island
#

I guess you want kwargs but be able to tell the user what the possible keywords are

tawdry vapor
#

Yes. Otherwise I'd have to check each parameter for being unspecified so I can avoid adding it to the payload

#

Plus I'd have to manually construct the dict to send to the request

cold island
#

Constructing the dict doesn't seem bad

tawdry vapor
#

I had to do it for create. It feels redundant especially when there are many params

cold island
#

Wait if you're doing the overload anyway why can't the args all be optionals?

outer oasis
#

Is the top free memory?

#

Activity monitor?

cold island
#

Search. Just not sure why you need default values for them. Oh wait I do

slim widget
#

Yeah, on macos it's running an entire linux virtual machine @twilit juniper

tawdry vapor
cold island
#

Yeah I don't see a great way to do that

#

I'd probably just build the dict manually

tawdry vapor
#

How is that an improvement, besides being able to validate params a bit earlier?

cold island
#

Just seems a bit cryptic atm

#

The infraction icon is probably a class attribute for each subclass

twilit juniper
#

With WSL

outer oasis
#

Using a WSL backend is optional, as I remember it

twilit juniper
#

For docker no

cold island
outer oasis
#

You can uncheck Use WSL to use Hyper-V instead

outer oasis
tawdry vapor
# cold island The infraction icon is probably a class attribute for each subclass

Yeah I was thinking that. The one caveat is that abstractness cannot be enforced, for what that's worth. There is a trick where the abc defines @abstractproperty but the subclasses just use regular class attributes. However, concrete classes are only validated when instantiated, yet class attributes don't require instantiate to be accessed. IIRC I played around with a way to "statically" validate that but yeah I don't think it's necessary.

cold island
outer oasis
#

Fair

tawdry vapor
cold island
brazen charm
#

@patent pivot arcade still broken

patent pivot
#

ah yeah did't get around to that

#

having a look

brazen charm
#

and the pd and np packages which do nothing apart from adding duplicate symbols

patent pivot
#

!doc refreshdoc

stable mountainBOT
#
Inventories refreshed

- np, pd```
patent pivot
#

!d arcade.AnimatedTimeBasedSprite

stable mountainBOT
#
class arcade.AnimatedTimeBasedSprite(filename: Optional[str] = None, scale: float = 1, image_x: float = 0, image_y: float = 0, image_width: float = 0, image_height: float = 0, ...)```
Sprite for platformer games that supports animations. These can be automatically created by the Tiled Map Editor.
thorny obsidian
#

@patent pivot can you change your name to something longer or shorter? Right now your name is causing me to think you're hemlock >_>

Mr. Webscale K8s Man perhaps

patent pivot
#

OH sorry sorry sorry

hoary haven
#

Mrs

patent pivot
#

fixedd fixed

thorny obsidian
#

big thanks! :D

vocal wolf
#

lmfao

thorny obsidian
#

I ... apparently don't read names anymore and match on approximate shape, length, and color

foggy tiger
#

@twilit juniper which video

dim pelican
#

I'm learning so much about github by failing so hard at it....Finally got everything set up to work on the actual file that needs changes

#

sir-lancebot#833

dusky shoreBOT
desert vessel
#

where did the issue template dissapear ????

brazen charm
#

to lancebot

desert vessel
#

isnt it in the py bot ?

brazen charm
#

no

vocal wolf
desert vessel
#

thanks for letting me know :D

dim pelican
#

Speaking of templates, just opened up sir-lancebot#834 for commit templates

static canyon
#

@vocal wolf you mentioning on sir-lancebot#814 that it's preferred to only assign a PR when it's not the author working on it. Does this also apply to the bot repo?

dusky shoreBOT
vocal wolf
#

but yes

static canyon
#

👍

#

My logic was that it distinguished between "does this have anyone still working on it?" and "the person working on it is the author"

#

But good to know

static canyon
#

I suppose it doesn't matter too much, but can anyone think of a branch name for bot#1780? All I can think of right now is ignore-errors-from-infr-attempts-on-mods which seems rather long lol

dusky shoreBOT
static canyon
#

Then again, we do have longer ones like Only-check-domain-filters-against-URL-like-parts-of-a-message, so guess length just doesn't matter in a branch name

static canyon
#
                    if hasattr(user, 'roles') and any(
                        moderation_role in user.roles
                        for moderation_role in MODERATION_ROLES
                    ):
                        confirm_msg += " as target is a moderator or higher"
                    else:```is this the correct over-hang indentation for the `any` statement? pycharm indents an extra level but not sure if that's inline with pydis styling or not
brisk brook
#

Doesn't need to be long enough, or explain what it does (because you will have a pull request attached to it), just needs to be unique.

static canyon
#

👍

brisk brook
#

Hell, you can even use fix-1234 etc.

static canyon
static canyon
brisk brook
#

Can you send a screenshot?

#

Doesn't render nicely on my phone

static canyon
#

It's the any overhang I'm not sure about (lines 4 and 5)

brisk brook
#

I have a faint memory of such an error, something like "continuation line on the same level as next logical line"

#

I think that looks fine so as long as passes linting I'd say I am happy

static canyon
#

Yeah, it passes linting so I'll leave it 👍

static canyon
#
async def infraction_group(self, ctx: Context, infr_id: int = None) -> None:```should the typehint for `infr_id` be changed to `Optional[int]`? I was told in the dpy server that you shouldn't do this when the argument is the last of the command (or in this case, group), but not doing it does technically make the type annotation incorrect
brisk brook
#

It's fine

desert vessel
#

Hey peopl!

timid sentinel
austere hornet
#

@clever wraith Is there an unreverse command for @dusky shore ? Cuz he just made my avatar so weird and I want my old one back. Or would I just have to manually change it?

#

Oh wait I thought it saves it to my actual profile

#

Nvm

#

Sorry for the ping

short snow
#

just reverse your reversed avatar to make it normal

austere hornet
#

Yeah mb

#

I guess I haven't fully waken up yet

fervent sage
austere hornet
#

I literally woke up 10 min ago

green oriole
#

If we can have many people trying to break this version of the bot, that'd be perfect

short snow
#

tests :help_me:

#

for clean cog, zig's rewrite PR, why don't we use the metricity for getting messages from channels? I would be much faster IMO?

cold island
#

Metricity doesn't store message contents. I'm also not sure speed is a concern here

#

As in, it shouldn't be unbearably slow, but that's not the case we're in

austere hornet
clever wraith
#

lmao

austere hornet
#

Mb

short snow
#

also really nicely documented 👌 PR and code

#

@patent pivot This is about the enhanced incidents message PR, do I show that the message was deleted in the embed if the message gets deleted after the incident gets filed

patent pivot
vale ibex
#

hardly, it's just 4 nicely separated commits

green oriole
#

why spring cleanup lol

#

there are like a few dozens actual changes, rest is lock file

brisk brook
#

Autumn cleanup 😤

desert vessel
vale ibex
#

Done

austere hornet
#

@vale ibex Could you also take a look at sir-lancebot#823 as well please? Thanks so much!

dusky shoreBOT
desert vessel
vale ibex
#

which is essentially mastermind but with a different theme

dim pelican
#

Is it ask for review time?

#

I have two lol

austere hornet
vale ibex
#

Yea, I don't think it's worth having the same game in the bot twice

#

you could take a look at the snake antidote game source and see how it compares to your implementation

#

You could always see if you'd do it differently or if there are improvements to be made

#

or, you can wait a few days for the discord py 2.0 PR to be merged, and make a game with buttons

#

or re-write some of the games with buttons

austere hornet
desert vessel
#

btw

#

are you guys planning to switching to drop down menu's

#

and buttons ?

vale ibex
#

Yes

#

we have a PR up to migrate sir lance to discord py 2.0

#

then we can try out the new features there, and do a dry run of 2.0

thorny obsidian
#

Buttons! Buttons everywhere for all the events!

vale ibex
#

if all goes well, we'll migrate bot to 2.0 too, and see what features can be migrated to interactions

#

we're not going to do one huge PR to re-write everything with interactions tho

dim pelican
#

Sorry for the silly question, but do we clone a local sir-lancebot from the PR to test it out on 2.0?

#

Or how would that work

thorny obsidian
#

Not a silly question! But essentially, you clone the sir-lancebot and then switch to the branch that Akarys is PRing

dim pelican
#

Ahh branches. I've been learning breaking a bunch of things with branches recently

austere hornet
vale ibex
#

I've got a nice alias I use for git to check out a PR, since contribs can't make public branches

#

cpr = "!cd ${GIT_PREFIX:-.} && git fetch origin refs/pull/${1}/head && git checkout FETCH_HEAD #"

#

then you can do git cpr 1234 to checkout PR 1234

thorny obsidian
#

A Pull Request is essentially saying "hey, I'd like to merge this branch and its commits into the main branch". So to do the actual evaluation of the PR, you review the branch

vale ibex
#

you'd need to change origin to upstream though, to be able to checkout via your fork

thorny obsidian
#

... or just feel free to use GitHub desktop and do it with buttons

dusky shoreBOT
#
Command: snakes antidote

Antidote! Can you create the antivenom before the patient dies?

Source Code
dim pelican
#

Right. And I keep running into the issue where a make a new branch, but it includes all of the commits from my main branch

austere hornet
thorny obsidian
#

If you have a fork, you can pull down the changes to your fork, then switch to the branch

dim pelican
#

I'll bookmark Chris's command there for a reference

desert vessel
#

configuring the help command in sir-threadevere is impossible hehe

#

like-