#dev-contrib

1 messages Β· Page 155 of 1

vale ibex
#

but rather us descriptive names, like info, success, warning, error etc

#

and have it consistent across each bot

#

but that's more of an observation of the bots, rather than something that would block this change πŸ˜„

magic arch
#

Ah yeah I agree

#

On this change though, what should I do with the existing issue/PR? Keep them or just start over? (bot#1977, bot#1978)

cursive relic
stable mountainBOT
#

config-default.yml line 365

site_api:    &API          "site.default.svc.cluster.local/api"```
static canyon
#

I'll delete my comment on the PR too since it won't be relevant anymore

magic arch
#

πŸ‘ I was worried about undoing your feedback πŸ˜‚ thanks

static canyon
#

No worries lol

#

I've done this myself multiple times (started a PR that then got completely changed xD)

#

Errr apparently I can't delete the actual review itself lemon_sweat

#

I'll just edit it to say it can be ignored

cursive relic
magic arch
cursive relic
#

Is it something that can be hosted locally?

magic arch
brazen charm
#

you wouldn't use that url locally

#

but it's just an endpoint of the site repo

cursive relic
#

It seems like I really should make my own version of invite filter as it takes me even longer to set that up

magic arch
cursive relic
#

Hmm.. setting up that API just to have a good invite filter seems a bit too much of work for me

magic arch
#

If you're just looking for an invite filter, hosting the entire @stable mountain bot might not be the way to go.

cursive relic
#

I was actually thinking just the API site as it seems to be only thing I would need to set up to make it work, and I alrd have @stable mountain setted up

#

Or I just have to make up smth else

cold island
gritty wind
magic arch
#

Kaboom, much simpler. bot#1979

dusky shoreBOT
cursive relic
stable mountainBOT
#

bot/exts/filters/filtering.py line 560

response = await self.bot.http_session.get(```
gritty wind
#

It’s an aiohttp.ClientSession

#

It’s available on the d.py bot instance

#

Though we do define our own for various unrelated reasons

cursive relic
#

Do you mind to link me docs if you know them as I can't find them from dpy docs

magic arch
#

Its not in the d.py docs since it's our own

stable mountainBOT
#

bot/bot.py line 242

self.http_session = aiohttp.ClientSession(connector=self._connector)```
cursive relic
#

Oh I misunderstood it. Hmm even more code reading, thanks for linking that!

gritty wind
#

We define one because we use it to connect to the API, but there is one just on the bot instance

stable mountainBOT
#

discord/client.py line 220

self.http: HTTPClient = HTTPClient(connector, proxy=proxy, proxy_auth=proxy_auth, unsync_clock=unsync_clock, loop=self.loop)```
gritty wind
#

There is no problem with defining your own if you want to tho

cursive relic
#

if something like that, I can easily re make a oversimplified version of ir

cold island
#

Hmmm so

#

!d getdoc

stable mountainBOT
cold island
#

arrow is here

#

but

magic arch
#

Well that's not great

fallen patrol
#

will be back

fallen patrol
cold island
#

did

fallen patrol
#

something with their imports

#

!d arrow.arrow.Arrow

stable mountainBOT
#

class arrow.arrow.Arrow(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, **kwargs)```
An [`Arrow`](https://arrow.readthedocs.io/en/latest/index.html#arrow.arrow.Arrow "arrow.arrow.Arrow") object.

Implements the `datetime` interface, behaving as an aware `datetime` while implementing additional functionality.
fallen patrol
#

!d arrow.api.get

stable mountainBOT
#
arrow.api.get(*, ...) β†’ arrow.arrow.Arrow``````py
arrow.api.get(*args: int, ...) β†’ arrow.arrow.Arrow``````py
arrow.api.get( ...) β†’ arrow.arrow.Arrow```
Returns an [`Arrow`](https://arrow.readthedocs.io/en/latest/index.html#arrow.arrow.Arrow "arrow.arrow.Arrow") object based on flexible inputs.
cold island
#

wow really

fallen patrol
#

publically these are exposed as arrow.Arrow and arrow.get

cold island
#

!d arrow.arrow

stable mountainBOT
clever wraith
#

most packages don't have their root names as a symbol

fallen patrol
#

"most"

#

afaict 90% of the doc packages do have said root names as a symbol

#

...nvm

clever wraith
#

not from what ak could see when he set some of them up

fallen patrol
#

yeah just tested, most of them don't

cursive relic
#

I managed to make a working invite filter even without the need of going too deep inside the source code

fallen patrol
#

what would happen if @stable mountain went down, with github unaccessible?

#

how would a redeploy be triggered?

clever wraith
#

kubectl

fallen patrol
#

(also assume that joe is not accessible)

clever wraith
#

someone can build locally, push to the GHRC and use kubectl to redeploy

fallen patrol
#

ghrc is down, its part of github.

#

without any github infrastructure, how would a redeploy be triggered without being able to push to ghrc

#

@clever wraith ^

clever wraith
#

push to dockerhub?

fallen patrol
#

ah okay

magic arch
#

Alright, I can't get the bot to run without Docker. With Docker, everything works fine, but running it with Poetry isn't working.

I have the site, redis, and snekbox running on Docker, all seem to be working fine. This is the full error from poetry run task start: https://paste.pythondiscord.com/dipuvixuni.sql

#

What am I messing up?

vale ibex
#

Is the site available at localhost:8000?

magic arch
clever wraith
vale ibex
#

They already have. Since it's looking for localhost not site....

magic arch
clever wraith
#

ooh

#

hmm

vale ibex
#

In your config are you using https or http for the site protocol?

magic arch
#

http I think, let me check

vale ibex
#

πŸ‘

clever wraith
#

what OS?

vale ibex
#

windows

#

since paths are C:\

clever wraith
#

Alright, win

#

then localhost isn't set up correctly

magic arch
#

If we're looking at the site config, no protocol: site: &DOMAIN "localhost:8000"

clever wraith
#

that's the default option

#

hmm

#

try with 0.0.0.0 inside your config

magic arch
#

Alright one sec

vale ibex
#

There'll be a site_schema and site_api_schema

#

in config

brazen charm
#

add it to your hosts file and use that, I recall someone else having an issue with localhost

magic arch
#

127.0.0.1 instead of localhost did the trick

vale ibex
#

If you do cat c:\windows\system32\drivers\etc\hosts I'm guessing localhost isn't in there

#

I'd recommend adding ```
127.0.0.1 localhost
127.0.0.1 www.pythondiscord.local
127.0.0.1 pythondiscord.local

magic arch
#

No cat on Windows, but yeah it's not in there

#

Thanks a bunch

vale ibex
#

I have cat, and I'm on windows

#

do you use powershell 7?

magic arch
#

Ah gotcha, it's just powershell then

vale ibex
#

ahhh

#

terminal allows you to have multiple command emulators open in tabs

magic arch
#

Yeah that's what I normally use, I'm doing this in cmd though since that's how I have VS Code set up

#

Need to figure out how to change the default loll

vale ibex
#

I run my wsl in windows terminal

magic arch
vale ibex
#

Have you updated windows terminal recently?

fallen patrol
#

github is back :whew:

vale ibex
#

The settings got updated to have an actual UI now

magic arch
#

Yeah it's awesome

vale ibex
#

There's a defaults option in there πŸ˜„

fallen patrol
vale ibex
#

Yea, I'm aware

magic arch
vale ibex
#

Ahhhhh

magic arch
#

That's still set to cmd for me, I'm sure it's an easy fix I just need to look for it

vale ibex
#

ctrl+shift+p search for terminal

#

there should be Terminal: select default profile

#

It should auto detect any terminal emulators you have installed

magic arch
#

Ah you're awesome ty

vale ibex
#

πŸ‘Œ

magic arch
#

Ew the font isn't working, I need to fix that too but I can figure it out

#

but hey it's powershell now

vale ibex
#

Nice πŸ˜„

#

What are you running to get that view in powershell btw?

magic arch
#

AAA nope broke it

vale ibex
#

lmfao

magic arch
vale ibex
#

Nice

#

I'll check it out

magic arch
#

Yeah it works great, I have it all set up in Windows Terminal with some customizations and whatnot

#

Hey Chris, I can take that Sentry error with long rule numbers when GitHub cooperates

cold island
#

o right github is down

#

was gonna catch up on some reviews πŸ˜”

magic arch
#

It's like semi-up now

#

Just incredibly slow

cold island
#

yeah pretty slow

#

I'll probably be asleep by the time it's operational

magic arch
#

Maybe πŸ˜‚

austere hornet
#

Ik this is off topic but congrats on helper @clever wraith !

clever wraith
#

thank you!

brisk brook
#

I kind of get a response sometimes

vale ibex
#

feel free to assign yourself to the issue

magic arch
#

πŸ‘

#

We'll see if GitHub will let me right now πŸ˜‚

#

Woo, got it!

#

Boom

#

Easy fix

vale ibex
#

Looks good πŸ‘

austere hornet
#

Hey @static canyon , will you be able to review sir-lancebot#901 sometime soon? There was a reminder this morning about it iirc

dusky shoreBOT
magic arch
#

hold on let me see where else shorten is already used

#

hah yeah every single place it's used, it's ...

vale ibex
#

Ah alright cool, yea maybe overwrite the placeholder then πŸ˜„

magic arch
#

Boom again

molten perch
#

πŸ‘Œ

magic arch
#

It is done πŸŽ‰

#

Thanks for reviews

#

!rule 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

stable mountainBOT
#

:x: Invalid rule indices: 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,...

magic arch
#

nice

#

and now there's a space missing

#

πŸ’€

#

smh my head

#

ok gimme a sec

#

bot#1981 wins the world record for smallest pr ever?

dusky shoreBOT
vale ibex
#

Ah didn't notice it got merged already

#

was going to mention that we should likely split up that line

#

since it's doing too much now

magic arch
#

Ah alright sure

wind ruin
magic arch
#

idk why it says -1, its really just +1

#

although thats about to change

vocal prairie
#

there's typically not a space between an ellipsis and preceding punctuation afaik

magic arch
#

it's done here for example now that I'm looking

vocal prairie
#

maybe I'm wrong, but I've never seen "This sentence ends here. ..."

magic arch
#

that's in !d by the way

summer garden
#

Should there even be a comma there?

brazen charm
#

doc strips punctuation in the content before adding the ellipsis, I think that'd be fine here too

vale ibex
#

Really it could just be ```py
rules = sorted(set(rules))
invalid = [str(index) for index in rules if index < 1 or index > len(full_rules)]
invalid_str = ', '.join(invalid[:10])

brazen charm
#

or just leave it as is as it's not really important

vale ibex
#

Yea

magic arch
#
        invalid = ', '.join(str(index) for index in rules if index < 1 or index > len(full_rules))

        if invalid:
            await ctx.send(shorten(":x: Invalid rule indices: " + invalid, 75, placeholder=' ...'))
            return

Well this is my idea there, similar to how docs does it, worth changing or no?

vale ibex
#

Sure, seems good to me

magic arch
#

boom

austere hornet
#

Who has good experience with Pillow? I want to know cool things like how resizing and rotating works

thorny obsidian
#

@summer garden I like the dropdown for the different display styles, it's always a bit annoying to have to go look up in the docs what letter I have to put for what kind of date style.

summer garden
thorny obsidian
#

when you select one, will it tell you/format the epoch with the right code for it?

summer garden
#

Right now it edits the message body with the formatted timestamp

#

which is escaped so it doesn't get converted

thorny obsidian
#

oh yeah that's fine

summer garden
#

What should happen with the dropdown when an item is selected? Should I leave it till it times out?

thorny obsidian
#

yeah, I think leaving it til it times out is fine

summer garden
#

I'm actually struggling with deleting the dropdown when it expires. We can't really delete the message since it contains the converted timestamp so I was thinking I'd edit the message to remove the ui.View

#

Is there anywhere in the repo where we do something similar that I could have a look at?

stable mountainBOT
#
It has arrived!

Here's your reminder: dusk time.
[Jump back to when you created the reminder](#dev-contrib message)

thorny obsidian
#

Look at king arthur I think? @vale ibex you did a thing to remove dropdowns but keep the message, right?

vale ibex
#

Yea you can edit the message and set the view to none

summer garden
#

How do I reference the message from inside on_timeout of my view class?

vale ibex
#

Is this from an interaction?

#

Do you have access to the interaction object?

summer garden
#

yes

#

the dropdown itself?

vale ibex
#

await interaction.message.edit(view=None)

summer garden
#

I don't think there's an interaction on timeout

vale ibex
#

You may need to store the message in the view init then

trail pilot
#

there's an example of editing when it times out on the challenges section of sir lance

#

wait what

#

it copied the line

#

this line and below

#

oh wait let me specify the lines

stable mountainBOT
#

bot/exts/utilities/challenges.py lines 327 to 336

kata_view = self.create_view(dropdown, f"https://codewars.com/kata/{first_kata_id}")
original_message = await ctx.send(
    embed=kata_embed,
    view=kata_view
)
dropdown.original_message = original_message

wait_for_kata = await kata_view.wait()
if wait_for_kata:
    await original_message.edit(embed=kata_embed, view=None)```
summer garden
#

Thank you, I'll have a read

trail pilot
#

Np

summer garden
#

It works great, thank you!

magic arch
#

Should channels.discord_py change to discord_bots in the config? Not sure if there's been discussion about this before

gritty wind
#

Probably no discussion on it, as it’s really insignificant

magic arch
#

Do you think it's worth the change or should it just stay for now?

fallen patrol
solemn vine
#

can't find information about setting up webhooks in a test server would it be okay if i leave them as of now i am not working on them

austere hornet
#

Also could a staff member please dismiss Bluenix's and Shom770's reviews on sir-lancebot#901? Thanks!

dusky shoreBOT
green oriole
timid sentinel
#

Eh, tbh I don't really think that sort of thing is worth changing, don't feel strongly either way though

magic arch
#

πŸ‘Œ I'll make a PR since it's a tiny change, if it's decided it's not worth it we can just close it

#

Although it looks like it will affect slowmode stats so I'm not sure who has an opinion on that one

cold island
#

Just don't change the name of the stat

cold moon
#

Stat name can change

#

It is just gauge of current slowmode and can be changed in Grafana.

cold island
#

Won't that split the data?

green oriole
#

yeah, but we can always rename the history data

cold island
#

Just don't see it as something useful to change. That stat name is independent of the config variable

#

!src sm

stable mountainBOT
#
Command: slowmode

Get or set the slowmode delay for the text channel this was invoked in or a given text channel.

Source Code
green oriole
#

I think it relies on the constant name

cold moon
#

It might create confusion later

magic arch
green oriole
#

alright, let's not rename the stats then

#

agree with zig

magic arch
#

Hey this needs a devops review since it changes config right?

vale ibex
#

Nah, devops is only required if it changes a workflow or a dockerfile

molten perch
#

Yeah, for example in api#30 πŸ˜‚

magic arch
#

Gotcha, gotcha. How is the config updated then, just curious?

vale ibex
#

The config-default.yml file it what's used in the container

#

so if you update that it'll be used in production too, just like when you change code

#

Devops don't need to do anything

#

Devops don't need to do anything for workflows or dockerfiles either, we just want to make sure we review any changes to those.

magic arch
#

Ahhh

#

Gotcha that makes sense

summer garden
#

Could I get a hand with git? I've accidentally been committing to the pydis repo locally, instead of my fork. How can I transfer the commits over so I can push to my repo?

placid ermine
glad mist
#

hey

patent pivot
#

git remote set-url origin git@github.com:[username]/sir-lancebot.git if using SSH

#

git remote set-url origin https://github.com/[username]/sir-lancebot.git for HTTP

#

should be able to push as usual then

placid ermine
#

ah right

summer garden
#

Ah that worked!

#

big thanks

gritty wind
#

@static canyon thanks for your review on the unfurl PR, I've addressed your feedback

molten perch
#

Hey! Sorry that I keep promoting my PR πŸ˜„
So, I would love to have some reviews on api#30.
It's not that bad, the core part is ~6 files in total, and there are also taskipy tasks that make things easier, like test , that will run tests inside docker, so that no-one has to bother with setting things up.(More about on that, in the README in the PR)
Thanks! πŸ™‚

brisk brook
#

Do we have any kind of censoring here for like super gory or inappropriate words?

patent pivot
#

uhhh we have filters, yeah

brisk brook
#

For the madlibs command I am thinking that we may have to listen if a message is deleted and in that case abort so that the bot doesn't send that back?

patent pivot
#

It's the same thing we deal with on the .uwu/etc. commands, if we get an alert we'll handle it

thorny obsidian
#

The mods will be alerted and can delete the embed, we don't really have that kind of short-circuiting logic for our other bot stuff where it takes in user input and spits it back out

patent pivot
#

yea

brisk brook
#

Otherwise Sir Lancebot will respond with that back and create a super inappropriate story with the words - or can we leave this to whatever moderator that sees it?

green oriole
#

It will run our filters onto the output

thorny obsidian
#

But that's a different from some of the echo-back commands, right? You can type code that won't trigger the filter and then have the bot say it. In this case with a straight echo that's not the case

green oriole
#

I mean, just running a print statement is the same thing, right?

#

Honestly after we get bot core ready and have Redis inter-bot queues, having sir lance send most of its output to Python for filtering doesn't sound too bad

gritty wind
#

At the same time, it probably does not matter

#

And it sounds like a nightmare for contribs

patent pivot
#

yeah not sure we need that

vocal prairie
#

What exactly is bot core? Is it a "framework" for the bots that centralizes stuff that's used in multiple bots, or have I got the wrong impression?

patent pivot
#

shared utilities really

brisk brook
#

No that's the idea of it, basically an abstraction built on top of a discord.ext.commands.Bot class that contains stuff that all bots commonly share (unloading, loading, internal eval, etc).

patent pivot
#

did we actually discuss that?

#

we don't have any code which defines a class iirc

vocal prairie
#

Got it, makes sense. Is this going to be usable outside of pydis as well?

patent pivot
#

maybeℒ️

gritty wind
#

The class stuff was discussed

patent pivot
#

we won't be building it with external use in mind I don't think

gritty wind
#

And basically, yeah we might have a class, but most of it will be ne standalone utils

patent pivot
#

components might be usable, stuff like redis pubsub

gritty wind
#

The class would just wrap those

gritty wind
#

Yeah

brisk brook
green oriole
gritty wind
green oriole
#

Oh, right

#

I mean we can make it so it just triggers a warn if it starts in debug and cannot ping the bot, and just disable those checks

gritty wind
#

Eh, not worth it imo, hasn't proven to be a problem

#

Mostly indifferent about it

green oriole
#

I've seen some eeehhh uwu usages and such

gritty wind
#

If the usages don't already trigger the filters, that won't make a difference

#

If they trigger the filters, the mods have to go there either way

green oriole
#

that's what my smooth brain just realized

#

🀑

gritty wind
#

lol

magic arch
#

@thorny obsidian if I'm looking at this correctly isn't the file filtering something that can just be changed with a command?

#
    def _get_whitelisted_file_formats(self) -> list:
        """Get the file formats currently on the whitelist."""
        return self.bot.filter_list_cache['FILE_FORMAT.True'].keys()
#

(bot#1983)

dusky shoreBOT
magic arch
#

in particular maybe this one

#

!help wl add

stable mountainBOT
#
Command Help

!whitelist add <list_type> <content> [comment]
Can also use: whitelist a, whitelist set

You cannot run this command.

*Add an item to the specified allowlist.

Valid list_type values are guild_invite, file_format, domain_name, filter_token, redirect.*

magic arch
#

yeah that

vale ibex
#

!wl g file_format

stable mountainBOT
#
Command Help

!whitelist
Can also use: al, allow, allowlist, wl

Group for whitelisting commands.

Subcommands:

!whitelist add <list_type> <content> [comment]
Add an item to the specified allowlist.
!whitelist get <list_type>
Get the contents of a specified allowlist.
!whitelist remove <list_type> <content>
Remove an item from the specified allowlist.
!whitelist sync
Syncs both allowlists and denylists with the API.

vale ibex
#

g isn't alias

#

sad

#

!wl get file_format

stable mountainBOT
#
Whitelisted File Formats (14 total)

β€’ .flac - embeddable audio format
β€’ .gif
β€’ .jpeg
β€’ .jpg
β€’ .m4a
β€’ .mov
β€’ .mp3
β€’ .mp4
β€’ .mpg
β€’ .ogg
β€’ .png
β€’ .wav
β€’ .webm
β€’ .webp

vale ibex
#

!wl add file_format csv

#

!wl add file_format json

magic arch
#

boom

#

ill close the issue now ig?

thorny obsidian
vale ibex
#

Yea I was not aware of this feature

thorny obsidian
#

I didn't look at it too closely since I'm busy atm

magic arch
#

ah gotcha

#

I just tried to find the code to see if I could fix it and saw that

vale ibex
#

Nice πŸ˜„

magic arch
#

the magic of finding defs/references with vs code lol

#

@vale ibex should that be changelogged too or will it just cause csv and json spam

magic arch
austere hornet
#

^

#

*which it does not which is does

magic arch
#

Ah yeah that too

#

all fixed btw @austere hornet

static canyon
#

I haven't forgotten about it

static canyon
static canyon
stable mountainBOT
#
Okay.

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

austere hornet
stable mountainBOT
vale ibex
#

sir-lancebot#957 is just a small QoL change for .aoc count so that it gives a more accurate countdown, using Discord timestamps

dusky shoreBOT
green oriole
#

@thorny obsidian ^ I tried to request you for review but chrome wouldn't let me

vale ibex
#

Yea was annoyed that it wasn't giving me a time, since I couldn't remember what TZ aoc was based in

#

So thought I'd fix it rather than complain haha

trim cradle
#

Does snekbox start entirely new interpreters each time, or is it forking an existing process? I'm interested to know if there's an optimized way to have numpy and pandas always available since they come up in most calls to !e in #data-science-and-ml.

trim cradle
#

But they're expensive imports, so if the only way to have them available implicitly is to have snekbox secretly import them before running the code passed to it, I'd oppose that.

patent pivot
#

probably possible, but not without a lot of architecture changes to snekbox

brazen charm
#

forking usually breaks things unexpectedly, don't think it really fits something like eval

patent pivot
#

the time limit kicks in from as soon as nsjail starts, which means we'd need to run imports outside the jail and then put procs into the jail, which is possible but difficult, and very easy to mess up

vale ibex
#

Just write faster code stel

trim cradle
vale ibex
#

hah

#

out of interest, the one that currently time out, would they have successfully ran given a few more seconds?

trim cradle
#

I never said anything about code timing out, Joe did.

vale ibex
#

Ah

#

so your issue is that they take long, rather than timing out

trim cradle
#

I wouldn't want every call to eval to incur an expensive import (numpy) that might not get used.

vale ibex
#

!e ```py
import time
start = time.perf_counter()
import numpy
print(time.perf_counter()-start)
start = time.perf_counter()
import pandas
print(time.perf_counter()-start)

stable mountainBOT
#

@vale ibex :white_check_mark: Your eval job has completed with return code 0.

001 | 0.42715913988649845
002 | 0.8533768462948501
trim cradle
#

@vale ibex worth noting that pandas imports numpy, so if you had imported pandas first, import numpy would have been faster.

vale ibex
#

!e ```py
import time
start = time.perf_counter()
import pandas
print(time.perf_counter()-start)
start = time.perf_counter()
import numpy
print(time.perf_counter()-start)

stable mountainBOT
#

@vale ibex :white_check_mark: Your eval job has completed with return code 0.

001 | 0.847184422891587
002 | 2.949964255094528e-06
vale ibex
#

Ah cool

trim cradle
#

we have all learned so much

vale ibex
#

Hah, I haven't learnt much about snekbox, today nor any other day, so I wouldn't know where to begin with making this better

#

but people far more intelligent than I have said it is difficult and prone to introduce errors

trim cradle
#

also it's cyber monday and the microphone lemon suggested I get still isn't on sale

#

😠

vale ibex
#

Guess you'll have to live with losing a second of your time for every !e call

#

You an always invoice Python Discord Inc. for it at the end of the year

trim cradle
#

can I get that in writing?

#

@vale ibex 😠

green oriole
#

It is doable using a site package

#

But we loose 1s for each eval, which is a bit meh

#

But yeah, that isn't impossible, and a bit hacky

thorny obsidian
vale ibex
#

Hah!

#

The first commit is just a basic refactor, swapping an if statement around

#

the 2nd commit is the actual change

magic arch
vale ibex
green oriole
#

excellent

#

ay, I can request for review now

molten perch
#

Hey! Sorry that I keep promoting my PR πŸ˜„
So, I would love to have some reviews on api#30.
It's not that bad, the core part is ~6 files in total, and there are also taskipy tasks that make things easier, like test , that will run tests inside docker, so that no-one has to bother with setting things up.(More about on that, in the README in the PR)
Thanks! πŸ™‚

stable mountainBOT
#
Absolutely!

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

molten perch
#

I would never.. lemon_wink

thorny obsidian
#

@vale ibex a few questions about your subscribe button PR. I'm not sure if I did something wrong or something's wonky.

a) If someone tries to interact with the buttons and they didn't invoke the command, all I get is an "interaction failed". I don't get the ephemeral response. Is that also happening with your local testing?

b) what's the timeout on this interaction, like when do the buttons disappear? I'm struggling to find this in the code, but that's most likely due to my unfamiliarity with views.

c) for roles like advent of code, it should be assignable before Dec 1. Can the current code handle that? It's currently just checking if the month matches the one given, but I'm wondering how we could introduce a bit of leeway into that.

