#dev-contrib
1 messages · Page 108 of 1
You'd make a new PR
if you want i can give you push access
Out of curiosity, what db does Modmail use?
I'm not sure, they may just store everything in caches. You can look into it here: https://github.com/kyb3r/modmail
oh lol hello
(we don't own modmail, but we're made modifications)
no it uses mongodb
Yeah, but you can use a different db
It might take some setup
But it's possible
Why though?
idk
I thought maybe, since things in PyDis seem to use Redis or Postgres
yeah but who wants to write their own bot for modmail when you can get one that just crashes sometimes
Nice save
Is it normal that this page looks so divided and with inconsistent newlines? https://pythondiscord.com/pages/resources/guides/off-topic-etiquette/
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
we use postgres, redis, and mongo
bump
whag is sir lancebot’s prefix
@dusky shore
.
thanks
i keep thinking about fun commands that are simple and easy to add
You can always check out Sir Lancebot's source if you're curious about it
hah
thx
152 forks 
>>> Me: .say Hello I am Sir LanceBot
>>> *Sir Lancebot deletes the message*
>>> Sir LanceBot: Hello I am Sir Lancebot```
would this command be a cool one?
That could be used to say some not so nice things
which is why regex is exist! filtering go brrr
@vocal wolf i think i actually found a modmail bug and that might be what happened lol
cc @sharp timber
Speak
lmfao
That's not always guaranteed, we can silently close channels
yours wasn't, though, which is interesting
well
yeah
like
i didn't get a close message but 6 seconds before i had gotten a message from a moderator
and i think that was followed by a close command
i assume this
that's what it seemed like
so i wonder if my channel was deleted but not fully closed on the other end so it was trying to relay the message i sent but did not relay it
because there was no channel or record
What is
__all__ = ("Bot", "bot")
In the https://github.com/python-discord/sir-lancebot/blob/main/bot/bot.py
What does that mean
It's a list of public objects of that module, as interpreted by import *. It overrides the default of hiding everything that begins with an underscore.
So that file is acting as a module
all files act as a module
https://www.python.org/dev/peps/pep-0008/#public-and-internal-interfaces extract from pep8 regarding __all__
Okay
Vhy?
A module is basically python is the code written inside the file
the regex module, the typing module, they all are just files
Because that's how Python work
You need an __init__.py file in importable modules, even if it is empty
8s 8t tho?
And there is a bot/__init__.py file
"8s 8t"?
M6 phone is *reezing wh8le I ty0e and #o some keys are long p4řssed
But I import it and my bot does not have an int int file
If you don’t have an init, you’re importing the file itself, not the folder
ok
Anyone have an idea why the docs command can't find discord.ext.commands? https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html
Ok sure
Oh that's what you mean
Point is how to make the docs command find it 😅
It's something about there not being a symbol for it
Poo
I have to paste that link like every day lol
I usually use commands.html though because it actually explains how to use it with examples
The command relies on the docs exposing the necessary symbols and providing tags to go off of in the html, in the case of that page there seem to be a few symbols around it for the sections or for the page itself. So for example you can do this but the names for things outside of normal objects aren't very discoverable to the users
!d ext_commands_commands
Commands
One of the most appealing aspect of the command extension is how easy it is to define commands and how you can arbitrarily nest groups and commands to have a rich sub-command system.
Commands are defined by attaching it to a regular Python function. The command is then invoked by the user using a similar signature to the Python function.
For example, in the given command definition:
@bot.command()
async def foo(ctx, arg):
await ctx.send(arg)
```...
class discord.ext.commands.Command(func, **kwargs)```
A class that implements the protocol for a bot text command.
These are not created manually, instead they are created via the decorator or functional interface.
👍 thx
THe page is also behind discord/ext/commands or something like that but because it leads to the top of the page iteslf instead of a specific tag I don't think it parses any content out of it
@brazen charm heh, nice.
Thank you again for the docs PR btw, feels so much better to work with these days.
I love my diff on the site repo
1 ++ 1 --?
we're not looking at this though
Hello, I'm trying to solve an issue for the upcoming Advent of Code and I'm having some trouble setting up the AOC calendar so I can test it. It requires a session cookie / join code which I do not have access to.
which issue is it?
I'm a bit late but... 😓
@sullen phoenix you around? Is your session cookie for your leaderboard still up?
yeah, here's my leaderboard's join code: 645282-edc03cc8
Could you send the session cookie to Lepto? I want to make sure we're still testing for multiple leaderboards~
you you can get your own session cookie by logging into the AoC site and looking at the cookies, Lepto
ah shweet, thanks
I don't believe I'm in the leaderboard
kutie sent me the stuffs though ! thanks anyway 😅
sir-lancebot#614 , sir-lancebot#618 , sir-lancebot#605 , sir-lancebot#649 and sir-lancebot#649
all of them need one approval each, if anyone has got sometime 
whoops, it is 649, not 615
@short snow re: wtf python
your comment on the issue implies that the command was meant to show the actual explanation/code.
Should I make use of the line pagination here, since some examples are really big. For example the walrus operator example.
any reason this is not part of the PR? was there a discussion/context that im missing?
yeah it was, lemme get the link
me and scal decided on that
somewhere in this chat
#dev-contrib message there
@short snow so it wasn't implemented because you couldn't think of a good way to do it, not because it was specifically decided against?
if thats the case, i would have some ideas
yeah, sure could you tell the ideas?
i can look into implementing
is there any markdown parser library alredy installed in sirlancebot? if so, use that
none are installed as of now
"You can get information about the Pride Leader on the Wikipedia command"
(from the pride leaders command) if the wikipedia command can do this why even have a separate command?
to specifically showcase notable LGBTQ+ community leaders active in the tech industry
🤔 fair enough
laundmo which markdown parser would be good? there are many and dunno which would be the best
in that case there a a few things to note about the markdown:
- all example blocks start with
<!-- Example ID: 11111-1111-111-111111 ---> - all example blocks end with a line containing
💡 Explanation - the last actual wtf block ends before
### ▶ Minor Ones
i would suggest searching for the header and after that the example id, and including everything until the explanation block on the first page (if that alaways fits) and the explanation etc on following pages
i personally used https://mistune.readthedocs.io/en/latest/ in the past, as its one of the only ones that can parse to whats basically a AST.
A fast yet powerful Python Markdown parser with renderers and plugins
that's what i did earlier, but there are many exceptions at places
so the regex would fail
the pattern doesn't maintain consistency
dunno if mistune would be able to parse it correctly i will still give it a try
umm 
got the latest version
installed with -U
carful: do you have v1 or v2? the docs i sent are for Release v2.0.0rc1.
i tried installing that, but it said couldn't find the version
fails with pipenv and pip
@short snow you installed the v1 version which is default when running pip install mistune but the docs are for v2
you need to specify the version when pip installing, as the docs say
i missed the c after r, 😛
ah
this looks nice, it might work, i will play around with it a bit more and commit the changes
(latex unload)
<@&267628507062992896> 
!c unload latex
:x: Could not find the extension latex.
!c unload Latex
:x: Could not find the extension latex.
.etx unload latex
🤔
.c unload latex
.ext unload latex
:ok_hand: Extension successfully unloaded: bot.exts.evergreen.latex.
I can't spell
and we should block it from working in dms
I blame this headache though
i did one of that reload
What's !c?
Got it
!extensions
Can also use: c, cogs, ext, exts
Load, unload, reload, and list loaded extensions.
Subcommands:
!extensions list
Get a list of all extensions, including their loaded status.
!extensions load [extensions...]
Load extensions given their fully qualified or unqualified names.
!extensions reload [extensions...]
Reload extensions given their fully qualified or unqualified names.
!extensions unload [extensions...]
Unload currently loaded extensions given their fully qualified or unqualified names.
👌
What's with the 3 reloads lol?
Latex command raises lance to the mem limit
People fucking with the latex command in offtopic
ahhhh
can we just rip out the setup function until it's fixed?
i did one of the reloads
where is it?
I had a lazy look on the two repos and couldn't see it
Was referring to Chris’ question
O
Rather hacky, but can't you just remove/comment that cog out for a while?
It’s an issue on lance, but I’m afk so can’t pull the number
I think the next step for this is honestly a local install.
sir-lancebot#705
I thought if it doesn't find a setup func it just carrys on with the loop, instead of erroring
noob question incoming: how would you install latex locally
its not like
you just open up google chrome and click on the download link lol
Getting LaTeX. Get to know how and where to get TeX distributions for Linux, Mac OS, and Windows containing LaTeX and obtaining LaTeX.
It is
Right?
ahh nvm, that's just for packages
We could prefix the filename with _
we can have it available on the node lance is running on or available in the storage that the nodes connect to if I'm understanding our setup correctly
I think we can restrict it... I think the setting is called paranoid? The only thing we'd have to check for is making sure we handle when someone tries to get it to loop forever or other silly stuff
what "thing" are you referring to? is there an issue for it?
Google says yes, both "paranoid" and "restricted" exist.
Is there an issue for this problem?
That was implemented, was it not?
Yes, on the repo where we track issues and PRs for the issues.
pydis_site/hosts.py lines 4 to 8
host_patterns = patterns(
'',
host(r'admin', 'pydis_site.apps.admin.urls', name="admin"),
# External API ingress (over the net)
host(r'api', 'pydis_site.apps.api.urls', name='api'),```
Well, the correct process here would be to make an issue on the repo so we can discuss it. Once it's approved and assigned to you, then you can start working on it.
github, gitlab, gists, and something else I think
Bitbucket
To open an issue, go here https://github.com/python-discord/bot/issues and then document (preferably with screenshots) what the issue is.
Would it be useful to have this information on the contributing page of the site? A lot of people reference those pages when setting up, so keeping it there might help.
it does send already?
Yes
.
A core dev will review it and if you'd like to contribute to the fix, a core dev will assign you
from: <your name> in: <channel name> in discord search
And yes, info is appreciated to make communication easier
I'm referring to this page: https://pythondiscord.com/pages/contributing/
If you can't document the error then we can't exactly know what to fix
So you want to limit the number of lines?
Yes
PR to fix this is here: https://github.com/python-discord/bot/pull/1551
For a bug, you want to provide whatever you think will help people find and fix the issue. Usually things like description, causes, reproduction steps, etc
But this is a simple fix, so nothing needed really beyond description
I plan on porting over the templates to more of our projects, but we will have a dev meeting at some point first
Cc: @vocal wolf
Not yet, the fix is being reviewed
we need a dev meeting, yes
If someone is already assigned, no
Unless you ask to work with them and get assigned
But it seems like the code is already written
So
do I PR a latex command which uses the local installation
and
do I have to open issue
I think you first should check with @patent pivot about this ^
hmm
theoreticlly we'd just install it in the docker image
we could maybe cache on the host
For bot#1547, is this good for the embed?
Not sure about the checkmark, it should use ✅ but overall that's pretty good
I'm pretty sure that check is the pfp part of the footer, right?
yeah
its because its actually an image slot to use a custom image
Oh hmmm
I used Icons.green_questionmark here
why is it named questionmark
Could we just plug the CDN url for the built-in emoji?
But that's not the Discord version of this, is it
oh
you mean this
Yeah, this exact one
but that's an svg and iirc they don't take svgs
issue is the image urls dont ^
Aaahh discord, consistency at its finest
Hmm couldn't you link it from the twemoji repo?
i mean, why not use a constant?
this is already a constant
Well, if we use the link we should store it as a constant
New constant?
I'm not too sure where this constant is from but it looks pretty bad in comparison to the other emojis
Should I just replace this
it can't be reused?
It doesn't really fit the Discord emojis if you ask me here
although ngl the constant has a pretty bad name Icons.green_questionmark
that's a checkmark.
bot/exts/help_channels/_message.py line 112
embed.set_thumbnail(url=constants.Icons.green_questionmark)```
that's where its used
This is what it looks like with the default emoji
this is the only use that i can see as well
Aha, it is used at the top of the help channel messages
You found it already it seems like haha
In this case it looks good because there is some vertical space under it
So this one is better?
Yes
Whoops I meant checkmark
It's still used in help channels though
Unfortunately you didn't.
It's actually a constant of question mark within the bot.
Yeah I know, which is why I messed up
Would that be out of scope for the pr to rename it in the help channels cog as well
I mean...it's a green question mark
wat
that is a checkmark
❓
that is a questionmark
you didn't
you didn't tho
bot/exts/help_channels/_message.py line 112
embed.set_thumbnail(url=constants.Icons.green_questionmark)```
That is the DM
bot/exts/help_channels/_message.py line 194
embed.set_author(name=AVAILABLE_TITLE, icon_url=constants.Icons.green_checkmark)```
i legit thought the constant was wrong
@vocal prairie o/ Just giving a heads up that since the guides have been migrated to the dewikification branch, you're free to start work on the search function
!src src
Display information and a GitHub link to the source code of a command, tag, or cog.
😛
Source code: Lib/inspect.py
The inspect module provides several useful functions to help get information about live objects such as modules, classes, methods, functions, tracebacks, frame objects, and code objects. For example, it can help you examine the contents of a class, retrieve the source code of a method, extract and format the argument list for a function, or get all the information you need to display a detailed traceback.
There are four main kinds of services provided by this module: type checking, getting source code, inspecting classes and functions, and examining the interpreter stack.
bump
theoretically it should just be 2-3 lines changed but god knows
What do you mean by local installation? Like using a latex distribution rather than matplotlib and starting with.subprocess?
Yes
Did what @gritty wind was doing not pan out?
No idea
I was thinking of still using matplotlib with the usetex=True configuration
ditching mpl entirely might also be possible ig
I see. Depends on how much benefit the mpl interface would provide. Hard for me to tell without actually seeing both implementations.
I think if we were to install latex then we should look into lightweight distributions. Even the most basic package on debian is like 150MB. Texlive is also not particularly fast from what I understand.
via mpl, it would just be the current code with one line added to the config
without mpl i think i would have to make a template .tex file, write to it and render in a subprocess
Yeah I found a ~150MB distribution too, though a SO post said ~75MB is possible
It's a trade off of performance and more features (ie more packages)
Odd
Also more work to set it up in the dockerfile compared to just apt get I imagine
It looked to me like it was only 105 mb
I saw as low as 10MB or something. No idea which packages it had though.
I probably already had 45 mb worth of packages installed
I'm not super concerned about space but it'd be nice to keep it low
I mean
if you're not working on the latex command
do you need a latex installation at all
No but
Docker file will install it anyways
Unless an env var could be configured to skip that in the image lol
@short snow went a little overboard with that docstring haha i didn't mean to make it that long, but i've approved nevertheless
If you’re talking about 100 and 150mb there isn’t much improvement over matplotlib
The reason processes didn’t pan out is matplotlib rendering would try to do everything in one step and basically overload the memory limits
Hey folks, an update. Discord have rolled out a service deploy and fixed the issue I reported about our bots not getting typing start and user update.
perfect, so now we can test whether the user is typing or not?
lol, just went on typing
yes, we can
So I think a PR is premature but using an external installation is probably the fix. Have you confirmed that the memory issues are circumvented when using an external install? The other thing to discuss is finding a distribution that has a good compromise between performance, size, and packages.
Have you confirmed that the memory issues are circumvented when using an external install?
Yeah, there are no memory issues when it uses the local installation
hah too late
i can just add it in my thing lol
am i good to start on that now?
dewit
epic, ty!
#dev-log message weee merged!
It matches subcommands iirc
!branding about
Can also use: branding current, branding event
Show the current event's description and duration.
is there a issue open about griff-ify command?
and would it be better to use an api, like https://github.com/Shivansh-007/griff-ify (needs more improvements)
or do it in the bot itself
@vale ibex to confirm on my issue, my current plan was to pretty much remove the individual commands in favour of just the two .avatarmod *ops and .avatarmod list, is this ok or should I try to keep both?
The main reasoning/issue that means removing the commands is better is that the ideal solution uses invoked_without_command in the group decorator, which means if I do .avatarmod 8bitify invert but there's a command named 8bitify, the command will take precedence and think that it was passed invert as an argument, not that it was passed two effects to apply.
The other thing is that I want to put each effect in a class like:
class EffectClass:
description = "A description of what the effect does, so I can use this in `.avatarmod help <effect>`"
def __call__(self, image: Image) -> Image:
...
```the issue i have now is that some of the effect commands take parameters, such as
```py
async def avatareasterify(self, ctx: commands.Context, *colours: t.Union[discord.Colour, str]) -> None:
```so I'd need to figure out some way to pass those as well.
The solution I'm currently thinking of thus looks something like this:
`.avatarmod *options` applies the options to your avatar with defaults that the effects provide
`.avatarmod list` lists the available options/effects
`.avatarmod help/info <effect>` shows the `EffectClass.description` for that operation
`.avatarmod effect <effect>` does what the current commands do basically, so an example command might be `.avmod effect easterify #87ceeb`
These should all work provided there isnt an effect called `list` `help` `info` or `effect` which seems fairly unlikely.
Wow this is a big message.
Yea, that sounds good. I'd like there to be a limit on the number effects you can do at once, or at least some limit on concurrency
yep, currently i have a constant called MAX_OPERATIONS set to 5
Also, my PR added root aliases, so .avatarmod effect may not be needed
but it can be changed
ohhhh yeah, thats very convenient
Yea 😄 Thank Mark for that, i just ported it from @stable mountain

