#dev-contrib

1 messages Β· Page 51 of 1

cold moon
tawdry vapor
#

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

glass pecan
#

i have an idea but it would require updating the logging first

green oriole
#

You could add the help channel categories to an ignore list

glass pecan
#

specifically it would allow us to suppress any activity logs with a context manager or a function decorator

cold moon
#

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?

tawdry vapor
#

It's the same event

mellow hare
#

Context manager would make the most sense, I think

tawdry vapor
#

Two channel update events

#

For the same channel

mellow hare
#

That'd give more granular control, right?

tawdry vapor
#

It uses a dictionary with the channel as the key so I cannot store the channel twice

glass pecan
#

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

tawdry vapor
#

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.

glass pecan
#

if it's more simple for you to do so, then sure

tawdry vapor
#

Well changing the mod log seems out of scope

glass pecan
#

sorta, unless it's more complex to work around the issue than address it

woeful thorn
#

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

glass pecan
#

tasty

tawdry vapor
#

Well I could just do nothing but I figured if the temporary patch is simple then why not

glass pecan
#

that makes sense too

woeful thorn
#

We could also just implement the context manager and update the other cogs later

glass pecan
#

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?

tawdry vapor
#

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
glass pecan
#

righto

tawdry vapor
#

No, I did not change to event dispatch

glass pecan
#

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

tawdry vapor
#

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

glass pecan
#

lol that's fair enough too.

cold moon
#

So new help channel system will be released very soon?

glass pecan
#

yep

cold moon
#

Nice

sand mason
#

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

glass pecan
#

@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

mellow hare
#

Tends to create quantity help rather than quality

sand mason
#

I just love your server

#

A good service

mellow hare
#

Much appreciated

sand mason
#

I think who boost your server they should get benefits from others

valid quest
#

They get a role

cold moon
#

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

sand mason
#

@valid quest na just not a role separate help channel

glass pecan
#

@sand mason We decided to provide only a role as we don't want to divide our community at all.

mellow hare
#

People start to feel entitled and other members end up feeling snubbed

sand mason
#

@mellow hare ok I got u

glass pecan
#

@cold moon this is something similar to an already proposed idea

cold moon
#

Oh

glass pecan
#

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.

cold moon
#

Okay

eternal owl
#

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

woeful thorn
#

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

eternal owl
#

well then we have to move files around

woeful thorn
#

Why?

#

None of the current tags need to be role restricted

eternal owl
#

oh

#

how about the 2nd idea

woeful thorn
#

And even if they did, what's wrong with moving files?

eternal owl
#

using the constants.py file or just adding the dict in the Tag cog file?

woeful thorn
#

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

eternal owl
#

got it

woeful thorn
#

Not have to remember that you need to edit x, y, and z file otherwise it will be broken

eternal owl
#

Id like to work on that

woeful thorn
#

ok

cold moon
#

I heard something like Markdown Metadata. This should 1 solution for this? Add something to there and check in python.

#

@eternal owl

eternal owl
#

okay, thanks

#

you could leave a comment in the issue too

clever wraith
#

!resource

stable mountainBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

hardy gorge
#

@crimson tinsel Did you follow the set-up guide on our website?

crimson tinsel
#

yeah i think I followed all the steps

hardy gorge
#

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?

crimson tinsel
#

yep thats what im getting, no it doesnt start up :/

hardy gorge
#

Hmm, how are you running it?

tawdry vapor
#

Sounds like encoding='utf-8' is needed when reading some file.

patent pivot
#

@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

valid quest
#