d) do you think it would be worth showing the other self-assignable roles but somehow indicate that you can only try to assign it during a specific timeframe?

vale ibex
thorny obsidian
#

So for the timeout, I think it would still be a good idea to have one. Because just showing up in a channel and seeing it, a person unfamiliar with the buttons may assume they can press it too?

vale ibex
#

if they do, then they'll get the error from it anyway

#

and that's if the command is even in the same screen, which it likely won't be in #bot-commands

#

If we're worried about the buttons both visible, it's probably better served by deleting the message after a certain amount of time anyway

#

rather than adding custom timeout logic to remove the buttons from the message, which wouldn't work if the bot restarts either

thorny obsidian
#

that works for me too

magic arch
#

For D, doesn’t the library have a feature to add a disabled button that appears but is grayed out and can’t be clicked? That might also work.

cold island
#

Also, I'm totally unsure how to implement button removal on timeout. The timeout event is dispatched to the view, but the view is not tied to a message, and you need to edit the message to remove the view

vale ibex
#

Yea, you'd need to store the original message in the view from the init

#

or, just do a delete_after on the original ctx.send, which I'm planning to do

cold island
#

hmhmhm

#

It might work for this particular case, but I dislike responses that delete themselves

fallen patrol
thorny obsidian
#

to show what roles are potentially available, even if they can't be assigned now. Also, the limit is because of the previous seasons and there isn't a strong reason to have advent of code or lovefest be a year-round assignable role. It's only relevant during certain times.

