#dev-contrib
1 messages Β· Page 157 of 1
Ah, that doesn't really matter
We can tell it to ignore each file in it it finds
Since all sub packages will be ignored too
As soon as it finds an underscore anywhere in that path it'll quit
yep, or switch the generator to use a recursive function which can knock them out faster π
meh your solution is better and faster
Over optimization
the line after the if is continue
I'm known for that
taking a break from trying to set it up, lol
Why don't you have docker on your local machine again?
@cold island give this patch a shot, it seems to be working from my testing
https://paste.pythondiscord.com/evodefigog.lua
Hmm... seems like the error is coming from walk_packages
What error are you having?
It's an ImportError but I only have the traceback object
I'll try removing the onerror
If you send the error, could help
I've become deeply unfamiliar with the import system
... for better or for worse
uuuh
Do you still have the function?
circular references?
I removed it
actually, the error would be different
circular references has differnt erros
There are no other mentions of that function
lol it is used somewhere for something once
Why do you have a greyscale santa hat. It looks like someone took a white marker to your pfp
Ξ» rg "unqualify"
bot/converters.py
22:from bot.utils.extensions import EXTENSIONS, unqualify
160: if argument == unqualify(ext):
bot/utils/extensions.py
9:def unqualify(name: str) -> str:
21: if unqualify(module.name).startswith("_"):
yes
ngl the white line makes me think paramount
put on a real christmas hat and change pfp
that's my plan
actually just take all event pfps together so you won't need to set it up everytime
https://github.com/python-discord/sir-lancebot/issues/965 could someone please check this issue ?
didn't someone (@cold island or @gritty wind, maybe?) said something against a blackjack game
well scal did and did not, he was not opposed to it but told it has been shot down many times in the past for gambling
Well Scaleios did bring up its a big chance of the idea getting denied but I still would want an answer to the issue? π€·
I'm not a true fan of it because of the gambling aspect either, yeah
kind of reminds me of twitch's prediction system
@gritty wind I got it live by modifying the docker-compose file
no more port forwarding necessary
...
@vale ibex all this to realise I can't test the partial message pr
I don't have a message old enough in the server to be out of the cache
Can't you just restart the bot/site?
I think that dpy will fetch recent messages and add them to the cache
meh I edited the bot to disable the cache temporarily
It doesn't, it only fills the cache on_message
and it doesn't work
so send a message, kill your bot, start it again
Is that in DMs?
I emptied the cache by passing None in the constructor
nope
wait
discord/client.py lines 120 to 122
max_messages: Optional[:class:`βint`β]
The maximum number of messages to store in the internal message cache.
This defaults to `β`β1000`β`β. Passing in `β`βNone`β`β disables the message cache.```
I'll try setting this to 1 in case setting it to none also disables a channel cache for some reason
nope
you cna leave it default, and just restart your bot after sending a message
Do you have more of a traceback, to see what is raising that error?
still fails
gimme a few minutes, I need to set up a modlog to sort through this cruft
what about !int e print(ctx.guild._resolve_channel(ctx.channel.id))
interesting
Missing a )
...why does it delete the response??
That is something The ChrisMan will have to answer
guess i'll try to configure some of the emojis
For a second there my brain started taking chrisman to Christmas, and i was thinking βoh wow, Chris sounds a lot like Christmasβ
Then I realize Iβm an idiot that hasnβt slept in a day
Christmasjl
it returned the channel name
hmmm
i figured out why
oh, errros are deleted after a while
that's in our error handler
Hmmm I can't see why it's not working on your bot
i configured all of the channels to the same channel π
like a perm check or smth
defcon & interaction channel
the error might be coming from there
reactions go brr
lol
now I can try
That makes sense now
and sadly the patch did not work
Could you expand on that?
Since it works on my bot just fine, and you have just shown that the last time you said that it was because of configuration.
What were the steps?
log is literally:
2021-12-03 12:26:01 | bot.exts.backend.error_handler | DEBUG | Command raw invoked by arl#8028 with error ChannelNotFound: Channel "None" not found.
would it make some sense for you to join my server, and try the bot yourself?
So, before it hits the Message convertor, it goes through the other decorators
namely @in_whitelist(channels=(constants.Channels.bot_commands,), roles=constants.STAFF_PARTNERS_COMMUNITY_ROLES)
So, is your bot commands a valid channel that exists in your server?
Could you send me your config.yml and invite me to your server?
(your) dms are closed π
oh, I have them closed for this server and opened in lemon's server lmao
my current config https://paste.pythondiscord.com/awisilezuy.yaml
update: we (okay, chris) figured out that this is the cause of the problem
oh
lol
tldr method name wasn't ever being called
@thorny obsidian didn't we used to have a link command for the aoc? or maybe it was for hacktoberfest
Nope. It was for hacktoberfest. My issue references it and the PR links to the issue.
oh right, you made the issue
I got some things messed up
excellent
do we use Redis?
oh you made the PR
Yes. My issue states that that should be the implementation used and my PR description says it's implemented with a redis cache.
gotcha gotcha
just a small nitpick that isn't worth changing, you send the log line {ctx.author} ({ctx.author.id}) is now linked to {aoc_name}. before actually setting the value, which may be a little confusing when trying to understand an error
finally managed to get tldextract working last night
other than that, the PR looks pretty good in its current state
I wanted to log that before you set it because if it somehow errors or crashes during the set for whatever reason you won't have a log of what caused it.
I'd have worded linking {ctx.author} ({ctx.author.id}) to {aoc_name} if the log line happens before the action is actually being done
I don't think the last two comments are really worth actioning
the part about the length being 0 being fine is true though, you'll just end up with an empty list
Yeah, I do plan on removing that. I had in there to prevent an earlier issue that I ended up accidentally refactoring out
I see, I see
@vale ibex when you've got time, do you mind looking at bot#1889? tldextract has been fully implemented and tested
So the reason we added tldextract was so that we could do subdomain and path parsing nicely
So it would make sense to change the check to be something like ```py
regex = r"\S+?.\S+"
sent_subdomain, sent_domain, sent_tld, sent_path = magic_extract_func(url)
for blacklist_url in blacklist:
filter_subdomain, filter_domain, filter_tld, filter_path = magic_extract_func(filter_url)
if filter_domain == sent_domain and filter_tld == sent_tld:
if fitler_path and sent_path != fitler_path and filter_subdomain != sent_subdomain:
return False, ...
return True, ...
changing the url regex too, so that we match on more things
of course this is pseudo code, so please don't just copy-paste it verbatim and expect it to work π
@clever wraith ^
chris, is #778 up for grabs π₯Ί
which repo?
@dusky shore
Ah, I was hoping to finish off what it says on the tin and then move a lot of stuff to other issues
I just haven't worked through feedback
π
...which I can then be assigned to :)
hah yea
Also I do list(dict.fromkeys(my_list)) quite often to remove duplicates and retain order π
I wish there was a better way than that...
there's also more_itertools.unique_everseen
like orderedset or other thing
But that's in Python afaik, so using dict.fromkeys is better
since it's in the C layer
I didn't realise that...
.bm 916393778166792253 intended impl
I've just pushed a commit with some fixes that I think should be done now
I think all of your other suggestions could be done in another PR(s)
hi sorry if being annoying, but how long does it take until there is a deny/accepted response for my issue?
looks good in that case
it depends when people are available to review it, we're all volunteers here. Different people are active at different times
Most activity is seen on the weekend, since that's when people tend to have the most free time
approved
Nice, feel free to open an issue enumerating your proposed changes, and i'll get you assigned
er, could you please unresolve those 3 comments that you said to make another issue because github is glitching and i can't click them...
thanks
or wait
should I even make an issue?
could go straight to pr for the ratelimits and issue refactor
(basically I'm not sure how I should split them up into issues?)
Yea, if you don't want to split them into different PRs, feel free to cover it in one
I mostly suggested an issue so that people could get context on why we wanted it
if you include it in the PR body that should be fine
total changes:
- constants
- move ratelimits
- remove git alias
- add wait for deletion
- include issue number in response
- move the if not message.guild check to before we scan for issues
- make only one request per pull instead of two
yeah, an issue is probably relevant, but can make it with all of those in it
Yea, seems fine to me
lol, bug or feature?
I'd say all of those fall into feature enhancement/perf enhancements
π
sir-lancebot#968
stalled π
@thorny obsidian I updated sir-lancebot#967 to be better illustrative of the changes that it is requesting.
I'm not sure what problem that's trying to solve. I'd like to retain the information that the leaderboard can only be refreshed in 30 minute intervals. Replacing that with a dynamic timestamp removes that information.
see sir-lancebot#966 for why the information of 30 minutes hasn't worked
I've read through that issue and responded. People who don't read the embed will still continue to not read the embed. Making it a dynamic timestamp just obfuscates that it's on a 30 minute interval.
I read the embed, but as I commented above, I (and likely others) did not see that last updated tiny footer until it was pointed out
there are other fields in an embed which are larger than the timestamp location, which is small and appears differently on different platforms
i understand wanting to keep the information, and that all of the information is already there, however, the presentation ends up shadowing some of the information with the large code block above the embed
Why not just move the footer right below the line "The leaderboard is refreshed every 30 minutes."
I like that
You do lose localized time though
Yeah, when I say read the embed, I do mean the full embed. There isn't always a good solution to people just not reading information provided.
Making it a dynamic timestamp just hides the fact that it's on a 30 minute timer. It's now on a ??? timer.
you don't, the <t:x> feature is localized
Ah I guess we can make it a timestamp yeah. I was mainly thinking of relative time which I find pretty annoying sometimes
In my own usage of it I tend to put an F time right next to an R time
<t:1:F> (<t:1:R>)
"
The leaderboard is refreshed every 30 minutes.
Last updated <timestamp>
<main message>
"
(not saying we should do that, just agreeing that the R times can be annoying)
Well you don't need the full datetime here
no i mean in my own code that's what I do π
I like this, I can implement it if you or kutiekat signs off, although I feel like kutiekat would like to implement it
!raw #dev-contrib message
== Raw message ==
<t:1:F> (<t:1:R>)
<t:1:t>
It has nothing to do with my current open PR, why would I want to implement it?
i was thinking you'd make a new pr, but hey, if you sign off i can implement it π
Yeah, I'm fine with this. I'm just going to be very particular about keeping the information that it's on a 30 minute timer.
Why would this require me to make a new PR? It has nothing to do with the .aoc link PR.
well, if you were implementing it then as you said because it doesn't have anything to do with your currently open pr you would make a new one with just this change
I don't really understand your question, I suppose
But if you approve the issue, I can go ahead and implement it
I'm very careful in lancebot that I don't actually PR anything that other people can work and would be a good experience for them. It's why I make issues but you almost never see me make a PR to that repo. Just because I comment on an issue or provide feedback does not mean I want to work on it.
The notable exception being things that are blocking other things I'd like to do. I PRed .aoc link because it's blocking an announcement I'd like to make and other work I'd like to do behind the scenes.
Adding a dynamic timestamp in the main body is fine though, you can implement it.
I was going to implement this and remove the footer last-updated
I won't implement it unless confirmed that the implementation i would use is what you want.
Yup. I replied to Zig's message with that saying it's fine. If the information that it's on a 30 minute timer is retained, I'm okay with a dynamic timestamp being added to indicate when it was last refreshed.
....er is there is a leaderboard I can test with
The one you joined.
how do I set it up on lance π
.env file should contain this:
The structure of AOC_LEADERBOARDS is: leaderboard_code,session_cookie,lb_joincode
The leaderboard join code doesn't have to work for this since it's just DMed to a user. You just need to pull your session cookie and make sure the leaderboard ID is the same as the one you've joined.
oh damn I forgot about today's puzzle
lol, good luck with pt 2~
pain already on day 3?
reading is hard 
how's this? @thorny obsidian
I'd prefer if it was just the timestamp because the date isn't really important. So <t:X:t> or <t:X:T>

as an aside, while here
I tried putting a language on the embed for a little bit of color
worth keeping or naw?
People are going to immediately question why some people's names have color and others don't. I'd rather keep it simple
What I have set up is more or less the same
It discards the subdomain and checks the tld and domain name
Yea, the path check is the more important part
if there is a path present, we want it require an exact match
@vale ibex I forgot, was aoc subscribe gonna get killed or wait until the end of aoc this year?
probably just wait, rather than pull the command out from under people during an event
cool
lovefest can be removed though
can I make an issue, and mark it as deferred?
π
hm
should the commands stay, and helpfully redirect users to use the Python command?
Lmao what kind of an issue name is that
Yeah ik, not saying it's bad, I just like the word "yank"
No
vim is an editor, and in vim, you can yank a line of text, which will store the line in memory. You can then paste it again, which is what we're doing here. The command is yanked from lance, since we've pasted them on @stable mountain π
Oh it's literally called "yanking"? Lmao
Ik what it is
I just never used vim
But yeah I get it
hmm, is there a standard for referencing the prefix of the other bot
lol @vale ibex I accidently removed my assignment π
as an implementation detail, I'm tempted to make a factory util for the embed, and just use it in both files
Sounds fine
although with the delete after 20 seconds, not sure if that feature was ever ported from bot
I was referring to the kwarg on Messageable.send
i seriously forgot that kwarg exists
hah
but it would be neat to delete the main invoke as well, not sure
Eh, it's fine if it doesn't
okay!
hmm, is there a standard for referencing the prefix of the other bot
Feel like the solution is to add a constant in constants.py lol
I think for this, just hard code it to !
we're never going to change it for @stable mountain and there's no reasonable way to get it in dev
the reason i wonder is only because there is a pr (or issue) to remove prefixes from help messages
yea, for commands within the bot
Make a bot-prefix-manager microservice /s
right, so that's why I'd make it a constant so it would at least be changable with one line π
Yea, a constant is fine, just no need for it to be in the config
config files are already filled with stuff that don't need to be configurable
i half want to implement a redis cache to be able to have a stat of how many people have used commands that are deprecated π
feature creep
not bad
lol saw this after pushing, sir-lancebot#971
given the previous conversation I just had with kutiekat, I figured that saying it several times in the help message was worth it, as we were discussing that people don't read the entire embed
Surely having less in the embed means they would be more likely to read it
and removing the repetition, since it just looks wrong
π
I'll change it for lovefest, but aoc is the same way, but with more commands, its more hidden
Yea, for aoc that's fine, since there's more there
It's just there's no point in having a group if it's sub commands both do the same thing
so this?
sir-lancebot#970
sir-lancebot#971
sir-lancebot#972
Why are they all different PRs lol
So.. there's one draft, one open and one issue?
the first is there so that it can be merged after aoc ends, the second is ig because there's no reason to delay it, and the issue because well, issues before prs
issue explains what is happening, and what we're doing
second issue is a pr which implements the function, and deprecates lovefest
third issue is a pr and a draft since chris didn't want to deprecate aoc commands during aoc
additionally, lance uses a set to de-dupe listed issues right now, which isn't great, so they are in a different order than i provided
once sir-lancebot#778 gets merged, I have sir-lancebot#968 already approved to start work on github and issue linking enhancements
when weβre ready, lol, probably once we solidify things at the staff meeting. itβll come in due course.
oh wait
sunday
@vocal wolf sir-lancebot#778 needs your approval after a disapproval
not sure who will be there though, so might push to next week? but itβll be soon, just continue holding further work on api
as a reminder #dev-contrib message
is the tldr that site will always feature the api?
I'm sure you know this, but an issue is not the same thing as a PR π
Just saying
actually, all prs are issues π
Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.
api will likely always be django
Ah gotcha
site⦠might move out at some point? who knows, probably not for now, for now site will stay as is and will be DRF and templates
yeah, I've done an enhancement to the github command that will only make one request, as knowing this means we don't need to make two requests 
Ah I see
you can actually view these two issues for more info π
see my review on the pull, which should be summarized on the issue
Gotcha, will do, maybe tmmrw
!remind 15H read this
Your reminder will arrive on <t:1638632142:F>!
Sure, what for?
specifically, it can parse urls, and remove the protocols for you
I mean, maybe, but it's a pretty easy thing to do by hand
It's one line lol
since urllib.parse also exists π
but also: the last / can have some significance and imo should not be stripped if possible
Could you clarify what situation you think that'll be relevant in
well, this is unfurling redirects, so if someone knows that, they can make it do a different thing if there is a last slash vs not
It isn't, it's unrelated
I kaizened in the change, as outlined in the PR body
This is for the filter content itself
The way the URL search currently works is we run a regex on the message body to extract URLs (this does not modify them), then run filter in extracted_urls
Having protocol and trailing slashes means we end up with filters that are duplicated sometimes
ahhhh, okay
Also discord forces trailing slashes on urls
!d urllib.parse.urlparse exists tho π
urllib.parse.urlparse(urlstring, scheme='', allow_fragments=True)```
Parse a URL into six components, returning a 6-item [named tuple](https://docs.python.org/3/glossary.html#term-named-tuple). This corresponds to the general structure of a URL: `scheme://netloc/path;parameters?query#fragment`. Each tuple item is a string, possibly empty. The components are not broken up into smaller parts (for example, the network location is a single string), and % escapes are not expanded. The delimiters as shown above are not part of the result, except for a leading slash in the *path* component, which is retained if present. For example:
and actually, that might be worth using
because of the docs for unparse, the suggested way to get a standardised rfc compliant url is to parse and unparse
parse.urlparse("content.com")
# vs
parse.urlparse("https://content.com")
It's a pain in the ass to work with for situations like this, and I'm not sure what problem we're trying to solve here
!e ```py
from urllib import parse
print(parse.urlparse("content.com"))
vs
print(parse.urlparse("https://content.com"))
@fallen patrol :white_check_mark: Your eval job has completed with return code 0.
001 | ParseResult(scheme='', netloc='', path='content.com', params='', query='', fragment='')
002 | ParseResult(scheme='https', netloc='content.com', path='', params='', query='', fragment='')
have fun parsing that
this is why I would use it and then reparse:
Construct a URL from a tuple as returned by urlparse(). The parts argument can be any six-item iterable. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had unnecessary delimiters (for example, a ? with an empty query; the RFC states that these are equivalent).
Arl, what problem are you trying to solve here
its a small thing, but if its not worth it, its not worth it Β―_(γ)_/Β―
true
lol testing it and pydis has a lot of redirects
it probably goes to pythondiscord.com followed by www.pythondiscord.com
yep
what i don't understand is how this is only 2 redirects
I would think there's 3...
left review
pydis.com/coc -> https://pythondiscord.com/pages/code-of-conduct/ -> https://www.pythondiscord.com/pages/code-of-conduct/
Count arrows
ohhh, right, that makes more sense
why do we need sir-lancebot#969 the footer already shows when it was last updated
F I didn't link the discussion
@short snow edited it on the issue, also here #dev-contrib message
additionally, the reasoning is in issue 967, https://github.com/python-discord/sir-lancebot/issues/967#issuecomment-985756194
not yet, no
probably worth adding
I could make a pr to migrate just those to the bot
but felt out of scope of that pr
although bot#1721 exists which is refactoring the time utils so felt like holding off, and we can standardize more of the times at once
don't think that's going to be merging anytime soon, so not worth waiting for it
additionally, botcore will hopefully be ready sooner, so migrating stuff from bot isn't good unless used in more places
botcore still has a decent way to go, shouldn't be blocking any decisions right now
don't get me wrong, I'll implement it if someone says to, but that's why I did it manually rather than migrate a util
we'll let people know once that's the case
if you want me to migrate the util, I can easily do that
yeah i understand that π
@short snow I don't want the action of setting the name to come before we log it. If something goes wrong we'll have no log of what invoked it.
Also I'm sure if not duplicating one line of code is worth it. I think the code is readable and follows a logic that makes sense. In general, I'd rather suggestions to PRs have some sort of benefit or purpose.
Sure π
what comment?
I've already changed the tense, I just haven't pushed those changes to github.
I got earlier feedback on it.
I'll look into the code soon, all my dev stuff is on linux (am on windows)
neat, I'm excited for the merger
one of the `s got cut off from the first commit with the ... and then combined with the rest
ahhhh
π₯Ί
Here's your reminder: 8H this
[Jump back to when you created the reminder](#dev-contrib message)
I found something wrong with Python 3.10's Error message
Can I post it here??
By Python 3.10 you mean the bot?
Wait there is no bot like that nvm
There used to tho
No, the language
This channel is discussion for Python Discord's project, not the language itself. Any bug reports should go to https://bugs.python.org, or if you're not sure if it's a python bug specifically, feel free to ask in #python-discussion or #internals-and-peps.
Feel free to ask about it in #python-discussion or a help channel and we might be able to explain what's happening too.
ok thanks for letting me know
Here's your reminder: read this
[Jump back to when you created the reminder](#dev-contrib message)
@vale ibex so I do agree that the error message for not being on the leaderboard should be a bit nicer. Mentioning both "run .aoc join and that the leaderboard takes 30 minutes to refresh" but I don't actually know where that error starts/propagates from.
There are a few helper functions for pulling the leaderboard and I didn't dive into troubleshooting where it actually starts.
_helpers.py line 218
!remind 5H this
Your reminder will arrive on <t:1638650597:F>!
!remind 5H this
Your reminder will arrive on <t:1638650612:F>!
@vale ibex Adjusted error embed to add some more info and I incorporated your other suggested names. Should be good to go~
noice π
One thing I'm not quite happy about but what take some more time to think about it, is if someone recently joins the leaderboard, links their account, and then tries to call the leaderboard with no argument. It'll error on them until the leaderboard refreshes so there's no way for them to pull the leaderboard without specifying someone else's name
Hmmmm, yea
An easy fix would be to just not error if no arg was given, and we're inferring name from link
but that's still not ideal
the best fix would be to not error for accounts linked since the last refresh, but would require storing when accs were linked
we could just use a volatile list for it actually
and just live with the fact that if lance reboots it might happen
Hmmmm, I think for the announcement I'd like to make today I can say "once the leaderboard refreshes and you've verified you're on it, then link your account" to avoid this not-quite-so-edge edge case
I'm gonna look at adding <@&916691790181056532> role to people when they complete the stars
could look at that the same time
We landed on the idea of giving it to people who have completed all the stars so far with a 12hr grace before we remove roles for people to have a chance
and then leave it running until Feb or so
I'm fine with that, sounds like fun motivation finish regardless of leaderboard placement
should be 24h grace, unless you mean 12h from when the next day starts
Do you want me to hold off on the announcement until this feature is ready?
nah, go for the announcement, I don't think I'll have a chance today to do it
okay cool cool
Nah, 12h from when the new stars are available if you don't have them we remove the role
and when you complete, we'll add
just to show people who have completed the stars for today
sir-lancebot#969 π₯Ί nother lb buff
Seems fine from just looking at it, can test it later/tomorrow
working on a metricity issue while I have time today
π
does the new .aoc link command filter out @s?
.aoc link @fallen patrol
:x: Please use #aoc-bot-commands for aoc commands instead.
@fallen patrol doesnt that let the bot ping everyone?
<@&267628507062992896> ^
Probably not
allowed_mentions is a thing
we use allowed mentions
yeah
defaults to nothing, has to explicitly say if it wants to ping people
π
that's not true
yes it is
no, i have evidence it isn;t
not a discord default, but we certainly set it on the discord.py client
we might allow user pings, definitely not roles or everyone/here
I just tested and it doesn't work so it's fine @fallen patrol
@patent pivot can you open dms?
well, could I submit a pr to make it not allowed to mention any users, preventing this, at least (with a lot less urgency, ofc)?
or switch that output to an embed
itβs by design, users is a significantly smaller vector than roles/everyone and we already filter on mass pinging which youβd need in the first place
I remember previous concerns of members abusing commands that mention other users when they had been blocked, or to annoy other members
we do not want to default to users off
yes, but while there is a code solution for that there is also a ban hammer
true lol
@magic arch should the additional quote parsing be removed from the leaderboard command?
the link command doesn't have that additional quote parsing, so there's now a slight difference between the two commands
No. Because people are used to having to use quotes for the leaderboard command and I'd like to keep it for the remainder of this year
well, the quote command is different so its a bit odd, imo
oki
people can deal with it, not a huge deal like kat said π
π
Here's your reminder: this
[Jump back to when you created the reminder](#dev-contrib message)
Here's your reminder: this
[Jump back to when you created the reminder](#dev-contrib message)
!remind 1D I hope I'll actually get to this at some point
Your reminder will arrive on <t:1638737442:F>!
Hey would anyone want to work with me on sir-lancebot#937 + sir-lancebot#956? Feel free to DM me if interested, thanks!
Preferably someone who is good with Pillow
So the result of !user says "too many to count" if someone has a lot of activity blocks. But I want it to say "all of them"
I could make a pull to change that
I think we'd both get in trouble
oh lol i thought you were asking someone to do it π
I'm not calling the shots here. I'm just saying how I want things to be.
hmmmm
this intentional?
Only the person who called the command can interact with it, that's an intentional decision
so there's no error like the subscribe command?
like, was letting the interactions fail intentional?
rather than showing an ephermal error to the user
Probably just less work
This seems like a good utility, or if it raises an error, a global error handler
Yes, exactly. Only the interaction fails, so the person who issued command will still be able to interact with the view itself.
As for the error message, it could have been added, I admit. But the person who's trying to interact with a view origined from another user, gets this (small) error message anyways.
I think it should be implemented as exception and handle it in error handler
the difference is that "This interaction failed" makes it look like the bot is broken
This interaction failed doesnβt give enough information to user.
I agree. I admit I should've added it.
Although, I don't think we should go above sending an ephemeral response.
I addressed the problem in sir-lancebot#973
hi
1 suggestion) 2048 game on @dusky shore :D
suggestion 2) and updating the tic tac toe to use discord buttons (3*3)
suggestion 3) Enhancing tags to command to add button syntax mapping to links, for eg:
:button <link> text
That 2048 game seems like it generates the images of the board, if so would be fine as long it's not too resource intensive. tic tac toe, with buttons sounds good π
Ok that's it, thought of putting them here before opening issues
Adding more meta data to tags has a PR open iirc, while it doesn't do exactly that, it does add some of the things that you may need
#bot-commands message like here the computerfile video could go into a button, many tags reference a link so it might be good
should i open issues for them?
Yup, sounds good π
out of the 3, I think the tac tac toe one may already have an issue
so just have a search first
okay π
Can we guarantee it looks correctly on every platform?
Hey. I want to contribute an event to the AOC in Sir Lance Bot. What should I do?
I'm not sure if we have any aoc feature avaiting development (CC @thorny obsidian)
Did you have something in mind, or were you looking to generally help out?
I had something in mind...
which was....
I just want to make it such that #advent-of-code-spoilers-archive is locked when the puzzle starts and unlocked when the global leaderboard is full.
Yea that sounds reasonable, are you familiar with the sir lancebot project, or discord bots in general?
Ah alright cool. All of the AoC related code is in this directory https://github.com/python-discord/sir-lancebot/tree/main/bot/exts/events/advent_of_code
So where should I put this code, because it will work 24/7.. I guess.
it would probably make the most sense to hook into the task we currently has which notifies when a new puzzle is available, that's here https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/events/advent_of_code/_helpers.py#L566
bot/exts/events/advent_of_code/_helpers.py line 566
async def new_puzzle_notification(bot: Bot) -> None:```
The usual process is to fork the repo, work on a branch of that fork with the code changes, and then PR it to the main repo. After a review, and any fixes that are required, it will be merged into the main code, and @dusky shore will be redeployed with those changes automatically
Okay, Thanks. :)
There's a setup guide here for sir-lancebot https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/
A guide to setting up and configuring Sir Lancebot.
By the way, for which all roles should I lock it?
Ideally..
Can probably do it on the everyone role
And the global leaderboard data?
(π
Contributing to sir-lance bot for the first time, so I don't know which variable stores that..)
That's in a redis cache in _caches.py
The fetch_leaderboard funciton in _helpers.py parses the cache and returns it
So when it's value == 100: the global leaderboard is full and the channel is supposed to be unlocked.
Hmmm, I'm not actually sure if we have the global leaderboard cached or not
Ah, no it seems like we don't
Honestly, it might be easier to do it based on a timer, rather than the global leaderboard itself
since that would reduce the load we put on the aoc website
Hmm, we can say for 30 minutes. Since, the global leaderboard is full till then.
Yea
Something to keep in mind is that our bot isn't guaranteed to always be running, since if new code it pushed, it will be redeployed with those changes
Since you'll be waiting for 20 minutes, and then unlocking the channel, there's a chance that during those 30 minutes the bot restarts, and that task it lost
So, I'd suggest that on startup of the cog, we check if the channel is locked, if so, we check if it should be locked, based on the time. If not, then unlock it
This is on top of the 30 minute timer to unlock too
So, what I have to do is
When notification is sent, lock the channel, then asyncio.sleep for 30 minutes. Then unlock it.
After that, in the startup of cog, we'll check if the channel is unlocked. If it is locked, then we w'll check if the time is 30 minutes after midnight EST. If it is, then unlock the channel. If it ain't.. maybe asyncio.sleep for that much time..
yup, that sounds good
The first part being the main feature, the second being a safety check to protect against restarts
Yes. Now I need to figure out where to put it..
The __init__() of the cog in _cog.py is where the reminder task is created
that would make for a sensible place for the safety check
I was actually planning to open an issue about that once my 2 current PR's are merged
This is a good idea too, maybe we can both work on this together once my 2 current PR's are merged
We could work together on this one too if you want
Also bump
@vale ibex We can't automate the locking of that because it would request the global leaderboard too frequently. It's something I specifically didn't do.
Yea, which is why I just suggested doing it on time a little further down
I don't want to do that either.
So we just lock the channel for 30 minutes after the puzzles are available
If global takes 10 minutes to fill, for 20 minutes that channel is locked for no reason with a lot of good discussion not able to happen
As it stands there are maybe 10 people in this server who are fast enough to get on global and they're aware to not share spoilers until it's filled
It was a very concious decision to not automate the locking of that channel.
So is the whole idea of locking the channel while the leaderboard fills up not worth it at all?
but rather, just have it be policy not to discuss current stars while the global board isn't full
That's always been the policy, yeah.
Ah alright, I think the channel topic is the only thing causing confusion here then
Since it implies it's completely locked out, rather than just being policy
I was experimenting with the channel locking the year and decided it wasn't necessary. I haven't updated the faq or channel description yet though
Alright cool, seems reasonable to drop it then
So... I'm going to modify somethin else then..
Any specific issues that I could look upon?
I've actually been working on a 2048 game myself this week so could you @ me in the issue? I might be able to look into adding to the bot
If you want to work on something AoC related, I can write up an issue for something I've wanted to have~
sure
@austere hornet Will do, and I am not sure about working together as I won't be opening more PRs until I get the current ones in a merging state
Alright, sounds good
@idle delta So I was thinking of having a command .aoc mystats and that will show someone's times for day and star so far. It will also show their position on the leaderboard for that given day. Essentially this page, but customized for our leaderboard! https://adventofcode.com/2021/leaderboard/self
.aoc link should check if the input is formatted as a Discord mention and throw an error if it is
Hmm, that sounds like a good idea
had the discussion yesterday, was deemed not necessary #dev-contrib message (starts there)
Ah well there you go
I don't mean for the purpose of stopping pings, but for accidentally setting a Discord mention as their AoC name
I've seen multiple people do it already
We could opt for more checking in the name provided for linking, although I wonder if that's an effort in futility, because people will always find new ways to misinterpret it and somehow link the wrong thing
That's another option, although it might annoy people if they need to wait 30 minutes for a leaderboard refresh before they can link
Oh, I don't mean to check the leaderboard. I don't think I would ever want to verify it against the leaderboard without a fundamentally different approach to how we do this. I just mean also including checks for quotes and other common missteps
Ahh gotcha, yeah I agree
@vale ibex could I make a pr on python-discord/modmail to bring the development branch in par with kyb3r and add the ci workflow? π
nvm lol
oops lol i thought there was a confirmation stage
development branch is still behind
hmmm yeah we should see if we can adopt any meaningful things from development into master
Is the fetch bug something to fix upstream or something to patch first?
what's the fetch bug
I can't open a modmail thread because I'm not in modmail's cache.
oh lol that's fuckin weird
π
hmm, we can fix it on our branch and then PR from python-discord to upstream
you can PR from an org fork
lol i just talked to chris about this
development got a recent bump to discord.py v2, and a few other nice buffs
yeah, I suspect there may have been users who this bug also affected but probably didn't have enough stake/care enough to follow up on why there wasn't a response from modmail
I was about to try and troubleshoot, and write a pr for modmail, actually
although you'll need to apply the fix to the development branch, and backport it to stable if you wish, if you intend to send it upstream
given that the methods in question had some refactors in the development branch
yeah, makes sense
lol whoops i opened a PR from python-discord to kyb3r
When upstream merges, we can drop commit to avoid conflicts
joe stop clicking things
i'm good, nothing major fucked up yet
key word: yet
lol
Here's your reminder: I hope I'll actually get to this at some point
[Jump back to when you created the reminder](#dev-contrib message)
same, i had it myself, and realised i didn't have it configured so it wasn't doing anything
pyproject.toml line 30
flake8-bandit = "~=2.1"```
(not that its doing anything there since I don't see configuration)
never used bandit and generated a baseline, don't be pendantic.
lol
thing is, I ran bandit seperate from my pre-commit hook of flake8-bandit, and got 150+ errors, so like, I don't think its doing anything on site except requiring extra dependencies
....think I could make a pr to site to remove it?
!remind 6D too much going on
Your reminder will arrive on <t:1639256159:F>!
no
I don't know what you're referring to, but it is working
question: would it make more sense to just edit the repo to make development the default branch? /gen
when I run bandit -r . I get 2 low priority issues
one is inside a tests directory and so is excluded
the other is excluded with a # noqa: S105
oh actually both have explicit excludes
bandit and flake8-bandit are working as expected and I would like to continue having them on the site repository
π
these are the only issues
I must be mistaken or something lol
okay yeah
when i run flake8-bandit, it doesn't return any of these issues
(this is my project)
all of them are assert statements which would be removed by optimised compiling
but flake8 passes Β―_(γ)_/Β―
@patent pivot
uhhhh
we build the image off master, and having development means that we can make any necessary changes before code goes in
master will stay as default branch for now
were just these the conflicts you fixed?
no this was on site
unrelated
the way I resolved conflicts was just regenerating the bandit baseline
π
okay, bandit is working, but i can't get flake8-bandit to work-- that's why i don't think its doing anything
i-
I'm an idiot
working fine here
hmmm, looking at the code now, it shouldn't reach that line
so it might have already been fixed
def check(topic):
_, user_id, other_ids = parse_channel_topic(topic)
return recipient_id == user_id or recipient_id in other_ids
channel = discord.utils.find(
lambda x: (check(x.topic)) if x.topic else False,
self.bot.modmail_guild.text_channels,
)
if channel:
thread = await Thread.from_channel(self, channel)
So channel will only ever be truthy if there is a text channel with the user's ID in it, in the correct format
so, it should be fine now
I'm gonna bump the hash in the manifest and redeploy
if it's still broken, at least we get a new traceback to investigate with since the code has been moved around slightly
do you need me to test it?
Yea, that would be useful
I'm just kind of tooling around while I wait for my model to train
(my model will be training for a bit)
huh, modmail is using a git repo in requirements.txt but doesn't have git installed on the image
@fallen patrol have you ever been able to successfully build an image after pushing to d.py 2.0?
I've never built an image lmao
nice
since that's not to our modmail
and for our modmail, we don't push logs since it's a fork and shouldn't really be altered from upstream too much
Ahh I see
different modmail when /s
preferably soon, kyb3rs isn't the easiest to troubleshoot
@patent pivot you still around? kubernetes#110
We should keep in mind that when we want to fetch from upstream again, we probably want to do some rebasing and cleaning up
:white_check_mark: Restarted deployment modmail-bot in namespace default.
wait, it'll auto deploy won't it
or do we not do that for altered manifests
cluster says no
?about
now we wait
This is an open source Discord bot that serves as a means for members to easily communicate with server administrators in an organised manner.
0h 3m 6s
897.38 ms
3.10.2
kyb3r, Taki, fourjr
DOCKER
Follow the installation guide on GitHub and join our Discord server!
This bot is completely free for everyone. We rely on kind individuals like you to support us on Patreon (perks included) to keep this bot free forever!
Checkout the people who supported Modmail with command ?sponsors!
nothing so far
you could try and figure out why but that would be a waste of time given the convoluted internals
Yea, I'm not gonna bother
ah
ModuleNotFoundError: No module named 'lottie'
modmail missing a module
it's just....not in the requirements???
huh, is it using that for stickers?
wtf
yea, we've pulled in modmail development, since it has a possible fix for the issue you're seeing
first it didn't have git installed in the image, and it was using git to pull d.py
and now lottie just isn't in the requirements
honestly... kind of sounds like a 
ok, latest version installs fine
ah nice, now it's ModuleNotFoundError: No module named 'cairosvg'

guess I'm whack-a-moleing their requirements.txt
12/05/21 22:09:10 __main__[1718] - ERROR: Unable to import cairosvg, report on our support server with your OS details: https://discord.gg/etJNHCQ
great
same error forcing with --platform=linux/amd64
Added lottie[pdf]==0.6.10 to requirements.txt
i was there for this discussion
same error
...did you pull the updated development branch from modmail?
yup
commit c16ff261f204f5831da577d26a011db5d65d4610 (upstream/development, development)
Author: Yee Jia Rong <28086837+fourjr@users.noreply.github.com>
Date: Mon Nov 22 20:21:56 2021 +0800
Optimise Stop pagination
latest commit
can you check that you have a 64 bit version of python
yup, sys.maxsize returns 9223372036854775807
i said they shouldn't generate lottie stickers....
ugh
what this library does is it allows lottie stickers to be generated and shown in chat
i'd honestly just remove its features @vale ibex
what did they change again
@vale ibex mind if I revert the version bump?
so we get modmail back and running in the meantime
2f762025d07c26092e90a2e4f5e45e5d6900364d
revert this commit: https://github.com/kyb3r/modmail/commit/2f762025d07c26092e90a2e4f5e45e5d6900364d
I swear to god I'll yeet those people out the building
lmao
who lol
the modmail maintainers
they don't use docker for the hosted bots
that's why they didn't realize they broke it
could they literally not add a docker build step to ci π
I just asked internally why they don't
!remind 3d
Your reminder will arrive on <t:1639002394:F>!
kyb3r/modmail#3098
I did it for them
alright, I've fixed the lotti issue
now onto ModuleNotFoundError: No module named 'six'

Wait what isn't modmail down? why do I see that it's online?
not push, just to try building it
oh
that's caching, reload your client and you'll see
Ahh
@vale ibex ... the pipfile is good. Just need to export the requirements with pipenv
Could you
git checkout afc3051bd1a9df7ef6741874b28b233c4ec5447a
kubectl apply -f namespaces/default/modmail/bot/deployment.yaml ``` @vale ibex
I am getting forbidden on patch π
Ok that worked
could you do that for me? I don't have pipenv setup
you do not have the most recent development branch.
this has six, lottie, etc
this is not what you have.
I no see them
lottie isn't there
lottie, that is
six is actually in my requirements.txt
but still getting that error
six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
OK Chris won't roll back modmail π
I have
i think he did, but it takes a bit to deploy
arthur deployments redeploy modmail-bot
:white_check_mark: Restarted deployment modmail-bot in namespace default.
inherent slowness of kyb3r's bot
I was doing the manifests
good
gimme a minute, maybe
Ok looks like it's up now
It's the plugin download and setup we've found
so if the download cached the files, you would be able to mount that as a volume, and be able to persist the cache, keeping the boot time quick
obviously, the bot would need to support and use the cache as well
just asking for myself
This is an open source Discord bot that serves as a means for members to easily communicate with server administrators in an organised manner.
0h 3m 10s
38992.67 ms
3.10.2
kyb3r, Taki, fourjr
DOCKER
Follow the installation guide on GitHub and join our Discord server!
This bot is completely free for everyone. We rely on kind individuals like you to support us on Patreon (perks included) to keep this bot free forever!
Checkout the people who supported Modmail with command ?sponsors!
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
alright, seems to be good now?
just dm it and it'll talk to you (this is a joke don't actually do it)
actually its fine to dm it once, just don't react to the check
π if you aren't in the cache you can DM it as much as you want
hopefully not soon
oh hey, it is using 2.0a0 now?
no.
45d498c1b76deaf3b394d17ccf56112fa691d160 isn't the 2.0 hash?
I dropped the env above
Yup, using it now
so we pushed the dev branch to prod, that's what has been happening?
I don't have the bot set up right now, tho
getting the same issue with cairosvg, so working through it
yep
me and joe and chris
it better not be using Py 3.9+
I am going to scream, it is
oh god
most wheels are missing
It is lacking a few other stuff though
not sure if that's the problem, tho, is it?
I'm getting some error when trying to pipenv sync locally
the issue that someone had with cariosvg is this:
both the bit version of Python and GTK must be 64
this was someone self hosting on windows, so ymmv
side note: the logviewer will need an update as well: https://github.com/kyb3r/logviewer/pull/44
taking deep breathes
this might fix the lottie issues temporarily, which would at least make 2.0 runnable
that commit added all of the lottie support for stickers, which IMO its not that important if you get to see the image or not
cc @vale ibex
Let's see if we can make it run
Lmfao
doesn't cost us much to try
well...gtk isn't even being installed onto the image at all
let alone 64 bit version
lmfao
only a modmail bot that doesn't run for a little bit, but who cares
lmfao
it is running
not if it fails with needing missing libraries again
@slow bone is up
like I just said, there is no rush
i think the reason we were bumping to dev is to see about fixing that uncached problem with dms
it is
which is a bit of a rush (IMHO), as who knows how many people can't dm the bot because they aren't cached
but yeah, i agree
@vale ibex not important for now, but I updated the clean PR
Alright, I've got cairosvg working again
but now it's back to saying six doesn't exist
I have the bot running
just regen the requirements.txt and switch the base image to python:3.9
lemme grab a token from somewhere
try just reverting that commit lol
at minimum, that should make development runnable
I just said I got it working 
oh
I'm still getting ModuleNotFoundError: No module named 'six'
is the base image 3.9?
Even though six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' is right there in reqs.txt
yes
plz try reverting that commit
We're not going to drop a commit from upstream to try and patch it being broken
either we fix the issue upstream, or backport the fix
no, i mean try reverting temporarily, to see if that's the bug
oh my god please modmail
its been a problem for other users too, that i want to be able to raise it being an optional feature and dependencies
Alright, I've got it running now
so if you can successfully run the bot without that commit, it would help me to convince them to make it optional
Err, why not just run it yourself?
or if you can run it with it, that would also be nice too, since i can bring the steps that you did to make it work internally
most of this is docker related, which I don't use for mine, and I currently don't have it set up Β―_(γ)_/Β―
Well I'm sorry but I think there are more pressing matters right now
yes that commit will fix it
but that's not what we're trying to do
so what are you trying to do, then?
alright it seems to be working alright, gonna push the fixed to the fork
lol i'm afraid to see them
It's just relock reqs and remove -slim
it already ended that way once....
lol i get the same missing cairosvg version even out of a dockerfile and after manually installing it to the same venv!??
arthur deployments redeploy modmail-bot
:white_check_mark: Restarted deployment modmail-bot in namespace default.
?about
This is an open source Discord bot that serves as a means for members to easily communicate with server administrators in an organised manner.
0h 37m 17s
107.07 ms
3.10.2
kyb3r, Taki, fourjr
DOCKER
Follow the installation guide on GitHub and join our Discord server!
This bot is completely free for everyone. We rely on kind individuals like you to support us on Patreon (perks included) to keep this bot free forever!
Checkout the people who supported Modmail with command ?sponsors!

did you pin the version, or something?
do we even have logs anywhere for the modmail fork
wdym?
webhook I mean
