#dev-contrib
1 messages Β· Page 159 of 1
and I like to do stuff from the past to present
it glitched and hitting back would end up on the same empty page
so I started from the front ;-;
Yes I will, probably next weekend, I have a reminder
Lol too much red
How did you produce it? Did you try clicking on a button from a while ago?
arl do you have every channel read? lol
from five minutes ago, and by a different user. nonetheless, the ux stands
!src subscribe
Display the member's current state for each role, and allow them to add/remove the roles.
I have a select few notifications on all messages.
So uh, I keep hearing about this April 2022 deadline. What does that mean, and how does it affect this server? afaik, that's when the message intent becomes mandatory, but that doesn't apply to this server, does it (since none of the bots here are in over 100 servers)? Are there any other changes I'm not aware of?
Discord is going to be adding a new intent for accessing message contents. We'll need to turn on the new intent for our bots, but there's no big deal there. It only requires approval from Discord for verified bots (more than 100 servers), so not us. We'd just need to update in the portal and probably where we initialize the bots in each repo
TL;DR: We'll need to enable it, but that's not a big deal for us. (Although discord.py not supporting it might be interesting)
And discord is also releasing some new features which discord.py doesn't support
Thanks, that's what I assumed. I thought I had previously heard discussion of having to update the lib used for bots in this server before April, but I likely was misremembering.
that's accurate. in some form, dpy will need to be updated before april
be it switching to a fork, or just patching dpy to provide the msg intent, it must be updated
I think we're good with d.py, it has a messages intent already, the only change is that it's becoming privileged which doesn't affect the code
!d discord.Intents.messages
Whether guild and direct message related events are enabled.
This is a shortcut to set or get both guild_messages and dm_messages.
This corresponds to the following events...
not the same intent
Oh is it really?
correct
and it's not documented by discord yet, either
but it has been confirmed its a new intent
of message content
Interesting, well I assume we can probably patch it somehow
Ohh, I see what you mean now, that makes sense.
[redacted]
I wouldn't spread that around, that's not confirmed in any way, we've not had any discussion on this internally
...hence the two disclaimers at the bottom
right, but I'm not sure how the disclaimers help that statement, people aren't going to care about that. just hold off on starting rumours like that until we actually hold some form of discussion amongst core developers
gotcha, redacted it π
Sure, feel free to do it, I was waiting for the issue cog merge PR to be merged, so if itβs merged, go for it!
Your reminder will arrive on <t:1642053765:F>!
Your reminder will arrive on <t:1642053801:F>!
wait what
deleted the extra...
...how can i run a docker container in a development mode?
like, bot or lance
I'd look at the guides for the respective env vars
docker compose is configured for development on both bots
since we don't use it in production
so it has bind mounts that mean you don't need to rebuild the container to adopt new code
Oh, I mean without having to rebuild the containers all the time
so if i'm modifying just a cog, i should only need to reload the cog?
should be the case
interesting, okay
sir-lancebot#918 in what state?
in_whitelist doesn't work for on_message yet i.e. it excepts discord.ext.commands.Context as a parameter, so for the more unfurls pr can i edit the check?
secondly, currently more unfurls would only work in staff channels, so i am just using the is_staff check and keeping the in_whitelist part commented out as said in the issue
Right now nope, in future yes
Well we can consider the change when it's needed
But if you just need to make sure that you're listening to messages in specific channels you can just make the check inside the listener
Can some people look at bot#1889?
Did something with the python bot change recently? It's not finding list.insert.
It can't find list methods other than sort
Yea, the python docs don't supply symbols for those functions
so it's a limitation, not a bug.
it's a bug in the python docs.
It's because those functions are inherited by list, rather than against list themselves iirc
Nah
The problem is because those methods are defined in a non standard page that has a no docs tag
ahh
!e ```py
help(list.insert)
They're defined on some tutorial page
@white light :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'help' is not defined
Chris can you find the bpo number in the core dev chat pls
then some operations are also defined for sequences and mutable sequences but those are in a table that also can't be reference directly
You'll need to run site.main() first to get help
this one, for anyone curious: https://docs.python.org/3/tutorial/datastructures.html
Thanks
could I contribute this upstream? π₯Ί
Feels rather large for what it is
using a button rather than a reaction. this also means ephemeral replies when already bookmarked by the user
I could remove the 'bookmark' part of the label
sir-lancebot#933
It's already an issue and just needs core dev approval. I believe the person who made the issue wanted to implement it as well
ah
oh its bot#2011
da heck
yes.
@fallen patrol I'm not sure if I want to change this. The spookify command has "a user's avatar" (https://github.com/python-discord/sir-lancebot/pull/956/files/e23c15895065373bb6cdc8ff3403c1a9ddb2da0e#diff-3735492de5848acf107c5ead6ef51a2eaa8e0bd42db3d8d2c19b06d4f2df12d2R290) so I'm not sure if it makes sense to keep that as is and change the christmasify command to "your own avatar". What do you think?
it should say your own avatar, for spookify, then. Its not possible to pass another user to these commands anymore.
Oh, it used to?
yeah
Oh ok, I'll change it for both then
If a core-dev approves it here, I'll fix up those docstrings, heh
It should probably just be added to this PR
Yeah right ig that makes sense
well, there's also sir-lancebot#887, which needs core dev approval
@fallen patrol What do you think would be a good title? I honestly have no ideas lol
same Β―_(γ)_/Β―
Oh I thought of one, "Is this you or did you turn into Santa Claus all of a sudden?" What do you think about that?
Btw if you haven't guessed I copy/pasted the spookify command that's why I still had the old embed title there
:x_square:
Sorry, not sure what you're implying by that lol
could a core dev look at and maybe approve sir-lancebot#976?
that's very sad, ak was planning on approving that haha
π
sir-lancebot#901 needs reviews!! I think I just need one more review to get it merged!
it has the approvals, is just waiting on TizzySaurus#9615 to re-review since she requested changes
It's missing a core dev approval, Tizzy's requested changes doesn't block the PR.
ah, I see
Er, I gave one suggested change, to fix a possible DoS attack on @dusky shore π
(inb4 a core dev says that a DoS attack on lance isn't really bad)
But basically, if a user runs multiple of that command, then sends a message, they can get up to lance editing around 8 messages per message they send, which does lead to rapid api spam
I sent a fix in the suggestion, and tested it locally, so it should be good to just add.
And yes, the error handler doesn't actually handle errors of multiple concurrency, so
That can be resolved with either a local error handler to set handled on the error if it is of commands.MaxConcurrencyReached to True, or a pull request to update the error handler.
update: I've sent another comment which features the local error handler solution. π
could i get another review on bot#2001
not the review you were looking for, but left one π
hi
:incoming_envelope: :ok_hand: applied mute to @inland fulcrum until <t:1639453407:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
well...
it was so minor i didn't leave it
but tldr since the docstring is 8 hours minimum, I would have made the constant use that instead of 24 - 8
!ban 920153402007244810 Sending IP loggers
:incoming_envelope: :ok_hand: applied ban to @inland fulcrum permanently.
you def were double checking that user id lmao
saw that typing indicator

I did that initially but that wasn't the way the limit was specified, so left it like that
if something affects both bot and lance (eg it was ported from one to the other) which repo would have the enhancement issue?
My assumption is bot
oh nvm it only impacts bot lol
*he not she fyi
whew, that's good
I don't mind people making a mistake, just please use the correct pronouns now that you know π
saw a maybe-mark up for grabs and am curious what exactly the problem still is, I'd like to mayhaps have a stab at it if you still intend to give it up
Oh, that
It turns out there's loads of bugs in it that just haven't been discovered
I ended up having to do all sorts of hacky overriding dpy classes
I might start from scratch again
!remind 4d
Your reminder will arrive on <t:1639815244:F>!
oh fun!
Ok, thanks, will take a look later today if I get a chance
Ah I see
@austere hornet (my review isn't blocking anything)
(Sorry kat, forgot to disable the ping)
Oh ok, thanks for letting me know
https://github.com/python-discord/sir-lancebot/issues/947 pr opened but not approved yet.
bot core is public finally nice
as of version 0.7.0 (bot is on 0.6 right now) this will make the docs command much less helpful
(ignore the rest of the implementation)
top is 0.6.1, bottom is 0.7.4
this commit breaks the doc command somehow https://github.com/matthewwithanm/python-markdownify/compare/0.7.0...0.7.1
uhh i don't see anything that would make the embed so
where does --- come from?
is it there in the docs
Tl;dr ```py
def convert_hr(self, el, text, convert_as_inline):
return '\n\n---\n\n'
yeah i'm not sure how that causes a problem
unless this is like that ... regex problem black had
ah
this is how that line of code actually works
markdownify/__init__.py line 96
convert_fn = getattr(self, 'convert_%s' % node.name, None)```
ok i think i know why
yeah that makes sense how that changes the output
yea, --- is actually part of the markdown spec, but we don't want that
one sec, lemme cross check with the bot source
think i found it
ok nope, ignore
remove hr?
well while doing the above not-actually-a-bug-yet thing i did find a real bug
!d cleardoccache will error on success
@patent pivot #dev-log message
how do these sometimes get through the worker?
Β―_(γ)_/Β―
i mean
i can successfully recreate it
but i don't know exactly what github is doing differently
if i use the integrated support in my ide then 100% that event gets through
holy crap there were a lot of unlabeled PRs in sir lance
Could I get another review on sir-lancebot#745
Also sir-lancebot#901 needs 1 more core dev review to get merged I think
Maybe something worth running on the cluster?
Well, in front of the cluster rather
I imagine whatever scanning nginx is providing, CF is providing better
Considering they've rolled out the mitigation across all sites, I think we might not gain much
do you have a pro CF subscription?
It's deployed globally
don't have any java apps that it really matters for, but yeah also cloudflare is mitigating it at WAF level and pythondiscord.com is on cloudflare pro
A NGINX blog post about mitigating Apache vulnerabilities is beautiful
π³ I had nothing to do with that
nothing
Lol
Is it just me or is Sir Lance really slow today
rather, it's not answering calls:
#aoc-bot-commands message
just seems like its aoc lb from a few commands i tried
ahhh alright
not sure if I'm doing something wrong but I did receive an error locally with the aoc command π
AWS has issues recently, which can be felt everywhere π¬
Ah
I think that's just our pastebin being down
!paste
...why did i not try that
lol
yes, yes it is that being down
Tbf I was wondering too until I saw we were getting the same error in our alerts channel π₯²
lmfao
Hah
infra resolved yet?
yeah seems like it
<@&409416496733880320> policy bot needs to be re-asserted on sir-lancebot#944, it should be merged since it has two approvals
It's passing
It refreshes when you go to the website
it's just that we just got our ingresses up
oh
aha wait i can press update branch
Yeah see dev-ops
and that is why it hadn't merged
merged
hope autodeploy doesn't f up
lol
....
because all of the subcommands are treated differently.
well that's an obvious mistake, I'll go try and fix that and submit a new pr
why does that even happen, why does whitelist_override not apply to subcommands?
sigh
in fact, it wouldn't be possible unless you patch groups
the override doesn't actually have any way to know it's wrapping a group, because the group deco sits on top of it
I guess we could take a group key like redis does namespaces
nah nvm
I'm thinking I'll re-implement this override like this:
# top of the file
colour_whitelist_override = whitelist_override(
channels=constants.WHITELISTED_CHANNELS,
roles=constants.STAFF_ROLES,
categories=[constants.Categories.development, constants.Categories.media]
)
# on each subcommand command:
@colour_whitelist_override
Can you get a command's group from ctx?
!docs discord.ext.commands.Command.parent
The parent group that this command belongs to. None if there isnβt one.
bah
We could possibly check that in the whitelist check, and then use the base
Something like:
if hasattr(ctx.command.callback, "override") or (parent := ctx.command.parent) and hasattr(parent, "override"):
perhaps a little less hard to read π€‘
!remind 30M be less ugly
Your reminder will arrive on <t:1639612708:F>!
*i mean the code
uh huh
yay recursion
oh good
not necessary to use recursion
!d discord.ext.commands.Command.parents
property parents: List[discord.ext.commands.core.Group]```
Retrieves the parents of this command.
If the command has no parents then it returns an empty [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)").
For example in commands `?a b c test`, the parents are `[c, b, a]`.
New in version 1.1.
Here's your reminder: be less ugly
[Jump back to when you created the reminder](#dev-contrib message)
its a lot more complicated than just that if statement π
its much more complicated than this
for some reason, that function isn't running at all
^ tldr typo
it works now
sir-lancebot#981
So I'm still confused about how to remove the blue pixels from the pfp. Is that a Pillow function or is it some other way? I don't think that question was ever answered
That was about flattening the image. I'm talking about how you said I should remove all the blue pixels from the image
oh
I have no idea, it looks like something with this https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.convert, maybe
That looks like the same function you said to use for flattening the image. That doesn't seem to be what I need for taking out the blue pixels. I was kinda dumb and forgot about Google so I found this, I think this is more what I need, let me know what you think: https://stackoverflow.com/questions/49280402/python-change-the-rgb-values-of-the-image-and-save-as-a-image/49280658
ah π
Done π
ty
woo typo: bot-core/.github/depndabot.yml
lol
Thanks
I didn't even see your PR
I've added a webhook to stop it from happening again
Loll no worries
so botcore will now go to #dev-log?
yes
so that's why I thought it was closed source
So what's the status on this? What was the final decision? Couldn't tell from the commit you linked in that issue
It's using .display_avatar so I'd assume per-server pfps are supported
Ah ok, gotcha, thanks
Actually, I'm not exactly sure what you mean by "per-server". You mean any pfp from any server from any user can be used?
Fuck sake, just accidentally pinged tizzy instead of @brisk brook on the unfurl PR again π€¦ββοΈ
I don't know why lol
Anyways, what I was getting at is that you need to run b!blacklist add redirects https://tinyurl.com
Ah, and no. I did not add tinyurl to the filter list.
Why isn't that listed here?
old screenshot from originally setting it up
Is your site updated?
Try running docker-compose down site && docker compose up -d site
Discord is painfully slow right now
I believe I executed docker-compose build so yes, I can check again before I go. Testing all other PRs I have been requested a review on
The list is dynamically pulled from site, and it's live in prod right now, so not sure what to say
docker-compose pull will update cached remote images
On another note, I am testing bot#1989 and I am getting this?...
Ah, great I'll try that.
No worries π
Oh wait this is what Chris' PR is supposed to fix lol
bot#2016 π
yes
It did fix, Zig's PR just doesn't have that changeset
Yeah haha
Aaaah, I pulled web and now I get 404's on bot#2006
git merge main here as well?
Here I copied it into an HTML file
What do you have in your config
the route is supposed to be /api/healthcheck
But it looks like you are still on the old subdomain system
Doing Ctrl + F in my bot config I don't have any reference of healthcheck?
Or are you talking about configuration for site?
Just checking, for helpers+, the file upload restrictions don't apply, correct?
Yes, you're looking for URL for site
If you're using the testing server, we've updated the config on notion
Oh perfect I'll copy that again then
yeah
The config on Notion still does "pythondiscord.local:8000", is it meant to?
Ah, of course sorry. I remember changing something to get Docker to work but totally forgot what I did
A lot of people miss that note, I wonder what can be done about it
The bot guide also has that explanation
Big red lettering?
We canβt exactly move it midway into the file, unless we make it uncopypastable, but then people wonβt even see there is a second half to copy
It's red, but not like "Aaaaaaahhh" red.
I think we already have that lol
LOOK AT THIS >>>>>>>>>>>> β οΈ !!CAUTION!! β οΈ <<<<<<<<<< LOOK AT THIS
I read it the first time I set up the config, when I actually read the page.
But now I forgot I changed anything and just skipped that text since I had read it previously
Maybe add it as comments?
Where
in the yaml
Whoβs scrolling that far down in the first place
People who copy the config
I donβt follow
If we put it inside the config, and people arenβt reading it
No matter where you put it
It wonβt be read
hmm well yeah you won't know to look there actually
Putting it beside URL is pointless if people dont know they need to modify the url
One solution would be to make two configs, one defined for docker, and one for local
And put each under a subpage
Thatβll force you to read enough
But itβs also inconvenient to maintain
Me - who tried to debug the problem
Because you knew you had a url problem π
Hmm, the error seems rather clear about it:
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host pythondiscord.local:8000 ssl:default [None]
Maybe we could leave those blank and force someone to set them depending on setup?
As in, set some crazy value that will error out and draw attention with a comment explaining what needs to be done.
I'd rather we just set the default to Docker values
Since that's the one new contribs are using
And then have a message at the top how to change it to run locally
Rofl
how is the whole metricity slow as fuck DB thing going?
If it wasn't already answered, it'd be the pfp for this server or the account pfp
I think I told at least five persons in total to look at that header in the staff server page lol
I think it has been fixed now (i.e. literally 1.5hrs ago)
nice, nice
Cc @vale ibex since you made the announcement
!u
You are not allowed to use that command here. Please use the #bot-commands channel instead.
Look it is fast!
Before the improvements it took >19 seconds; now just .4s
Chris majicked it
Idea:
an AOC day command on sir lance that just explains the gist of that day? or rather posts a small excerpt from the day
i forget what day had what when people talk about days and i've noticed other people have the same problem
Would we PR in a summary each day?
No it wasn't answered yet. Got it. But actually what I'm asking is, the avatar commands are not cross user (meaning only the invoker of the command can modify their avatar), is that right?
that's cool
Yeah
no just redis it with a command
You can't modify someone else's avatar
I don't think redis is write for this
I have an index on my repo for that, maybe we can pin it?
People would spend a lot of time writing it, it shouldn't be stored somewhere we can lose it
That would be a good idea tbh, I had to use it as a reference multiple times today
not what they were thinking of, they're working on christmastify, like the easterify commands
we don't take a user arg for them, no
Yeah, I know
And you can't do it for someone else
#advent-of-code message there, if someone wants to pin
Which is what I said
poke poke @static canyon @gritty wind
I'm not involved in AoC decisions rn
a pin seems like a pretty mild decision :3
Ok, I already understood. My next question is: as I was working on Christmasify (sir-lancebot#956), @fallen patrol left a review saying I should change the brief so that it says "your own avatar", which I agreed with earlier. But then I noticed it said "a user's avatar" in the spookify command so I asked in this channel what the briefs should actually say and arl responded saying both should say "your own avatar". So I said ok, then we should open a new PR to fix that on Spookify instead of doing it all in the Christmasify PR. So what I'm asking is - do you approve of either me or arl doing that? I believe arl wanted to do that iirc but if not I can open the PR, no problem.
I think "a user's avatar" is fine as the code isn't targeted at a specific user.
Oh ok, then we don't have to change anything. Sounds good π
ah, I thought that was left over from when you used to be able to run the commands on other users
now it just works on yourself
I don't think commands should be able to be ran on other users because copyright issues
It may have been, that's just my opinion on the issue.
Makes sense
Alright, site#636 and bot#2016 are two fairly small changes, which in themselves are reverts
pg_repack made things considerably faster
so we can show activity blocks all the time now
I can't be the only one annoyed that !communities doesn't work for the !guilds tag π
gonna take a look at bot#2015
could someone assign me?
i just came to ask if you had the time to show me as you work on this issue. sometime tmrw maybe
?
i'm too tired, what do you mean?
if you're willing to stream can i watch?
also do we have it to ignore pings of our various bots?
yeah, that already happens
but it doesn't ignore self mentions, lol
so if you mention yourself in a message that counts ;-;
anyways I'm gonna go sleep
me2, gnight!
!remind 8h maybe in 2h hours
Your reminder will arrive on <t:1639751732:F>!
could someone maybe approve and assign me to sir-lancebot#976? π₯Ί
I've not got access to a computer but @fallen patrol if you wish to implement the reminders thing then go ahead
I would like to be kept "in the loop" so to speak though please
π
I'll assign you when I get on my laptop
Altho I just realised it hasn't actually been approved yet so don't start yet
could you also get this one too, plz? π₯Ί
ah, core devs have to approve, ignore that ^
I thought it was moderators and up
I can ask π
cool
!remind 6h30M also check approvement
Your reminder will arrive on <t:1639751258:F>!
paste.pydis halted?
yep, having a few issues with cluster, investigating
oh okay
What does it look like now?
which bit
what query?
we've got queries that took 4 or 5 minutes now taking seconds
I mean what changed with that tool?
oh right, it just reorganises some storage of data, along the lines of what CLUSTER and VACUUM do
we hadn't auto-vacuumed in a while because of problems with the containers shared memory
we've changed the base image of postgres to now include pg_cron and pg_repack
we were intially using cron to refill the message cache by refreshing a materialised view
And the schema is still the same?
but now with repacked data we shouldn't need to do that
yeah, schema is the same, right now we shouldn't need to make any modifications to metricity
Something is up with the bots lately, does anyone know why? First @slow bone now @stable mountain ?
Yup
what happened though?
That's my question too, but I think Scale just answered, the infra is down at the moment
So something happened to the infra
yeah i was asking why infra is down
Ah
The specific reason is one of our nodes has failed, and it's slowly coming back
Hmm ok I see
should be back up now
Help channels are moving around again and Lance is responding so lgtm
yeah, we're all fixed
that's really cool
are all the recent issues due to Linode 
some are, some are just capacity things
sadge
hopefully we're mostly stable now, we'll see if there is anything we can change to stop resource surges and stuff
Here's your reminder: also check approvement
[Jump back to when you created the reminder](#dev-contrib message)
Here's your reminder: maybe in 2h hours
[Jump back to when you created the reminder](#dev-contrib message)
!remind 6H datetime, datetime, my old friend reminder pr approvement
Your reminder will arrive on <t:1639779389:F>!
@hoary haven bloop bot#2015
voice channel or dm?
come to code help 0?
bot#2015 and the fix, bot#2017
I've been working on sir-lancebot#787 with mathstrains, but we've come across a couple hurdles and development has stalled. If I were to make a draft pr, could I get some pointers? The core functionality is there but the implementation seems messy
Sure
@cold island message.mentions is returned by the api, of what users were mentioned. if the replied to user is in the message content, they would still only get one mention, and it's only counted once
ref: #dev-log message
Yeah so how do you tell if it's in mentions because they were mentioned in the message, or because they were replied to?
if they were mentioned in the message, they're automatically mentioned by the reply
like
reply to one of my messages with a mention to me, and turn off the reply mentioning
you'll see that it'll actually mention me, and show the little @ graphic in the UI
so it's not possible to reply with the user mention in the body without mentioning the user as a reply
Wait but
how will you know it should be subtracted?
Since it should only be subtracted if it was a reply but not a mention
I realize it's an edge case, but between this and making async calls for every relevant message that is a reply I'm wondering if it's the right approach
well, it only makes the async call IF it's not found in cache
although there is a very very very edge case bug there where its possible the message is deleted, and not a DeletedReferencedMessage, so I need to try/except that fetch..
I'll add that
(this may not be important to patch, tbh)
Honestly it doesn't matter that much, I don't mind ignoring it
But I'm wondering if it'll be more straightforward to just find all mentions in each message
!d discord.Message.mentions
A list of Member that were mentioned. If the message is in a private message then the list will be of User instead. For messages that are not of type MessageType.default, this array can be used to aid in system messages. For more information, see system_content.
Warning
The order of the mentions list is not in any particular order so you should not rely on it. This is a Discord limitation, not one with the library.
this is users who are mentioned, as determined by discord
if this is something we can predict now I'd rather have the code handle it
yeah I'll do that
it's such an edge case tho
referenced message would need to be out of cache, and deleted instantly after the user replied to it
Sure, but it won't cost us really and the Sentry issue won't be fun π
yeah
and it's really only likely to happen during a raid which happened while the bot redeployed and lost cache
so even more stuff to happen during an already stressful time π
For posterity, you can also mention somewhere that this approach has the advantage of only counting mentions resolved by Discord, since I can see it being a point of discussion in like 2 years
so.... if we did regex for the mentions we wouldn't need to fetch the message as we'd be able to see if it mentioned... although we'd have to use several regexes which seems harder.
- codeblock regex, so we don't match within a codeblock
- making sure all users that we match are actually in the guild (so mentions of banned users or such for some reason doesn't trigger it)
oh lol, I'll just mention the above part
cc @hoary haven, we had another discussion about bot #2015 (since I believe you are interested in following along)
Congrats on helper @summer garden !
thanks mate
Ofc!
sir-lancebot#778 needs two reviews π₯Ί
is there a way I can run docker, but attach my terminal to stdin?
I've been using docker-compose up, what's the difference between docker run -it
-t (tty), which on top of what docker run does with attaching input/output, will also pass along signals
-i (interactive) will keep stdin alive
but it's not directly related to docker-compose
for that you'll want docker compose run, which by default does allocate a tty
so you could do that, or you could docker compose up detached, then attach with docker attach
sir-lancebot#901 also needs a review (core dev)! Sorry I keep asking, but it's been up for a while now
Most filters only have to delete one message at a time
it's also often not all in the same channel
And also the deletion event can continue as the user(s) is (are) sending messages
I might look at optimizations as part of the rewrite, but it's not worth dealing with now imo
yeah, it doesn't seem really important outside of raids, which tend to be a bunch of rules being fired at once
during a raid it would be nice to be able to delete in bulk, as there's so many messages in all of the channels
poor @stable mountain hits* so many ratelimits during that
* due to ratelimit handling it doesn't actually get 429s, but dpy is sleeping in the background
oooo
Yeah it doesn't seem like we'll lose functionality by switching over (eventually)
ah
i thought i saw some 2 month mutes or stuff
although maybe i confused that for bans
or i confused that for modpings schedule
lol
all of the features kinda meld into one feature in my head, don't judge me
I mean worst case scenario we just have python reapply the mute once it expires
We already keep track of a mute all throughout its lifetime
Which funnily enough does mean we have tasks thatβll outlive the bot going right now
lol
Here's your reminder: datetime, datetime, my old friend reminder pr approvement
[Jump back to when you created the reminder](#dev-contrib message)
uhhh, sorry in advance for this issue dump!
- could a core dev maybe approve sir-lancebot#976 (tic tac toe)
- two reviews are needed on sir-lancebot#778 (merging github autolinking)
- tizzy said bot#1924 (remind datetime) wasn't approved yet, but I'd like to get started on that :D (also want to discuss scope, perhaps could add expiration time or duration to infraction commands too)
approved both issues
don't worry about infraction commands
cool
makes it easier :P
yeah, just not a thing we're going to end up using
we time people out with a duration so they serve that duration, doesn't matter when it expires, be it early morning or late night
right, right
...after commenting that, I can't think of a single problem that being able to set a specific time when someone's punishment would expire would solve
oh missed that, could you also assign me in addition to keeping tizzy, to bot#1924? #dev-contrib message
@hoary haven are you able to provide a bit more context for bot#2019 for us plebs? π₯Ί
so you saw the issue? bot#2018
we re-ordered the embed to 2, 1, 0 about 30 days ago. joe pulled the stats then and now, and while the changes aren't drastic, they are about what i expected and show the effect that i was looking for..
that being said the cost of building a new !ot command that would dynamically pick the least recently active off-topic channel probably isn't worth it, so we're going for just hardcoding #ot2 instead.
ah
so we're going for just hardcoding #ot2 instead.
worth also having ot1 in there as well?
Just one is probably simpler imo
maybe. i'm curious to see what effect this has in another 30 days, so like the idea of leaving it to a single channel for now.
agreed
sir-lancebot#982 @short snow π₯³
!pypi python-dateutil
@static canyon I'm not really sure that bot#1924 needs a new converter
Niiiiice
I really wanted to do that but I already have 2 PR's open currently
Its really only what you can handle, if you can handle other prs you can do them π
Yeah ik
But with school and stuff
Anyways
I have 7 pulls open across pydis right now Β―_(γ)_/Β―
Oh really
yeah I don't have nearly as much going on lmao
also I would say your (currently open) prs are kinda big, too
Can agree
Okay so basically
- I've implemented iso 8601 timestamps
- I've also made the response slightly different if it ends up reminding at midnight on the day of. This can happen if supplied just a single day.
Not implemented:
mm-dd-yyyy
dd-mm-yyyy
The reason I didn't implement these is because the US and rest of the world don't agree on these, but if we can agree on it I can write a converter for it π
I heard arl had a show and was busy 
π
possible to make the winning line green?
not reall big just after finishing the game add a logic to change the buttons?
(the current implementation for winning is using any() and every different combination)
yeah i saw that
i'll probably try the colour thing lol
!remind 3M sigh
Your reminder will arrive on <t:1639799501:F>!
!remind 3M also reminder pr, other typehints lol
Your reminder will arrive on <t:1639799531:F>!
a 3 minute reminder π
yes
Here's your reminder: sigh
[Jump back to when you created the reminder](#dev-contrib message)
Here's your reminder: also reminder pr, other typehints lol
[Jump back to when you created the reminder](#dev-contrib message)
Oh that looks pretty nice
lol, oof indeed
(after I said that looks nice I think I wanna take that back) Kidding, this is still pretty nice
I additionally made some enhancements to the AI (doesn't play any different, but it feels different)
@hoary haven So, looking at the tag, !off-topic will now call the off-topic-names tag. I know some users will manually call !off-topic for the now !ot embed.
There's not a good way to solve this, because if we rename !ot back to !off-topic, the fuzzy match between that and off-topic-names is too close, and !ot won't produce the embed we want.
I'm wondering if we before we merge this, we make an edit to the tag metadata functionality. Where we can add an alt-names key that we can maybe use if the fuzzy match is close? I'm began to look into this but it's going to take some dedicated time for me to fully wrap my head around the logic and flow for the tag groups.
(cc: @brazen charm @vale ibex)
yes, but it would still require an edit to support a new key like that and making sure the logic works.
I mean, if we have the metadata, I can add the key and logic and stuff
shouldn't be too\β’οΈ hard
have you taken an in-depth look at the tag rework?
mm yeah i had chris try some things locally on his side, whatever works best to get what we want (!ot always getting the single-channel embed)
nope, but I am a faster learner (see my recent pulls to lance and bot)
and the PR isn't urgent so if we want more functionality from metadata that's fine
I would probably avoid making statements like how hard/easy something is if you haven't looked at it before. I don't think it'll be hard, but I want Chris's and more specifically Numerlor's input on it first.
just took a look, seems simple enough honestly
they hit every channel smh
I know some users will manually call !off-topic for the now !ot embed.
btw i don't think this is a downside
mina, could you check #dev-branding, they did it in every single channel (and slow enough python didn't get them for spam)
edit: thank you whoever
I think it's weird behavior if !off-topic and !ot pull different embeds since currently !ot is just a fuzzy match for !off-topic
yeah, i understand the weirdness of that, but i'd also be curious to see whether the full name !off-topic has been invoked much at all
you shouuuuld be able to check in grafana?
given we're in dev contrib, I want to mention this so I don't forget it..
I've seen two people just today do a slow spam, where they send something to every channel but very slow, so they don't get caught by the boost rules.
Anyway to catch this with the bot?
Although the viewing stats in grafana is very finnicky and I think the way it calcs it for tags is a bit fucked
o! i make new discoveries of grafana every day. will check
mmmm... !topic will pull the longer command, and people will mistakenly do !topic instead of .topic
I mean, if we add aliases, I wonder if we can add tag blacklists...
i mean, we can
oh people do that now haha
actually blacklisting phrases is super simple to implement, looking at the source
well, the last time it's been called, in-full and on-purpose, was when Chris and I were checking to see why !ot broke when the tag rework got merged on December 8th
just a sec, finishing something with bot#2020 and then can focus 100% on tags
Soooo, definitely safe to say that it isn't used much at all. So I'm actually fine with not blocking this over the tag rework and adding a new issue to support alt-names for tags
Error response from daemon: driver failed programming external connectivity on endpoint bot_redis_1 (6ce31309b81ddde1640181a2f08041d80cd11190621a2e182c8a31095618d053): Bind for 127.0.0.1:6379 failed: port is already allocated
....
I redact "just a sec" because docker
ah its because both @dusky shore and @stable mountain have the same configured bind for redis so i can't run both of them at once
or wait
i only need one redis running, don't I?
Bot and lance can use the same redis, yeah?
i found where the stats are in grafana but they're borked as far as i can tell. all null
yuuuuuup, that's grafana for you.
Sometimes, when the wind is just right and the moon is exactly full it'll provide useful data
But anyhow I approved~
I still think this is a concern
we could blacklist tag names
so someone who tries !topic doesn't get met with the off topic embed
cc @hoary haven
blacklist based on what, the channel it's invoked in? i don't think that would be a good idea. but regarding your earlier question about the "slow" spammers i'm asking mod team
no, more like: a user uses !topic but topic is in a blacklist of tag aliases, so it won't attempt to fuzzy match it to a tag
oh
Mehr there's a delete button at the bottom of the tag so there's already a solution
If people mistakenly invoke !topic instead of .topic it'll produce an embed of the same length as we currently have. I don't think we need to engineer a solution to try to prevent people from calling an incorrect command because they misremembered the bot prefix.
I just had a conversation with mina, and if you read the message right above yours, you'll see I came to the same conclusion-- there's already a solution for the problem
I did read the above messages. I still want to clarify that that isn't really a problem that we need to solve. I'd barely classify it as a problem.
(cc @fallen patrol) infractions already accept ISO datetimes π€ We don't use it often, but it has its uses.
lol yeah, I added that converter to reminders in 2020
Oh wow, its been a year already? /s
er, bot#2020 *
whoever opens the next thing gets 2021 π
oof
lol yeah it'll happen before then
hey, admins, I need an emoji added for one of my pull requests. (tic tac toe to buttons)
Its an odd request, given its a fully transparent emoji, but the reason is simple: discord itself sizes buttons differently on different operating systems, so tic tac toe with differently sized buttons wouldn't look too great. The buttons would keep changing size
this is the file
How does it solve it?
Since I'm using π½ and π΄, all of the emojis are the same size
but if I were to switch to zero width spaces and spaces, and other stuff, it wouldn't look too great, as on mobile, buttons get sized differently with a smaller minimum size
additionally, on the coding end, passing a character to button.emoji is different from button.label, which has to be determined before sending. I'd have to refactor to not use an emoji for a single kind of button
how it looks 
hmmm ok. I never bothered getting permissions for the emoji servers so will need another admin to wake up
weird, clicking on it, increasing its resolution (the image)
its not time critical for me, but I'll be on in the morning and then not again until sunday
There's no rush, work on it when you're available
yeah
there's only a few more bugs, I keep patching them and then I find a few more
I'm worried I may have to refactor the entire cog entirely ;-;
@cold island is this supposed to be like this?
I would think that we'd want to remove/disable/handle interactions on timeout
it times out
uuh
If you can figure out a way to do that
be my guest lol
Because I didn't
!src help
An interactive instance for the bot help command.
The timeout event is not aware of the message
So you'd have to somehow record each message the view is used in
the magic is here, somewhere
async def send_command_help(self, command: Command) -> None:
"""Send help for a single command."""
embed, view = await self.command_formatting(command)
message = await self.context.send(embed=embed, view=view)
await wait_for_deletion(message, (self.context.author.id,))
!d discord.ui.View.wait
await wait()```
Waits until the view has finished interacting.
A view is considered finished when [`stop()`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.View.stop "discord.ui.View.stop") is called or it times out.
π
so when the view times out, this will end
now, I think I can merge wait_for_deletion into the view...
by making a delete button instead of reaction
Because Buttons Are Always Better\β’οΈ
buttons are chonkier π
But yeah your suggestion about the wait seems to do the trick
yeah
although given this, I think this particular case it would be better as a button
super tiny in comparsion ;-;
the delete as a button?
yes
I'm kinda fine with it being small tbh. Would like to see what other core devs think
Ah, so could we even disable the buttons after wait()?
yeah
I also don't like a discrepancy between having a delete button in some places and an emojis in other, so I'm not thinking about the particular case
yeah, makes sense. I've switched my own bot to buttons for deletion but I can see how it would be confusing
also zig could you assign me to bot#1964
done
cool thanks
Here's your reminder: See referenced message.
[Jump back to when you created the reminder](#dev-contrib message)
!e
So the help function from Python doesn't work in the eval command... The following code won't work with the eval. A bug?
from typing import Union
print(help(Union)) β
@severe tangle :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | NameError: name 'help' is not defined
!e
help(print)
@short snow :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'help' is not defined
hmm
Yeah, that seems pretty good
I think just yyyy/mm/dd support is good
bot#2020
The edit_reminder_duration func needs to use the new converter (the Expiration union)
And I'm not sure if the way you don't it allows for specifying time & date or whether it's just date nvm, I see now that you're using the isotime parsing
The site module isn't being loaded
I don't exactly remember why, but I believe there is a good reason for it
!d site
Source code: Lib/site.py
This module is automatically imported during initialization. The automatic import can be suppressed using the interpreterβs -S option.
Importing this module will append site-specific paths to the module search path and add a few builtins, unless -S was used. In that case, this module can be safely imported with no automatic modifications to the module search path or additions to the builtins. To explicitly trigger the usual site-specific additions, call the site.main() function.
Changed in version 3.3: Importing the module used to trigger paths manipulation even when using -S.
!e
import site
site.main()
help(print)```
@clever wraith :white_check_mark: Your eval job has completed with return code 0.
001 | Help on built-in function print in module builtins:
002 |
003 | print(...)
004 | print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
005 |
006 | Prints the values to a stream, or to sys.stdout by default.
007 | Optional keyword arguments:
008 | file: a file-like object (stream); defaults to the current sys.stdout.
009 | sep: string inserted between values, default a space.
010 | end: string appended after the last value, default a newline.
011 | flush: whether to forcibly flush the stream.
Oh and I don't know if you heard about it yet but timeouts are getting rolled out on Monday if you want to start working on an integration to replace the muted role
Also reviewed the unfurl PR
No plans on doing so for a long while I don't think, higher priority things in mod-dev domain right now, like filters
Oh well, @summer garden, I didn't see that your epoch command PR was still a draft and reviewed, do you want to hear about my comments right now or wait until your PR is all done and dusted (my comments do not mention the failed lint if that's the reason why it is a draft)
I was quite stuck for a while on this, but when I was writing a comment to ask some questions, I had a bit of an epiphany and I'm working on that new implementation now. I wouldn't mind the review
a'ight!
Yes the lint is part of it but there are a couple other issues which I haven't yet addressed
I thought I updated that...
When I looked earlier it hadn't been updated
You're doing t.Union[DayDuration, Expiry] instead of just Expiration which is defined as that here: https://github.com/python-discord/bot/pull/2020/files#diff-ff5e005753653eb0abb88e1134e9b2f98346c73ed2719d43fce1678a7bbb1ddeR32
bot/exts/utils/reminders.py line 439
async def edit_reminder_duration(self, ctx: Context, id_: int, expiration: t.Union[DayDuration, Expiry]) -> None:```
!remind 11H admins + emoji = ttt
Your reminder will arrive on <t:1639879069:F>!
I'll have to modify a converter to actually support this, still. iso 8601 uses - - and not / /
Oh yeah, that's fine
you could always go for blindly replacing - with / if they mean the same thing to you
ooh yeah
any / before an non numeric character can be replaced
eh just T is fine
Yeah, I'd go for just T
(why yes, I do tend to overenginner everything)
!d arrow.api.get
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.
yeah, I'll make a new converter for that then
For what it's worth isoparse itself doesn't seem to support my idea of being able to pass just a time and then it gives the next occurence of that time
So e.g. if I did !remind 16:00 hello then it'd remind me in 50mins (since it's currently 15:10)
(and I'd like support for this)
I think I added this, (idk I'm on mobile and very busy later) but for most users, it won't be that simple, as the bot cannot detect a user's timezone
I'd want it to assume UTC unless otherwise specified
Since that's how times are generally parsed
!remind 16:00+01:00 hello would remind at 16:00 utc+1 (15:00 UTC)
That way users can just add their tz offset
ahhh so I will need a custom converter π
can't say that wasn't in the initial design spec so Β―_(γ)_/Β―
!remind 13H if you're awake enough lol
splitting at +, arrow.get() and relative times. also / to - before T
Your reminder will arrive on <t:1639887690:F>!
@short snow 
noooice
!remind 13H ttt, gc :)
Your reminder will arrive on <t:1639890481:F>!
Would the alt-names be a normal alias for the tag or did you mean something specific with the fuzzy match being close?
.bm #dev-log message
Ot tag broke. Doesn't work with additional text after and in itself, gives only ot2
Words breaking the tag altogether
Full tag name working and ot showing only ot2
The first one I'm guessing is caused by the tag being on cooldown
So it knows there's a tag that similar, but then doesn't show it
The latter is intentional
I think it's because the command doesn't see it as an exact match, so it does fuzzying which is ambiguous
ohh i do often like invoking !ot with additional words in my message though. this is something i didn't consider
I think trying an exact match with only the tag name if it has a group shouldn't cause any other issues, I'll open a pr
@brazen charm @final geode thanks to you both!
bot#2019 per @hoary haven its intentional being two tags
Yes, I was made aware of that. But ot being now broken by not accepting text next to tag is real
yee, bot#2023 is the pending fix by Numerlor
Bump once again and sorry I keep asking, but this has been up for a long time and is almost ready to be merged. Thanks!
Hmm, so I mentioned the idea of an aoc 'day' command earlier that tells you what the day was about, but I think I have an idea on what it could be displaying, which would just be the name of the day and a short excerpt from the day, and you could either search up a day with it or search up a description for a day
though it's quite late to add a new AOC command so π€·ββοΈ
i.e.
.aoc day 6
or .aoc day lanternfish
^ could I make an issue for this? or should I hold off on making it with the amount of aoc commands we already have
hey we have 2022 to be prepared for
AFAIK you can always make an issue
and I'd recommend making one as it can be tracked and linked to if ever brought up again :P
Yeah you can always open issues without asking
oh wait yeah π€¦ββοΈ, stupid question then haha
bot#2022
technically, by that logic you can also make pulls without being approved as all pulls are issues
- plz don't do this
what about it?
i was checking if 2022 is already made lol
I like that idea a lot, but how would we keep up with the days? Just someone manually adds the info? I guess, my question there is do we just do a "Here is the exact puzzle text ..." or do we try to briefly describe the main features of the puzzle ourselves?
Also, I'd ideally like this to handle multiple years as well. What would the interface for that be?
So what what I was thinking:
when sir lancebot sends the message saying the next day is available, it requests the aoc webpage for the current day and then stores the name of the puzzle and the excerpt of the puzzle and caches it (i presume maybe a redis cache for when the bot goes down), so whenever someone calls it, it would just fetch it from there
but for previous years, since it wouldn't exist yet in the cache it would make an API request then cache it for future use
well not an API request,
So we would just be taking an excerpt from the website as is?
it would just use beautifulsoup for reading the webpage
could possibly scrape them, and cache them in redis with a tight rate limit to not request each day more than once ever, or, given that we use redis, a mod or helper or someone could add it. there may also be aoc helpers who could add it and they don't have anything else, just a whifelist to edit it in
yep, or just the first paragraph of the excerpt for brevity
^ oh that could be a good idea, where someone could just add it into the 'index'
but it would have to be trusted people
hmmmm, I'm curious how useful that would be. People generally remember puzzles by the main characters/problem to solve. Like Day 6 is the notorious lanternfish problem.
The command or storing the first paragraph of the excerpt?
yeah, so some way for staff to add it would be nice
storing the first paragraph as an excerpt
ahh I see, well if it's a day from previous years people might not remember it from the name only
because some people may not have participated in previous years
Looking briefly at the text for the first ~13 days. It looks like the memorable thing from each day tends to be in the first 2 paragraphs
could scrape for an initial load in, and then aoc helpers could edit, giving a title, alias, etc if needed
also just to throw out an idea, maybe we only get the keywords from the first two paragraphs, so just collection.Counter the two paragraphs split into words and ignore common words
The first day is more complicated since it includes more story intro
^ combining both ideas
Nah, I think it's fine to excerpt the first two paragraphs up to a certain word count
Sounds good
Could I try and spin up a PR for this or put out an issue and wait for more approval?
someone had figured out where the sample input was as well
issue, I'd like to bikeshed more :)
Let's do an issue to make sure we understand what we fully want. We can discuss implementation details there and once we're all agreed a PR can be opened.
Sounds good
If we can reliably scrape the webpage for the info we want then we can have a task run 30 minutes after the puzzle release to pull the contents of the webpage into redis
What would we use to schedule it by the way? because if we use asyncio.sleep and the bot goes down within those 30 minutes, a problem might arise
unless we just scrape the webpage if the day the user requested is not in the cache but is a valid day
Lol
Just check if it's been 30 minutes since the puzzle released and if it's not in redis then we're good to grab it
ahh alright, so just a tasks.loop I believe
Update about sir-lancebot#956. I'm feeling like I won't be able to work on this simply because I can't seem to understand Pillow. How should I proceed?
Here's your reminder: admins + emoji = ttt
[Jump back to when you created the reminder](#dev-contrib message)
ye, with a datetime object :)
note: in the task you'll need to check if it's day 1 to 25, but it should use the month override, so don't check the month internally
Here's your reminder: if you're awake enough lol
splitting at +, arrow.get() and relative times. also / to - before T
[Jump back to when you created the reminder](#dev-contrib message)
also arrow dehumanize !!! @fallen patrol
I'm taking another stab at bot#1942, will update when commited and pushed
er bot#1924
Damn, nice
That might also support just the time (no date info)?
i'm gonna sleep soon\β’οΈ and in the morning i want to bikeshed all supported formats as input so I don't overcomplicate this
It's probably documented what the full list is
Oh, I mean all of the formats we want to support for !remind <duration> input
since we have options