fallen patrol
fallen patrol
cold island
fallen patrol
#

does it?

cold island
#

yeah

stable mountainBOT
#

discord/ui/view.py line 155

def __init__(self, *, timeout: Optional[float] = 180.0):```
fallen patrol
#

welp okay then

fallen patrol
thorny obsidian
#

there isn't a strong reason to have advent of code or lovefest be a year-round assignable role. It's only relevant during certain times.

cold island
#

she edited the message

fallen patrol
#

(okay now i see your edit since it had been scrolled, lol)

#

well, the second part of my question still stands

cold island
#

People will be toying with a role that can't be used. Easier to just say it's not the season for it

thorny obsidian
#

because people spamming role subscribe/unsubscribe during random parts of the year when it isn't relevant isn't something I want.

fallen patrol
#

ah

green oriole
#

hmmmm I've seen permanent interactions on other (non d.py) bots

#

I wonder how that works

gritty wind
#

I’m assuming you’re referring to the views, not slash commands and user/message buttons,

but, as someone who hasn’t used views, I assume it’s like everything else in the bot lol

#

If you want it to be long lived, you keep an external cache of things you are handling, and reattach listeners on startup

brisk brook
vale ibex
#

Just dev testing

vale ibex
#

Also, @thorny obsidian I'm not seeing the issue you described in a

last patio
#

this looks very cool

vale ibex
#

Did you happen to restart your bot after running the command?

last patio
#

looking forward to january to get my promotion

vale ibex
#

lol

#

wanted to show off my join with a different final seperator

vale ibex
last patio
#

make sure to deploy it as well 😎

vale ibex
#

Is there a better way to do this? ```py
# Join the months together with comma separators, but use "and" for the final seperator.
month_names = [calendar.month_name[month] for month in self.months_available]
available_months_str = ", ".join(month_names[:-1]) + f" and {month_names[-1]}"
return f"{self.name} can only be assigned during {available_months_str}."