lul
this would a really nice addition
a fine addition to our collection
Is this on concurrent operations, or number of options at a time?
If the latter, I think adding a max_concurrency to this could be a good idea.
thats max chained options, but yeah i'll add a max_concurrency too
Awesome 😄
Cool, thanks!
!source
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
!xyz
xy-problem
Asking about your attempted solution rather than your actual problem.
Often programmers will get distracted with a potential solution they've come up with, and will try asking for help getting it to work. However, it's possible this solution either wouldn't work as they expect, or there's a much better solution instead.
For more information and examples: http://xyproblem.info/
Yea, what about them? 😄
we should add one about how to get help, people always ask "where can I get help" and I always say #❓|how-to-get-help and #python-discussion
a more detailed command would be way betrter
We used to have one before, but it was abused and dropped without context
it should be added back
So we removed it, in favour of people writing actual sentences to users
how was it abused?
What would that tag even say that isn't easier to just type out?
just a single line
User A claims a help channel or asks a question
User A: "Hi"
User B: tag
The tag was just dismissive, used to often and too early, and often would just come across as rude to users, especially ones who have never used the system before
But again, what do you envision from this tag anyways?
can you re-post it?
Read the #help channel for information on claiming a help-channel or ask more simple questions in #python-general.
Never be afraid to ask questions, and make sure to ask them according to basic conventions: https://dontasktoask.com/
The first sentence is easily conveyed in:
Check out #❓|how-to-get-help to get help.
Doesn't really take much to type it out
As for don't ask to ask
That was blacklisted in the first place because while it's message may be relevant, it's quite rude in presentation, and is often dropped to quickly in a manner that had the same problem as the old tag
Read the #help channel for information on claiming a help-channel or ask more simple questions in #python-discussion.
Never be afraid to ask questions, and make sure to include your full-error, what you are attempting to achieve and all the problematic code so we can help you quickly.
?
Honestly, I don't see us ever adding back a help tag like this. When it existed before, it was used in an aggressive manner.
For example, as Scaleios showed above, a user would opened a channel with Hi or hello and would then the channel would get flooded by people sending the ask tag. Which is extremely off putting for new users.
Whereas a simple What is your question? or What can we help you with? is far more welcoming.
isn't all that info already in #❓|how-to-get-help
and at that point, won't it be easier to tell people to read it
bot#1111 btw
might want to comment and close that then?
That issue exists as it's something that we may consider if there is a good way to prevent it from being abused.
The last two sections summarise that quite well.
I think it would be a helpful tag but I conceed the possible agressivness of the use of the tag may be problematic.
Yea, that's the problem unfortunately. I agree it can be useful to save time, but due to the number of users in this server, it's highly likely to be abused if re-introduced 😦
maybe if it was exclusive to general and said something simple such as
Read the entirety of the #get-help channel to learn where to get help and how to ask a good and detailed question!
I don't honestly think it's all that useful of a tag, and the reasons for that require a bit of an understanding about why it was removed it in the first place. The tag is a very easy way of telling people to do something, the problem there is: users aren't expected to be told to do something.
If a user that isn't familiar with the help system comes in and says hi, they do so because that's expected in other settings. In their mind, they are just following the norm, and the next step would be waiting for someone to respond, then ask the question, like you would in real life.
Because the tag is literally one word, four letters, a ton of people would drop in, invoke it, then wait for the user to respond, without clarifying why they did that at all. The asker then may not understand why this block of text has shown up, or why people are typing random words in.
it feels much nicer as a user imo if someone says "Hey, you should check out #❓|how-to-get-help since this isnt really the right channel" anyway
No, no, no. you guys have misunderstood me I think
Consider these two scenarios:
User A claims a help channel
User A: Hi.
User B: !ask
Bot: ....
In this scenario, nothing is targeted at the user, and a block of text has randomly shown up
Second scenario:
User A claims a help channel
User A: Hi.
User B:@User AHey, please check out #❓|how-to-get-help (or hey, go ahead and ask your question)
no no no
the tag is for when people ask
"Where can I get help"
A lot of people come and don't exactly know which channel to ask so they just are like "where can I get help". I'm not thinking about people asking the question badly
But why would they read a random block of text
Why is a tag easier than saying: check out #❓|how-to-get-help
less characters and the tag can be more detailed.
in the search look for 'where can i ask'
and there are other variations of people asking, it's common. I think a tag would make it easy for helpers to respond to somebody quickly whilst helping somebody else.
I'll just go off your last draft:
Read the #help channel for information on claiming a help-channel or ask more simple questions in #python-discussion.
Never be afraid to ask questions, and make sure to include your full-error, what you are attempting to achieve and all the problematic code so we can help you quickly.
The second paragraph is about what type of questions to ask. The first is literally one sentence that can just say: "check out #❓|how-to-get-help"
It will also be directed at the asker from a user, not in a random text block from the bot which they may not understand is directed towards them, espically in high trafiic channels like #python-discussion
Then remove the second part, I agree with your reasoning why it is unreasonable
Hmm but without the second paragraph, there really isn't much left in the tag
If you want to ask a simple question, go ahead and ask it in the General Channel, if you need help on a more in-depth project then check out #how-to-get-help and claim a help channel.
But if you are looking for help on a specific topic, browse channels in the Topic Chat/Help category to see if any channels are applicable to you.
from !code
so fast to type, more detailed. common question. seems to be no reason not to add imo
I outlined my qualms with this being a tag at all here:
It will also be directed at the asker from a user, not in a random text block from the bot which they may not understand is directed towards them, especially in high trafiic channels like #python-discussion
The fundamental flaw with that message imo is that there is no context in which it makes sense. The only place where it makes sense to direct people like this is in #python-discussion, in which case you can drop the first sentence. You can drop the second one in favor of "check out #❓|how-to-get-help". The only thing that tag adds is the third sentence about topical channel (even though you can tell users the correct topical channel directly). Anyways, I don't think one sentence is enough to displace the problems with a tag.
!code @gritty wind
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
Right, so imagine this in a fast scrolling channel like py-gen
a random user has pinged me with nonsensical words
not really clear what I'm supposed to do from here
Which was also a reality of the original ask tag
Oscar: !code @slow bone
Here are the best channels to get help:
If you want to ask a simple question, go ahead and ask it in the General Channel, if you need help on a more in-depth project then check out #how-to-get-help and claim a help channel.
But if you are looking for help on a specific topic, browse channels in the Topic Chat/Help category to see if any channels are applicable to you.
Modmail: ?
Oscar: Read bot's message :)
Understand this above scenario is not 100% of the time, most times people understasnd instantly
Could also be a in-build functionality of the bot that if you @ somebody in the tag calling it will send it in the tag-text itself.
len(check out #❓|how-to-get-help) < len(Read the bot's message)
I think you are saying some false intuitions on how fast general is, sometimes it is very slow and usually it is at max 1 message every 6~ seconds
It doesn't have to scroll at all
but how do you connect between a random bot message, and someone pinging you?
Not needed all the time and the tag also talks about more stuff.
I outlined how the only thing the tag adds is topical channels
This server is full of Python Programmers, we are not stupid. Even a basic human should be able to figure it out. By this logic we might aswell remove every other tag that can be used to answer a question.
Even if, in some cases; people will not understand it. Your logic still applies to most tags avaliable.
They are still mostly functional.
What is the connection between someone pinging you, and a random bot message
After a bot command prefixed by a symbol "!" is sent a bot sends a message with the header "Here are the best channels to get help:"
As for the other tags, the only one I think really applies to that is resources, what other ones are used in py-gen?
I think the relation is there.
Ultimately, if you are 100% sure about your viewpoint, leave a comment on the issue. We'll discuss it in a staff meeting, and maybe vote on it
The main concern I see with the tag is people just throwing it around. You're assuming the best case scenario where both the sender and the recipient understand what's going on and are using it properly, but previously with the ask tag it being sent instantly after a help channel was claimed (even when the claimant was typing out some kind of an explanation to the code for example), with no later communication from the person who sent it was a frequent occurrence. That is not something that you can really fix with wording imo as long as the idea of the tag remains
"how do I make my code look like yours does"
!code
"how should I start to learn python?"
!resources
"what is the xyz problem?"
!xyz
I don't know all the tags, I think it works im more.
I stated earlier how it would be a good idea to make the tag specific to pygen
In my opinion, it's rather insensitive to through some random tag at someone, especially since many people ask that right when the join the server. It's much kinder to actually take the time to welcome someone and direct them to get help if needed.
I assume that the tag would be sent in py-gen after somebody asked where to get help, if it is not used in that scenario it really should be discounted and most people will learn to do so.
It's more detailed, easier to type and helps the user more.
But it's insensitive. We don't want this server to become people throwing random bot tags at each other 24/7, we want it to be a friendly, welcoming community where we can have (virtual) human interaction and chat about Python.
I think the same things apply, even if at a smaller degree because more people are active in the channel
And tbh, not as many people read bot tags as you think. When they see embeds, a lot of people just ignore them.
Is it any better to throw a channel name at them #❓|how-to-get-help ? You are taking my examples to extreme lengths that are simply not realistic, they will be sending it 24/7, just in the case somebody asks where to get help. It's a one-time question people have which elimiates the need for them to ask again.
Stop trying to disaprove of this specific embed by disaproving of all embeds, they are useful, widely used and approved by the community. It's just the same.
can I get a link to the issue? I can't find it.
it's this one
be nice if this was a thing lol
maybe I should just make a new issue with more details instead concidering this is simply different.
I thought it was, guess I was just mistaken.
huh. what about using replies for this in the bot
so if a person replies to a message with a tag, the bot will reply to the same message
that'd be cool
but only in #python-discussion
i don't know if its possible in discord.py
it is lol
good idea then
That was suggested, but I don't know if it was ever implemented.
!d discord.Message.reply
await reply(content=None, **kwargs)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") to reply to the [`Message`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Message "discord.Message").
New in version 1.6.
Only the person who "summoned" the embed can use the trash can

and only for around 5 minutes too
i'm going to start making an issue
bot#1382
…why is double ping such an issue?
it's not
in this issue it is
if ur worried about actually pinging a user twice in the channel, just send the content and then edit it to actually mention
that way you get the orange color but not the rest of it
would enjoy input @gritty wind or @vocal prairie
!help is an existing command
FUCK
lol
what else could it be
!gethelp
yes, gethelp
bruhhh
already I cahnged the title 3 times
filters are moving
?
We're redoing our filter system so it's more cohesive, adaptable, and makes more sense.
take a look at site#482 and bot#1530
and site#479
It's not being removed, I just created a new branch without the old filters system so that the bot is still functional
The commit message says it will be brought back
@sleek steppe the bug you'd commented about in the image commands PR became an issue lmao
i wonder how this works
is there some sort of size restriction or something that's making it get sent separate from the embed
you need to make the filename url safe i think
I think it's names with spaces in them
yea, that's what I thought I did
when i add () to my name it breaks
oh, () are valid filenames in unix
perhaps urllib.uriquote
no thats with change
ok
Ummmm… Lance just died when I did .savatar. No response
After typing for a while
And I haven't changed my pfp for a day or two.
yep, we got the error
ok, sir-lancebot#713
This is what I have now
looks cool
does it apply random rotations?
I don't think so
Then what does it do?
slices the image into tiles and rearranges them it seems
Yep
Isn't that what .splitify does?
It's being worked on iirc
.splitify is this
Ohhhh
look at sir-lancebot#687
mosaic seems like a good name
I think the .issue and .pr aren't really needed with the dsfasdf#234123423414 thing
That's true
the new code snippets feature should probably become a part of that cog
True, we could def use a consolidation of those features into one cog that makes sense
do they give extra info tho?
.pr quackstack 37
.issue python-discord/sir-lancebot#1
.issue 1
sir-lancebot#1
nope
ok yeah its kinda useless then
i think rather than removing it maybe it would be worthwhile to increase the info it displays, such as including the author
Yeah, I think maybe having like a "github" cog or whatever that contains these features would be helpful
.github
Because the asfasdf#11214 and having .issue and .pr feels needlessly redundant.
.github kutiekatj9
.github
Can also use: gh, git
Commands for finding information related to GitHub.
Subcommands:
repository [repo...]
Fetches a repositories' GitHub information.
user <username>
Fetches a user's GitHub information.
.github user janine9vn
No organizations 
could i create an issue along the lines of "Increase the amount of information given in .issue/.pr commands"
Basically, remove the ability to have multiple issues/prs since normal detection can do that, and add author details
Yeah it was changed to a group
lolno, I'm not bout to be doxxed that much
doxxed?
You can selectively enable which organisations for which you publicly display your membership
Listing of my organizations would very quickly reveal who I am and I don't want the link between them ever. So I just don't list any.
hm, didn't think of the other ones, just meant pydis
python-discord should be fine right?
I don't want people from org A to necessarily know who I am here. I don't want people from org B to know who I am over there and I contribute to both.
but no pressure lol
ah
anyways, bump :P
You're contributing to public repositories but fair enough, I suppose it would make it easier to find.
I am, but there's not that much of a link from my github username to the one here unless you look particularly hard.
It can allow for more discussion about it at the very least, so why not
.github/pull_request_template.md line 18
- [ ] Read all the comments in this tempelate?```
Sure
Hello! I was thinking about how to implement search for the website, and I was thinking that it could get the headings and stuff using beautiful soup for the html. But I don't know how that would work for markdown. Any thoughts?
Why do you need to get the makrodwn?
Markdown*
is this the right channel for questions about contributing to python or is this specifically only for the discord ?
It's specifically for this Discord's project. If you have questions about e.g. CPython contribution, I think #internals-and-peps is an appropriate place.
ok thanks!
@tawdry vapor bot#1555 merged
Thanks
oh
Whenever you're available, then
Does anyone know the Discord username of this person? https://github.com/doublevcodes
@clever wraith iirc
@clever wraith if you are in fact the in question person, were you able to make any progress on this?
https://github.com/python-discord/bot/pull/1410#issuecomment-828001506
fwiw it is linked to their discord account
Because a lot of the files were moved to markdown in the site repo
As part of dewikification
To implement search
but like
why does that require parsing the markdown?
do you need to know all of the formatting?
I need to know the content
Specifically, the headers
Right?
Or is there something I'm missing?
but then you would just need to parse the header---- ohh
🤦
there's request headers and text headers
i was thinking you meant request headers
why? NO IDEA.
If you have time to commit/push, go ahead.
That could work
I also need to search for multiple types of headers
So I guess I could programmatically generate a "sitemap" with all the headers listed to use internally
obviously you would need to check how many there are lol
The bot doesn't include docs for Pygame right?
!docs
correct
Could we add that? I see a lot of people asking about Pygame
Look up documentation for Python symbols.
Is this the kind of index you would need? https://www.pygame.org/docs/genindex.html
I'm not actually sure, I've never added to the docs command before
Probably https://www.pygame.org/docs/objects.inv and https://www.pygame.org/docs/ref/
You'd need the objects inventory like and a base url that^
!docs setdoc
package_name
!docs setdoc <package_name> <base_url> <inventory>
Can also use: docs s
*Adds a new documentation metadata object to the site's database.
The database will update the object, should an existing item with the specified package_name already exist.
Example:
!docs setdoc python https://docs.python.org/3/ https://docs.python.org/3/objects.inv*
Probably https://www.pygame.org/docs/#reference instead of the second one
No, that doesn't make sense
Or just https://pygame.org/docs
It's probably docs/ref
Since https://www.pygame.org/docs/draw.html#pygame.draw.circle is invalid
Well yeah but the /ref/ part might be in the inventory
We can always remove it from the system, I think Mark's links are correct.
!docs setdoc pygame https://www.pygame.org/docs/ref/ https://www.pygame.org/docs/objects.inv
HTTP GET on https://www.pygame.org/docs/ref/ returned status 404, expected 200
oof
So the base url doesn't have ref?
!src doc setdoc
Adds a new documentation metadata object to the site's database.
It makes the assumption that the base URL has to be 200 but there's no technical reason why it should be
Like it can be 404 but its children can be 200, as is the case with pygame
Is the base url only for when you do !d?
No. It's used to generate the URL to a symbol.
Ah ok
isn't that the main thingy
!d discord
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
no, i guess not
can we have a discord.py tag explaining why to use .listen() over .event?
i don't think that's necessary, the docs for listen explains it quite well (with examples as well)
!d discord.ext.commands.Bot.listen
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/stable/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...
ah the example gets cut out off the embed now, but easy enough to click the link
for that we will have to leave discord, it could be better if we make one for own, adding few more points if needed (?)
Is leaving discord such a big issue when the recipient is already probably navigating between their editor, docs and discord?
uhh nope
There was just an interesting idea: what if the python bot moved help channels with only the claimant's messages to the top? People looking for people help could easily find people in need, and the chance of getting buried decreases.
i think it has its benefits, but in the end it means more state tracking of the channel which might cause weirdness if any events were dropped, that being said the weirdness applies to everything so /shrug it could be cool
There were issues previously with moving channels around frequently, not sure if it'd still be an issue but having the channel move around may not be the best for other people as they'd have to remember the names instead of just the order
I mean a command that prints or DMs the user channels which need help - that way, states only need to be gotten when a user queries them: it could DM or print a list of all the channels which are not attended to and their first messages. It's easier to scroll down a list with the owner, first message, whether it's been attended to, than hunting through the channels and scrolling to the last messages. That being said, its utility could be questioned...
I believe something like this has already been discussed a couple of times, but no idea if a consensus was reached
Ah, aight :D
what about a bot-managed message like the one in #❓|how-to-get-help with unanswered channel links?
having the order change in the channel list is disorienting for members that switch between channels
Good idea: an entire list could be maintained of all help channels and their important information
Where would it be kept?
A new channel maybe? #help-info
wdym?
The dynamic message showing what help channels are available for claiming hasn't frozen
Ah yes :) this is about the help channels that have been claimed but haven't been answered yet
Functionality is questionable tho
I know, just commenting on the other feature that we currently have.
Ohhh, ok
I like this idea, would we still go with a redis cache just like the dynamic help channel message?
Isn't there already something like a cache of unanswered channels? I'm not sure
It'd have to solve the problem of not receiving messages while restarting
So it'd have to peak into some channels at start-up.. although I think that you can get something like the last message ID in each channel from just the channel obj? So there may be a neat way of doing this check that doesn't require any additional requests
I'm not too familiar with the help channels ext though
We used to have a different emojis for unanswered questions, I'm not sure if we have a cache for it though
Not like it would be too hard to add anyway
Does last message id always point to the last message in discord or is it just updated from the events it receives?
Oh yeah unaswered comes with the problem that a second msg from the claimaint shouldn't mark it as answered
So last msg ID wouldn't work anyway
It could be used to at least check for new messages
Yea, true
So something like "repeat: get message, is it the owner's ID?"
That wouldn’t really work, it could be the owner responding
Just checking if the cached id and the current id are mismatched on a restart. If they are it'd go through the history
You have to find the first message in the session
Claimant ID is cached I'm sure
if we also knew the msg id of the msg that claimed the channel, we'd be able to minimise the amount of requests needed
yea, there is a claimants cache which holds user IDs and question_messages which holds msg IDs
well it still wouldn't work though
But then, wouldn't we need to match every message to claimant ID?
because the claimant could have sent something after someone answered yea
well at least it'd minimise the amount of histories that need to be checked
but just checking the last message wouldn't be enough
The time of last message needs to be cached too, because of dormant, so every time a new message is sent, can we check if it's the claimant?
but then two simultaneous messages would break it.
what if we cache the first messsages when the channel are opened?
and then on on_message, compare the msg id with that help channel's first msg id which was cached
if same, put that in #❓|how-to-get-help
if not, continue
or whatever channel
and btw akarys, i have pushed the tests for enhacing incidents
How would you get an on message without a second message 👀
Just put it in automatically and remove it in a message event
Maybe compare the author
As for state syncs
welp, yeah
Just ignore it
that would be a good solution
hay guys how do u move channels without rate limits?
like from Occupied to available
We don’t
There are limits
And we take them into consideration when designing the system
Some choices in the past have caused us to reach the limit, and sometimes we have turn certain features down
ok thank you for the reply
Discord.py handles ratelimits quite well though
Discord.py will never get 429s unless you
A) are working with reaction endpoints
B) are running requests outside of it's internal handler
yea, we're just bullying testing lancebot
oof
C) Are working with channel names and topic.
I haven't gotten 429'd in dpy before 🤔 and I've spammed a lot of times, including reactions
If you want a quick path to rate limits, try renaming a channel
Counting channels mean we can’t have nice things
Somebody once thought they could rename a channel as a minute long countdown to something on Reddit
That was a fail
Wdym
shouldnt
I've gotten them before so
unless your bot is restarting a lot and losing its ratelimit states
Would an unload and load of the cog that did the edits affect it?
nope
Then idk what to tell you because it does get the 429s
i dont have enough time to explain how libs like d.py/corded do ratelimit handling, but at a high level each route has a bucket, when you send a request that bucket is locked until the request is over so you can only have one request per bucket concurrently, the headers are examines and if the remaining is 0 it sleeps until the reset-after time before unlocking the route
Oh
That actually might explain editing channels
Since.... Not every parameter does cause a rate limit.
That makes sense
Ah nice a tag speedrun
was there an issue for this blocking tag?
this feels like it's written with the dpy audience in mind; and i'd still point them to the FAQ on blocking as it feels like a better explanation https://discordpy.readthedocs.io/en/stable/faq.html#what-does-blocking-mean
This tag doesn't talk about blocking, even though it should
You should probably mention the issue in the PR description instead of the other PR
Previous user became inactive so I approved @clever wraith to take over.
@sleek steppe noice bot#1556
thanks
@tough imp you're still planning on doing a full review of bot#836, correct? Just making sure that it'll eventually happen.
I will attempt tomorrow
Thanks!
I've got an idea.
The .bookmark command can have an argument "secret" so that when you invoke the command, your message gets deleted.
And maybe a unbookmark command?
I don't like that idea
I think that relaying user messages permanently to user DMs is something that should definitely be public. I think if anything we should make it more visible that has happened.
Unbookmark sounds alright, I'd be alright with that (we could implement with replies or message links)
Well, sometimes, the bookmark is not needed, so there is no need to keep it in the dm
Ah ok
yeah sorry, was replying to the other one first 🙂
🤔 how would the command differentiate between normal bot replies in the DM and "bookmark" messages?
U specify the bookmark msg ID, which the bot had sent to you
And we can match for embed title
we know the structure of a bookmark embed, yea
🤔 honestly don't see the point, but if everyone wants it 🤷♂️
i got that when you said it earlier, i just don't see it being a compelling enough reason
but maybe that's because i don't use the command often
likely yeah. tbh though i'd be using the dm channels pins for tracking important bookmarks in that case instead, but I can also understand if people just want to remove it entirely from dms. each to their own.
I don't think it's particularly useful, but it's also not particularly harmful and not a large cost to add
ye
ah 👍
Also sometimes, your dms clutter up with game messages, so it is hard to navigate through them, maybe we can have a solution for this too
Yeah, and other games too
hmm.
That was for Ankith, he asked if I was referring to battleship, and deleted it
yeah thanks for announcing that 👍
I was confused to whether the bot DM messages get deleted or not. I went to check and yeah, a lot of battleship gameplay messages there 😂
since I remember the bot deleting its own message "x has played, now its your turn" "you missed" "you hit" (or smth i dont remember correctly)
but my own messages aren't getting deleted. (the coordinates)
Would anyone be willing to review this? It's a rather simple pr. https://github.com/python-discord/site/pull/476
Pining sounds like the right solution
Yes, but pins have a limit right?
For the ppl who do bookmarking a lot ^
I misunderstood what you were talking about, mb
there is a command to force change an ot name?
no
Nope, but the admins have edit channel perms haha
hm.
Say you play battleship a lot, and you want to look at your bookmarks, currently there is no particular way to do this rather than just scrolling across the dm channel.
So what akarys suggested was to pin these bookmarks so we can view all of them together, but there is a limit to number of pins a channel can have so there is indirectly a limit to number of bookmarks too then
Yeah I got it after
I just thought you were talking about the results of the games rather than the bookmarks
Ah lol
on this, right now the bot just silently ignores it if you try using the command in your DMs, shouldn't we make it guild-only?
https://github.com/python-discord/sir-lancebot/pull/603#discussion_r584463410
@fervent sage fight me
the bot doesn't make sense. I just did .wiki something and someone other than me was able to change pages by reacting with left and right and even trashcanned it and got it deleted. I thought that could be done only by the person who invoked the command?
oh.
Might just be for that command
Does Lance have a centralized paginator like Python?
Aaaamd stealing that for my bot lol
django.core.exceptions.ImproperlyConfigured: Set the METRICITY_DB_URL environment variable
i get this error when i run pipenv run start, so i did export $(cat .env)
but still doens't work
# .env
DEBUG=1
LOG_LEVEL=INFO
DATABASE_URL=postgres://pysite@localhost/pysite
SECRET_KEY='q4LdTplNaG2RazKV-UkbK5GxSp82_EenlIMohZZ_sDU'
Dumb question, but did you set the METRICITY_DB_URL env var?
nope, wasn't mentioned in setup.md
If it's site, then https://pythondiscord.com/pages/contributing/site/#2-environment-variables mentions it
Maybe setup.md isn't the most updated
The guide on the website is better ig
works, but Database could not be found, exiting.
Are you doing it with Docker?
# .env
DATABASE_URL=postgres://pysite:pysite@localhost:7777/pysite
METRICITY_DB_URL=postgres://pysite:pysite@localhost:7777/metricity
DEBUG=1
SECRET_KEY='q4LdTplNaG2RazKV-UkbK5GxSp82_EenlIMohZZ_sDU'
STATIC_ROOT=staticfiles
nope pipenv
yes
Ah, then idk.
and the db exits
I've only done it with Docker
If the database is hosted locally i.e. on the same machine as the webserver, then use localhost for the host. Windows and macOS users may need to use the Docker host IP instead.
If the database is running in Docker, use port 7777. Otherwise, use 5432 as that is the default port used by PostegreSQL.
You're using port 7777
You should be using 5432
That wording is a bit confusing
7777 is actually the correct port
7777 is the port the docker image exposes to the host, so if you are running the DB using the DB's docker image, that's what you use
Even if it's not dockerized? Jason is using a local db with no docker
dawn was right, 5432 works
5432 is the port if your DB is installed locally
outside of docker (and our docker setup)
Are you not using the compose's DB?
nope
running locally
django.db.utils.OperationalError: FATAL: password authentication failed for user "pysite"
FATAL: password authentication failed for user "pysite"
``` btw, this is what i get now
Why'd you decide not to use Docker?
docker is really slow when i start it, and if i keep it running 24/7, my system goes slow.
i followed the steps mentioned in the guide

