#dev-contrib
1 messages ยท Page 156 of 1
but I've changed it to ping now
just dev testing
depends on the context
simpler can be good, unless there's a good reason for convention
alright, small PR to improve ux for the subscribe command bot#1985
!help reminders
!remind [mentions]... <expiration> [content]
Can also use: reminder, reminders, remindme
*Commands for managing your reminders.
The expiration duration of !remind new supports the following symbols for each unit of time: - years: Y, y, year, years - months: m, month, months - weeks: w, W, week, weeks - days: d, D, day, days - hours: H, h, hour, hours - minutes: M, minute, minutes - seconds: S, s, second, seconds
For example, to set a reminder that expires in 3 days and 1 minute, you can do !remind new 3d1M Do something.*
Subcommands:
!remind delete <id_>
Delete one of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> [content]
Set yourself a simple reminder.
Nice
Yea, just pointing it out since poetry run task test is a lot longer than just plain pytest
In bot we have it since we add a bunch of params for xdist and code coverage
and retesting config
which aren't even necessary, either
addopts can be configured to always run with those params
core devs: might want to comment on the open api PRs so no more work in being put into them, no?
I just realised, those aren't comparable
poetry run runs it in the environment, pytest must be ran within the environment as well
so its only comparing task test to pytest
if you're running pytest, its either already in the venv OR poetry run pytest
and task test and pytest are about the same length so
!remind 90M review this and api-18
Your reminder will arrive on <t:1638406149:F>!
small pr to fix the hanukkah command before hanukkah is over, since its currently live!
sir-lancebot#959
only one more review needed ^^
@fallen patrol what do you mean by no labels added to the pr yet, tho?
triage
PR labels are mostly just for categorisation, rather than functionality
:facepalm:
unless its the Do not merge, or needs devops
i have been out of it today lol
๐
oh lol i have sir-lancebot#950 also open--needs one review
deleting code, nice
yep
nice
as there is no trashcan, its clear that lance was killed while I was paginating ๐
100% that's why I used to think that lance had a slow paginator
yup it is ๐
If anyone's in my test server, could you test the .aoc link command?
Zig modpings ๐
hm... I actually found a decent use case for the walrus operator in this feature and it's readable
What's the use case?
Depending on the case I think I have a few cases in my code where a walrus could also benefit from the usecase you had the walrus operator for
usually I've just used the walrus operator for truthiness checks like:
if role := discord.utils.get(guild.roles, name="Role Name")
Very similar to that. I'm checking to see if something exists in a cache. If it does, I want to use it.
Ahh, that's one of my favorite cases of the walrus operator, a lot better than:
if truthiness_check:
item = truthiness_check
Here's your reminder: review this and api-18
[Jump back to when you created the reminder](#dev-contrib message)
Hey can someone peek at sir-lancebot#962? It should be an incredibly quick fix and it'd be awesome to have it live before AoC day 2 opens.
You can put them into "" though
True, but that seems unnecessary complicated for folks who don't know that when it's the only argument
Hmm yeah, you could probably just PR IMO
A PR likely won't get reviewed and merged in 90 minutes by a core dev. But I'm fine with PRing this in general, so consider this approval.
yeah, chris is asleep (or at least not online)
Fair enough, and if it doesn't happen before day 2 then so be it, still a good little thing to have soon imo
hey if i pr it then you'll only need one review ๐, since you'll be able to review it
I already have lance up and running for a few feature reviews, so it's not the contrib review I'm concerned about
Plus a core dev would need to review and merge either way
oh, didn't actually realise that a core dev had to review everything
thought it was 2 (authorized) people or a core dev
Yeah it's 2 staff and a core dev ๐คทโโ๏ธ (core dev also counts for staff)
If it's not a tag speedrun, then you need a core dev + 1
two staff/contrib reviews, one has to be a core dev
one staff + one coredev
Some changes require specific admin approval too depending on which repo and which features they're changing
both scale and joe should be asleep and this is not urgent enough to ping over. Xith is busy enough as it is
imagine sleep
loll
go sleep
ugh, I have no good way of splitting this feature into more than one commit
or stay for like a few minutes if u wanna review something lol
ah ok
so should you
no
i won't review ๐
well it is done, everyone wish the pr good luck! sir-lancebot#963
It does have the effect of .aoc lb "My Name" no longer working and people have already gotten used to that
true, maybe we can strip quotes? not sure if it's valid for aoc usernames to have quotes
I think the solution there would be to see if starts and ends with " and if so, it strips just that from the ends
gotcha, will do really quick
what if someone's name has" at end and start lol
can you show an example?
lemme try
can't see a single " in our 700+ people on the leaderboard, so my guess is no but idk
Because I don't know of anyone's AoC leaderboard starting and ending with " since the name comes from one of the Auth methods or you select Anonymous #121312
although there is ๏ฟฝ so there's that
how do make it choose your github name, not username
it = adventofcode
i had seen eivl paste a screenshot containing his github name
These are the only options I have
It comes from GitHub when you Auth I'm pretty sure
Right, so people can. Who does though?
And they need their Github name to be that and they need to Auth with their github name being that
๐คทโโ๏ธ
I think having a QoL feature that works for 99% of people is more important than the odd person sticking quotes in their name
yeah
technically if that happens they can just go like ""Shivansh"" and this'll work for that 0.01%
but then that odd person won't be able to use it
no i'm saying they can with two double quotes on each end instead
it'll only strip one pair of quotes
hmm maybe
if self_placement_name and self_placement_name.startswith('"') and self_placement_name.endswith('"'):
self_placement_name = self_placement_name[1:-1]
like this, if self_placement_name is passed as ""Shivansh"" it'll turn into "Shivansh"
yeah just super rough code to test it first lol
actually looks like it might have to be ands, otherwise it doesn't check self_placement_name first
that arg can be none, None.startswith raises an error, etc
yeah i was just writing that lol
and instead of .starswith/etc you could self_placement_name[0] == self_placement_name[-1] == '"'
ah true
just getting set up to add our staff lb in there so I have a two word name to actually test
and shorten the var name ig lol
maybe, should we change that arg to just username maybe @thorny obsidian?
yeah just call it username or aoc_name
yeah aoc_name is okay also you could make it a single line if you are changing the name
left new review
also might go back to startswith/endswith for readability if its shorter now
there's also these two in the stdlib now https://docs.python.org/3/library/stdtypes.html?highlight=str#str.removeprefix
!d str.removeprefix
str.removeprefix(prefix, /)```
If the string starts with the *prefix* string, return `string[len(prefix):]`. Otherwise, return a copy of the original string:
```py
>>> 'TestHook'.removeprefix('Test')
'Hook'
>>> 'BaseTestCase'.removeprefix('Test')
'BaseTestCase'
``` New in version 3.9.
i think we just want to strip if they're at the start and end
๐
!remind 6H meta tag issue
crossref: #community-meta message
or make pr
Your reminder will arrive on <t:1638449648:F>!
It was mostly a joke
but it is true I didn't run it locally because
- I/we already tested it on chris' bot
- Two people already approved, it just needed a final sign off to confirm that's the two staff reviews are good enough
The main thing is that I didn't know how d.py 2.0a0 views work so reviewing that is a bit tricky
If I understand bot-core currently, we would probably move the extensions cog to bot-core right? Since it is something which is needed on both the bots
yeah I suspect we'll move things like that across
I don't see a reason why we can't do something like https://jishaku.readthedocs.io/en/latest/cog.html though and just pass in a bot core module
So even https://github.com/python-discord/sir-lancebot/pull/745 would be moved right?
probably, yes
ok ๐ Also if some coredev has got sometime, it needs another approval :D
@vocal wolf @molten perch @brisk brook Pinging since you have approved/have open feedback on it.
I've pulled sir-lancebot#778 up to speed with main and added a commit on top to fix an issue I found during testing
you fixed stuff just now?
yea
ah I see the force push
the last commit
thought you meant a different pr lol
roight
the final commit I just added
it should probably be tested again before merging
I've done some local testing but the merge conflicts were extensive
๐
oh right
I'm gonna dismiss your review just incase another core dev clicks the shiny green button
!remind 10h thing #dev-contrib message
Your reminder will arrive on <t:1638481109:F>!
very well
Alrighty, I'll get to it after school
Oh yeah, sorry. When I approved this we were not gonna remove the issue command, and such. (And I was not even a staffer back then) Iโll check it out as soon as I can.
Dorsan congrats on coredev btw
Nothing to be sorry about I just grabbed the names of people who approved it, since it was quite an old PR that needed rebasing onto main ๐
Hello, first time im in this channel, just checked the !contributing and it brought me here. So anyone can add anything in the sir lancebot open-source project? Are there any requirements? I mean, if I'm allowed can I try to implement a user vs bot blackjack game.... ?
The usual process is to create an issue on the github repo with as much information on what you want to make
Then we discuss it within the issue, until it gets appoved/denied
Once the issue is approved, we would then accept a PR that implements it
We advise you to wait until the PR is approved before starting work, since we don't want you to waste time building something that may be denied at some point
Of course, you can always look at the already open issues for things to work on too ๐
Sorry, what is PR?
A pull request, it's a concept in most version control systems https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
github pull request, basically they are merge requests which you open to repositories to merge your "code" in theirs
essentially you write the code, and then request maintainers of the main code to pull those changes into the source
chris can you review a PR on lance 
I've been slowly making my way through Github notifications, so feel free to request my review from github
unless it's a tiny PR that I can review quickly ๐
Ah I see, but I've checked a lot of the source codes in the bots, they import functions and other stuff I have no clue about, would an expert here help me with making the PR valid?
and when I mean import functions, its some custom stuff
If you get an idea of what you want to implement, and it gets approved
then we can help you out with implementation details ๐
You can always ask here with any specific questions you have
Okay, is there a link to where I can post an issue in the github? Also do you have like a template I can follow when describing what my idea is?
sorry if im being annoying
.src
!src
on those repositories, go to the issue tab
I wouldn't call that tiny haha, quite intricate changes
Thank you! ๐
sir-lance has templates so if you want to open issues on bot you can probably just copy over the template
I've added it to the list though
Add user vs sir-lancebot games where people can enjoy some games :)
Idk if this counts as cheating, but am I allowed to ask if this would be a valid title for the issue? or do I need to be more specific?
Yea, you need to be specific to what you want to add.
What if I want to implement 2 games? Do I make 2 issues or the 2 games in 1 issue?
2 different issues
since one could be approved whereas the second doesn't
and its easier understanding the discussion
Alright thanks, what does proposal mean? Isn't it marriage?
It's in the template "description proposal"
describe your proposal, describe what you are wanting to add to sir-lancebot
Ohhhh sorry, okay thanks!
@short snow(sry for ping)
## Proposed Implementation
<!-- Detail any implementation you had in mind, including any screenshots if possible -->
I don't understand this one
how would you want your suggesiton to be implemented, like if you are making a issue for a tic-tac-toe game then we could probably include how the board will be looking, will it be using buttons/reactions. How owuld the tic tac toe leaderboard work
Oh okay, thanks
if you are fine with anything/haven't planned anything yet you can jsut skip that seciton
its optional
Oh alright
just helps the contributor who would be assigned to that issue (if it gets approved) better understand the issue to get some insight of what the issue author is asking
Here's your reminder: meta tag issue
crossref: #community-meta message
or make pr
[Jump back to when you created the reminder](#dev-contrib message)
!e @short snow ```py
my_optional_string = None
if my_optional_string and my_optional_string.startswith("a"):
print("something")
if all((my_optional_string, my_optional_string.startswith("a"))):
print("something else")
@vale ibex :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 5, in <module>
003 | AttributeError: 'NoneType' object has no attribute 'startswith'
ah, thanks ๐ didn't know about that
Yea I just ran into it a few weeks ago myself
after looking it its understandable though
.... I just realised something
and and or always return something
thanks for coming to arl's realisations
Almost everything returns something if you include None ๐
For a second I thought you were evaling Shivansh's ID lmao
hah
I do quite like that feature of the eval command
where it only evaluates code inside blocks if there are any
Ah I see
!e py a = 5 like this ```py
print(a)
@vale ibex :white_check_mark: Your eval job has completed with return code 0.
5
I love that you can eval across codeblocks
Aha
By far my favorite thing for illustrating points in help channels
yupyup
Mhm
I'm definitely taking inspiration from python when i make a really good eval command for my bot lol
which i haven't written because I'm still trying to figure out the best way
you could always fork snekbox and add additional language support ๐
while it may not be accepted as a PR upstream, it's a nice base to start from
๐ who told you
lol I was thinking about doing it myself a few weeks back
Just didn't have time for another project ๐
I was trying to do it, but haven't recently
problem is the language I'm trying to add only works on windows, so I have to use wine
so far I just haven't sat down long enough to try and get it to work
@short snow have you tested the .aoc link feature?
Statically linked into the binary using include_dir
Hmm, didn't someone wanted to build upon it to serve standard files
I guess it can be done in a second PR
might have been me with .well-known
nope, jsut code review as of now
some of your comments will likely be answered by testing locally
Because that worker can serve on any subdomain, like paste.pythondiscord.com
probably just the one you commented on, anyways i am going to bed now, will look into that tomorrow
This worker will be used to serve robots.txt files across our infrastructure.
The worker should be set on *pythondiscord.com/robots.txt. Each robot file is defined in the robots/ directory, the fil...
ya i'm just not sure how critical that is
It isn't, but the PR is two months old heh
Or do you mean how important it is to serve robots.txt on other domains?
on other domains
Wasn't that discussed in #dev-ops?
Gah, review auto-dismissal is frustrating sometimes
maybe, can't remember
hold on all API work for now
we're talking about the future of the project, will discuss publicly in due course
Will make the suggested changes to my lance PR tonight when Iโm home, thanks for reviews
bot/constants.py line 694
THREE_DAY = 4230```
where is it used?
bot/constants.py lines 691 to 695
class ThreadArchiveTimes(Enum):
HOUR = 60
DAY = 1440
THREE_DAY = 4230
WEEK = 10080```
!e print(1440 * 3)
@fallen patrol :white_check_mark: Your eval job has completed with return code 0.
4320
not sure, but its a typo
@clever wraith i think the reason its not day * 7 in the constant is because weird stuff happens with enums when that's done
not even sure ThreadArchiveTimes is used anywhere
Its probably worth keeping since thread support still hasn't been implemented or adopted by the server (in a public setting)
I'd assume it's really not worth keeping with the Discord.py constant that apparently exists
It is used
Look at the blame
I think it is used by the nomination thread system
I guess you want to rename to THREE_DAYS?
no, the math is wrong
Three days is 4230 minutes though
someone entered 4230 when it should be 4320
Oh right
... did you enter it ?
!e print(60 * 24)
@fallen patrol :white_check_mark: Your eval job has completed with return code 0.
1440
I didn't see the typo
That's probably worth a fix then, yes
You have ak's approval to PR directly, apparently
So have fun
Unless I'm crazy, I don't see where this constant is used
other than the section right underneath where it's defined
bot#1986
bot/exts/recruitment/talentpool/_review.py line 99
auto_archive_duration=DEFAULT_THREAD_ARCHIVE_TIME```
bot/exts/recruitment/talentpool/_review.py line 18
from bot.constants import Channels, Colours, DEFAULT_THREAD_ARCHIVE_TIME, Emojis, Guild, Roles```
discord/channel.py lines 726 to 733
if message is None:
data = await self._state.http.start_thread_without_message(
self.id,
name=name,
auto_archive_duration=auto_archive_duration or self.default_auto_archive_duration,
type=type.value,
reason=reason,
)```
discord/channel.py line 196
self.default_auto_archive_duration: ThreadArchiveDuration = data.get('default_auto_archive_duration', 1440)```
we can just cut that entirely
and instead, set it on the channel's themselves
ye
oh, I see
this is the default for the channel
honestly that's a bit dangerous lmao
if the server ever goes to level 2 boosting that feature will stop working
it shouldn't happen, but best to not plan on always having it
It's there so that we can use the shorter times in dev
since dev guilds won't have nitro boosts
also, just an easily accessible enum of options
I don't think that'd be a problem if the default is per-guild
I think essentially this solves a problem that doesn't really exist
channel default is 24 h
the constant isn't necessary IMO, just change channel defaults to 1w
er i mean, there's an indirect guild default of 24 h, since that's the default of the channel default
Yea, I see your point about it breaking if we ever lose level 3 boosts
however unlikely that is to ever happen lol
Feel free to open another PR removing it, just make sure to update the reviewer cog that references them too ๐
but granted, it also means that it could break if discord changes: "You now need boost level four for threads"
Yea
I feel like having the enum there isn't causing harm and could be useful for future
same
i'm about to open an issue on the fork i favour to add it
lol
fwiw, @vale ibex, they aren't accurate anyways
if you set, eg 1h archive time on a thread, it could be 1 hour, 10 minutes
so the typo isn't that bad, but the api would complain
hah good to know
erg, i've never set up bot
lol idk why i find this a bit funny
setting up the advanced thing is required for the intermediate thing
well, setup difficulty isn't contribution difficulty
If you use docker it's done for you ๐
I haven't gotten around to fixing my gpg problems so I can't right now
...wow I'm that lazy
@vale ibex making the pr, have you already changed the default of the channel to a week, or should i mention that needs to be done?
(this thing, in channel settings)
@patent pivot can you turn off the king arthur checks
thank you lol
totally didn't discover that by trying to do arthur deployments redeploy snexbox
:x: Redeployment aborted
:no_entry_sign: 'Tis but a scratch! Could not find deployment, check the namespace.
:no_entry_sign: 'Tis but a scratch! Could not find deployment, check the namespace.
it's fine
amazing
it just will never work, so no point allowing it to spam and click buttons again
no it's a non-existing deployment
@vale ibex so remind me, the first message in the cache is the earliest?
well i just learned about this
uh
why are there so many help channel prs?
nvm there's not that many
no, theres 3
sir-lancebot#953
this feels a bit overdone?
Like, I feel like help, ping, text commands, avatar, should continue to work in dms
The reasoning about forbidding DMs is that it can't be easily observated and moderated
I mean, does a help command have to be moderated??
and avatar commands?
serious question, btw
Avatar commands, I think so
Help channels it is mostly for observability
But I'm not a core dev
BOT_TRACE_LOGGERS according to the bot guide which I wrote myself lol
bot/constants.py lines 197 to 203
class Bot(metaclass=YAMLGetter):
section = "bot"
prefix: str
sentry_dsn: Optional[str]
token: str
trace_loggers: Optional[str]```
bot:
trace_loggers:
that too i think
just make a config system that doesn't care if its env or yaml ๐คก
That's the bot constant, not what should be set in the env file
Yea, it's BOT_TRACE_LOGGERS
It's a comma separated list of cog names
or, BOT_TRACE_LOGGERS=*
which I have in my env
its nice, I've been inspired by the idea and built on it for my own bot lol, although I might tone it down a bit
Is there an open issue currently for adding a few discord.py forks to the docs command, I'd look but mobile
not that i know of uh i'll check for you
Tyty
power moderator/shitposter of said forks smh
Shhhh 
Its mainly because more people are asking about them now in discord-bots so being able to get up symbols is useful
i don't see any open on bot or meta
well, the problem is namespacing, i think. Not sure if all of the forks changed from the discord namespace
Yeah that's my concern
The only one I'm positive won't break anything is disnake
Since the shim is optional
and dislash
actually they even recommend to not use the shim
is there really a good way to make a shim?
I can probably make nextcord releases that don't have the shim too
can I dm you?
Nextcords method is fairly solid iirc (I didn't touch it so idk) but the main issue is interference
I have some fork info that I don't want to share here
Sure
bot#1988
Might move it to meta
Sounds good
Here's your reminder: thing #dev-contrib message
[Jump back to when you created the reminder](#dev-contrib message)
hey you left me off of that, I reviewed too!
I only tagged people who approved or had open comments
there were a few others who reviewed too
(The first sentence of the message you linked)
@gritty wind why is it better that the __init__ silently fails rather than error (such as when you're developing).
No that's the thing, the way I did it it won't silently fail
I'm saying if we did it some other way, it would
Ah, I see.
should this be moved to @stable mountain?
reason: merging the autolink feature with that as well
clearly this pr should be merged, but after that, maybe it belongs on python
oof, sorry, I will have a lot of suggested changes
Hey do you have any more questions/suggestions or are we good to merge
which pr?
No I don't really see anything wrong but I was planning on attempting to build the documentation locally once.
No rush then
ah, botcore ๐
I just woke up a few hours ago, so I'll probably be around to merge it all day lol
Yup
Oh, well I am going to bed now ๐
So this was a "do tomorrow" kind of thing
@short snow hey, addressed your review in sir-lancebot#963 (and thanks @/arl)
That's alright lol
i have nothing better to do ๐คทโโ๏ธ
yeah that was fast ๐คฃ
Were you hoping to merge it soon?
I could take one last look (especially on the Sphinx configuration file and GitHub actions) and see if I can spot anything. (and have you merge it afterward).
Thanks lol
Wanna squash it or just merge
eh up to you, i have no opinion there tbh
Cool cool cool
awesomeee ty
.aoc_leaderboard Hassan Abouelela
mm not reconnected yet
.aoc_leaderboard
oh it's no _
wait now it's up
the few seconds while lance was down lmfao
#bot-commands
:x: Please use #aoc-bot-commands for aoc commands instead.
lance does not agree with you ๐
awesome all working
Good reminder to go do by aoc too
cough cough sir-lancebot#960
cough make me a contrib or helper and my review would count /s
actually, thinking of it, this isn't going to affect the leaderboard command anyway
lol i'm only on line 100 of the first file of lance#778 with 7 comments already
sorry for the work
.aoc lb is already restricted to like... 3 channels if that
Yea, I realised lb isn't actually a command that is allowed outside and would be redirected ๐
I can review that as soon as I finish this sticker
the PR only affects the ones that could be ran in #advent-of-code
oooo sticker ๐
I hope it's as artistic as this one
This is probably not the right channel for this, but @thorny obsidian I noticed that you have the "Partner: r/Python" role but not "Partners". Is it supposed to be like that?
.....github that is dumb
Lmfao
what just happened
I'unno ask @patent pivot, he's the one who gave me the roles
Lmfao
....uh lance
lmfao, tbf I didn't notice
that is a help command or error handler bug
I saw that I had access to the correct channels and didn't even bother to verify
You used .....github in an unauthorized channel, which not even a valid command
yeah
.github is though
@patent pivot are you at the pub again lmao
because i saw that in the channel list with #dev-announcements
anyways, the thing is that /repos/{org}/{repo}/issues/{num} provided a pull request works
/repos/{org}/{repo}/pulls/{num} provided an issue does not work
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.
Do only staff members have access to that emoji?
Nope, anyone can use it!
i think
Anyone can use it here, people with nitro can use it in any discord server
Gotcha
Same applies for all our custom emotes (that's how they work on discord)
ooh sweet i found a place which can cut down a request on github autolinking
this will half the requests made to github by @dusky shore when running pull autolinking
...oh wait, it doesn't provide draft info. darn.
ooh yes it does!
@vale ibex i left a review on sir-lancebot#778, found a place where two requests are used, except all of the data is supplied in the first request
so instead of lance making two requests per pr, only one request is needed
I also left an implementation example
uh
@gritty wind... it actually does count? https://policy-bot.pythondiscord.com/details/python-discord/bot/1990
lol
@brisk brook did you actually run sir-lancebot#745
When we are waiting for the guild to be available there isn;t a need to fetch channels right? Since the cache would already be updated and would contain the channel
uhhh
re-pull the image and re-build
i rebuilt the venv, but why did that happen?
Kat, removing it works (commented on github-)
yummy reviews
@thorny obsidian and @hoary haven I feel like you would know
I'm reviewing the patron pr rn and am wondering, should it be prepared for members to have multiple patreon roles?
It just needs to select the highest. The multiple patreon roles is only really a thing when a user goes from one tier to another within the same month iirc
yeah basically what kat said
well, it would be on the first of each month when it would be a problem
since the first of each month is when the info embed is sent to #community-meta
i tried to reproduce it but couldn't get it to work (bc it was during a month where i already had the highest role i think)
bot#1917 btw
first of each month should be fine because patreon should resolve it and remove one of the roles
i think when the 1st of the month came, my lower tier role went away
The only hellish race condition I could think of is if a person like... somehow upgraded during the patreon integration update? maybe?
huh, I accidentally refactored that problem away. I'll take that as an accidental victory. I'll update the PR in a bit when I finish this next part of my project
(off-topic here but we use the same shell/theme and I love it)
jeez, i should take a break
i've reviewed half of lance's and bot's open prs today
er, more than half
well time to look at site
inb4 kronifer asks for reviews
@vale ibex and @molten perch, as you both have reviewed bot#1889 i should probably let both of you know that it has been updated to use tldextract
screw you arl
lol
checks failed ๐
ah, i see now
idk i just feel like its gonna be an annoying thing to review
i havent contributed in a month ok im out of the loop
wow
and they were at the hospital yesterday
eh, everyone makes that mistake
(the one i left instructions on how to fix)
because i have seen it so much, even to go as far to do it myself
i- I'll put it this way
that's happened so much, I have a taskipy task.
There is really no problem with bumping all deps in that PR tbh
We modify them so rarely, and we don't have any alerts to keep us up to date
redis got bumped to 4.0.0
not sure, I was investigating the changelogs
I see only one breaking change, and it doesn't impact us
lmao
oh is my pr gonna mess things up?
its what i said about the poetry lock updates
but it might not be a problem, from what scale is saying
there's one minor change with rapidfuzz which may cause different results, but nothing major
tldr rapidfuzz wasn't computing a fuzz properly and now it does
Yeah?
nvm, I had missed an obvious line of code
I wrote up a whole thing on how there was discrepancies between coros and non-coros
then noticed its taken care of with an if action is load await else..
would someone drop a sanitised summary of why commands can't be ran in dms?
(cont from #community-meta)

so yeah, the two reasons is we want to have information if the command fails, and be able to moderate the result
that's why I think !user would be fine to allow
although I would like to make it clear that if we allow it it is because it will have another purpose in DMs
My reasoning is partly because of the debugging stuff, but also because running stuff in DMs means we have much less control over what's happening with the bot. We can't as easily figure out what's happening, and why. If something starts breaking because someone found a loophole, we have no way of dealing with it
But I really don't think being able to run this command in DMs is that much of a benefit
and actually, allowing user in dms brings some other issues, which are more implementation details. Specifically, the author would be a user obj instead of member obj
We can still just add it as an option on discord
we do have stuff like battleship running in DMs
hrmmmm, compromise?
Yes, but only for the game itself, and even then, not a fan
that's fine, we have the guild ID
!u infractions for instance could DM you
remove the infraction info from !user for non-staff
and then do what scale just said before me
That way we get the DMs aspect, without having to accept commands from DMs
in other news scale and I tend to think on the same page, apparently
that's a good compromise, I was thinking about that
๐
I mean, I've been saying it here and #community-meta for like 10 messages >.>
yup
i didn't see you say making a subcommand
I guess we could make it an option but eh
that wasn't clear to me ๐
I thought you were talking about making dm vs not dm an option
huh if it becomes a subcommand, it can become a bit more detailed with infraction information, if y'all want that
Do you mean like seeing the specific infractions?
We did discuss specifically allowing that in the mod team before
or summaries
Let me see where that weant
Its not like I have 8 infractions or anything plus a few notes
Actually, now I remember
its also not like I know exactly what they all are already including at least one of my notes
There are specific limitations that mean we can't send any past infraction text
Maybe infraction type, but that's as far as we can go
limitation as?
We usually edit the infractions afterwards with information intended for the mod-team
Since we don't store edits, we have no way of automatically going back to the original
I wouldn't mind changing the detail infraction per infraction
!note @green oriole test
:ok_hand: applied note to @green oriole.
I was hoping for an infrac number
just warn him then
I mean it is gonna be 100
oh, ID
oh shit i gotta go sleep
If we wanted to send the reasons in DMs in the future, we can start now recording the original message
But we can't make it retroactive
Showing like
Your total infractions:
Mutes: 24 (1 active)
Superstars: 1
Voice_bans: 6
Warnings: 49
doesn't sound so bad
that's what is on the mod embed, without shadow infracs
Yes, that's fine if we want to do it
yeah I figured
that's my infraction count if you are wondering
Superstars: 1
wait how many of these do I have?
I think only one, but eivl might have done a second one too
i was half thinking it was either yours or fake data
do I look fake to you? 
no
Count from [0:101:10]
That's the only true way to identify who's on the other side
This is a python server after all
no, never has been
that's python slice notation
0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
sorry, had to be pydantic ๐
have I passed your captcha?
Faaaake, a true frenchman would break out the calculator and a notebook for this
Though I suppose you're more italian
Conclusion: uncertain, need more tests

how long would it take until my issue is answered, looking in #dev-log others get answered very quick
ah okay, also one more question, i saw in the topic above us, what is a superstar?
^^
IIRC its when someone has a inappropriate name and moderators force a discord nickname to them which they can't change for a certain while (taking away their nickname change permission)
ahh alr
Ah also, if my issue is accepted, and i make a code for the bot do i get the contribute role?
what does substantial mean
It means several contributions over time, you don't get it over one.
Eh, not exactly
If that one contribution was really big, then you could get it for just that
But generally speaking, yes
Think of it similar to the helper role, you don't get it for helping one person once ๐
It's deliberately left open-ended so that it's at the discretion of the core dev team, rather than people saying "I've submitted X PRs so give me contributor"
Sure if someone built the entire API in a PR maybe, but even then I would count that as many contributions (many added features).
Yeah, true.
I wanna make a whole game system for Sir Lancebot, it would need me to add like 4-5 games and a main file off if it gets approved
What do you have in mind for a "game system"? We already have a ton of games, so I guess we kinda already have a system?
That's cool, I am not a core dev - so I am not one to say whether you get the contributor role from that. You'll just have to see afterwards.
dead?
Yeah I just wish it gets acceptes, it will be my first contribute ever in my life and first time i actually work with github, it would be a great experience and ngl i look forward for it ๐
We are not going to be continuing it, though an official announcement has not been made
uh im on my phone its har to write mich but like i wanna make a blackjack game, battle ship game, the 4 in row (idk what its called) and a few other games where players can play against each other, each win gives you x amount of chips and these chips can let you upgrade stuff like โ15% chip boosterโ and similar stuff
im bad at explainign whats in my mind but i wanna try to do this
Hmm, well we can take it one step at a time, the store system, and the games aren't necessarily dependent on each other
The whole store thing sounds like a hard sell though
Like the whole chips, and being able to upgrade and what not
It's not a small thing, and I don't know if we want something like that or not
You can open an issue for it, though I'm not sure how I feel about it
oh okay maybe the games can be accepted though? i did already do a issue yesterday, still waiting
(you can also open individual issues for each game, though battleships and connect 4 already exist)
oh it does? i made an issue for blackjack
I don't think we have one open for blackjack, though we may have shot it down in the past for gambling
ohโฆ damn.. but my idea has no gamble but i get the idea, blackjack is usually used for that
ill just wait and see if its denied or accepted 
why?
Just gonna have to wait for the announcement for further details
well
ok
yeah dorsan's work on API testing
Dorsan was part of the meeting that led to the API sunset
I do not
Soonโข
not like it really matters though
Wait so the API repo is getting deleted? I missed the convo a bit
perhaps just archived, but yes
there was no convo here, just a coredev meeting IIRC
I wasn't there, but didn't it take place in #763406158522220544 ?
Idk
Well I saw something about the API repo here but wasn't sure what it was about
just joe saying hold on your development on API and wcodes asking for updates ig
Ahhh gotcha
Wait why?
announcement to come soon
@thorny obsidian you said "we won't we doing this" in aoc but I don't see any replies on either of my issues about aoc commands, could please provide a reason why the ideas bsoyka and I came up with won't work?
I will, once I have some time. But I wanted to be clear that that's not something we're doing before people started to invest too much time in it.
if you didn't read the full text of the issue, the title that you saw does not match the rest of the pr, I think I updated it after sending that embed
Like I said, I will take a look and respond once I have some time.
How to convert django project into exe file?
Hey, this channel is for discussing Python Discord projects, it sounds like you are looking for #tools-and-devops
which pr num is Christmasify
yea, sir-lancebot#956
currently draft
I left a comment on bot#1991, even thought it already got merged
thanks
What's the point of leaving that comment four hours after the PR was merged
Anyways, it's probably a wont-fix because most repos don't change master every week
I was asleep ๐คทโโ๏ธ
Hmmm
From what I can tell, a value that's been saved to a dictionary and then the reference is updated will keep the old reference
!e ```py
create the objects
sen1 = object()
sen2 = object()
assert sen1 is not sen2
d = {'a': sen1}
print("is sen1", d['a'] is sen1)
print("is sen2", d['a'] is sen2)
sen1 = sen2
print('reassigned sen1')
print("is sen1", d['a'] is sen1)
print("is sen2", d['a'] is sen2)
@fallen patrol :white_check_mark: Your eval job has completed with return code 0.
001 | is sen1 True
002 | is sen2 False
003 | reassigned sen1
004 | is sen1 False
005 | is sen2 False
(I promise this is relevant)
@vale ibex I'm reviewing bot#1990 right now, and have found a future hidden bug, which may or may not be worth just letting it occur, with a comment
library objects are made by this mapping https://github.com/Rapptz/discord.py/blob/1a4e73d59932cdbe7bf2c281f25e32529fc7ae1f/discord/ext/commands/converter.py#L984-L990
discord/ext/commands/converter.py lines 984 to 990
CONVERTER_MAPPING: Dict[Type[Any], Any] = {
discord.Object: ObjectConverter,
discord.Member: MemberConverter,
discord.User: UserConverter,
discord.Message: MessageConverter,
discord.PartialMessage: PartialMessageConverter,
discord.TextChannel: TextChannelConverter,```
so this line, won't change any params that are hinted with discord.PartialMessage
https://github.com/python-discord/bot/blob/02bc740b08e99caa9214461a91f5e885e65fc826/bot/__init__.py#L21
bot/__init__.py line 21
commands.converter.PartialMessageConverter = monkey_patches.FixedPartialMessageConverter```
however, the bot doesn't use PartialMessage as a typehint for any command, so it should be good, but this would crop up in the future if one was implemented
Yea, that's a good point, I'm not sure if we'll ever run into it, since there's rarely a reason to use PartialMessage over normal Message
but probably worth a comment at least, so that people don't need to do that investigation themselves
If you're expecting that to give you True, False (after the reassignment) then you are misunderstanding on how Python works.
I checked, and this bug is also in disnake, probably any other forks
Probably because they don't know yet, probably worth making an issue on one of them ๐
hah yea, there's so many I'd feel bad raising an issue on one and missing others
Things don't have names
The point was to illustrate the CONVERTER_MAPPING and monkeypatch of the library below
When you insert something into the dictionary you aren't binding the variable name, you are putting in the value of that variable
yeah
I added this comment
Hah
Why not just update the dictionary too instead?
Its not part of the public api
The repo is archived ๐
I'm more concerned about forks doing weird stuff
although when delving into the converter world a few weeks ago I did find that you can make a class method named convert on objects, and dpy will use that, so you don't need to make a converter for every rich class you have
Yea, we don't want to go too much in depth with monkeypatches, since that makes migrating harder
So preferably we keep them to just what we actually need
The thing is that I would hate to be the person debugging this later on ๐
sigh I guess I'll figure out how to run bot ๐
hence the comment right next to the monkey patch ๐
I highly doubt we would ever use the PartialMessage convertor
but if we do, the comment is there to save them debug time
Since this patch won't break it, it just won't have the fix
A guide to setting up and configuring Bot.
Ah, yeah it's pretty minor. I would argue that the comment isn't visible enough (as it stands I can't see myself going to that file when debugging something).
What would you be debugging?
and right below that: docker-compose up web to start the site container. This is required.
lol
You'd be debugging, "oh the fix we made the the message convertor isn't working" let me see how we did that
Hmmm, you have some good arguments..
wait, i need a database too
might be worth figuring out how to run docker i guess
Yeah uhh, Docker is great. I still have never installed Redis on my system (well, other than inside Docker).
oh wait i can run them on different machines
which is good, since i have docker on one machine, but i haven't debugged with gpg isn't working yet so i don't use it for my development
could use it for review i guess
You're probably struggling because those are the instructions for bot lol
Though yes, docker would be ideal
Esp if you want to avoid PG
yeah i'm just going that route for the site so i can run bot
Lmaoo
Ikea moment
(also i did go to the site docs after that but didn't say anything smh)
well currently no docker issues
does site run on 0.0.0.0 by default?
says it is
but I can't access it from a different machine
No, because it is only exposed on your machine right?
i suppose that's what happening
You need to port-forward it
kk
tfw cf tunnels are the easiest port forwards
My life as a web dev hasn't been the same since someone told me about it
its a local machine so using cf would be... worse
No network connection at all?
Its local to my own network. I can use 10.0.0.201 to access the machine, but since 8000 isn't running on 0.0.0.0 I can't access it from this machine
If it has an internet connection (which I assume it does since you installed docker and pulled the repo), cf's argo tunnels are basically magic for this, but I digress.
Did you start forwarding the port?
Did you start forwarding the port?
not well, apparently
how do you forward a port from an ssh session?
-R
when connecting to the session?
uh, it was interactive
Wdym?
(whats the syntax for the arg to this?)
Nightmare
ssh -R 8000:localhost:8000 pc_name
ssh -R 8000:127.0.0.1:8000 remote
docker is up, i think
yeah, it is
...wow i can't believe i thought of using curl from another session to request 0.0.0.0:8000 ๐
@gritty wind
vscode will just automatically forward running services so ๐คทโโ๏ธ
its my firefox theme
Oh that's mine
Yeah it's draft
I'm working on it
Been a bit busy lately
But I'll get to it
That reminds me actually
sir-lancebot#901 needs reviews
Oh and thanks for dismissing the review @trail pilot
Wait why didn't the command work
(it did, i deleted the result with the trashcan emote)
Ahhh
yeah that sounds about right
windows subsystem has entered the chat
if you're running in WSL, that may not have the same localhost as the rest of your system
that's a lot of red
yeah, need to figure that out
Though I guess you wouldn't get a connection refused
zig modpings pr ๐ friendly bump
Hmmm I want to make utility modules on the bot, but I don't want to prefix each one with an underscore
Sorry, whatever attention for dev I have right now will probably go elsewhere
Could you give an example of what the module looks like
Is it a cog, standalone functions, etc
hmm ok
I have a cog in a file, and then I have other files next to it
But I have a lot of files next to it
So prefixing each one is kinda annoying. I'd like to just define __all__ in the ext init
You do get a connection refused because nothing is bound to the loopback on port 8000
_utils/__init__.py: __all__
Windows doesn't know what to do so it just refuses to connect
What I mean is that I want the extension loader to use it
Do what arl is suggesting:
\
| cog.py
| _utils
\
| file_1.py
| file_2.py
I thiiiink it shouldn't load those
hmmm
it will load those
wait
It won't
is this bot or lance?
(they have slightly differing implementations)
for module in pkgutil.walk_packages(exts.__path__, f"{exts.__name__}.", onerror=on_error):
if unqualify(module.name).startswith("_"):
# Ignore module/package names starting with an underscore.
continue
Why are you going back and forth so much lol, it wont
We can probably switch up the searching function to make it work pretty safely
if any(name.startswith("_") for name in module.name.split(".")):
It's using pkgutil.walk_packages and I can't really tell it to not go into the subpackages
Yeah, that does seem to work, and doesn't break anything
hmm
We can tell it to stop searching if it finds an underscore at any point in the tree
Hmm well it won't stop searching, we can tell it to just ignore each file
wdym?
Like