cold island
#

@vale ibex @thorny obsidian would it make sense to just have a message in #welcome or somewhere else where you can click on buttons to add roles?

vale ibex
#

hmmmmm, possibly

#

would just need a task each month to update the buttons

cold island
#

yeah

vale ibex
#

you'd also lose the context of what roles you already have

cold island
#

Well I mean, you have the user profile

vale ibex
#

but that could be solved with an ephemeral message saying what the action was

#

and the user can click again to toggle

cold island
#

And you can respond with an ephemeral message

vale ibex
#

would need to think about how to handle available roles changing etc

#

but it could be done

#

it might lead to a nicer interface too

cold island
#

As long as you create the view correctly, the message will update accordingly

vale ibex
#

I mean more like, it's going to be 1 message that lives forever, so on boot IG we would just get that message ID and update the view

cold island
#

yeah

vale ibex
#

along with a task at the start of each month to force an update too

#

just in case the bot lives across a month boundary

cold island
#

And possibly a command to update it on demand

vale ibex
#

yea

#

that could work

#

@last patio fyi don't review the subscribe PR just yet, we might be changing it

#

I'm thinking we store the messageID in redis and just do the checks & alterations on init

#

doing that would mean we don't need to think about making the interaction survive across boots, since it'll be a new view with new interactions each boot