Quick suggestion: a system that detects non-ascii nicknames (as well as other nicknames that don't fit our rules)

crimson tinsel
#

Im running it on python using python 3.8.2

patent pivot
#

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
---
tawdry vapor
clever wraith
#

@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

patent pivot
#

@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

valid quest
#

Maybe a scan per message?

#

Can do a util for on_message

patent pivot
#

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

valid quest
#

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

crimson tinsel
#

@tawdry vapor That fixed it!!! Thanks!

tawdry vapor
#

Would appreciate if you could create a PR for that fix

patent pivot
#

I guess on_message could be useful

#

we could have a mod alert for it

valid quest
#

If so, i would love to work on in

#

I will free some time for it if there is a need for this system

patent pivot
#

First off open an issue on the bot repo so everyone can comment their thoughts

valid quest
#

Yep

#

Will do

crimson tinsel
#

Will do!

crimson tinsel
#

@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'```
tawdry vapor
#

Your server is missing the verification channel or you did not change its ID properly in the configuration

crimson tinsel
#

awww okay, it doesn't say to create it in the guide

tawdry vapor
#

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

crimson tinsel
#

okay will do!

cold moon
valid quest
gusty sonnet
#

Hmm have you considered str.isalnum @valid quest

valid quest
#

Yes, i took a look at it yesterday and i forgot

#

Thanks!

gusty sonnet
#

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

valid quest
#

Yeah, that is why isalpha is less usable, and i went for the first solution

gusty sonnet
#

For example ハーγƒͺさん (CF8) is a fine name

#

It is mentionable with @CF8

valid quest
#

Oh ok

#

So

gusty sonnet
#

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```
valid quest
#

Yeah that's better

#

Thanks for the clarification, I probably didn't read well enough

clever wraith
valid quest
#

@gusty sonnet Updated πŸ‘Œ

#

Also gave you credit for the solution πŸ˜†

gusty sonnet
#

It's fine lol, poor the cf8 guy that got mentioned though haha

valid quest
#

Yeah lol

gusty sonnet
#

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

clever wraith
#

no eww .format() really needs to die

gusty sonnet
#

Actually it's fine, specially if you create a string template

#

.format() is very very powerful

clever wraith
#

too late commited

#

I don't think you read the issue that it closes

gusty sonnet
#

I did, and I imagined a situation like this

clever wraith
#

whatever , i commited , and i pushed multiple commit at once this time :yayy: finally using proper git tool

gusty sonnet
#
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

clever wraith
#

wow , we tried to do that

#

earlier

#

end up scraping that

gusty sonnet
#

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

clever wraith
#

we can use channel.history

gusty sonnet
#

That's extra effort

#

And not very user-friendly

clever wraith
#

so for example

#

.bm

#

so for example
will bm this ?

gusty sonnet
#

It can be, yes

clever wraith
#

in that case we need to use history

gusty sonnet
#

It should be discussed more about what will be .bm instead

#

Still, I do not want it to bookmark a .bm

clever wraith
#

I mean this is where you can discuss btw

cold moon
#

@gusty sonnet I also fixed Space Cog PR.

gusty sonnet
#

@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

clever wraith
#

I mean cmon , it remove the cluster except block are already making

#

I like how it is right now . it is much readable

gusty sonnet
#

That's what indentation is for

clever wraith
#

wouldn't something like .bm 5 work? bookmarks the fifth message up

gusty sonnet
#

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

clever wraith
#

true

gusty sonnet
#

.bm @user1 is good as well

#

Bookmarking last message of user1

clever wraith
#

ah yep

gusty sonnet
#

Which solve the racing issue

clever wraith
#

oh so now what will be the type notation for target_message ?
union(int, discord.Message) ?

#

Ps. I never used union

valid quest
#

Is there a converter to a message?

#

Not sure

gusty sonnet
#

There is

clever wraith
#

I mean a small wrong mention and it will stuck in channel.history

valid quest
#

Nice

clever wraith
#

that is capable to crash bot itself

valid quest
#

@gusty sonnet Using links? or just ids

clever wraith
#

both

valid quest
#

Im not sure you can get message from link but

gusty sonnet
#

Either is fine

valid quest
#

Ah cool

clever wraith
#

ids if it is in cache

gusty sonnet
#

message jump_url works

valid quest
#

yeah

clever wraith
#

wouldn't something like .bm 5 work? 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

gusty sonnet
#

Or you can define the limit yourself. That's why I'm raising it in the issue as this is a design issue

clever wraith
#

yeah i am gonna limit it to 20ish

gusty sonnet
#

Jumping straight into code will lead to a lot of changes / unnecessary commits

clever wraith
#

I feel user mention is better

gusty sonnet
#

You can make it possible to do all 3

clever wraith
#

cuz bot can maybe get confused as message.id are also int

gusty sonnet
#

.bm message_link .bm 5 .bm @user1

clever wraith
#

no

#

we can't

gusty sonnet
#

You can

clever wraith
#

.bm 5
is nearly same as
.bm 694445010036457512

#

ahh shut up @dusky shore

gusty sonnet
#

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

clever wraith
#

don't you think we are going overkill here ?

gusty sonnet
#

I definitely think we need to discuss about the pros and cons of each way, yes

#

As an user, what is the most convenient

clever wraith
#

Like no one is counting message up specially in a fast chat
@ user is wayyyyyy better

valid quest
#

Yeah, i can agree on that

clever wraith
#

and counting can also lead in confusion , like does it starts from 0 or 1 ?

gusty sonnet
#

That's true, specially in a crowded channel

valid quest
#

anyways, you usually you bookmark something that is going to disappear

gusty sonnet
#

Counting always starts with 1

clever wraith
#

or does it ?

gusty sonnet
#

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

clever wraith
#

wait i have a bold example for this one

cold moon
#

About my Tag trashcan PR: Should this ignore these messages in ModLog or not?

gusty sonnet
#

What do you mean @cold moon

#

And that has nothing to do with counting starts from 0 or 1 @clever wraith

cold moon
#

Like when you click on trashcan emoji, this log to ModLog !tag <tag> message delete. Should this ignore it?

gusty sonnet
#

Ah, that's fine, you are deleting a message from the bot

cold moon
#

ok

clever wraith
#

As an user, what is the most convenient
@gusty sonnet por que no los dos?

#

they're not mutually exclusive, are they?

gusty sonnet
#

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? πŸ˜„

clever wraith
#

very true

clever wraith
#

@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 ?

crude gyro
#

the docstring should have a blank line between the first line and the next ones

clever wraith
#

like this ?

cold moon
#

Yep

crude gyro
#

yes, except now your description (the bottom part) starts with a lowercase letter and has some grammatical issues.

clever wraith
#

ok i accept i am not good in grammar

#

can you point that out ?

#

ran?

cold moon
#

Just capitalize first word

clever wraith
crude gyro
#

should be A user mention, not an

clever wraith
#

a e i o u
U is there

crude gyro
#

yep, that's it

clever wraith
#

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

gusty sonnet
#

a e i o u in spelling, not in letters

crude gyro
#

it's not perfect

gusty sonnet
#

/ˈyo͞ozΙ™r/

clever wraith
crude gyro
#

see that bottom part?

clever wraith
#

yeah

crude gyro
#

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.

clever wraith
#

command is invoked ?

#

you're missing the where

cold moon
#

In the channel where command...?

#

Ye

clever wraith
#

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

crude gyro
#

sure, invoked is fine too

patent pivot
#

github app is now available for everyone!!!!!!

clever wraith
#

still it opens github.com links inside app in a webviewer

patent pivot
#

does it?

#

not for me

clever wraith
#

it does for me tho . will tell next time i see that

#

yeah, works on my machine

green oriole
#

It wasn't already available for everyone?

#

Anyway, I personally quite dislike the UI, I think it is worst that the web UI

cold moon
#

Finally my site PR don't fail...

cold moon
crude gyro
#

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

hardy gorge
#

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

crude gyro
#

yeah let's just do that then

crude gyro
#

Hey @cold moon, I've assigned your Contributor role now. Thanks for the work you've put in recently.

cold moon
tough imp
#

🎊 congratulations!

cold moon
#

thanks

hardy gorge
#

Neat.

clever wraith
#

nice

green oriole
#

guido even Guido is happy about it

cold moon
#

@crude gyro Sorry about ping, but will I get write access in repos too? I'd just like to have PR approve perms. πŸ˜…

crude gyro
#

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.

cold moon
#

It's nothing

clever wraith
#

Eyyy congrats @cold moon

languid prism
#

!f-string

#

!init

glass pecan
#

hi there

languid prism
#

!init

glass pecan
#

this isn't a bot channel

languid prism
#

i know

#

i had a bug with the bot

#

i was trying to show it

glass pecan
#

then please describe the bug instead

languid prism
#

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

glass pecan
#

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

languid prism
#

yeah i know, but i think it should have sent python magic or at least the str pattern

woeful thorn
#

Not the documentation

languid prism
#

ooohh ok

#

so it's expected

#

wouldn't it be better that instead it searched for the definition to python official docs

woeful thorn
#

No, we have a docs command for searching docs

glass pecan
#

we have a docs command already

languid prism
#

okay

#

why making tags then?

#

just out of curiosity

glass pecan
#

tags are brief explanations

#

that aren't exact docs

#

they're often addressing commonly asked questions in the server

#

or commonly seen issues

languid prism
#

like FAQs?

hardy gorge
#

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

stable mountainBOT
#

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
hardy gorge
#

wow, it's massive

glass pecan
#

lol

#

or gotcha probs would be a better example

hardy gorge
#

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

stable mountainBOT
#

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.")
languid prism
#

oh i understand perfectly

#

is there any form i can contribute to the bot? like taking issues?

glass pecan
#

yes

#

We have two bots, we usually suggest starting with our events/fun bot though

#

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.

languid prism
#

okay! thanks

patent pivot
#

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)

clever wraith
#

Maybe add that to contributing tab ?

green oriole
#

Yeah, it looks interesting

#

Does discord.py supports the creation of templates yet?

#

I would assume no but

patent pivot
#

Not yet I don't think

#

Why would they need to though

green oriole
#

The question is about why they would support it or what would we use it for? :D

clever wraith
#

Backups

patent pivot
#

@clever wraith doesn't store any messages or anything, backups would be pretty useless

clever wraith
#

@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)?

crude gyro
#

you'll find both sprinkled around

green oriole
#

@patent pivot I was thinking about needed the d.py support to be able to dynamically update the template based on changes made here

patent pivot
#

Ahh that is true

#

I do hope bots get access to that endpoint, I'll check a bit later

crude gyro
#

@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.

clever wraith
#

ok, cool

#

i'll just use the former then, it's what the rest of the project uses and i'd rather be consistent

crude gyro
#

technically the latter might be better since it does an is

#

but it's not like it reaaally matters.

#

they'll both assert true

clever wraith
#

i'll convert them all to the latter in a future PR once i'm done with this

crude gyro
#

sure. if you want.

clever wraith
#

i stylistically like the latter more

tough imp
#

I think at the very least it should use assertIs over assertEqual

hardy gorge
#

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

clever wraith
#

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

green oriole
#

It doesn't looks like bots have access to the server templates, at least for now

clever wraith
#

actually i'm not sure why it failed

green oriole
#

... And apparently someone found the endpoint, but bots aren't authorized to use it, so that's probably a no

uneven cairn
#

Can you jump in with a PR for an issue, or are you meant to declare your intentions beforehand?

woeful thorn
#

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

crude gyro
#

@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

hardy gorge
#

Something that then auto-generates the correct ID configs would still be neat though, I think

green oriole
#

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

clever wraith
#

ELI5 server templates

#

pre-set categories, channels, and roles?

crude gyro
#

yeah. click and play server setup.

clever wraith
#

crashes my client

#

ah, works now

#

neat

hardy gorge
#

@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.)

crude gyro
#

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.

woeful thorn
#

It’s a little weird to have to nuke a server and make a new one for diffs

crude gyro
#

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

molten bough
#

That's an interesting template to look at

crude gyro
#

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

molten bough
#

the API to get template data is unauthenticated

#

shouldn't be too bad to bot that up for updates

patent pivot
#

yeah me and scragly found that URl the other day

molten bough
#

wonder what that is_dirty is for

#

that's usually like an unsaved flag

clever wraith
#

very interesting

patent pivot
#

when a server goes out of sync with the template maybe @molten bough

clever wraith
#

creating that template automatically joined me in a voice channel

patent pivot
#

that always happens

#

when you make a new server

clever wraith
#

oh, really? didn't know that

crude gyro
#

yeah it does

molten bough
#

yup

#

yeah, maybe, joe

tawdry vapor
#

@clever wraith Just a mistake. It should be assertIsNone. That's what I would use if I were to write those tests now.

clever wraith
#

okay, good to know

clever wraith
#

@woeful thorn how can you edit my github comments ?

glass pecan
#

he didn't

#

i did

clever wraith
#

Cmon dude

glass pecan
#

yeah no

clever wraith
#

I would have removed that comment tomorrow

glass pecan
#

mhm

#

consider an edit light

#

messing with github usually results in a repo ban

clever wraith
#

;-;

clever wraith
#

yeah, gh issues really isn't the place...

jade tiger
crude gyro
#

@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

jade tiger
#

sure. nothing outward facing should have changed at all, but I'll get some images when I have a free moment πŸ‘

crude gyro
#

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

clever wraith
tough imp
#

have you addressed all of Shira's feedback?

clever wraith
#

Yeap

jade tiger
#

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

crude gyro
#

there are various tools to achieve this

#

just google it and you'll find one

jade tiger
#

πŸ‘

crude gyro
#

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

jade tiger
#

i just spun up obs quickly

#

windows

crude gyro
#

yeah, I figured you might've. but that's giving yourself many additional steps

jade tiger
#

yep. I'll have a quick shop around

molten bough
#

FormatFactory is still being updated

#

it's ad-supported but I remember it working well

crude gyro
#

it's very simple

molten bough
#

Oh, that's neat, that looks like peek

#

I use ShareX for screen recordings

molten bough
#

yeah, ShareX actually uses ffmpeg for it

green oriole
#

Why not OBS?

jade tiger
#

github doesn't show it off the bat it appears

molten bough
#

mostly because ShareX is running 24/7 with hotkeys

jade tiger
#

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

cold moon
crude gyro
#

@jade tiger wait, where'd you put those gifs?

#

I thought it was for #519

jade tiger
#

in the description

crude gyro
#

the fuck

#

oh nooow it shows

#

nice

#

excellent, thanks a million for doing that

jade tiger
#

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

cold moon
jade tiger
#

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

cold moon
#

Ye, that's why I'm gonna replace invalid information

jade tiger
#

πŸ‘

uneven cairn
hardy gorge
#

I'll update it.

#

Thanks

uneven cairn
#

No problem!

tough imp
green oriole
#

I’d like to, but I don’t have photoshop

tough imp
#

should be doable in any editor of your choice that can make gifs

uneven cairn
#

Do template created channels all share the same few first numbers for their ID?

#

They seem to do for me

clever wraith
#

@tough imp is there an SVG for the game jam icon?

tough imp
#

I think so, but I'm not sure where

#

we may have to pingu @crude gyro for this one

crude gyro
#

scrags has it

#

I believe he posted it in event planning

#

maybe you can find it there @tough imp

tough imp
#

i'll see if i can get it

crude gyro
#

we should've pushed it to branding tbh

#

maybe you can just ninja push it to master if you find it, @tough imp

woeful thorn
#

@uneven cairn the beginning bits of the IDs are based on creation timestamp

uneven cairn
#

Oh, never knew that. Thank you!

tough imp
clever wraith
#

thanks

cold moon
#

Hmm, this last issue in bot repo

cold moon
crude gyro
#

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

cold moon
#

Ok

tough imp
#

@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

cold moon
#

Okay

clever wraith
#

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 :)

tough imp
#

ok, thats fine

#

just wanted to make sure that youre aware of each other

green oriole
#

I wanted to play around with morphing too, but I cannot find any good way of doing it

clever wraith
#

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

eternal owl
#

Will we ever have a tag that can be accessed by mods and up but not helpers?

hardy gorge
#

That's not planned at the moment

#

The last time it came up the idea was reject

#

Did you have something in mind?

green oriole
#

I got stabbed last time for suggesting something like that lemon_pleased

hardy gorge
#

Stabbed?

eternal owl
#

I was thinking of using metadata + dividing the tags into different foders incase we have such a thing in the future

hardy gorge
#

Hmm

#

Okay

eternal owl
#

unless we want subfolder inside a subfolder

#

or a folder for each role πŸ€”

hardy gorge
#

what do you mean by subfolder inside subfolder?

eternal owl
#

we have Tags folder rn

hardy gorge
#

Isn't there a structure proposed in that issue?

eternal owl
#

yes

#

i meant Tags/helpers/<another highter role folder name>/

#

here helpers is a sub folder

hardy gorge
#

Why would we want that?

woeful thorn
#

I don't think there's any reason to have to add and parse metadata

hardy gorge
#

I'm think I'm missing part of the point here

eternal owl
#

but we could have tags restricted to higher roles pithink

green oriole
woeful thorn
#

Why can't there just be a folder for each role? You're just checking the highest role

hardy gorge
#

yes

eternal owl
#

Thats what I was asking

hardy gorge
#

but you don't need folders inside of helpers for that

eternal owl
#

no one responded, lol

#

okay

hardy gorge
#

That's what we're confused about

#

Just have a subfolder for each role, not roles nested within each other

eternal owl
#

ves lemon, nice name

hardy gorge
#

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

eternal owl
#

πŸ‘

#

we don't need developers folder

#

the tags available to all will just lie in the tags folder

hardy gorge
#

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

eternal owl
#

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 the helpers folder and then have metadata say that these are restricted to mods and up

#

a stupid idea, idk what I was thinking

hollow lichen
#

Nice song by Ela and Lemon

eternal owl
#

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 pithink

#

everyone can view all the tags

#

We can't really hide stuff

woeful thorn
#

We're not trying to hide them

#

We don't want random people to be able to invoke them

eternal owl
#

oh

eternal owl
#

got everything working, will lint and open PR tmw

#

can i have the trashcan emoji png

eternal owl
#

ty

hardy gorge
molten bough
#

Noice

hardy gorge
#

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

clever wraith
#

which is pretty odd, considering the server icon isn't included with the template

cold moon
#

Maybe pin server template here?

clever wraith
#

this one?

cold moon
#

OK, thanks

hardy gorge
#

That's the test server we have

green oriole
#

Does templates sync emojis too?

hardy gorge
#

Probably not

green oriole
#

So we'll have to manually sync them

clever wraith
#

I don't think assets are synced

green oriole
#

It would make sense though, you have an higher limit than non boosted servers

clever wraith
#

@hardy gorge do we have a template for the production server?

green oriole
#

Do we just fetch them from the branding repo?

#

It might need a little bit of work though

cold moon
#

Emojis syncing should made on bot side.

green oriole
#

I mean, we have the list of mandatory emojis in the config file

#

We can't just sync them all

clever wraith
#

we totally could

green oriole
#

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

cold moon
#

There will help my last comment in server syncing issue, I think

hardy gorge
#

we totally could
@clever wraith

Probably not, given that we have more emoji slots here than a regular dev server.

clever wraith
#

@green oriole I thought that's what you meant by "syncing"

#

sorry, misunderstood

green oriole
#

I mean, your suggestion was already what was going to be implemented :)

cold moon
#

ok

clever wraith
#

or, rather, that by "them all" you meant the mandatory ones in the config

green oriole
#

We can't sync them all, all the emojis on the prod server, because of the limit

cold moon
#

Mandatory emojis should then in different category on config

clever wraith
#

yes Akarys

#

what I'm saying is I didn't know you were talking about every emoji

#

just the mandatory ones

green oriole
#

Yes I get it, no probs

clever wraith
#

which don't exceed the limit

cold moon
#

Like trashcan

green oriole
#

We could just grab all the entries from the Emojis config

clever wraith
#

I'm actually fairly surprised that twemoji doesn't include a trashcan

green oriole
#

No needs for a new list to keep up to date

#

Yeah that's weird

clever wraith
#

πŸ—‘οΈ there's this, but it's not quite the same

green oriole
#

It doesn't really looks like a trashcan, that was the issue iirc

clever wraith
#

yep

#

why @dusky shore is not bunnybot ?

hardy gorge
#

The deseasonifying PR has been merged

clever wraith
#

thanks, global warming.

#

Will there be plans to rename seasonalbot seeing as it's no longer... well... seasonal?

tough imp
#

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

green oriole
#

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

hardy gorge
#

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

clever wraith
#

Discord f up again

cold moon
#

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.

clever wraith
#

using utils.get ?

cold moon
#

Yep

timid pivot
#

yo\

#

20 bucks if you can answer this

clever wraith
#

I mean utils.get is too quircky

timid pivot
#

Whats htmal

cold moon
#

@timid pivot I think this is not channel to ask this

#

utils.get is very useful

clever wraith
cold moon
#

Second way is loop over items (channels, roles etc.) and check names equality, but utils is much cleaner

timid pivot
#

@cold moon wah why you being mean

gusty sonnet
#

@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

uneven cairn
#

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.

clever wraith
#

Good catches

#

Mind making a PR for this? :)

crude gyro
#

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.

clever wraith
#

I feel like azure not working

#

checks are not happening

#

can someoen tell me what is happening ?

clever wraith
#

stuck

hardy gorge
#

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

clever wraith
#

I can't resolve em

hardy gorge
#

why not?

clever wraith
#

Cuz its locked

hardy gorge
#

That simply means that GitHub can't resolve it automatically for you

#

You'll have to resolve the conflicts yourself

clever wraith
#

how can i see the conflicts ?

hardy gorge
#

You should be able to resolve them when you update your fork from master, because that needs to do the same merge

clever wraith
#

so pull it

#

pull the mater

cold moon
#

Conflicts are there due deseasonify

clever wraith
#

well, i know why, i just don't know how to fix it

clever wraith
#

incorrecto @molten bough

#

debootstrap is in the venv dockerfile

molten bough
clever wraith
#

and the previous builds succeeded

#

(even though those were already using debootstrap)

molten bough
#

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
#

it is if it isn't found in cache

#

which is why previous builds went through fine

tough imp
#

@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

molten bough
#

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, ...)?

clever wraith
#

succeeded() is true

#

and the right side is expanded

molten bough
#

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.
clever wraith
#

didn't notice that

molten bough
#

but it isn't built

clever wraith
#

that's exactly what i want though

molten bough
#

That seems inconsistent to me, but tbh, I wouldn't know

green oriole
#

@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

hardy gorge
#

That seems like a lot of work to automate an action that doesn't take a lot of time

woeful thorn
#

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

green oriole
#

Yes, but what if you try to find the ID of a non existing channel? Should you create a new one?

woeful thorn
#

If it exists in the configuration file it should exist on the test server

#

This shouldn't touch production

green oriole
#

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

woeful thorn
#

There's only one category that actually matters

cold moon
#

Maybe is better idea to have env variable SYNC_SERVER and when this is True, this sync server on setup?

green oriole
#

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

cold moon
#

You need .env for token anyway

woeful thorn
#

Not everybody uses docker

brazen charm
#

There already is a proper var for that

cold moon
#

Ye

green oriole
#

Anyway, having a env var for an automatic destructive task just doesn't seem like a good idea

cold moon
#

But one thing about config syncing: Guild ID must correct, otherwise this fail.

green oriole
#

You can just take the ID of guild where the command have been triggered

cold moon
#

Yeah, true

green oriole
#

Which category are you talking about @woeful thorn?

woeful thorn
#

The help channel category

#

It's the only category in the config file

green oriole
#

But we still need to sync other channels

woeful thorn
#

Their categories don't mean anything

cold moon
#

Basically, when we have server, based on template, this can simply take channel by it's name.

green oriole
#

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

woeful thorn
#

It would, but being able to generate a configuration file from the server would be the best starting point

molten bough
#

The channels in the config file in the repo already have the correct IDs for production, right?

woeful thorn
#

Yes

molten bough
#

Would it then make sense to sync the channel names with their IDs to the site for a json endpoint?

woeful thorn
#

Nothing is going to the site

molten bough
#

that way you wouldn't have to hardcode the channel names to generate the config

#

hm, okay

cold moon
#

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.

hardy gorge
#

Are you writing new tests or changing existing ones?

#

Either way, we should be aiming for IsolatedAsyncTestCase for coroutine-based tests

cold moon
#

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

cold moon
#

About paginator: should this use clear_reaction loop instead removing all reactions? Currently this remove every reaction, but this should remove only paginator reactions.

glass pecan
#

in what regard

#

is this when the paginator ends?

cold moon
#

Yes

glass pecan
#

then why would we not remove all reactions

cold moon
#

Like when someone other react with other reaction, then this don't remove these.

glass pecan
#

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

cold moon
#

ok

glass pecan
#

and there's less of a reason to do so when it's adding unnecessary api calls

clever wraith
#

Did name changes was not included in deseasonify ?

#

Was*

woeful thorn
#

What?

rocky bloom
#

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?

green oriole
#

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

rocky bloom
#

true ig

#

actually

#

since all paths have been renamed when we deseasonified idt even git commands would work

crimson tinsel
#

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

brazen charm
#

how does it look?

crimson tinsel
#

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

tawdry vapor
#

Is 192.168.99.100 your Docker IP?

#

And can you access the site in your browser using those domains?

crimson tinsel
#

yeah i checked the machine default ip and thats what it is

#

umm let me check

#

no i can't reach those sites

tawdry vapor
#

Does http://192.168.99.100 work?

crimson tinsel
#

no that doesn't work either

tawdry vapor
#

Is the docker container for the site running?

crimson tinsel
#

yeah you run docker-compose up postgre right?

tawdry vapor
#

That would only start the database

#

docker-compose up would start both the db and site

crimson tinsel
#

ohhhhhh

#

let me try that

brazen charm
#

shouldn't need to do anything beyond docker-compose up in the site for the bot

#

(apart from the bot configuration ofc)

crimson tinsel
#

Okay now im getting a failed install on installing levenshtein

tawdry vapor
#

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

crimson tinsel
#

yeah everything else so far seems good besides that

#

is there a flag for ignoring errors ?

tawdry vapor
#

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?

crimson tinsel
#

docker-compose up is attempting to install

#

ill put the full error here

cold moon
#

pipenv run test throw same warning

tawdry vapor
#

Said it's an error, not a warning.

brazen charm
#

and installing it

cold moon
#

Ye, sorry. Error not warning

tawdry vapor
#

Well they could be mistaking that warning for an error

brazen charm
#

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?

crimson tinsel
#

one sec, it may be running now

brazen charm
#

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

crimson tinsel
#

okay so its running now, but i cant access the ip still

#

sorry ive been asking so many questions, thanks for all the help!

brazen charm
#

what do you get from docker ps ?

crimson tinsel
#
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
brazen charm
#

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

crimson tinsel
#

ill try that

#

yeah that didnt do anything :/

tawdry vapor
#

What's netstat -an show?

brazen charm
#

Did you also add the port when accessing the ip?

tawdry vapor
#

Oh that would definitely be the problem lol

crimson tinsel
#

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

brazen charm
#

what do you get in the bot and the docker log?

crimson tinsel
#
 bot.api.ResponseCodeError: Status: 400 Response: {'actor': ['Invalid pk "320068243182321665" - object does not exist.']}
hardy gorge
#

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

crimson tinsel
#

so the only thing i get when i start up the is WARNING: Unable to get DEFCON settings!

brazen charm
#

that's what I get when I forget to turn on the site, are there any errors when starting the bot?

crimson tinsel
#

im getting this a few times when i start it up

hardy gorge
#

Hmm, but the ResponseCodeError above indicates that you can connect some of the times

#

Odd

#

I have no idea what could be causing that

brazen charm
#

what's that ip from?

crimson tinsel
#

im not sure lol

#

thats why im confused

uneven cairn
#

is your docker subnet 172.18.0.0/16?

crimson tinsel
#

where can i check that? sorry im new to docker

uneven cairn
#

docker network inspect bot_default

#

Assuming you haven't changed the name of the network

crimson tinsel
#

yeah its down as my ipv4 address

uneven cairn
#

it should tell you where that IP is from

#

Is that an error message from the bot?

crimson tinsel
#

yep

uneven cairn
#

what container has that IP when you run network inspect?

molten bough
#

That'll be Web

#

The web container

crimson tinsel
#

bot_web_1

uneven cairn
#

is the IP fixed?

molten bough
#

It's resolved using the hostname web

uneven cairn
#

So the site should be up, but it is refusing connections?

molten bough
#

Which would mean it's down, I expect

crimson tinsel
#

any idea why this is happening?

molten bough
#

You could try docker-compose logs web

#

See what's up

crimson tinsel
#

im not getting anything from that

molten bough
#

Maybe docker-compose up db web and see what it does without the bot

crimson tinsel
#

no errors with that command

molten bough
#

It should be outputting logs for you though right?

crimson tinsel
#

nothing got added to the bot.logs file

molten bough
#

No, in the console you ran the command in

crimson tinsel
#

oh yeah it is

molten bough
#

It'll be showing you the output for the two containers we just started

crimson tinsel
#

yep

molten bough
#

So what's up with web? Does it seem to be running correctly?

crimson tinsel
#

okay i think I just got it up and running, i had to run docker-compose for bot, web and postgres seperately

molten bough
#

hm

#

strange

#

but okay, once it works

crimson tinsel
#

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'

molten bough
#

Would need the full traceback

hardy gorge
#

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

crimson tinsel
#

okay lemme make sure

#

OKAY i got everything working now!!! THANK YOU SO MUCH FOR EVERYONES HELP!

molten bough
#

\o/

rigid plume
tough imp
#

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

rigid plume
#

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

weary rampart
#

how often do the bots restart?

brazen charm
#

should be on pushes to master

uneven cairn
#

Is discussion regarding an issue meant to be kept to Github?

tawdry vapor
#

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

cold moon
#

About this ban reason characters limit issue, should I apply fix to mute and unban and mute too?

gusty sonnet
#

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

cold moon
#

OK, but kick? This show too 512 char limit

gusty sonnet
#

Oh true, kick too!

crude gyro
#

we don't really use kicks but yeah go ahead.

uneven cairn
#

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?

crude gyro
#

there's a separate URL filter

#

so they are.

#

just through a different mechanism.

uneven cairn
#

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

green oriole
#

I don't think the filtering cares about spaces around the word

uneven cairn
#

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

green oriole
#

Do you have a link to the source code?

uneven cairn
#

It seems to be intentional

green oriole
#

Yeah that's weird

crude gyro
#

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