#dev-contrib
1 messages · Page 161 of 1
I've been working with disnake myself
We're not switching right now, I don't think we even have enough active members to get a PR through, or all the inevitable fire-putting-out PRs
metricity is small enough that you likely don't need to put out many fires
though tbf this isn't a huge issue
hey I'll have you know I have converted two public bots so far to forks and there were no fires!
It's fine with metricity honestly, worst case scenario if metricity goes down is we lose a bit of data
That's already happened
Most people didn't notice
they are all drop-in replacements tbf
okay that's not accurate, one of the hosting datacenters had a fire but that wasn't related.
Bot goes down and this server goes poof
We're in no rush to upgrade right now, I'll leave it at that
we have users that rely on our stats to figure out which channels are worth looking at in the morning
which is amusing
but this doesn't break that
ye, some more drop in than others
I'm trying to debug this right now, but honestly the command may be harder than having the bot just print out any calls to terminal
It ran once, then the command stopped working
I don't get it
I told you to use the thingy smh
debugger when
Where did you add the process commands?
Debugger is active, but nothing is even being called
hmm
bottom of on_message
use the thingy event to get the thingy debug in the thingy
There are a bunch of quit early returns in on_message
I am, I'm just using the command to get it in a nice format for review
look at my PR and add it to the same place
this is why i said to add a new listener event smh
do you need one?
Shouldn't we check for bot
kinda bikesheddy
!d discord.ext.commands.Bot.listen
(in your PR)
@listen(name=None)```
A decorator that registers another function as an external event listener. Basically this allows you to listen to multiple events from different places e.g. such as [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready")
The functions being listened to must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.9)").
Example...
yeah you don't need a cog for that
Ah fair enough
wdym?
plays welcome to python discord video
if not message.author.bot: process_commands
welcom to huudraulic.. wait
I mean, you could lol
Yeah still no lock with the sock command
but the bot isn't really going to be invoking it's own commands
literally move the current listener to this ```py
@bot.listen("on_message")
async def process_messages():
Am I just not adding the cog or something
and then remove process commands from it
I'm more thinking the other bots
Craft a nice eval, ping the bot, tell it do whatever
Ahh
sigh
Where are you loading the extension?
Last line of main
bot.add_cog(Internal(bot))
I know it's working because
It's just not working anymore
bot.run isn't in main
I keep forgetting d.py doesn't use a type heirarchy for that
would be a lot easier to listen
!paste
spoiled by kord lmao
does d.py not have trace logging you can use to see the gateway events?
if so, seems like a simpler solution
not afaik
it does, and I suggested it above
I don't think they have any logging
I've already patched the event
If that's what you're suggesting
Also I know that everything is loaded properly because:
sigh i'm on pc again
you seem to be going to a lot of effort to debug a debugging tool, is my point
so maybe it's worth taking a simpler route
The simpler route here is collecting all these metrics by hand
D.py exposes them in an event, but not in a readable way
The function that gets the output is not being called
so then all you should have to do is work up the potential call tree until you find a breakpoint that does get hit
I'm gonna get a paracetamol. /hj
Alright, so update
the event does fire
(bottom right)
but it doesn't call the handler for some reason
Well discord sends the event, it doesn't fire clearly
and to this day, he has yet to be seen again
odd
I can get it to fire now if I don't restart the bot
Which means the only thing I have left to do
I'm still salty about the caching race condition I found that they didn't want to fix in case it broke the entire stack lmao
Yeah sounds about right
yeah it fires
Ok, breakpoints loaded, next up is seeing what happens
wow you debugged everything and added a whole command and I just added a print listener 😂
and yes my bot is running in docker because I couldn't figure out how to run metricity outside of docker rn
!d discord.Guild.threads
property threads: List[discord.threads.Thread]```
A list of threads that you have permission to view.
New in version 2.0.
this is why
What's why?
So... ?
Yeah that's fine
It's not getting to the coro await step which calls our code
But all the steps before that are the spaghetti dispatching from d.py internals
sync_channels?
Which means the function one level up is called about 40 times for this one message
on_thread_update
I think I'll call that route a dead end, but why is it dispatching for one event listener but not the other
What, your on_thread_update gets called?
i didn't do the repo steps
The second archive in that chain does get called for me
It's just the first update after starting the bot does not fire if it's an unarchive
I am going to guess its similar to message deletes, where d.py doesn't fire that event if the thread isn't cached
that's why it's in the database to begin with
sounds accurate
can repro
It's not firing at all for me with this
same ^
Is that the one from the startup process maybe?
this is one of my favourite reasons to shit on d.py by the way haha
Do you see two sync logs up to step 3
nope, it was after the user sync
tries with a fork
Strange
Is that using my repo, or your repro
lol they don't have it patched either
that's what happened when I reported it
I rebuilt and restarted, waited for user sync, unarchived, archived
The second unarchiving and rearchiving would've meant you'd see that log again
Out of interest, could you change guild.threads to await guild.active_threads() in the channel syncer scale?
So I think it's only firing once like me and arl are experiencing
On mobile now so can't do it myself
I mean yeah it is firing once
sure yeah
we were already at that equilibrium haha
It might be the cache hasn't updated by that point
nah, archived threads aren't cached period
I am aware
are you telling me this is probably the same race condition I mentioned earlier
Possibly
Nope, no change
Alright
I'm gonna leave this to you guys since I don't have any access to a pc right now lol
The syncer isn't being called at all, so that might be expected
I'll have to go to bed soon anyway haha
hmmm
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
given this, if there's a thread_member update event we could use that....
Well it's not crash looping now at least, so it's not an urgent fix
yeah this doesn't break anything for us aside from data integrity
Yea, my command that's up for pr will solve that too
which would be a pretty big break if this wasn't the initial behaviour I guess haha
!d discord.on_thread_member_join
discord.on_thread_member_join(member)``````py
discord.on_thread_member_remove(member)```
Called when a [`ThreadMember`](https://discordpy.readthedocs.io/en/master/api.html#discord.ThreadMember "discord.ThreadMember") leaves or joins a [`Thread`](https://discordpy.readthedocs.io/en/master/api.html#discord.Thread "discord.Thread").
You can get the thread a member belongs in by accessing [`ThreadMember.thread`](https://discordpy.readthedocs.io/en/master/api.html#discord.ThreadMember.thread "discord.ThreadMember.thread").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
New in version 2.0.
You'll be able to give it two epochs and it'll sync all messages between them
what does your public stats dashboard look like from all this, by the way?
yeah I saw that haha
Our usage of threads is minimal so probably no change
will it ever change, and we use threads more here?
I mean I already don't know what it looks like
Not being called either
was wondering for comparison haha
But also making it to socket command
nvm, it isn't
Unless it's GUILD_MEMBERS_CHUNK
Oh, when you say public stats, do you mean stats.pythondiscord.com or soemthing else?
yeahh, i should have realised that since I have streaming logs for that
ah yeah that's what I was wondering
huh that's a lot more basic than ours
guess this isn't the right place to ask why go basic though haha
that page could be replaced with a metabase dashboard tbh
oh that's not a metabase dashboard
btw could someone take a look at bot#2022? I've looked at that and need some more opinions
I think we considered metabase, but the resource overhead might've been too high
These are just generated on the server occasionally and served statically
yeah that's probs more sensible at this scale tbf
okay, I've got a date with youtube and some headache pills, but thanks for trying to look into this promptly
suggestion: needs something to fill this whitespace
that's just what metabase does at the top of a dashboard
ah ;-;
Here's your reminder: @fallen patrol Have you seen this? #dev-log message
[Jump back to when you created the reminder](#dev-contrib message)
non-zero chance we caused the linode block storage outage in frankfurt today 
good job team, keep up the good work
what happened
nothing we directly did
but we opened a few tickets about our block storage problems the other day
today a fix was deployed
lmao
either way we saw some improved volume handling after the skirmish earlier today
so that's +++++
ideally we have no problems in first place, please linode kubernetes engine 
had a look at the upgrade we did that moved us to deb 11
there was no changelog lol
it was just an upgrade offered from kubernetes 1.21 to 1.22
Authors: Kubernetes 1.22 Release Team
We’re pleased to announce the release of Kubernetes 1.22, the second release of 2021!
This release consists of 53 enhancements: 13 enhancements have graduated to stable, 24 enhancements are moving to beta, and 16 enhancements are entering alpha. Also, three features have been deprecated.
In April of this yea...
which wasn't a release that contained anything major
added support for swap memory which was nice
but we don't use that lol
Wonder how annoying I'd be if I asked for voice channels and minutes in metricity as well 
Also we.. Have a discord experiment that might mean metricity is inaccurate right now, depending on how d.py works
Yeah I can see this server doesn't have it
@summer garden question! When I give epoch something like .epoch 2 weeks, this is part of the output: "Could not parse the following token(s): "
What exactly does that mean? I'm not sure what the ignored_tokens section of code is doing
I just sent a DM to Scaleios because discord doesn't want us talking about it outside of the servers it's on
Haha
Smh Joe lmao
I didn't even realise they'd said anything, I heard it through unofficial sources lol
But yeah we are testing that
I mean it's already data mined lol
yea
I found out about it via reddit
it won't
yeah
as for this i can't think of a super nice way to track this
i guess track start and end of every session a user spends in voice
as a row
That's about all I can think of too
But then I'm not sure how you'd calculate based on join/leave on metabase
would have to be native sql
Sadge
Sorry I would have answered sooner but I was baking pizza. A token would just be like a word. They have that phrasing in the dateutil docs so I kept it
Here's some more info I found in the docs just now
... breaks the time string into lexical units (tokens), which
can be parsed by the parser. Lexical units are demarcated by changes in
the character set, so any continuous string of letters is considered
one unit, any continuous string of numbers is considered one unit.
thanks for the review, i'll look over it now
How do you feel about the wording of The resulting date and time is: ...? I feel there's a better word in place of "resulting"
let's see if snekbox works in podman huh
I think that's fine, it could maybe be "Date and time parsed as: ..."
ah I think that's much better
!remind 15H remind arl about this
Your reminder will arrive on <t:1640189502:F>!
I will send a message to work saying "if anything goes down today, blame python discord"
Sadge
Would appreciate reviews on sir-lancebot#930 and sir-lancebot#745
hmmm not sure i agree this is better
my biggest concern is that they aren't fully aligned
Also sir-lancebot#901 please (needs a core dev review!!)
that's the reason i am not really liking it, me and chris iterated over it many times but we can't really get it alligned
You physically can't align them
The solution would be to wrap the number in an inline codeblock
That way each number takes the same width
.wa seems to be broken for certain inputs
.wa 1-tanh^2(x)
I’m guessing it’s the ones which take too long to compute
.wa short 1+1
.wa short 1-tanh^2(x)
1 - tanh^2(x)
I really wonder why it would be 403-ing
The wolfram response for the floor is made of floor
.wa x^2
.wa 1-tanh^2(x)
yeah, there's also a pretty strict ratelimit on non-staff, plus a per guild ratelimit
.wa 1-(tanh(x))^2
also staff aren't subject to that ratelimit ;-;
so like, every time zig runs, he's running it regardless of the ratelimit
It's still failing so that's not it
I wonder if there are types of API keys or something
They don't document what rate limits will return
So for all we know 403 may be a rate limited exceeded error
We should add logging there
what is the member_arg in https://github.com/python-discord/bot/blob/1302632c39469a124e85e6b43c5278526874ce5e/bot/decorators.py#L177
I did not understand the explanation in docstring
bot/decorators.py line 177
def respect_role_hierarchy(member_arg: function.Argument) -> t.Callable:```
So if you have a ban command with the first argument being the user, then it should be 1
Or target if it is named target for example, which is a better option tbf
all arguments counted self,ctx?
name of argument instead of number?
Yes
seems like self is not counted, but ctx and so on are
and good to know that it works with both, name and position. Thx 😄
Here's your reminder: remind arl about this
[Jump back to when you created the reminder](#dev-contrib message)
where i can get code of react-nft-challenge
@summer garden why do your commits not link to your github profile?
@fallen patrol Bump
tldr not sure if there's other flaws with that input style, so implement the original concept in a method so it's easy to change how the input is gathered
@gritty wind i have Debian 10 on a machine and it likely has v1 cgroup so I think I can test snekbox there
wait how did you test on several different oses?
Span up a ton of VPSes and installed snekbox on each
The problem I ran into with deb 10 is the docker install script installed a version of compose that’s refusing to work with snekbox
Between testing another OS and fixing compose for this one
I made a decision
I have no doubt it’ll work on whatever we use
what error out of interest
I think it said it couldn’t recognize the version
Something about 1.1 and 1.2 as available options
I tried updating the package, but it didn’t do anything
interesting
If I get more time, I’ll spin up another VPS and check, but we’ll see
No more time 🤡
u r such a troll omg
imagine having time
I do commits from the pycharm ui. I guess whatever way they verify accounts with github doesn't count as it being my account
my assumption is your configured git email doesn't match what's on your github account
@fallen patrolthanks for your comment on the pr. I don't see how your suggestion would work though
which pr?
sir-lancebot#983
regarding manually throwing in the ...ago or in...
haha sorry this was very vague
The problem is that the dateutil parser will accept something like 6 hours as absolute time (take the current time and set the hour to 6), even though it might've been meant as relative
There's no practical way to differentiate between the two beforehand
ahhh....
I'm not sure I'm making any sense here
you are
although I don't like that behavior as absolute time, and think that we should do something to get it... not absolute
fwiw I have a particular interest in however we solve this problem, as I'm working on a command for bot which may benefit from what we discover here
the only thing I can think of is making sure the date string is "full", as in it includes (year), month, day, (time?)
(bot#1924 for context)
lemme look at the implementation in a little bit
Quick question: is there a specific rule about games on Sir Lancebot that says you can't make games for it that are going to take ___ amount of time or longer?
uhhh
no specific rule
but games that last like
upwards of 5-10 minutes are kinda eh
we restart the bot enough that it might become quite annoying
Ah gotcha, thanks!
this is why we have redis 🤡
that reminds me
there's a ttt history command
and I was thinking, maybe it'd just make sense to remove that?
Ohh yeah seems useless
For a second I was thinking there is a history of ttt command and was gonna ask why you wanted to remove that lol
I've already an open pull to move ttt to interactions so it wouldn't be that hard to lump into the same pull, actually would make the current implementation easier
@hoary haven fwiw I think the patron pr is waiting on the author, it was mostly complete when I reviewed
bot#1917
yeah i saw
smh I wish there was a trashcan on those embeds because I want my typos gone..
Yeah same
That would be useful
it's part of github command enhancements, which I can't remember the number rn
but it's waiting on sir-lancebot#778
@thorny obsidian so what are your thoughts on lance's error handler vs @stable mountain ? saw your comment and you were talking about having a different behavior for a specific command rather than going to the error handler. They behave differently on the two bots, so should we equalise their behaviour and port the best features of each to the other?
Indifferent? I'm not a core dev.
I don't think the two bots need to match 1:1 for how they implement things. Anything that we do want standardized will be so in bot-core and then it will just be handled. Unless it's a critical bug or something that needs to be fixed, I'm hesitant to port things over from python bot
then why display the help for the command vs an error?
the error message for lance does show how to use the command
My comment was that what bones has implemented already works fine and I don't see a strong need to change it.
ah
🥲
finally metricity is running
ohhhhhhhhhh that's why i had so much trouble
...
site's docker compose exposes the db on 7777
metricity's docker compose puts the db on 5432
If anyone’s available, I’d love to get some reviews on sir-lancebot#988. Shouldn’t be too big of a PR
no unicode format?
What do you mean?
Like \UF29E0? That’s supported
The regex I made for parsing it is meant to be pretty generous with what it supports
Yeah, I was talking about unicode format in the resultant embed, which isn't present on it now 
also we already have emojis on lance, if its possible to use that instead of emoji
!pip emojis
I tried it. But it didn’t have too many good features for my use cases
The format for the codepoint on the embed is just the one I found the cleanest and simplest
!pip emoji
one sec
ok cool, but if someone wants the format of 👪 in unicode, that won't be possible right?
Fyi since a spring-cleanup-like PR on lancebot we no longer use typing.List
It's list[xxx] now
Same for tuple, dict, etc.
The Unicode codepoint is right there? I’ve never really used the \uXXXXX format in design—only codepoints—so I don’t think that format would make sense
Ah, neat! Could you leave a review comment and I’ll fix it
I saw unicode mentioned in the original issue hence pointed it out, 👍
For input, yes
Done 👍
I may be able to do a full review at a latter date, not sure
Thanks, Tizzy
That was one opened by Kat (restructuring Sir Lancebot), right?
Nope
It was something else
Oh ok
It was sir-lancebot#802 @austere hornet @obsidian patio
Ah ok thanks!
Who is ventaquil on Github btw? Like what Discord account corresponds to that Github user?
I might know but not sure so won't say in case it's wrong 
Oh ok no worries
MorowyKomandos
Ahh thanks!
@obtuse arrow I left a review on bot#1940, not sure if you saw
sorry i wasn't clear i wanted to know if there is smth i can contribute to the site
ping me next time when replying please
Have a look at our issue tracker, it’s where we put all tasks
may i know how to see that?
The link is in the embed
Make sure to see the contributing guide too, which is on our website
https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/site/
thanks
is there a way to get my editor to render these images? working on markdown files for the site

which editor?
vs code
could temporarily add https://www.pythondiscord.com before the static
sure i'll do that as a last resort lol
I have this extension for the previews:
Name: Markdown All in One
Id: yzhang.markdown-all-in-one
Description: All you need to write Markdown (keyboard shortcuts, table of contents, auto preview and more)
Version: 3.4.0
Publisher: Yu Zhang
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
i've not done any setup btw, just cloned the site repo and started editing
yeah i installed that extension
lemme open my site env
this is the preview provided by ctrl shift v
or I guess you could try making it a file URL, don't think anything will be able to resolve it without changes though
which file is that?
pydis_site/apps/content/resources/guides/pydis-guides/help-channel-guide.md
trying to find it in site's structure but not familiar with it
oh my god that's so long lmfao
oh.
odd.... the preview does not show up on my end either
yeah i'll go with numerlor's option haha. easier to "read" when all the images show up in preview
sorry there's not a better solution
wait--
you could run the site, and look at the live preview in browser
docker-compose up & then open 127.0.0.1:8000
i have no experience with docker and won't be able to install it on this work machine anyway. one day though. thanks 
If you have access to pip and python
You can get the base requirements for docs by hand
And generate a static preview
Or if your PR you’ll automatically get a preview from actions
i do have pip and python
Try “pip install poetry && poetry install” in the site repo
That’ll give you everything you need
If you run “poetry run task static”, it’ll do all you need
i am so afraid of the word poetry. will let you know how it goes
i don't have the latest pwsh so i replaced && with ; and it worked it seems
made the virtualenv in my appdata/local dir, can't make it in the project dir i think i've heard with poetry.. is that right?
It should be fine actually
Though poetry can create the env for you
If you want to use your own, make sure to activate it before running poetry install
ok think i got it
Poetry creates virtual environments in appdata by default
There's a config option to change it
If you create your virtual environment first, Poetry can detect it
doesn't it use %userprofile%/.virtualenvs by default?
App data for some reason /shrug
you aren't an English teacher, you shouldn't be afraid of it smh /s
Edit: I actually have no idea if you are an English teacher or not so ignore this if you are
Haha
!otn a mina the english teacher
:ok_hand: Added mina-the-english-teacher to the names list.
Good one
yuck english 
Here's your reminder: here we go again smh
[Jump back to when you created the reminder](#dev-contrib message)
@fallen patrol @summer garden Have you seen my latest comments on sir-lancebot#985?
I don't think the issue with a 9x9 board is taking up the channel. My main concern was how long the game would last and also the tediousness of inputting numbers by row and column
I just don't think it's well suited to be played in discord
Sorry I should have replied sooner. It slipped my mind after I read the pr comment
And I don't necessarily agree with immediately telling the player if the number they inputted is right or wrong. I feel like that spoils it to some extent
It would make people more likely to guess, rather than exercise logic
Oh I see. I mean, I get that, but as I proposed here: https://github.com/python-discord/sir-lancebot/issues/985#issuecomment-998423458, I could do that to make it less tedious. But tbh I don't see how it's extremely tedious to input 3 numbers. Is it because you have to do it many times throughout the game? Is that what you're saying?
I don't necessarily agree with that because just saying the input is right or wrong doesn't actually give it away. At least, I don't really see how it does.
(this has been addressed) #dev-contrib message
Oh yeah forgot about that, thanks
Often in sudoku there are two possible spots for a number in a given row or column or whatever. The goal is to deduct which one of those squares is correct. If you verified if the person's input is right or wrong it shifts the game towards guessing rather than logical reasoning
Really? I thought you can't repeat any numbers in a given row or column
Unless I'm misunderstanding
*two or more possible spots, of which only one is correct
you can't, but it spoils it if you're told whether your move is correct or not each time you make a move
There could be multiple valid options, but later when more of the puzzle it solved it turns out that your choice was incorrect
Hmm. I'm still not quite understanding why.
it's the whole part of the puzzle and the fun! especially on a reduced board size, you shouldn't spoil it imo
It's part of the challenge to know ahead of time which choice is correct, without having the rest of the cells filled out already to show you.
^
originally, sudoku (and still now) was/is played on paper, which never had checking lol
btw, have you thought of how you're going to allow for users to edit their entries? (change or remove)
Oooooh. I didn't think about that. That's a great idea. If I do end up doing this, I'll definitely need that
But wouldn't that just be like entering a new guess?
I propose that either columns be named alphabetically and rows numerically or vice versa. This would remove some confusion in placing your number in the wrong spot. For example .sudoku B6 8. Removing a square might be something like .sudoku B6 X
I don't know if other people do this, but I always get my axes mixed up 🙄
Ooooh yeah that sounds a lot better
Heh, I don't think it matters what axes is labeled with letters and which one with numbers afaik
I think Y axes should be labeled with letters and X with numbers (it's like chess if you know how to play that)
I still think 9x9 is rather large. 4x4 is admittedly very easy. If we were to meet in the middle, that would be 6x6. The only thing about that is that the grids are rectangular not square
I mean, I think 6x6 could still work
Btw, you don't want to use .sudoku, you just run that once, then just enter B6 8 or B6 X. I think it's better that way. What do you think?
Btw, the 8 was just an example of a number for the board, right? Just checking
yeah that's right
also, this makes sense to do as a text based game imo.. not something with pillow
I know we're quite deep into the sudoku rabbit hole, but another alternative is kenken - a similar "grid" game. The rules are obviously different, but it would allow us to play on a smaller board, (as small as 3x3) without it becoming too easy. The rules are here if you want to give it a quick read http://www.kenkenpuzzle.com/howto/solve
Yeah I don't really understand how Pillow works anyway so I wasn't planning to use it
if not, I'm still down for a 6x6 sudoku
Oh my I know that game I've played in school before lol. It's pretty cool. I could probably do both (not at the same time ofc) but yeah kenkens are awesome. I'll write up an issue
I was trying to find the name of this back when this sudoku idea first came up. Apparently it's huge in japan - the new yorker has a nice mini documentary about it
Ah I see yeah I think I knew that when I first learned about kenkens in school. Regardless if no objections I could start with the 6x6 sudoku and then do the KenKen
.bm
The only issue would be the formatting into text, as kenken requires the little subscript "objective" in the corner of each box
Oh yeah. Hmm. I'll think about that more and if you come up with anything feel free to ping.
Quick question: is this the code for the eval command on @stable mountain? https://github.com/python-discord/bot/blob/main/bot/exts/utils/snekbox.py
Yeah that's the code that interacts with Snekbox
Does anyone know where I could find the code on Snekbox that adds a trashcan reaction to the eval message from the bot that allows the command invoker to delete that message?
I'm referring to this:
bot/exts/utils/snekbox.py line 222
scheduling.create_task(wait_for_deletion(response, (ctx.author.id,)), event_loop=self.bot.loop)```
Ah thanks
Question: is this entire block of code relevant to this? https://github.com/python-discord/bot/blob/94b4ad61c203e5b8b33ace2ef639a9fb2fdea4e4/bot/exts/utils/snekbox.py#L214-L222
bot/exts/utils/snekbox.py lines 214 to 222
filter_cog = self.bot.get_cog("Filtering")
filter_triggered = False
if filter_cog:
filter_triggered = await filter_cog.filter_eval(msg, ctx.message)
if filter_triggered:
response = await ctx.send("Attempt to circumvent filter detected. Moderator team has been alerted.")
else:
response = await ctx.send(msg)
scheduling.create_task(wait_for_deletion(response, (ctx.author.id,)), event_loop=self.bot.loop)```
no
This isn't the right channel for that question, I think that question goes in #career-advice
the important thing is actually the source of wait_for_deletion
what are you trying to do?
So if you recall a few days ago, you made a typo when you were trying to use the GitHub Issue/PR Link command and you kept typing the wrong number or something I think and that gave me the idea of having a trashcan feature just like the eval command. I'm in the process of writing an issue now
I was just trying to see how I should implement it
sir-lancebot#968
Ohh
i have a slew of enhancements to make to that command once sir-lancebot#778 is merged
but yeah, you'd just copy https://github.com/python-discord/bot/blob/94b4ad61c203e5b8b33ace2ef639a9fb2fdea4e4/bot/utils/messages.py#L60-L105 to the corresponding file in lance
.bm just in case
I see, thanks
I mean, if 778 never gets merged....
Heh
@austere hornet now that we've bikeshedded that much...
To avoid spam of the "Hint" button, I'm going to record the last time the button is pressed using the built-in time module in Python and count 3 minutes from that time and after that time elapses, allow the user to click that button again. Then the process repeats.
you can edit the message and view to enable/disable the buttons btw
!d discord.ui.Button.disabled
property disabled: bool```
Whether the button is disabled or not.
.bm
!remind 12H
Your reminder will arrive on <t:1640363494:F>!
Hello!
I found a small typo in the tools section of the website (pythondiscord.com)
I think it is more of a font issue than a typo.
The link says: our met a repo instead of our meta repo.
Screenshot attached.
could you link the page?
Which browser are you using?
it is font, since it doesn't happen for me
Alright.
Thanks for looking into it though.
which browser are you using?
Brave
try looking the shields, perhaps they're blocking the font we use from loading
No. Still the same result.
Can you right click on the link and select inspect, then go to the "computed" tab on the right?
At the bottom it should then show the name of the rendered font
Alright. That is actually one of the listed fonts in the CSS that it attempts to use. I don't have it on my system though so I can't see what it'd look like for me.
One would assume that if it's explicitly requesting that font then it should look okay.
The kerning is all messed up but I don't know why
Unsure if it's an issue on your end or on the site's end.
It's especially bad for the f and t characters
keming
I'm unsure, sorry
It's okay.
Thanks for letting me know about the actual problem, though. I really appreciate it.
the site requires postgres, or is there a docker setup?
coz one without docker looks complex
Yes there is a Docker set up documented in the setup guide.
A guide to contributing to our open source projects.
Tldr docker compose up
ok thanks
@obsidian patio have left a slightly more in-depth review on sir-lancebot#988
@static canyon thanks!
Uhm in the form you guys gave, I see infinite loading. is that a bug or something?
oh i guess that's it.
Anyways, it would be better to have client side error i think?
Steps to regenerate would be just entering the country name and hit enter.
also UI is a bit confusing which does not represent that we NEED to enter discord info.
I mean I found out that I NEED to log in after I've seen the error.
yeah, that's something that we will improve
discord data is a flag on the form like "collect data" or "don't collect data", it's not a field in the sense that shipping is and so it's handled a bit differently.
the frontend should reject submission until the data is collected, and the backend is already doing that validation (hence why frontend is getting an error from backend)
is opening gh issues on the bot repo the preferred way to request something?
Depends on what you're requesting
Yes you can just open an issue. You can also discuss it here first if you want
thanks, it isn't fully formed yet 
Here's your reminder: @austere hornet now that we've bikeshedded that much...
To avoid spam of the "Hint" button, I'm going to record the last time the button is pressed using the built-in time module in Python and count 3 minutes from that time and after that time elapses, allow the user to click that button again. Then the process repeats.
you can edit the message and view to enable/disable the buttons btw
[Jump back to when you created the reminder](#dev-contrib message)
Sorry, I'm a bit confused. Didn't I already say that I would add a feature to the Sudoku game that would allow the player to edit their guess? And yes I figured out the part about enabling/disabling the buttons, thanks
hm?
Well you said "you can edit the message", not sure what you mean by that
Remember this?
@fallen patrol ^
!d discord.Message.edit
await edit(content=..., embed=..., embeds=..., attachments=..., suppress=..., delete_after=None, allowed_mentions=..., view=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the message.
The content must be able to be transformed into a string via `str(content)`.
Changed in version 1.3: The `suppress` keyword-only parameter was added.
you can edit the message and disable the buttons, that was all
Oh ok, yeah I know that 🙂 Thanks!
cool 👍
I'm (mostly) afk from now until the 27th or so
@short snow yes you will get your review smh
just fixed this
now enter won't submit unless you've authorised with discord, if you haven't it'll scroll down until the "discord login" button is visible
Hey @patent pivot, question for you. I'm in the process of writing an issue on Lance for another game called Kenken. (This was suggested by bones, see #dev-contrib message). I was DM'ing him just now and he thinks I should make Sudoku and Kenken in one cog. However, I don't think that is a good idea since they are 2 separate games. What do you think?
should be a separate cog probably, not sure
Yeah that's what I'm thinking
oki i'm home now and would like to try running the site locally
https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/site/ is this comprehensive enough/updated enough to get me going?
A guide to setting up and configuring Site.
and i'm now on mac, and have pyenv installed
do you guys just install all pydis dependencies on 1 virtual environment? 1 virtual environment for each repo?
1 venv for each repo
aside from that's how prod works, it's just good practice to not share venvs between projects
and poetry is a dependency manager, and doesn't create environments.. correct? so i should use something like pipenv in conjunction with it
it does create venvs, actually
poetry creates virtual environments, yea
however I prefer to create my own venv and it automatically uses that
python3.9 -m virtualenv .venv
poetry install
mk
then I set the local venv in my editor config and never have to think about it again
I've had problems with that so I don't let it do that anymore, personally
interesting, I haven't ran into any issues with that specifically
You seem to hit all the issues 😅
yeah pretty much
if poetry has a bug I will find it whether I want to or not
and I have
in other news I really only use poetry for dependency management and pep 517.
ok i think i installed poetry in multiple places unintentionally but i think i got it lol
lol I use pipx
so one copy of poetry and that's it :)
much better than their installer
I just did a normal pip install, never had any issues
apart from when they broke their cache lookups
but that [using pip] is installed to site packages, so by using pipx it's in its own little private corner, er venv
not like I use the system python for anything beyond poetry and pipenv
it failed to install Installing psycopg2-binary (2.8.6): Failed
everything else seems to be have installed fine
what os
If you have Postgres locally, that’ll possibly help you work past it, but ideally it should work
seems like an m1 mac issue
ahhh, yeah
sigh
well
given
you don't need that
okay so first try poetry update and then poetry install again
Poetry update will fuck the lock file
There are much newer versions
But given that this is not appearing in the issue tracker
I don’t think it’s version specific
Have you tired the provided troubleshooting steps in the error
!pip psycopg2-binary
Actually you know what
It doesn’t have m1 images at all
You need to build from source
And the instructions say building from source requires Pg
Yep, it will probably be able to build from source if PG is installed
so the next best thing is don't install it
It really isn’t, we haven’t tried to install it
IIRC Mina was only trying to view static content
no not yet
@hoary haven this still true?
The thing is arl you still need all imports to succeed
Even if doing static builds
We still import everything
erm while working on editing site markdown files i wanted the static images to render basically
I kinda want to work on this to make it not true lol
Tbh, I don’t think it’s worth it
Saying you need to install project deps to use the project is not really
Much of a stretch
I mean you could just install docker
and run it via that
you just won't get pre-commit stuff then
Mina can't install docker on work machine
That --platform=linux/amd64 arg I added coming in use lol
and if you do want the dev dependencies for pre commit you can export what poetry installs, then delete the postgres dependencies
bc that's like the one thing i'd like lol
poetry export --without-hashes > requirements.txt
Yeah that’s the linting stuff
then delete the postgres dependencies from here
finally while in the venv, pip install those dependencies and finally pre-commit install --install-hooks
will get you the linting deps :)
& my issues with poetry too lol
I have enough experience with poetry to basically not use it for everything it does 🥲
Honestly just get windows
@hoary haven if you follow this answer, it should get pg_config installed https://stackoverflow.com/a/21080707
lolol really?
can confirm, bought windows pro to use docker on windows
yup, windows is really nice
for what, specifically
Programming
I’ve got wsl, and I can’t think of anything I can’t do
Nothing breaks either
That Microsoft quality
haha i hope to be proficient at using both since i use both regularly
oh i haven't tried wsl though
sudo poweroff
check and mate
Who turns off their PC wtf
afk
Actually you don’t even need to turn windows off, it’ll turn itself off to update
not me 🙂
Perfect lol
alright. i don't really know what i did, but i basically ignored the psycopg2 stuff and just did docker-compose up and 127.0.0.1:8000 works 
it told me to use 0.0.0.0:8000 though, which doesn't work
Docker installs it’s own dependencies, which is why it’s usually the goto option
so i could have skipped poetry altogether?
Docker allows you to run the project without running anything
however, in-editor code completion and pre-commit linting requires you to have dependancies installed locally
yesno
if you use docker it uses poetry to build the image
ok
but unless you use vscode or can set up your editor to code in a docker container... you would need to install the dependencies in a local venv anyways
did you ever get the pre commit dependencies installed?
poetry run task precommit i did this earlier and it seems to have worked
did you install the dependencies?
poetry install ? yeah i did that first and besides the pysocpg2 everything installed fine
it told me it did lol. how do i check?
do this, and compare it to the output of pip freeze
any differences, weren't installed
your best bet is to just take the output of that poetry export, remove the postgres deps, and pip install that
https://paste.pythondiscord.com/molokaqaye.yaml this is my poetry show
so that's what i'm supposed to have? not what i actually have installed?
yeah looks like it
yeah, poetry show doesn't show you what is installed AFAIK
mk yeah not everything was installed. none of the flake8 stuff was
the important part ;-;
legit you could get away with a global pre-commit and all of the flake8 stuff for linting in the poetry env, nothing else needed
wait is this supposed to show me what poetry wants to install?
it shows psycopg2-binary but doesn't show flake8.
oh f I forgot
add the --dev flag
when i pip list tbh it looks like i have everything, flake8 stuff and pre-commit
ok i see flake8 stuff and pre-commit when i do that
Poetry installs development dependencies by default, unlike pipenv.
Not sure why the dev flag made a difference
Not for poetry export appearantly
^
poetry export by default exports only main dependencies and with hashes
@brisk brook you occasionally use the integrated vscode extension to review and leave comments on github, don't you lol
I tried it but hated it, what makes you think that?
Is it something I do that you can do in that?
this #dev-log message
it escaped the worker which filters all of these events. I've only known it to escape when I submit a comment on a pull from the extension
comment on github? gets caught no problem
comment on the extension? it escapes
Caught refers to it not being sent yeah?
yeah
What I do is that I go through the whole diff and make comments (sometimes only one, like here). Then in the top right I select "Review changes" and pick "Comment"
hmm I wonder if that contributes
How do I authenticate with the site API?
authorization token header
Even when setting Authorization to suitable-for-development-only (copied from the site page after being set up in an .env file) I get: ```json
{
"detail": "Authentication credentials were not provided."
}
the api key should be badbot something
so Authorization: Token badbotsomething
if you have the bot working then it's in the .env or env vars
Ah, no I am just running site standalone
Just to get the key; it should also be somewhere in the guides
I am looking through this: https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/site/
A guide to setting up and configuring Site.
the suitable-for-development-only is for something different
You're also missing the Token auth type
Ah there you go!
Yes I started using that after you mentioned it a bit above and got "invalid token" instead.
the eyes weren't for that, the eyes were for mostly afk where mostly belongs to some different dictionary
also merry Christmas
guys
Thanks, you too! (btw I don't really celebrate and also off topic for this channel)
nextcord may be going zap
Is there a way to get the bot instance without passing it around?
bot.instance
@cold island speaking of filters, what do you think about stripping spaces from text before applying the URL regex? Would've prevent the raid the other day, probably.
I wasn't around for that raid, what was in it?
I think Mark is talking about the reaction raid
A discord invite link that had random amount of spaces between characters
Oh strip in that sense
Of coruse there'd still be other circumventions but might as well prevent this easy one
Yeah I'm trying to think if it can cause falses
I think URLs are generally pretty distinct, especially if the scheme is included
But if we have a filter just for bad.com then it could be a false positive for imnotbad.com
Wait that came out wrong
I think it would be like we have a filter for imreallybad.com and it would pick up im really bad.com
but less likely to be a false positive if it were written as http:// im really bad.com
Don't remember if the raid included a scheme in the links
Yeah, probably
For general URLs there's a PR (or should be) that moves away from looking for schemes
What?
I didn’t know you were bad smh
🙄
that could work? but it'd need to know when to do it and when it's already been done.
discord.gg/python discord would evaluate to what?
or discord.gg/dpy d f g h would go to what?
lol please stop
What are you posting
Arl pls stop
I have a feeling you’re pinging the mods
can someone repost what I'm saying ;-;
Yep
since both of those first urls are whitelisted but discord.gg/pythondiscord isn't```
also sorry I didn't realise invites mentioned mods ;-; since the bot catches them lol
just a feeling, huh?
Anything the bot "catches" notifies the mods
I don’t have the mod role if you’ll notice
Most things do lol, mostly the point
Until zig is done at least
One day
ik that one filter I was working on didn't ping mods sooo
Whether or not it pings the mod shouldn't matter. If your message keeps getting deleted then don't keep resending it
That's probably a good rule to go by
(sorry if that comes off overly harsh, can't really tell)
True. I was thinking about it for URLs in general. Invites are problematic since the domain is fine but the part after is what matters
I think maybe what could work for invites is if the text is first searched as-is, and if nothing is found, strip spaces and search again. On this second try, if something that looks like an invite is found, but can't be parsed further, err on the side of caution and remove it.
It would evaluate the .gg/python discord as .gg/python, see that it's a valid invite, and stop.
If it evaluated .gg/python discord and .gg/python was not allowed/valid, then it would strip spaces, check again, detect .gg/pythondiscord, see that's not whitelisted, and remove it.
if you want a sample of one of the raid messages from yesterday: d is cor d. g g/h D2 Cm Jh tzj JOIN NOW! | erk7d
what's this part?
that part differed in each message, to avoid filters looking for duplicate messages i presume
ahhh
If .gg/python is already not allowed, then I don't think it's necessary to look further. The main improvement here seems to be joining the parts before the slash
You're right, i was overthinking it
I think it was an example
perhaps a better one would be dpy or ~3 characters
yes, it's an example
Okay, 6 hours of writing filters is enough, time to sleep
So I realised I never got around to writing this for whatever reason, so I've spent the last two hours or so getting a dev env setup on my laptop lol
sir-lancebot#991
Quick question about the Github Issue/PR Link feature on Lance. Was there any reason @dusky shore was chosen over @stable mountain for this feature? I feel like this feature would be better on @stable mountain .
These sort of fun feature usually go on lance, while the more crucial features go on python
Ah I see
It helps keep python more stable while reducing the review requirement on non-critical stuff
But there are exceptions sometimes
I see, thanks
Is it ready for review?
yup 😄
Sweet, I'll take a look now then
I've also had a lot of baileys today so excuse simple mistakes lol
Also Merry Christmas!
and to you! Everyone is sleeping so I thought I'd be productive lol
Haha, I'm 2 wine glasses deep trying to deal with a racist and misogynistic uncle, so I'm probably same level
oh! Is the role actually ready yet?
Can I bug you for the sleigh that Fronto posted?
want that to be the icon?
to at least try it out, it's very relevant to AoC and cute
yeah!
how's it look?
oh that's actually so cute (cc: @trail pilot)
Ooh, it looks awesome
I like it, but unsure if someone who didn't know what the icon was would recognize it. Although I'm willing to take that risk
the details are a bit fuzzy around the edges but otherwise I think it looks like a sleigh
but tbh, I could see people mistaking it to be the Docker logo
like some weird, modified version of the Docker logo
hah
I'm also fine with the tree + star inside of it
This is the tree with star
I also prefer the tree
Nah, can hardly see the snowflake
That snowflake is hard to see. I say let's stick with the tree + star
cool
it's being given out as soon as the PR is merged 😄
Got it
Probably whenever it gets merged. I'll make an announcement when it happens to let folks know
given that the other github autolinker is on @stable mountain i really don't understand how this feature is divvyed up
I'm going to join the rest and head to bed, I'll take a look at PR comments tomorrow 🙂
The answer is: randomly
night!
although I've asked before and got an answer about why not to merge them, just forgot it, so nvm
ah, we use heads/tails to determine where a feature goes 🤡
if it lands on its side somehow we put it on @radiant merlin
I am a bit too lazy to do an actual review as it would require me to setup a test server
Code wise it looks good
Except those two comments
lol I have one that I can invite you to
cc @short snow ^
lmao thank you @patent pivot
ur so welcome
bot#1951 & bot#2013 both need one more review for merging 👀