cold island
#

mhm

vale ibex
#

I'll probably just drop a bunch of commits locally so that the PR is a bit nicer to read through haha

#

just "start again" as far as the PR is concerned

#

ofc keeping code locally and just rebasing

cold island
#

Sorry πŸ˜…

vale ibex
#

Nah don't worry it's not much effort

#

just some fun force pushes to drop commits on the remote πŸ˜„

#

I'll give it a look tonight

vale ibex
dusky shoreBOT
vale ibex
#

since it's quite relevant to the event starting tomorrow

clever wraith
#

did weeeee.. yes

#

good

last patio
#

will take a look

#

merged

vale ibex
#

nice nice

#

now I can know when aoc starts in the best timezone

#

gmt

clever wraith
#

ngl it is a good tz

vale ibex
#

.aoc count

dusky shoreBOT
#

The Advent of Code event is not currently running. The next event will start <t:1638334800:R>.

last patio
#

rock solid

thorny obsidian
#

Because someone checking their profile to see what roles they have feels like clunky ui

#

And I wanted to still keep it as a subscribe command to prevent changing all the "run .subscribe in bot-commands" messages that are all over the server

cold island
thorny obsidian
#

And #roles and probably a few other places that don't immediately come to mind

vale ibex
#

They'd need to be updated regardless

#

since they reference !unsubscribe

#

which won't exist anymore

thorny obsidian
#

Just make unsubscribe an alias =P

#

But keeping it as a command still makes it easier for people to adjust to. It's just a different interaction with the command. They don't need to go to an entirely separate channel now

vale ibex
#

I guess the thing we need to ask is which is better UX

  • a command that the user needs to be told about and then subsequently run in bot-commands, but also includes the context of what role they currently have.
  • A static message somewhere that users can click on to toggle their roles
thorny obsidian
#

I prefer the first. Not having the context of which roles you do or don't have without looking at your profile is awkward imo.

cold island
#

How does it currently show the roles in the PR?

vale ibex
#

clicking the button toggles the text & colour

#

clicking a red button gives this error

clever wraith
#

that text is super long

#

could we do like "+ Announcement", "- PyWeek Announcements", "+ Advent of Code"

vale ibex
#

We could remove the role word

#

since it's not needed

#

having add and remove is better though imo

thorny obsidian
#

I'd rather be explicit and very clear than try to keep it shorter for the sake of being shorter

cold island
#

Just as a note, red seems like a better visual cue for removal, and grey for disabled

clever wraith
#

true that

vale ibex
#

luckily they're constants so that's easily changed

#
    ADD_STYLE = discord.ButtonStyle.success
    REMOVE_STYLE = discord.ButtonStyle.secondary
    UNAVAILABLE_STYLE = discord.ButtonStyle.red
#

So yea, having the static message would mean add/remove would become toggle

#

and then the ephemeral message would tell the user the action that was preformed

#

So they can click again if they didn't realise they already had the role

cold island
#

If there's already an implementation for the command, and a static message is not clearly better, then we can just stick with the command I think

vale ibex
#

Yea, this is the current interface after clicking some buttons

#

I've changed it slightly though, so that unavailable buttons are sorted to the end

cold island
#

To the end of each row?

vale ibex
#

Otherwise it retains the order the roles are in-code

vale ibex
clever wraith
#

it is a bit weird that you have the locked roles without any additional words

cold island
clever wraith
#

maybe add a πŸ”’ ?

vale ibex
#

Clicking it gives a verbose response

#

I don't think adding an emoji would help, since it's still something a user would need to learn what it means

cold island
#

Still seems more intuitive that way

#

Would help if the bot replied to you, so it's easy to understand which is yours

vale ibex
#

wdym?

cold island
#

I imagine it's going to get a bit spammy in #bot-commands

vale ibex
#

Those are ephemeral messages

cold island
#

Like, it'll reply to your invocation

vale ibex
#

so only you can see them

cold island
#

No I mean

#

The original message with the buttons

vale ibex
#

The view that holds the buttons doesn't have context of other people's invocations

#

that would require storing all of the views that are active somewhere, with the autor's user id

cold island
#

I just mean that Botty will reply to your message here

vale ibex
#

Have it reply to the &subscribe, rather than the bot's message?

cold island
#

Currently there's no reply here

vale ibex
#

Ahhhh right, I see what you mean now

cold island
#

Either that or ping you in the message

last patio
#

I like it

#

Nice work

vale ibex
#

alright, rebooted the bot

#

with the emoji and the reply

clever wraith
#

I need to find the invite :3

#

got it

vale ibex
vale ibex
#

feel free to play more while I commit them

clever wraith
#

cool!

#

is the reply mandatory?

vale ibex
#

Yea, interaction.response.send_message always replies to the button message

clever wraith
#

sadge

clever wraith
thorny obsidian
#

@vale ibex oh this is interesting. A person cannot unsubscribe from a role during off months. That's consistent with current behavior, right?

vale ibex
#

yup, it is

#

unsubbing could be possible, with some changes

#

but also I'm not too sure if it's all too useful

#

since atm the temp ones we allow modification the month before

#

so they have a month to remove if they want to

thorny obsidian
#

yeah, just noticed it while doing some funky testing

#

not dire nor does it need to be "fixed", just wanted to confirm that it's consistent with the current behavior

vale ibex
#

yupyup

#

atm the commands in lance are completely locked so you can't run sub or unsub unless the month matches

thorny obsidian
#

all you need know is core dev and you're good to go

vale ibex
#

noice

stable mountainBOT
#
It has arrived!

