#dev-contrib
1 messages Β· Page 51 of 1
When a help channel is moved, two separate channel update events are sent: one for the channel topic edit and one for the category change. I'm trying to suppress the mod log for them, but I can only ignore one event. Anyone have ideas for how to fix this?
The mod log could be hard coded to ignore help channels but I'd rather that be a last resort
i have an idea but it would require updating the logging first
You could add the help channel categories to an ignore list
specifically it would allow us to suppress any activity logs with a context manager or a function decorator
Maybe should ModLog.ignore events changed to t.Union[Event, t.List[Event]]? So this support multiple events? But yeah, this need bigger changes I think?
It's the same event
Context manager would make the most sense, I think
That'd give more granular control, right?
It uses a dictionary with the channel as the key so I cannot store the channel twice
yeah this idea wouldn't be limited to a single channel suppression
it also wouldn't conflict with other async coros running, so you'd be able to await inside the context manager and would still correctly suppress
So consensus is the mod log would require significant changes to facilitate this? If that's the case, I can hard code ignores for now and it can be changed later.
if it's more simple for you to do so, then sure
Well changing the mod log seems out of scope
sorta, unless it's more complex to work around the issue than address it
Implementing a context manager would touch a lot of different things, I'm keen on the context manager idea and I think we can live with spurious logs until it's implemented
tasty
Well I could just do nothing but I figured if the temporary patch is simple then why not
that makes sense too
We could also just implement the context manager and update the other cogs later
if the patch is super simple to work around it, it'll probably be better to tackle modlog/logging in it's own PR
did you already change devlog to an event dispatch mark?
I think I can just copy this ```py
is_help_channel = (
getattr(msg.channel, "category", None)
and msg.channel.category.id in (Categories.help_available, Categories.help_in_use)
)
I used it for the codeblock embed
righto
No, I did not change to event dispatch
coolio
then i'll try draw up something tomorrow with the proposal for the logging changes
i'll make a quick issue ticket for now with some basic details that can be fleshed out at that time
not meaning to delay it, it's just getting a bit late for me now as it's 2:30am
OK that sounds perfectly fine
I think I'll leave channel creation unignored for now cause I don't feel like writing a helper function for this check π
Besides it may be kind of useful to know when a new channel was created
lol that's fair enough too.
So new help channel system will be released very soon?
yep
Nice
Guys actually I have idea about your bot everytime you help the people they will give you a point and it will create a leaderboard so the people can see who is the best developer and the guy who give the point put a timer on him
@sand mason nope. we don't wish to gamify the server at all
thanks though for providing feedback, feel free to think of other ideas
Tends to create quantity help rather than quality
Much appreciated
I think who boost your server they should get benefits from others
They get a role
I think I got idea: Maybe add something like .challenge command to SeasonalBot to get random coding task/challenge. But this mean we must collect much challenges
@valid quest na just not a role separate help channel
@sand mason We decided to provide only a role as we don't want to divide our community at all.
People start to feel entitled and other members end up feeling snubbed
@mellow hare ok I got u
@cold moon this is something similar to an already proposed idea
Oh
just gonna see if i can find a little details about it
Yes, it's on our list for discussion at our next staff meeting if we have time. It's on a lower priority, but it's so far considered a good idea to have some form of simple challenges available to members. It's not exactly the same as your thoughty, but it's similar, or at least might help address a similar thirst by users who might be interested
Initial proposal was in Apr 2019, so it has been delayed by a fair bit, but I'll try make sure I focus some time on getting some traction on it in the near future.
Okay
https://github.com/python-discord/bot/issues/778
I have another idea for implementing this:
Convert the Tag md files into json files and add a field called restricted_by or use_by whos value will be a list containing the roles that can use the tag.
OR
In the constants.py file, add a dict which stores the roles and the tags that can be used by the users having that role
Why can't we do what is suggested in the issue and use subfolders
Converting them all into JSON defeats the purpose of using Markdown on GH as a format that's easily editable, and we shouldn't have to touch constants every time a tag is added
well then we have to move files around
And even if they did, what's wrong with moving files?
using the constants.py file or just adding the dict in the Tag cog file?
we shouldn't have to touch constants every time a tag is added
To contribute a tag you shouldn't have to do anything except write the tag
got it
Not have to remember that you need to edit x, y, and z file otherwise it will be broken
Id like to work on that
ok
I heard something like Markdown Metadata. This should 1 solution for this? Add something to there and check in python.
@eternal owl
!resource
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
@crimson tinsel Did you follow the set-up guide on our website?
yeah i think I followed all the steps
Okay, and you get:
discord.ext.commands.errors.ExtensionFailed: Extension 'bot.cogs.tags' raised an error: UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 626: character maps to <undefined>
Does the bot work otherwise?
yep thats what im getting, no it doesnt start up :/
Hmm, how are you running it?
Sounds like encoding='utf-8' is needed when reading some file.
@cold moon we'd have to parse the markdown ourselves if we went down that route
but I agree markdown metadata would be cool, and extendable, I am open to the idea
Quick suggestion: a system that detects non-ascii nicknames (as well as other nicknames that don't fit our rules)
Im running it on python using python 3.8.2
Maybe put some resources on the issue regarding usage of it in Python, from what I remember it's a section like this at the top of the md file:
---
tag_name: blah
lowest_role: 267630620367257601
---
@crimson tinsel There's an opportunity for you to make a contribution here. I believe you can fix this error by adding encoding="utf-8" to the arguments of read_text() here https://github.com/python-discord/bot/blob/master/bot/cogs/tags.py#L45
@patent pivot that particular "header" thing is called frontmatter
it was popularized by jekyll, I think. I use it in most of my projects which do markdown nowadays
@valid quest that has been a suggestion before, I think we opted against since we decided we only want to moderate nicknames which are directly affecting users, so if they are spotted in channels we will moderate but we won't moderate for anything more than that (with exception to things which could cause client damage, like those weird text combos on phones etc.)
@clever wraith Jekyll is where I first used it as well, yep
Potentially, but I think it's wider than that
For example, if a user has a name like . . . . . .
technically complies with our guidelines, but since we reserve staff judgement we deem this not acceptable and would not allow it
same with repeated characters etc.
which in some places are fine and others are not
Yeah, but isn't a basic system like that going to be helpful?
Probably will just notify in a log channel or even ping when needed
@tawdry vapor That fixed it!!! Thanks!
Would appreciate if you could create a PR for that fix
If so, i would love to work on in
I will free some time for it if there is a need for this system
First off open an issue on the bot repo so everyone can comment their thoughts
Will do!
@tawdry vapor not sure if you can help me again, i think i set up my test server wrong. I keep getting errors like this
File "C:\Users\Kmont\.virtualenvs\bot-uMBUYHkk\lib\site-packages\discord\ext\tasks\__init__.py", line 73, in _loop
await self.coro(*args, **kwargs)
File "C:\Users\Kmont\pycharmProjects\bot\bot\cogs\verification.py", line 205, in periodic_ping
messages = self.bot.get_channel(constants.Channels.verification).history(limit=10)
AttributeError: 'NoneType' object has no attribute 'history'```
Your server is missing the verification channel or you did not change its ID properly in the configuration
awww okay, it doesn't say to create it in the guide
Needs to be edited
Verification cog used to not load by default but that was changed recently
I suggest you just create every channel and role that's in the config
okay will do!
@patent pivot https://python-markdown.github.io/extensions/meta_data/ this is how to make this easily
Alright, Joe I opened the issue for the topic, also added some examples of checks we can use- https://github.com/python-discord/bot/issues/856
Hmm have you considered str.isalnum @valid quest
The nickname policy says as long as it is not noisy and mentionable
numbers should be fine I think
Also there are cases when it can be fine, that will fail the check
Yeah, that is why isalpha is less usable, and i went for the first solution
So probably partial checking instead will make it better, like py any(map(str.isalnum, name))
Or make that even stronger - we count how many char is mentionable, 3 is a good count
sum(letter.isalnum() for letter in name) >= 3```
is this ok ?
It's fine lol, poor the cf8 guy that got mentioned though haha
Yeah lol
I guess it is fine for a base, let's wait for others to take a look at it
@clever wraith If it's too long you have to break it into multiple lines, consider brackets / the old .format()
But yes, what you are doing is also fine, try to even the lines imo
no eww .format() really needs to die
Actually it's fine, specially if you create a string template
.format() is very very powerful
I did, and I imagined a situation like this
whatever , i commited , and i pushed multiple commit at once this time :yayy: finally using proper git tool
A: hello, this is a very nice article I found
B: Nice!
C: very very nice!
D: wow, let's talk more about it
20 messages later
A: .bm```I would expect that `.bm` to refer to his previous message
Or, the message right above it
Bookmarking a .bm is meaningless
Like in this screenshot
I definitely do not want to have that among my DMs
Whenever I look at it I have 0 idea what it is about
we can use channel.history
It can be, yes
in that case we need to use history
It should be discussed more about what will be .bm instead
Still, I do not want it to bookmark a .bm
I mean this is where you can discuss btw
@gusty sonnet I also fixed Space Cog PR.
@clever wraith Please try to see if a review can be applied to other part of the code, you've removed a blank line between try and except but you did not remove them between the excepts:
except discord.Forbidden:
await ctx.send(f"{user.mention} Please enable your DM to receive the message.", delete_after=7.5)
try:
await reaction.remove(user)
except discord.Forbidden:
await ctx.send("I don't have permissions to remove reaction.", delete_after=7.5)
except discord.HTTPException:
await ctx.send("Unknown error while removing reaction.", delete_after=7.5)
except discord.HTTPException:
await ctx.send("Unknown error while sending bookmark to user.", delete_after=7.5)
else:
sent_person.add(user)```
You might also want to do that as well
I mean cmon , it remove the cluster except block are already making
I like how it is right now . it is much readable
That's what indentation is for
wouldn't something like .bm 5 work? bookmarks the fifth message up
Adding more blank lines does not automatically make it more readable,```py
if cond1:
func()
elif cond2:
func()
if cond3:
func2()
elif cond4:
func3()
else:
pass```is definitely not readable
And yes that's a good idea @clever wraith
Just that you gotta be fast
true
ah yep
Which solve the racing issue
oh so now what will be the type notation for target_message ?
union(int, discord.Message) ?
Ps. I never used union
There is
I mean a small wrong mention and it will stuck in channel.history
Nice
that is capable to crash bot itself
@gusty sonnet Using links? or just ids
both
Im not sure you can get message from link but
Either is fine
Ah cool
ids if it is in cache
message jump_url works
yeah
wouldn't something like
.bm 5work? bookmarks the fifth message up
I feel this is better
than mentioning one
cuz that can lead to bot stuck in in loop until we define a limit
ok choose one
.bm 5
or
.bm @clever wraith1
Or you can define the limit yourself. That's why I'm raising it in the issue as this is a design issue
yeah i am gonna limit it to 20ish
Jumping straight into code will lead to a lot of changes / unnecessary commits
I feel user mention is better
You can make it possible to do all 3
cuz bot can maybe get confused as message.id are also int
.bm message_link .bm 5 .bm @user1
You can
Yes and no
Yes, it looks the same for us
No, it will give you an int if it fails to convert it into message, that's why the order in Union is important
And either case, you need to check its type anyway
don't you think we are going overkill here ?
I definitely think we need to discuss about the pros and cons of each way, yes
As an user, what is the most convenient
Like no one is counting message up specially in a fast chat
@ user is wayyyyyy better
Yeah, i can agree on that
and counting can also lead in confusion , like does it starts from 0 or 1 ?
That's true, specially in a crowded channel
anyways, you usually you bookmark something that is going to disappear
Counting always starts with 1
or does it ?
index starts with 0 because it's the distance from the first element
You never count first apple as 0
You index it as 0
About my Tag trashcan PR: Should this ignore these messages in ModLog or not?
What do you mean @cold moon
And that has nothing to do with counting starts from 0 or 1 @clever wraith
Like when you click on trashcan emoji, this log to ModLog !tag <tag> message delete. Should this ignore it?
Ah, that's fine, you are deleting a message from the bot
ok
As an user, what is the most convenient
@gusty sonnet por que no los dos?
they're not mutually exclusive, are they?
True, they are not haha
But if I can choose, I'll prioritize user's experience
Since there are 40k users and only 40 devs? π
very true
@gusty sonnet
async for message in ctx.channel.history(limit=20):
give me a reasonable limit
if type(target) == discord.User:
async for message in ctx.channel.history(limit=20): # Takes last 20 messages from the channel.
if message.author == target:
target = message
break
actually this
i am keeping it 20
does this read top-down?
as in, won't this take the first message with the matching author in a 20 message range? @clever wraith
so for example
this message is first and ^ is second
kinda same as how search works
k
was double checking, wasn't sure how it ordered them
all of the other repos are already archived, including code-jam-6
STUPID GIT TOOL
I had commited and before pushins i did pipenv run lint , and there was a issue so i reverted what was causing that issue with a commit message , now when i pushed it only pushed last commit , fucking whole commit message
this is a development branch, right?
just fix it and force push :)
what is this ?
the docstring should have a blank line between the first line and the next ones
Yep
yes, except now your description (the bottom part) starts with a lowercase letter and has some grammatical issues.
Just capitalize first word
should be A user mention, not an
a e i o u
U is there
yep, that's it
god english
"in the channel command is ran" is also wrong
A user mention can also be passed to get the user's last message in the channel command is run
is perfect
a e i o u in spelling, not in letters
it's not perfect
/ΛyoΝozΙr/
see that bottom part?
yeah
there were.
"in the channel command is run" is grammatically problematic. The sentence overall is confusing because of the ending.
"in the channel where the command was run" would be better.
I mean it is visible in .help
so is is better
.help bm
#deleted-channel.
I thought it got fixed btw
no it isn't visible
so invoke can be better word tho
sure, invoked is fine too
github app is now available for everyone!!!!!!
still it opens github.com links inside app in a webviewer
It wasn't already available for everyone?
Anyway, I personally quite dislike the UI, I think it is worst that the web UI
Finally my site PR don't fail...
Why https://github.com/python-discord/bot/pull/833 is stalled?
maybe because @hardy gorge should take another quick look at it.
since you addressed his request for change
seems like it could probably be merged with Ves' approval
I added the stalled label as there were some things ELA had in mind at the time as suggestions for the matching algo (as I commented). I think we've since settled on looking at fuzzy matching and a more robust algorithm in its own PR, though, going by ELA's later approval.
I think we can merge it
yeah let's just do that then
Hey @cold moon, I've assigned your Contributor role now. Thanks for the work you've put in recently.

π congratulations!
thanks
nice
even Guido is happy about it
@crude gyro Sorry about ping, but will I get write access in repos too? I'd just like to have PR approve perms. π
we're currently reevaluating the Contributor GH permissions, so you'll have to wait until we've decided what we're going to do with them, I'm afraid.
It's nothing
Eyyy congrats @cold moon
hi there
!init
this isn't a bot channel
then please describe the bug instead
but its not happening know
π¦
ok, so i was experimenting with the bot, used the f-string command as showed, and then
!str
and so it shows f-string
yes
you didn't provide an exact match
it's falling back to fuzzymatching
__str__ is not equal to str
in general this will be less predictable when using it for tags
so just avoid using markdown in commands when it's unnecessary and you should have a better experience
yeah i know, but i think it should have sent python magic or at least the str pattern
The fallback is to our tags: https://github.com/python-discord/bot/tree/master/bot/resources/tags
Not the documentation
ooohh ok
so it's expected
wouldn't it be better that instead it searched for the definition to python official docs
No, we have a docs command for searching docs
we have a docs command already
tags are brief explanations
that aren't exact docs
they're often addressing commonly asked questions in the server
or commonly seen issues
like FAQs?
There are a lot of things we explain a lot that you won't find directly in the documentation
man scragly is fast
Take this one:
!functions-are-objects
Calling vs. Referencing functions
When assigning a new name to a function, storing it in a container, or passing it as an argument, a common mistake made is to call the function. Instead of getting the actual function, you'll get its return value.
In Python you can treat function names just like any other variable. Assume there was a function called now that returns the current time. If you did x = now(), the current time would be assigned to x, but if you did x = now, the function now itself would be assigned to x. x and now would both equally reference the function.
Examples
# assigning new name
def foo():
return 'bar'
def spam():
return 'eggs'
baz = foo
baz() # returns 'bar'
ham = spam
ham() # returns 'eggs'
# storing in container
import math
functions = [math.sqrt, math.factorial, math.log]
functions[0](25) # returns 5.0
# the above equivalent to math.sqrt(25)
# passing as argument
class C:
builtin_open = staticmethod(open)
# open function is passed
# to the staticmethod class
wow, it's massive
anyway, this is not something you'd find directly in the documentation
It's there, but not exactly in this form
The or-gotcha is probably better
!or-gotcha
When checking if something is equal to one thing or another, you might think that this is possible:
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite fruit to have.")
After all, that's how you would normally phrase it in plain English. In Python, however, you have to have complete instructions on both sides of the logical operator.
So, if you want to check if something is equal to one thing or another, there are two common ways:
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")
oh i understand perfectly
is there any form i can contribute to the bot? like taking issues?
yes
We have two bots, we usually suggest starting with our events/fun bot though
We have a contrib guide over at https://pythondiscord.com/pages/contributing/
You're welcome to suggest features in an issue ticket and if you're interested in implementing an idea yourself, just mention so in the ticket.
If it gets ok'd then you'd be all good to work on it.
Otherwise check out any open issue tickets that are available to choose from.
If you find something that you feel like you'd be able to do, comment in it saying you're interested in implementing it and if you can be assigned.
okay! thanks
@green oriole Discord templates are now live, for example: https://discord.new/sJ3my7Yve3pD
Your issue about channels should maybe make use of it, this is a nice feature and sets up most of what would be needed without us having to configure stuff in the bot specifically for development (adding bloat to production)
Maybe add that to contributing tab ?
Yeah, it looks interesting
Does discord.py supports the creation of templates yet?
I would assume no but
The question is about why they would support it or what would we use it for? :D
Backups
@clever wraith doesn't store any messages or anything, backups would be pretty useless
@tawdry vapor apologies for the ping (and maybe someone else knows the answer to this), but is there any reason we're using assertEqual(stderr, None) and not assertIsNone(stderr)?
you'll find both sprinkled around
@patent pivot I was thinking about needed the d.py support to be able to dynamically update the template based on changes made here
Ahh that is true
I do hope bots get access to that endpoint, I'll check a bit later
@clever wraith it's pretty common to see these used more or less interchangably, some devs prefer to just use assertEqual for everything no matter what. I think either way is fine.
ok, cool
i'll just use the former then, it's what the rest of the project uses and i'd rather be consistent
technically the latter might be better since it does an is
but it's not like it reaaally matters.
they'll both assert true
i'll convert them all to the latter in a future PR once i'm done with this
sure. if you want.
i stylistically like the latter more
I think at the very least it should use assertIs over assertEqual
We should probably just use assertIsNone, as that's the proper method to assert a name is assigned to None
but I get that people drown a bit the plenitude of unittest's assert method
hrm
it thinks I didn't make any changes to the dockerfile and uses the latest one from dockerhub
even though my dockerfile has an extra debootstrap package
It doesn't looks like bots have access to the server templates, at least for now
actually i'm not sure why it failed
... And apparently someone found the endpoint, but bots aren't authorized to use it, so that's probably a no
Can you jump in with a PR for an issue, or are you meant to declare your intentions beforehand?
If there is no existing issue itβs generally desired to make one first to ensure that the proposed changes are desirable and fully planned out
If there is an existing issue, it would be a good idea to indicate that youβre working on an implementation
@green oriole the bot doesn't need access. we can just make a server template manually, ask users to use this to set their server up, and then the bot can take over from there.
still saves a ton of work
all those roles, channels and permissions take a while to set up
Something that then auto-generates the correct ID configs would still be neat though, I think
I mean, you'd have to manually update the template then
Which kind of defeat the purpose
That's why I suggested using a snapshot system so the bot could sync all the roles and channels with the push of a button
@green oriole I disagree. Our server does not change that quickly or that drastically to implement our own templating system now Discord has already provided one for us that is actually supported by their platform. I'd much rather use the tools they offer even if that means regenerating a template every once in a while manually. We'd have to implement the templating system, maintain it, and every time someone uses it, it's going to make a lot of unnecessary API calls. (I wouldn't consider the latter that fair use of the API now that they've implemented a tool to do that.)
yep, I'm with Ves
it takes literally seconds to generate a new template
we will keep our own test server updated, and generate new templates from that whenever we need to.
Itβs a little weird to have to nuke a server and make a new one for diffs
it'd be nice if these templates could just update an existing server
but anyway, I'm not saying we can't have some feature to update the server, but we should not be using a bot for initial server setup
That's an interesting template to look at
it's a bit of a mess, we should probably consider dumping a template of this server after this event and using that as our own test server
the API to get template data is unauthenticated
shouldn't be too bad to bot that up for updates
yeah me and scragly found that URl the other day
very interesting
when a server goes out of sync with the template maybe @molten bough
creating that template automatically joined me in a voice channel
oh, really? didn't know that
yeah it does
@clever wraith Just a mistake. It should be assertIsNone. That's what I would use if I were to write those tests now.
okay, good to know
@woeful thorn how can you edit my github comments ?
Cmon dude
yeah no
I would have removed that comment tomorrow
;-;
yeah, gh issues really isn't the place...
@crude gyro here's the nudge you asked for ages ago when https://github.com/python-discord/bot/pull/519 was ready to go π
@jade tiger would be nice if this PR had images showing off the final result in the PR description. I don't really see the need to test this branch personally since it appears to already have been thoroughly tested, but I would like to see how it looks before approving it
I can maybe review it tomorrow
sure. nothing outward facing should have changed at all, but I'll get some images when I have a free moment π
cool
it's a nice habit for these sorts of frontend tasks.
I like to split up PR descriptions with subheaders and add pictures and gifs every chance I get
gifs are particularly neat for PRs, GitHub will gladly animate them
really makes a PR come alive when you can show what you made in action
Ok i want some answers for
https://github.com/python-discord/seasonalbot/pull/386
This PR now uses channel.history function . What should possinly the limit. Currently it is last 20. If 20 is right this PR is ready to be merged
have you addressed all of Shira's feedback?
Yeap
this may sound obscene, but what's the best way to convert a 40sec mp4 to a .gif?
actually never mind. github just had a moment trying to upload it
(I just changed file extension)
or maybe not
π
there are also some nice tools for recording gifs in the first place
which might make your process easier?
in ubuntu, I use one called Peek
makes it trivial to record any part of the screen and save as gif
very convenient
yeah, I figured you might've. but that's giving yourself many additional steps
yep. I'll have a quick shop around
FormatFactory is still being updated
it's ad-supported but I remember it working well
yeah, ShareX actually uses ffmpeg for it
Why not OBS?
github doesn't show it off the bat it appears
mostly because ShareX is running 24/7 with hotkeys
hey that gifcam is superneat
cheers lemon
I'll probably use that again π
yippee it worked. Lmk if you're after any other usage but I think I covered most stuff
About this: https://github.com/python-discord/bot/blob/dcde0d8d867696a5a99b9738c2b98f96ad779dca/bot/cogs/reddit.py#L203 d.py don't have time param yet on loop decorator. Or is something else mean here?
no worries. that gifcam is a handy gadget to have around I've realised π
and sorry this PR dragged on so long
and yeah it probs took a little buffering time. 40sec vid
I think I'm gonna modify this comment in Reddit cog. loop decorator still don't have exact time support https://github.com/Rapptz/discord.py/issues/2159
it's in the ext-tasks branch. I think danny was planning on rewriting the whole ext.tasks extension, but who knows when that'll happen
Ye, that's why I'm gonna replace invalid information
π
https://pythondiscord.com/pages/contributing/bot/ mentions that python 3.7 is installed, but the Dockerfile implies that the bot is on 3.8.
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.
No problem!
If anyone's feeling creative, get it while it's hot: https://github.com/python-discord/branding/issues/48
Iβd like to, but I donβt have photoshop
should be doable in any editor of your choice that can make gifs
Do template created channels all share the same few first numbers for their ID?
They seem to do for me
@tough imp is there an SVG for the game jam icon?
scrags has it
I believe he posted it in event planning
maybe you can find it there @tough imp
i'll see if i can get it
we should've pushed it to branding tbh
maybe you can just ninja push it to master if you find it, @tough imp
Oh, never knew that. Thank you!
@clever wraith
thanks
Hmm, this last issue in bot repo
I tried to do something too
I don't like the slide off the screen
I'd prefer it just faded back after x seconds
which wouldn't be a super interesting animation, but it'd be a place to start.
better than nothing
Ok
@clever wraith @cold moon if you're both working on the logo then feel free to share ideas / communicate to make sure you don't both put effort into creating the same thing
Okay
i can't say i'm exactly "working" on it, it's given me a perfect opportunity to play around with vector graphics morphing with js
it's very probably i don't even produce anything usable
which is why i was interested in the svg :)
I wanted to play around with morphing too, but I cannot find any good way of doing it
i'm currently optimising the svg so morphing could even work properly
need same number of paths
which i just realised wouldn't work
hrm
Will we ever have a tag that can be accessed by mods and up but not helpers?
That's not planned at the moment
The last time it came up the idea was reject
Did you have something in mind?
I got stabbed last time for suggesting something like that 
Stabbed?
I was thinking of using metadata + dividing the tags into different foders incase we have such a thing in the future
I am refering to this
https://github.com/python-discord/bot/issues/778
what do you mean by subfolder inside subfolder?
we have Tags folder rn
Isn't there a structure proposed in that issue?
yes
i meant Tags/helpers/<another highter role folder name>/
here helpers is a sub folder
Why would we want that?
I don't think there's any reason to have to add and parse metadata
I'm think I'm missing part of the point here
but we could have tags restricted to higher roles 
I was referring to this stabbing https://discordapp.com/channels/267624335836053506/291284109232308226/680416638696292393
Why can't there just be a folder for each role? You're just checking the highest role
yes
but you don't need folders inside of helpers for that
That's what we're confused about
Just have a subfolder for each role, not roles nested within each other
ves lemon, nice name
oh right
Wouldn't this basically be all we need?
tags/admins
tags/moderators
tags/helpers
tags/developers
I'm not even sure there's a need to have admin specific tags
π
we don't need developers folder
the tags available to all will just lie in the tags folder
By the way, what kind of metadata did you have in mind? I can't really think of anything useful and I agree with @woeful thorn, if there's no pressing need to parse something and/or to make it more complicated than it needs to be, I don't think we should.
Yes, that's the other option. I was unsure. This feels more consistent, but the other one has less nesting for most tags
I don't really care either way
okay
By the way, what kind of metadata did you have in mind?
I thought we wouldn't have many tags restricted to only mods and up so thought of dumping the tags restricted to them in thehelpersfolder and then have metadata say that these are restricted to mods and up
a stupid idea, idk what I was thinking
Nice song by Ela and Lemon
I don't really understand the need of having tags restricted to roles when people can just go over to our github repo and look at em 
everyone can view all the tags
We can't really hide stuff
We're not trying to hide them
We don't want random people to be able to invoke them
oh
ty
We even get a reminder if the server goes out of sink with the template
Noice
Although I suspect it's going to be useless because it gave me this after updating the icon
So, we'll probably learn to ignore it
which is pretty odd, considering the server icon isn't included with the template
Maybe pin server template here?
this one?
Python Discord test server template https://discordapp.com/api/v6/guilds/templates/zmHtscpYN9E3
OK, thanks
That's the test server we have
Does templates sync emojis too?
Probably not
So we'll have to manually sync them
I don't think assets are synced
It would make sense though, you have an higher limit than non boosted servers
@hardy gorge do we have a template for the production server?
Do we just fetch them from the branding repo?
It might need a little bit of work though
Emojis syncing should made on bot side.
I mean, we have the list of mandatory emojis in the config file
We can't just sync them all
we totally could
So my thoughts were : "grab the list of emojis from the config, fetch them from the branding repo, and create the emojis"
I think it would make the most sense
There will help my last comment in server syncing issue, I think
we totally could
@clever wraith
Probably not, given that we have more emoji slots here than a regular dev server.
I mean, your suggestion was already what was going to be implemented :)
ok
or, rather, that by "them all" you meant the mandatory ones in the config
We can't sync them all, all the emojis on the prod server, because of the limit
Mandatory emojis should then in different category on config
yes Akarys
what I'm saying is I didn't know you were talking about every emoji
just the mandatory ones
Yes I get it, no probs
which don't exceed the limit
Like trashcan
We could just grab all the entries from the Emojis config
I'm actually fairly surprised that twemoji doesn't include a trashcan
ποΈ there's this, but it's not quite the same
It doesn't really looks like a trashcan, that was the issue iirc
The deseasonifying PR has been merged
thanks, global warming.
Will there be plans to rename seasonalbot seeing as it's no longer... well... seasonal?
to explain, it does still change names, we just have the branding manager turned off at the moment as we're using some custom assets for the game jam
I renamed him manually
I just had a thought about the autoconfig cog, one of issue is that the server needs to be recreated every time we want to update the server, so what if we use the template as the input for the bot to sync the server? It would remove all the needs for a snapshotting system
That was the idea, yeah. We don't need to snapshot the server, since the templating system does that for us.
No need to recreate a Discord feature ourselves that is going to make a lot of API calls to create channels/categories/roles
The only thing that would be handy is a system that then distills the IDs from the newly created channels/roles/categories for the config
Because that's what templating can't give us: An automatic configuration for the bot
Discord f up again
My idea is that server ID is in .env, then this try to fetch all channels. When channel fetch fail (result is None), this try to get channel by name and update ID in config. When there is no channel named x, then this create new channel. This is pretty automatic configuration.
using utils.get ?
Yep
I mean utils.get is too quircky
Whats htmal
Second way is loop over items (channels, roles etc.) and check names equality, but utils is much cleaner
@cold moon wah why you being mean
@timid pivot This channel is for talking about projects related to our repo, you can read about it in the channel's description
Also we don't allow advertising in any form. If you have a question, you can find a free channel by going to #bot-commands and type !free
https://pythondiscord.com/pages/contributing/bot/#site-only specifies that the site should be run with docker-compose up site, but the service name is web, so I believe the command should be docker-compose up web.
In addition, https://pythondiscord.com/pages/contributing/bot/#configure-the-bot specifies that urls.site should be set to web:8000 if the site is running on Docker, but fails to mention that the bot should also be running as a Docker container, since the alias only works between Docker Compose services.
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.
can't make a PR for documentation changes
these are wiki articles
<@&267629731250176001> <@&267628507062992896> I'm unavailable until later today but if any of you have ten minutes today, feel free to address the stuff @uneven cairn mentioned above. just some small improvements to the documentation. In case you're not familiar, if you log into the site with your Discord credentials, you'll see an edit button on this page that you can use to change stuff.
I feel like azure not working
checks are not happening
can someoen tell me what is happening ?
Looks like there are conflicts, could that be a reason?
Try to resolve them, they need to be resolved anyway before anything can be merged
I can't resolve em
why not?
Cuz its locked
That simply means that GitHub can't resolve it automatically for you
You'll have to resolve the conflicts yourself
how can i see the conflicts ?
You should be able to resolve them when you update your fork from master, because that needs to do the same merge
Conflicts are there due deseasonify
@molten bough wanna try figuring out why the latest build failed? :) https://github.com/python-discord/snekbox/pull/71
well, i know why, i just don't know how to fix it
and the previous builds succeeded
(even though those were already using debootstrap)
Well, I'm not sure why that'd be
actually, yes, I am sure why that'd be
the base docker container isn't built for PRs
@clever wraith yea, you will have a conflict as deseasonify renamed the seasons package to exts, but that should be trivial to resolve
in fact, git will pre-solve it, but asks you to confirm it
here's what the base image task shows
Evaluating: and(succeeded(), or(eq(variables['BASE_CHANGED'], 'True'), and(eq(variables['VENV_CHANGED'], 'True'), eq(variables['BASE_PULL'], 'False'))))
Expanded: and(True, or(eq('False', 'True'), and(eq('False', 'True'), eq(variables['BASE_PULL'], 'False'))))
Result: False
that's.. a confusing conditional
and(True, ...)?
oh yeah
anyway you'll notice that the BASE_PULL isn't defined here
hmm
yeah, I'm not sure really, this build script has changed a lot since I saw it years ago
looking at "check if images need to be built" though
it says
Cannot pull base image from Docker Hub due to detected changes; the base image will be built.
didn't notice that
but it isn't built
that's exactly what i want though
That seems inconsistent to me, but tbh, I wouldn't know
@cold moon I think syncing should be done via a command, not at bot start to avoid syncing when you don't want to, it is a destructive task
@hardy gorge yeah, I understood the point of syncing the config file, but if you add a new channel required by the bot, you'll need to delete the dev server to recreate it based on the updated template, that's why I'm suggesting that we should be able to have the bot sync the server with the template
That seems like a lot of work to automate an action that doesn't take a lot of time
I don't think the server template is the big short-circuiting win we're in need of. Sure it's nice to get a server with one click but the effort of ensuring that the configuration file reflects the channel IDs of a test server is still fully present. It doesn't matter that the server matches the template, what matters is that all of the channels in the configuration file are present & updated with the correct IDs. Templates don't do any of that
Yes, but what if you try to find the ID of a non existing channel? Should you create a new one?
If it exists in the configuration file it should exist on the test server
This shouldn't touch production
Yeah, the cog will not be loaded in production anyway, just to be sure
So we have the base server created by the template, and then some additional channels created by the auto config?
It sounds like a mess to match categories and stuff
There's only one category that actually matters
Maybe is better idea to have env variable SYNC_SERVER and when this is True, this sync server on setup?
Is it?
No we shouldn't require people to add some env files around
Using docker deployment you shouldn't need one you do need one, nevermind
You need .env for token anyway
Not everybody uses docker
There already is a proper var for that
Ye
Anyway, having a env var for an automatic destructive task just doesn't seem like a good idea
But one thing about config syncing: Guild ID must correct, otherwise this fail.
You can just take the ID of guild where the command have been triggered
Yeah, true
Which category are you talking about @woeful thorn?
But we still need to sync other channels
Their categories don't mean anything
Basically, when we have server, based on template, this can simply take channel by it's name.
It would be cool to still organize them
I made a first version that created channels based on the name only, without sorting them, and it was a complete mess
It would, but being able to generate a configuration file from the server would be the best starting point
The channels in the config file in the repo already have the correct IDs for production, right?
Yes
Would it then make sense to sync the channel names with their IDs to the site for a json endpoint?
Nothing is going to the site
that way you wouldn't have to hardcode the channel names to generate the config
hm, okay
About migrating to dpy 1.3.x, can I make some unittest.TestCase to unittest.IsolatedAsyncTestCase? Just this new command calling don't like asyncio.run.
Are you writing new tests or changing existing ones?
Either way, we should be aiming for IsolatedAsyncTestCase for coroutine-based tests
I'm replacing asyncio.run(command.callback(cog, ctx)) with asyncio.run/await command(ctx). This is new feature in dpy 1.3.0 that you can call commands this way
But asyncio.run is not working in 100% cases
About paginator: should this use clear_reaction loop instead removing all reactions? Currently this remove every reaction, but this should remove only paginator reactions.
Yes
then why would we not remove all reactions
Like when someone other react with other reaction, then this don't remove these.
nope
there's no reason to leave other random reactions on a paginated bot output that's meant as a temporarily interactive source of info
ok
and there's less of a reason to do so when it's adding unnecessary api calls
What?
do you think it could be possible for seasonalbot to have a who made this command command?
either using commits/PRs to see who did it or something?
It could be kind of hard I think
We'll need to get the source of the command
Then run a funny git command
But the container doesn't have git
true ig
actually
since all paths have been renamed when we deseasonified idt even git commands would work
Hi I need a little help with my hosts file for the bot setup. currently I keep getting this error OSError: Domain name not found
how does it look?
my host file looks like this # 127.0.0.1 localhost ::1 localhost 192.168.99.100 pythondiscord.local 192.168.99.100 api.pythondiscord.local 192.168.99.100 staff.pythondiscord.local 192.168.99.100 admin.pythondiscord.local
Is 192.168.99.100 your Docker IP?
And can you access the site in your browser using those domains?
yeah i checked the machine default ip and thats what it is
umm let me check
no i can't reach those sites
Does http://192.168.99.100 work?
no that doesn't work either
Is the docker container for the site running?
yeah you run docker-compose up postgre right?
That would only start the database
docker-compose up would start both the db and site
shouldn't need to do anything beyond docker-compose up in the site for the bot
(apart from the bot configuration ofc)
Okay now im getting a failed install on installing levenshtein
Strange because that dependency is not needed for anything
And yeah, typical Windows issues for installation :\
If everything else besides levenshtein installs then you can just ignore the error
yeah everything else so far seems good besides that
is there a flag for ignoring errors ?
I don't think so
I just don't get why it's trying to install it
It's an optional dependency...
It's not even in the lock file
What command are you running to install things?
pipenv run test throw same warning
Said it's an error, not a warning.
and installing it
Ye, sorry. Error not warning
Well they could be mistaking that warning for an error
how are the warnings configured for the bot btw? Do we need the warnings that are out of the bot's scope and (mostly) our control?
one sec, it may be running now
removing the deprecationwarning filter shows the unsupported escape warnings which seem to be currently bugged but don't think we need the warnings from things like aiohttp
okay so its running now, but i cant access the ip still
sorry ive been asking so many questions, thanks for all the help!
what do you get from docker ps ?
0d08dc3d7755 bot_bot "python3 -m bot" 10 minutes ago Up 7 minutes bot_bot_1
b6c1c9567fbe pythondiscord/site:latest "python manage.py ruβ¦" 10 minutes ago Up 7 minutes 127.0.0.1:8000->8000/tcp bot_web_1
d9b527a3de15 postgres:12-alpine "docker-entrypoint.sβ¦" 3 days ago Up 7 minutes 5432/tcp bot_postgres_1
I'm really not sure here but try changing the port ips in docker-compose to 0.0.0.0, had that recommended to me and running as the current setup
What's netstat -an show?
Did you also add the port when accessing the ip?
Oh that would definitely be the problem lol
okay that was it lol i feel stupid haha
okay last problem, when i try to run a command like ban on my test server i get a 400 error
what do you get in the bot and the docker log?
bot.api.ResponseCodeError: Status: 400 Response: {'actor': ['Invalid pk "320068243182321665" - object does not exist.']}
That means it did not sync the the members with the database
It should sync those when the bot starts up
It may ask you for confirmation
Something like this:
so the only thing i get when i start up the is WARNING: Unable to get DEFCON settings!
that's what I get when I forget to turn on the site, are there any errors when starting the bot?
Hmm, but the ResponseCodeError above indicates that you can connect some of the times
Odd
I have no idea what could be causing that
what's that ip from?
is your docker subnet 172.18.0.0/16?
where can i check that? sorry im new to docker
docker network inspect bot_default
Assuming you haven't changed the name of the network
yeah its down as my ipv4 address
yep
what container has that IP when you run network inspect?
bot_web_1
is the IP fixed?
It's resolved using the hostname web
So the site should be up, but it is refusing connections?
Which would mean it's down, I expect
any idea why this is happening?
im not getting anything from that
Maybe docker-compose up db web and see what it does without the bot
no errors with that command
It should be outputting logs for you though right?
nothing got added to the bot.logs file
No, in the console you ran the command in
oh yeah it is
It'll be showing you the output for the two containers we just started
yep
So what's up with web? Does it seem to be running correctly?
okay i think I just got it up and running, i had to run docker-compose for bot, web and postgres seperately
im just getting some errors like this :ok_hand: pardoned infraction ban for @c1pham. Sorry, an unexpected error occurred. Please let us know!
AttributeError: 'NoneType' object has no attribute 'send'
Would need the full traceback
It maybe that the channel you're trying to send something to isn't available, which could have to do with the channel constants.
that's just a guess though
okay lemme make sure
OKAY i got everything working now!!! THANK YOU SO MUCH FOR EVERYONES HELP!
\o/
is issue #796 on bot repository up for grab?
i can't see activity on it
https://github.com/python-discord/bot/issues/796
it looks like it's still in the planning phase, which means that we haven't fully agreed on how it should be implemented (see ELA's comment)
you are more than welcome to drop a comment there
ah, okay
i don't think i have anything new to bring to the table, i was thinking of actually making it
guess i'll just subscribe to the issue conversation
how often do the bots restart?
should be on pushes to master
Is discussion regarding an issue meant to be kept to Github?
Preferably yes
It's OK to discuss elsewhere too if you take the time to update the issue with any relevant new information
Just use your best judgement on what is worth including and what isn't
About this ban reason characters limit issue, should I apply fix to mute and unban and mute too?
There is no problem for mute and unmute / unban because we do not store those reasons on discord
We take as much for reason as we can for a discord message - by default, limited to 2k
Only for ban that we put in a reason for discord
If you ban manually you will be able to see it as well
OK, but kick? This show too 512 char limit
Oh true, kick too!
we don't really use kicks but yeah go ahead.
Regarding bad word nicknames, would they count as an infraction? I'm wondering if using the infraction mechanism is the best easy to store a per user cooldown.
In addition, is there a reason why URLs in messages are not filtered?
Sorry, I meant for bad words in URLs
So you can bypass the word filter by appending http:// to the beginning of your message
So you can throw racist insults inside an url
I don't think the filtering cares about spaces around the word
Thing is, if the filter detects http://, it passes it to the URL filter
But the URL filter doesn't filter for bad words
Actually, I might move discussion onto the github
Do you have a link to the source code?
Yeah that's weird
our overall philosophy has been that there's always gonna be a million ways to bypass filters, but 90% of the users we want to moderate are going to be people who have no idea that the filters even exist.
by the time they figure out that filters do exist, they're usually already on their way to bantown
so we've never put much effort into countermeasures for filter evasion