Here's your reminder: review api#30
[Jump back to when you created the reminder](#dev-contrib message)

viscid coral
#

Isn't it the third?

thorny obsidian
#

mmmm, I'm not sure how it's being calculated since it starts in the evening

#

Tonight should be the third night of hannukah, which I think is how it's determining that

#

28th was the 1st night, 29th was the second. So yeah I think that makes sense that tonight is the 3rd

viscid coral
#

Doesn't it go by the candles?

thorny obsidian
#

You light the third candle tonight

viscid coral
thorny obsidian
viscid coral
#

What timezone is it of Israel?

thorny obsidian
#

I don't think it's coordinated to Israel time. It's just supposed to be lit after dark (generally) in your area.

#

Lancebot saying it's the third day, I think is meant to mean tonight is the third night of hanukkah and when you light the third chandle

viscid coral
#

Ok, thanks

vale ibex
#

Hey @clever wraith do you have time to finish off bot#1889?

dusky shoreBOT
vale ibex
#

If not, I can take a look at it

brisk brook
#

But it looks like there is a deadlock?

#

I can't get any help channels to close

#

Actually my 3 braincells still working are dumb, dumber and monke

#

I used the wrong prefix πŸ€¦β€β™‚οΈ

#

Not sure about that output though, looks somewhat worrying. But it could actually be working, I had to go hence why I sent this here rather than continue debugging

last patio
#

hahahahahahaha β€œis there a deadlock?” β€œi used the wrong prefix” i love it

thorny obsidian
#

@vale ibex I'm reviewing the nomination thread PR. When I start a review, I get the warning of "Could not find a thread linked to..." which is only in the archive_vote() function as far as I can tell. So I'm not sure how this is interacting.

brisk brook
#

Awwww nooo! The testing server and this server has now the same profile picture

austere hornet
#

You mean server icon, right?

magic arch
brisk brook
#

😀

#

Unless it's switched I'll have to

#

This is the worst thing that's happened to me since I had my first thought

magic arch
#

Well if it helps I'm confused too

vale ibex
#

are they πŸ‘ or πŸ‘Ž ?

austere hornet
thorny obsidian
#

so the checkmarks and magnifying unicode, but I've been having a hell of a fucking time getting the emojis to not error

vale ibex
#

since it sounds like the archive reaction listener is getting triggered from the bot reacting to the post

#

!e print("\u2705\u274C")

stable mountainBOT
#

@vale ibex :white_check_mark: Your eval job has completed with return code 0.

βœ…βŒ
vale ibex
#

hmmmm

#

What's your Emojis.check_mark?

#

is that also u2705?

thorny obsidian
vale ibex
#

after posting the review, the bot reacts with check_mark to the invocation

#

since that's also the incident actioned emoji in your config, it's seeing that as a archival request

thorny obsidian
#

jfc these emojis will be the death of me

#

\❄️ \πŸŽ„

vale ibex
#

I might just add check in on_raw_reaction_add that the reactor isn't the bot

#

just for local dev instances

#

kk that's pushed

clever wraith
vale ibex
#

Alright cool, let me know if you need any help πŸ˜„

clever wraith
#

schools just been really busy

vale ibex
#

Yea, understandable πŸ˜„ You should always prioritise school anyway.

thorny obsidian
#

urgh, I feel like I need a crash course in what unicode emoji formats our config will take to actually work with local dev

vale ibex
#

It's whatever discord.Emoji allows

#

so either a unicode string, or <:emoji_name:emoji_id>

#

<a:emoji_name:emoji_id> for animated

thorny obsidian
#

so our config has like... 3 different kinds, right?
<:emoji_name:id>
"\u123123"
":emoji_name:"

which one is expected and works?

vale ibex
#

all 3 should work

thorny obsidian
#

Okay, I had issues with it not

vale ibex
#

the first is for custom emoji, the second two are base emoji (unicode emoji/server emoji)

vocal prairie
#

all of those should work, but the latter is not ideal, since duplicated names can be issues

thorny obsidian
#

like ":eyes:" broke when trying to add reactions because I didn't have any ducky emotes

#

(from the _random_ducky() function)

#

and when testing the nomination archival, it's not acknowledging my specified incident_action emoji, which I have set as :snowflake:

vale ibex
#

in _cog.on_raw_reaction_add() what does emoji look like after being assigned?

#

compared to Emojis.incident_actioned, Emojis.incident_unactioned

thorny obsidian
#

but also something like "\N{TICKET}" works?

vale ibex
#

Yea, that's python sugar to make unicode

#

It's a CLDR name

#

can't remember what it stands for

thorny obsidian
#

so, this is what I'm struggling with then.
1st is the emoji it's getting, 2nd is Emojis.incident_actioned, 3rd is unaction.

vale ibex
#

it seems discord is returning it as a plain unicode char

thorny obsidian
#

I'll just... accept that emojis in discord and d.py make no fucking sense and approve this

vale ibex
#

so annoyingly, you'll need to use unicode in the config

thorny obsidian
#

Okay, so the config shouldn't use the :emoji_name: style then?

#

Also that means that if we ever don't have ducky emotes, it's going to break

#

because the grab a random ducky emote fails on :eyes: and discord just would not add that as a reaction

vale ibex
#

yea, if that emoji is ever being compare to an emoji returned by discord, rather than just being added to a message, it should be unicode

#

adding a reaction like that should work

thorny obsidian
#

oh it profoundly didn't for me

#

because the function returned ":eyes:" and discord just didn't want to do that

vale ibex
#

!int e ```py
msg = discord.utils.get(self.bot.cached_messages, id=915403844744249384)
await msg.add_reaction(":eyes:")

stable mountainBOT
#
In [6]: msg = discord.utils.get(self.bot.cached_messages, id=915403844744249384)
   ...: await msg.add_reaction(":eyes:")
   ...: 
Out[6]: 
  File "/bot/bot/exts/utils/internal.py", line 180, in _eval
    res = await func()
  File "<string>", line 6, in func
  File "/usr/local/lib/python3.9/site-packages/discord/message.py", line 1406, in add_reaction
    await self._state.http.add_reaction(self.channel.id, self.id, emoji)
  File "/usr/local/lib/python3.9/site-packages/discord/http.py", line 335, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji```
vale ibex
#

interesting

thorny obsidian
#

mhm, sooooo unsure what to do about that.

#

@cold island but I believe that was your PR that added the random ducky thing. I'm curious how you tested it and got it to work

vale ibex
#

alright, just searched the codebase for :\w*?: and this is the only instance that would cause an error

#

\πŸ‘€

#

!charinfo πŸ‘€

stable mountainBOT
#
Character Info

\U0001f440: EYES - πŸ‘€

thorny obsidian
#

secondary question, what's the intended behavior if someone leaves and then someone tries to post a review for them?

vale ibex
#

I think it should just fail

#

at least that's current behaviour I think

thorny obsidian
#

soooo, I see this in the code:

#

but I get this instead

vale ibex
#

what line is that from?

thorny obsidian
#

It's failing on line 87 in _review

#

you added a line that relies on nominee.id before that check comes into play

vale ibex
#

nah, the check is before that

#

but for some reason isn't checking the first thing that's returned

#

which is the error string it seems

thorny obsidian
#

that check is on line 123 for me

vale ibex
#

line 81

thorny obsidian
#

that's just checking for a review, no? and doesn't it return a string and then None, None?

vale ibex
#

Yea, it seems that's check is seeing if there's suppose to be a review

#

but it's jsut returning a string, so that check is failing

thorny obsidian
#

So it's getting a non-empty string

vale ibex
#

(this was previous code)

#

it seems that string was added for get_review to work nicely

#

but then broke that check on line 81

thorny obsidian
#

Right, but you added something that will now make it fail non-gracefully since it relies on nominee.id and the working check for a user in the guild doesn't come into play until line 123

vale ibex
#

Yea, whereas previously it would fail silently and probably raise an exception

#

we just haven't ran into it in prod

thorny obsidian
#

:D I'm so good at fucking these things up

#

I can think of one instance where we would have if the review tried to get posted later

vale ibex
#

Alright, fix pushed

thorny obsidian
#

approved~

#

Thanks for helping me debug

#

time to go watch GBBO before AoC

vale ibex
#

hah good choice

austere hornet
#

Welp...bye bye Sir Threadevere, nice having you

austere hornet
#

Why did Sir Lancebot's status change? I'm guessing it's the AoC countdown, but it used to say "Playing Commands: .help"

fallen patrol
#

yknow... I just had a funny feeling that sir threadavere might be back when it's time to test forks

stable mountainBOT
#

bot/exts/events/advent_of_code/_helpers.py line 502

async def countdown_status(bot: Bot) -> None:```
fervent sage
austere hornet
austere hornet
fervent sage
#

'cause nobody looks at the bots status because its below the bottom of the screen

austere hornet
fervent sage
#

yeah

thorny obsidian
#

so what's the harm in changing the status for some fun shenanigans?

austere hornet
fervent sage
#

well its current status can be useful to people if they want to find it, but one that doesnt show the prefix cant

thorny obsidian
#

I'm not sure how many people look at the bot's status as a way to find it's prefix though

fallen patrol
#

@dusky shore prefix

#

hmm, it should accept its mention as a prefix imo

vocal prairie
dusky shoreBOT
#
Command Help

AdventOfCode
.adventofcode
All of the Advent of Code commands.

Anagram
.anagram
Given shuffled letters, rearrange them into anagrams.

AprilFoolVideos
.fool
Get a random April Fools' video from Youtube.

AvatarModify
.8bitify
Pixelates your avatar and changes the palette to an 8bit one.
.avatar_modify
Groups all of the pfp modifying commands to allow a single concurrency limit.
.avatareasterify [colours...]
This "Easterifies" the user's avatar.

vocal prairie
#

It does

fallen patrol
#

huh

#

ahhhh that's modmail that doesn't

gritty wind
#

Considering modmail doesn’t have any user facing commands, and that mods only use a couple frequently, it doesn’t really matter

cold island
cold island
thorny obsidian
#

Cause it threw the error message Chris showed above

cold island
#

Yep, I'm positive I tested it

#

Maybe Chris can eval it with modmail, since it's still on 1.7

thorny obsidian
#

wouldn't that require joe?

cold island
#

Devops can

thorny obsidian
#

I thought eval was locked to owners since it's above everyone

cold island
#

Or at least devops admins

#

Or at least Chris

merry mantle
#

What’s this channel for?

#

Never mind

cursive relic
static canyon
#

2.0a0 iirc

cursive relic
#

it uses webhooks in some parts of code, right?

#

if yes, would it be possible to tell where

brisk brook
#

It uses for the incidents channel

cursive relic
brisk brook
#

It should be on python-discord/bot

#

I don't know exactly where, let me see hold on

cursive relic
#

thx πŸ˜„

brisk brook
cursive relic
#

thank you!

vale ibex
#

test

vale ibex
#

So when you developed it, you used emoji literals, which is why it worked

final geode
#

I think I noticed a bug in aoc leaderboard
an hour ago, I was 181st in leaderbord -> #aoc-bot-commands message
now I'm 182nd #aoc-bot-commands message
this means someone somehow jumped in front of me, which shouldn't be possible with how points are assigned (at first check, I already had both parts done, my score didn't change at all)

short snow
#

someone joined the LB after you ran the first command, so the points changed

final geode
#

but my score didn't change at all.

#

so the bug is still there - some people get adjusted and other don't

short snow
#

uhh, I dunno how the poitns are calculted, lemme check

vale ibex
#

aoc leaderboards can only have 200 max users, so we actually have a few leaderboards running in the background

final geode
#

yes

#

but they are merged at the same time

vale ibex
#

when you do .aoc join it sorts you into an aoc leaderboard in the backend

#

So when we calculate scores, we can't just use the aoc score, we need to do it ourself

#

So I am guessing there is an issue in that implementation

final geode
#

yes, that's why it shouldn't be possible to jump in front of someone

vale ibex
#

I wasn't refuting your point.

#

Just laying out all the info I have

#

I haven't looked into that too much myself, so I'm not too sure what could cause this discrepancy

final geode
#

as I said there are people who just jumped in front of me - e.g. 78 | continental-beauty-msbacd | 1352 | (1, 1)

  • score adjustment of people joining was +2 until place 70, then it was +1 for some time and became no adjustment later (including my place)
vale ibex
#

Yea, so I am presuming the thing that collates the points from each of the leaderboards, and then calculates the overall score/position has an issue somewhere

final geode
#

the +1 run through 84th place of old list/85th place of new list

#

!src aoc

stable mountainBOT
#
Bad argument

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

stable mountainBOT
#

bot/exts/events/advent_of_code/_helpers.py line 112

def _parse_raw_leaderboard_data(raw_leaderboard_data: dict) -> dict:```
short snow
#

ok not relating to this but why don't we use star_results to get the per day and star LB (currently it has a separate list)

final geode
#

okay, so the bot actually gets real completion time from api
so jumps make sense
and so do +2/+1/+0 because the person joining had two times and some people got two, some one, and some none tasks before the person joining

#

ty

#

idk why I thought it's in python bot and I tried !src instead of .src ^^'

vale ibex
final geode
#

it could at least say "are you sure you didn't mean {opposite_bot_prefix}src?" XD it would make me think, instead of just trying to use full aoc name and stuff because I thought it's about the short form instead of wrong bot XD

vale ibex
#

Yea that would likely be easier

#

Since to actually get the src from the other bot, we'd need ot have some inter-bot comms

#

like a redis pub sub sort of thing

molten perch
cold island
vale ibex
#

Me neither I'd be fine with a mix. The issue is that if you try to do message.add_reaction(":eyes:") discord returns a 400 error, so as long as we avoid that, we're fine

brisk brook
#

That never worked..

vale ibex
#

I never said it did

#

message.add_reaction accepts either a unicode escape sequence IE \U{eyes} or \u0123

#

or a custom emoji string

cold island
vale ibex
#

They don't.

#

you can ctx.send an emoji in that format

#

you can't message.react

cold island
#

Oooh right right

austere hornet
#

Huh? Does this mean when the next puzzle is released for AoC?

vale ibex
#

Yea, I think that's the intention

#

could be a little more explicit though

austere hornet
thorny obsidian
viscid coral
#

.hanukkah

cold island
# viscid coral

Feel free to PR a fix πŸ™‚
It's unlikely to be fixed if it doesn't get addressed by the ones who use it

viscid coral
#

I don't really know Python to fix it

fallen patrol
#

I've written a src command which was buffed, and showed the branch and more

vale ibex
#

How did you get a bot to give src information of a cog from another bot?

fallen patrol
#

ofc that still required the command to exist in the same file...

#

I didn't, let me think about it

vale ibex
#

Yea, there's either some interbot comms

#

or scrape github and search for cog classes

fallen patrol
#

that is partially how mine works

#

(the reason it worked like this is because github didn't always match the local code)

vale ibex
#

would probably be easier to do interbot communication than scrape github tbh

fallen patrol
#

it would request the file from github, and parse the ast, then find the function definition with the same name

fallen patrol
#

if we were to do this, I feel like using the database would make more sense

#

I think Lance and any other bots here to add to this could have an only-in-Prod update of its commands and where they're located

#

then python has a smart src command which would get it for all bots matching the name, or fuzzy match stuff, etc (doesn't have to be this big, just brainstorming ideas)

#

eg !global-src help would return a message with an embed for each bot: the src of python's help, lancebot's help, and king Arthur's help

#

now, if we were to change this and not use the db

#

then there could be an internal interbot com where python could get info

#

this could also extend to making a global help command with both Lance and python

#

disclaimer: this was entirely a brainstorm and some of this is almost certainly unfeasible, or not worth the work to implement it, and complexicity of said features

fallen patrol
austere hornet
fallen patrol
#

(aside from the formatting issue)

vale ibex
#

I'm guessing it's on the year

#

.src hanukkah

dusky shoreBOT
#
Command: hanukkah

Tells you about the Hanukkah Festivaltime of festival, festival day, etc).

Source Code
cursive relic
#

hannukah?

thorny obsidian
#

my guess is something in the code is not handling the cutover between months correctly

fallen patrol
#

!remind 5h out of hospital, look at Hanukkah command

stable mountainBOT
#
Can do!

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

frosty coral
#

Thank you for redirecting to the right channel. Will remember for future purposes

fallen patrol
molten perch
#

Thank you! πŸ™‚

cold island
#

@brisk brook I addressed your review on bot#1939 (about time)

dusky shoreBOT
brisk brook
#

Haha thanks I'll take another look

brisk brook
austere hornet
#

Congrats @molten perch !

molten perch
#

Thanks! πŸ˜„

green oriole
#

nobody will say anything about when volcyy actually joined

brisk brook
#

Congrats @last patio, we all like to feel like new ehh?

green oriole
#

wat

last patio
#

yeah bluenix we do 😩

#

thank you

fallen patrol
#

@last patio congratulations on core dev! Don't forget, force pushing can be dangerous πŸ‘€

last patio
#

thanks arl! that's why I do it daily

fallen patrol
#

nice!

trail pilot
vocal prairie
#

Congrats @molten perch!

#

Congrats @last patio!

#

I thought you were a core dev already tbh

brisk brook
#

PS: They were :p

austere hornet
austere hornet
#

Wasn't Volcyy a core dev for like ages

fallen patrol
austere hornet
#

Yeah, sent before I saw

thorny obsidian
#

Volcyy has been devops for awhile, but Core Dev as of like... two? weeks ago?

#

The role color for devops and core dev is the same

austere hornet
#

Ohh the role colors lmfao

#

Yeah

#

Didn't bother to look

fallen patrol
austere hornet
#

Well congrats @last patio !

thorny obsidian
#

They have overlapping areas for sure, but devops can work on things entirely separate to core dev items.

austere hornet
#

Ah

#

I see

thorny obsidian
#

Like managing our k8s cluster and various internal settings and tools doesn't have that much overlap with the nitty gritty of reviews and specific features for Python bot.

austere hornet
#

Gotcha

fallen patrol
#

ahhh, that makes sense

#

...what in the world

#

?

#

socket.gaierror: [Errno -3] Temporary failure in name resolution

#

oh fake redis

gritty wind
#

Feel free to post the rest of the traceback

fallen patrol
#

fake redis.

stable mountainBOT
#

bot/exts/holidays/hanukkah/hanukkah_embed.py lines 103 to 108

def hanukkah_dates_split(self, hanukkah_dates: list[str]) -> None:
    """We are splitting the dates for hanukkah into days, months and years."""
    for date in hanukkah_dates:
        self.hanukkah_days.append(date[8:10])
        self.hanukkah_months.append(date[5:7])
        self.hanukkah_years.append(date[0:4])```
fallen patrol
#

rather than this, can we switch it to using arrow?

#

(or datetime.datetime)

#

the list is currently ['2021-11-28T19:03:00-03:00', '2021-11-29T19:04:00-03:00', '2021-11-30T19:05:00-03:00', '2021-12-01T19:05:00-03:00', '2021-12-02T19:06:00-03:00', '2021-12-03T18:23:00-03:00', '2021-12-04T19:32:00-03:00', '2021-12-05T19:08:00-03:00', '2021-12-06']

brisk brook
#

@cold island it is not meant to work with the default !help command?

cold island
#

It's suppressed only for errors

brisk brook
cold island
#

Oh that help

#

No it shouldn't

#

Well

#

At least I didn't think of that πŸ˜„

#

It's an interesting idea though

brisk brook
#

I assume we want to change that ehh?

#

Because those are 5 reactions (so it fits on one actionrow)

cold island
#

You mean the paginator?

#

No I'm not trying to replace the paginator with buttons

brisk brook
#

Ooooh, right that's handled by another paginator?

cold island
#

I thought you meant adding navigation for extensions

brisk brook
#

Okay then that could be another PR/change in the future

cold island
#

yeah

fallen patrol
#

okay figured it out

#

the hanukkah command just needs to use datetime and strptime

#
def _parse_times_to_datetime(self, hanukkah_dates: list[str]) -> None:
    """We are splitting the dates for hanukkah into days, months and years."""
    for date in hanukkah_dates:
        try:
            self.hanukkah_datetimes.append(datetime.datetime.strptime(date,"%Y-%m-%dT%H:%M:%S%z"))
        except ValueError:
            # there is a possibility of an event not having a time, just a day
            # to catch this, we try again without time information
            self.hanukkah_datetimes.append(datetime.datetime.strptime(date,"%Y-%m-%d"))
#

there is also an issue with the api not returning a time for the last event, which is probably the current problem

#

by rewriting to datetimes, we solve a lot of the problems as well

austere hornet
thorny obsidian
austere hornet
#

Ah ok

fallen patrol
#

huh apparently there's also a memory leak in this cog too

clever wraith
#

a... memory leak? in a cog? in Python?

fallen patrol
fallen patrol
#

I'll put in the work if its authorized

clever wraith
#

I meant the language but granted that wasn't obvious

fallen patrol
#

ah

thorny obsidian
fallen patrol
#

oh i missed that lol

vale ibex
#

oh lol, not sure why I thought bot#1868 had passed policy bot

dusky shoreBOT
stable mountainBOT
vale ibex
#

well auto merge is on ready for a core dev πŸ˜…

fallen patrol
#

^ that's why i forgot that zig allowed

clever wraith
thorny obsidian
#

So question about async RedisCache, the .contains() method, is that just checking keys? I think it's the case, but wanted to double check

fallen patrol
#

sir-lancebot#959

dusky shoreBOT
thorny obsidian
#

okay cool cool

clever wraith
#

lol, he said "I am not sure what I'm looking at, but since it worked fine shipit"

fallen patrol
# dusky shore

the command is currently broken until the fix is live, so I would appreciate some reviews ^^

clever wraith
#

give it a minute

thorny obsidian
vale ibex
#

until you see the connected message in #dev-log, it's not live

dusky shoreBOT
clever wraith
#

we did test it properly last time in the test server, the code looks fine and two reviews were already there

#

I mean I don't know, ask him not me

vale ibex
#

The subscribe command always silently failed previously

#

I didn't remove that, but it doesn't seem great

clever wraith
#

it isn't great yeah

vale ibex
#

A redirect output could work

#

but then we couldn't do a reply

#

we could ping though

magic arch
#

why does it need to be a reply?

clever wraith
#

pinging is the same as replying tbf

thorny obsidian
clever wraith
#

ugh, don't make me switch for that pls

thorny obsidian
#

... alright then. Forget I said anything then.

vale ibex
#

Yea, reply seemed nicer since you could jump to the message