#dev-contrib
1 messages · Page 133 of 1
since the key vars and the channel names aren't 100% same, and not all all configured channels are contained in the template
Currently inactive, not enough manpower/demand
akarys is there a write up for the smart config solution, like how it would be working?
Uhh, maybe on the PR itself?
nah the pr description isn't really descriptive
probably this, lemme go through it smartconfig#5
I mean, if you are curious you can read through #5 and #10, but I would say so far smartconfig is an internal project, I'm afraid
you probably can lol,
okay
git rebase upstream/main right? to get the new changes into my branch
While true
It'll probably never be fixed because we won't open a PR specifically for this
I don't think anyone will mind if you kaizen it
cc FrenchSosig
Mh. I guess it doesn't hurt anyone as those lines are already changed. I can do that later on.
Honesty I would have requested the same changes if I saw that haha
😂
lol
Did you download them one by one haha
please upload them somewhere for me
Hahaha
zip and dms
You know you could have just asked someone to make a zip with an int e?
nor me until now
Haha
That's only staff iirc
Nah, there are just a couple env vars
But for only a few constants, if you wish to add some feel feee
All are documented in the page you linked, but you only need to set the ones in the first table
@thorny obsidian I have mentioned your review on sir-lancebot#618 and resolved the $u$king conflicts 🙂
Sus-king, hmm
BOT_TOKEN="Iain'tgivingthistoyoumyboy"
BOT_GUILD=814190307309781032
BOT_ADMIN_ROLE_ID=814190307330883591
ROLE_HELPERS=814190307330883585
ROLE_CORE_DEVELOPERS=814190307330883588
CHANNEL_ANNOUNCEMENTS=814311418127581225
CHANNEL_DEVLOG=814190307616358460
CHANNEL_COMMUNITY_BOT_COMMANDS=814190307980607493
CHANNEL_DEVALERTS=814190307980607495
TRASHCAN_EMOJI=""
USE_FAKEREDIS=true
tldr
that has two extra for the 745 pr
core dev role and devalerts
giving them quotes makes it easier for me to read
There it is
It's just a lot of copy pasting ids and adding emojis
Most of the setup is copying the IDs
Or rather, 99% of it
Here is fine
Aren't you setting up this bot? Here is fine too
Are you preparing a test server on mobile? You have my eternal respect.
Not sure what you're wondering about the logs, but you'll need a postgres instance, and optionally a redis instance
You can use our docker compose though
Which includes both, as well as the rest of the dependencies (site, snekbox)
You should also be following the guides here, otherwise you'll struggle more than you should
https://pythondiscord.com/pages/guides/pydis-guides/contributing/
When I get back to making them public, or you can become a helper :)
What's the blocker to making forms public? Or has it just not happened
Sitting down and making all issues public, which involves re scoping them, and writing the guides (possibly on site)
Actually getting you dawn on board was a big step in the process
Helped figure out all the pain points in the setup
Ahh. I can see if I can update some of the Notion guides to be more friendly
I did update them, and the process after you joined the team, but yeah, if you see something you wanna change, do go for it
Well, it isn't public yet
Docker is sort of like having virtual machines for your project, but not really. We use it for 2 main reasons:
- It allows us to create the exact same environment for all users that try to run the bot. Everyone is running the exact same image with the exact same configuration.
- It means you don't have to manually install a bunch of dependencies (like databases), or install them on your system, they'll just live in docker.
It's completely optional, for instance I only run the databases and site in docker, but run the bot itself through pycharm so I can use a debugger
for lancebot it isn't really necessary as you can skip redis for most features, does make the site and redis a whole lot easier to run though when they're needed (e.g. bot)
Oh yeah, the "Getting Started" guide is pretty clear
I think they could go on site whenever it's ready, it seems pretty good
Don't worry, you are always welcome to ask questions
That message was in reference to another project though
https://github.com/python-discord/sir-lancebot/pull/856
rejoice, .bm can now be used everywhere!
i messed up my original .bm PR (no one saw the error as well lol), but this one has been tested several times and expands upon the original
Cloning a fork allows you to push your changes without changing your remote
But just cloning the main repo would work fine, yes
A clone is a local copy. But our projects only allow branches and direct pushed by those in the org. If you want to create a PR and a branch, then you need to fork
Yeah. If you're just setting up your own bot instance without making code changes, you don't need to fork
It's a variable that may be used later on in the file
You can ignore most emojis, you'll most likely only need the trashcan to start with, and whatever other ones if you get other errors
But if you're setting the bot up for your own use, yeah you might want to set them all
They are prefilled, but will only work if your bot is on this server (or rather our emojis ones)
But that isn't really possible
you don't need to configure most of the channels fwiw, only some basics like the log, bot commands etc. but otherwise I'd only configure what you need for the functionality of what you're working on
Not really, since it's only the trashcan you need
If you want the actual images, you can copy them from here
Or from the CDN directly
speaking of all the configuring, any status on bot#1595 ?
@dry folio Thanks so much for reviewing sir-lancebot#843!
you're very welcome :D
hey, little suggestion: wouldn't it be cool to use a random word/dictionary API instead of a fixed file of 1000 words? that way, you'd get new words every single time (disadvantage is that the random words might be very obscure)
actually, you could make that into a sub game mode - say, when one puts .hangman hard, then can use those random words
So you'd like to clean up unused constants and use actual code constants for the less changed ones?
Do you think that urban dictionary could be used to grab a random word?
grabs one randomly and it's nsfw
ban
That is a big no haha, urban dictionary has way too much nsfw stuff
That was mostly put there for consideration as they take up some space in the yaml file, but I also don't think it's a big issue. The main point of it is to make the layout easier to navigate and remove unused and duplicate values
Alright, that sounds like fair changes, I think you can go for it
If that's something you are interested in contributing
Most of the constants don't match one to one in the template
For simplicity, we merged a lot of the channels
I love that idea! I will bring it up to Frontogenesis, he was the one who created the PR - I was just working together with him
So just copy a channel/category for whatever seems the best
You can have multiple constants point to the same channel or category
Don't exist in the config?
You should only be changing the IDs, rather than the names
I was going to do that originally but most dictionary APIs require a key
And I tried to apply for one of them for my own personal usage and they never got back lol
I think we're better off just using a set of 1000 words because I doubt the user will ever get another word again since if I'm going to be honest, not too many will play hangman
Just copy a different channel id
Eg for this, just use the admins-mods category for both
Hey @vale ibex , would you mind leaving a review on sir-lancebot#843 when you get a chance? Would really appreciate it. Thanks so much!
Can take a look on the weekend most likely
Ok, that's fine.
Hey @austere hornet , can I talk to you about hangman for a second?
I think he's offline, you can create a group DM with both of us if you wanted to, or just wait for him to come back offline
online*
(I'm Shom770 btw)
I wanna talk to you about the tries variable
It doesn't seem to be consistent with some of the word lengths
Is that intentional?
That's intentional, since in most hangman games you usually have a set amount of tries, regardless of the length
Ah wait
I see your point
if there's more than 7 unique letters
Well you can filter for the minimum unique letters
and maximum
so it's easier or hharder
@thorny obsidian we should probably change the labels now in @dusky shore's repo
:D I can help with suggestions!!
Wait why does the labels need to change? I see, because they're seasonal
hold on, need to deal with some rando tagging me and saying I should be domain leads???
wack
Lol it was someone saying you shouldn't
@thorny obsidian where hath thou gone
Hey @clever wraith what's up?
okay, so I don't really know that the area: x labels are supposed to mean. Like... what's frontend for lancebot look like? What's the backend? Those labels seem ill-fitting for our bot.
For the Categories, delete all current ones and replace with:
category: holidays <-- catch all for all fun holiday stuff
category: core <-- affects the core runnings of the bot (i.e. int e, source, ping)
category: events <-- my events stuff! AoC, Hacktoberfest, etc
category: fun and utilities <-- absorbs both practical and fun commands since I don't think there's a good reason to differentiate between them.
Have we ever used the invalid, meta: duplicate, or meta:external labels? afaik we just comment on the issues themselves.
and maaaaybe a category: content for when it's not a code change but just adding more content to the bot. Like with topics and the like
Feel free to DM me if you want to talk
frontend is for items similar to hardcoded embeds, changing the appearance of something or formatting, but more specifically the way something looks and not the functionality.
backend is for anything that isn't frontend
frontend could also be stuff in the README
hmmmm, does it make sense to have those labels? Isn't it just frontend and then if it doesn't have that tag it's assumed to be backend so we cooould dooooo area: formatting. Also README stuff would fall under area: docs no?
but the area stuff is \shrug for me, so I'm fine with leaving that be. It's mostly the category stuff we can change
category: fun and utilities<-- absorbs both practical and fun commands since I don't think there's a good reason to differentiate between them.
I think we should split them sinceutilitiescan mean stuff likewolframwhenfuncan mean cogs likecatify
I'm fine with that too~
Resolved it with fronto
So we'll have holidays, core, events, fun, and utilities. For invalid, meta: duplicate, and meta: external, we've used them very rarely.
@thorny obsidian We've used invalid 18 times, the last time being April 6th of this year. meta: duplicate has been used 3 times, the last time in October of 2019. meta: external has never been used.
amazing new labels!
Also, we're not doing hacktoberfest this year, right?
yep, like expanding the .quiz command database lol (is that issue approved yet? i shall check)
might as well yeet that label
correct, we're not participating in hacktoberfest this year
alright
also, for colors
I was thinking using evergreen for the categories
#38786d
I'll just go with that for now, we can always change it later

I hope it gets approved tbh
at this point the python quiz is just memorization
and who can type the fastest
yeah
the issue you're talking about is sir-lancebot#815?
Yep
oh yeah go for it. I'll overstep my bounds and say that's fine
Approved lol
Are we allowed to ask if other issues can be approved since everyone is here or should we just wait
@vocal wolf this can be closed, right? sir-lancebot#803
I would probably say
An agglomeration of fun games and quizzes with other PyDis members idk
needs to be a short description
PyDis mandated fun, you will enjoy.
I was just going to say Features that are fun
hm, i mean that could work but i feel like people would be confused since it's a bit broad
it's also a bit too literal haha
Games and other fun features
Features related to fun and games
yeah that sounds good
It's for the metabase cog, you can ignore those
The same folder as the config and dockerfile
You have to create it in the root of the project, the folder you are in by default when opening github
you have to create an application for the bot yourself, and then get the token from the application you made iirc
The one from the discord app portal
CC @thorny obsidian
Those two for now. We'll be adding two more in the coming months: trivia night and esoteric challenges
our code jam stuff is in Python
the api key is what's used to authenticate with the site api, it should be somewhere in the guides
🎉 Xith best triage lead
xith > not xith
https://pythondiscord.com/pages/guides/pydis-guides/contributing/bot/#environment-variables the example file has the value you need
A guide to setting up and configuring Bot.
I have no idea what this is supposed to mean lmao
nor me
oh wait
Nah, that's the default value
the guide could be clearer there, as you can only get it from there, the compose file or the site
lmao
only if you plan on working with the reddit cog
Btw. May I ask what the consensus on implementing dpy 2.0 features (eg.: views) in either of the bots, in the future?
iirc it's to use them if you need to, but existing features wont be updated to use them
at least rn
We will look at it for sure, we wrote a bit about our migration policy in #dev-announcements
Actually, that'd be a nice thing to fit in botcore
Who is working on that again, are you working on botcore by any chance @cold island?
I'd be interested in adjusting lancebot features as we work on them to incorporate some d.py v2 features
a common base for all bots
Instead of replicating the same core features (i.e. int e) across all bots, it uses a common base. So if we make upgrades to it, we don't have to replicate it across all bots
Yea, we found ourselves copying things from python and lance, like pagination, Int e, help command etc
No, buttons and select menus are tho
we should just use jishaku for eval 
We do for Arthur lol
time to go through every single issue of sir lance
Like kaizen them in as we have PRs targeting 'em?
Like for instance, if we're working to update AoC features, if we find a good use case for it, I wouldn't mind increasing the scope of AoC PRs to revamp it slightly
That sounds like a good idea
The reason I asked about dpy. 2 is because I had an issue about it. <#dev-contrib message>
You need to have both, with the config overriding the default config
That sounds like an excellent idea, and probably the kind of stuff we would accept a PR for, as it brings a large beneficial UI change
Don't change config default. Those are the values we use in prod
Glad to hear, I’ll open an issue for it. I was thinking about a generic view that could be used all around the code.
What OS are you on?
So you want to use WSL2 if you can
Otherwise, you can enable HyperV
Check out these install instructions: https://docs.docker.com/desktop/windows/install/
Once you have docker up and running, just do docker-compose up
(for which you need a win pro edition, so that may not be an option for you)
You shouldn't need to install a specific linux OS, just having WSL2 there with Docker is fine
mhm, make sure docker desktop is running, then docker-compose up
Alright I've updated the labels in all PRs and issues in @dusky shore.
only a bunch more repos to go 
@cursive relic what is giving you this error?
The docker-compose up or starting up docker desktop?
no? we only updated the labels in one repo
oh, lol
lol, moderator discussion is needed on whether or not we're allowing these words for sir-lancebot#843
fixing spelling in force pushes so no one notices 👀
yea, lets not have these
alright, i linked your message
Yep, sorry for not looking at the words earlier and removing htem
them
@dry folio I just ran a regex replace so all the two letter words are removed
In theory, takes me time to get to it though
could people look at sir-lancebot#849
i could use the reviews
Yo what the hell
i mean, sex and sexual?
we dont want wholesome sir lancebot saying those things
I know and I just realized that was our PR
I did not notice that
lol
Yeah ik
@trail pilot Did you remove those words?
Oh wait yeah you did sry tl;dr
Am I allowed to review?
Can anyone review
If so I'll gladly review
Yes, of course!
Code reviews are always helpful
Awesome!
yes
You're allowed to review, but it won't count towards the mandatory review count (since you're not staff/core dev)
I'm not sure if contributor reviews count or not
they do
Contributor reviews meaning contributors with the contributor role in Python discord itself or just the contributor label on github?
role
Ah
Yeah that makes sense, thanks!
It's definitely still worth reviewing btw
Just make sure you're thorough to the best of your ability, an approval with potential mistakes left in the code that could be caught with testing the functionality won't help anyone
Contributor reviews count
But they won't get the green check in github
But they do count towards merge
perfect!
Link to change log?
You really do make mistakes with config files.....
in my defence
policy-bot has an endpoint that lints configs
and I run all the configs I write through them
No, you don't have a defense
King Arthur has black incompatible isort config still
i merged that didn't i
first i am hearing of it, lol
i mean ultimately, I haven't had a problem with it lol
hey all, getting a weird error on my sir-lancebot clone: ImportError: cannot import name 'Thread' from 'discord' (/usr/local/lib/python3.9/site-packages/discord/__init__.py)
hmmm, might need to update the discord.py dependency, we've bumped it to 2.0.0a
Right, is that in the poetry.lock file? I've run poetry install and then docker-compose up which is when I hit that error
try run docker-compose up --build
Is there a reason for lancebot having different levels on its file and console handlers when debug is not on?
I'll set both to info like bot does through the logger then
now getting this error:
discord.ext.commands.errors.ExtensionFailed: Extension 'bot.exts.utilities.color' raised an error: TypeError: Expected discord.Colour, int, or Embed.Empty but received str instead.
Wait this is the file I'm working on... 🤦♂️
lmfao
But I don't know why I'm getting that error
is it fine if i just upload the working code
Not sure what this is
and u guys can just edit edit edit
fine to ignore
I think I figured out my first error, was trying to format an Embed incorrectly. But now I'm getting this:
TypeError: module() takes at most 2 arguments (3 given)
what's the full traceback?
@clever wraith We should be using trailing commas. Our style guide includes following PEP8 in cases where we don't call out that we're deviating from PEP8. Additionally, as mentioned in the review comment, it ensures that the git blame in the future is accurate.
alright
ill get on it soon
hm..... arguably the status embed should not be under the same requirements hmmm
sir-lancebot | File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
sir-lancebot | return _run_code(code, main_globals, None,
sir-lancebot | File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
sir-lancebot | exec(code, run_globals)
sir-lancebot | File "/bot/bot/__main__.py", line 31, in <module>
sir-lancebot | bot.load_extension(ext)
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 732, in load_extension
sir-lancebot | self._load_from_module_spec(spec, name)
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 663, in _load_from_module_spec
sir-lancebot | raise errors.ExtensionFailed(key, e) from e
sir-lancebot | discord.ext.commands.errors.ExtensionFailed: Extension 'bot.exts.utilities.color' raised an error: TypeError: module() takes at most 2 arguments (3 given)```
how are you calling color
class Color(commands.cog):
"""User initiated command to receive color information."""
def __init__(self, bot: Bot):
self.bot = bot
@commands.command(aliases=["color", "colour"])
@commands.cooldown(1, 10, commands.cooldowns.BucketType.user)
async def color(self, ctx: commands.Context, *, user_color: str) -> None:
"""Send information on input color code or color name."""
commands.cog -> commands.Cog
ahhhhh typos. Thanks Joe, you are a genius

Why does adding a trailing comma make the git blame more accurate? I heard it, hence I put it in the review comment, though I don’t know why it makes it more accurate
if you add a new element, or swap things around the you don't have to add the comma and create a diff on that line
Ah
With a
a = [
1,
]
file changed to contain a 2 on the second line in the list you can see how the diff changes
# no comma
a = [
- 1
+ 1,
+ 2
]
# trailing comma
a = [
1,
+ 2
]
howdy people. changes requested to sir-lancebot#849 have been made
@clever wraith Could you invite me to your testing server so I can test out some edge cases if you're fine with that
hey @patent pivot how long are ducks kept on quackstack?
until reboot I think
cleared when we deploy quackstack
when we go for S3 then permanently
couldnt that cause problems if someone spam requests
yeah - that's why we're migrating to S3
this setup is not production ready
!remind 18h t
Your reminder will arrive on <t:1631052475:F>!
.github/workflows/lint-build-deploy.yaml lines 76 to 79
build:
if: github.ref == 'refs/heads/main'
name: Build & Push
runs-on: ubuntu-latest```
!remind 12h fix the skip of the thing and do the other thing, tldr king-arthur#10 probably need another change
Your reminder will arrive on <t:1631034286:F>!
!remind cancel 2999
That reminder has been deleted successfully!
!remind 12h fix the skip of the thing and do the other thing, tldr king-arthur#10 probably need another change
see this section for what to add to the bottom of lint-build-deploy. https://github.com/python-discord/bot/blob/26cb61d15f30dfa170bb9ef61a167376ee0e3c52/.github/workflows/lint-test.yml#L135 Might need to refactor workflow to be like the below actually https://github.com/discord-modmail/modmail/blob/0ed105fd956a0455dc1ca1d19903149bacb0524f/.github/workflows/lint_test.yml#L171
Your reminder will arrive on <t:1631034454:F>!
.github/workflows/lint-test.yml line 135
- name: Prepare Pull Request Payload artifact```
`.github/workflows/lint_test.yml` line 171
```yml
artifact:```
sheesh, three messages for one command.
Yeah of course, I was just curious if 2.0 view things were part of the plan
is botcore public?
botcore#1
...@cold island?
going offline, if someone knows please ping me 😄
Yes, because that's where the docker-compose file lives
That would run only the bot
But it depends on Redis and Postgres as well as the site I think, which may cause issues.
But yeah, try it.
just try docker compose up -d first
Feel free to ask
Yea, but the compose should handle it for you
This will add all the dependencies you’ll need
The whole concept of env vars in the bot is for production, you really don’t need to use an env file in development. In production, we use config-default which is publicly visible on git, so we can’t put all our tokens and what not in there. In development, you don’t have the same problem
You can still use env vars, we document all of them in the getting started guide
I remember this problem from a while back
@vale ibex is working on a fix right now iirc
If everything is online, you should be good
Is it online in docker?
Right, in that case the bot won’t start
It’ll time out soon
Chris is working on a fix, but in the mean time you do need to tweak the database manually slightly
Do you have any way to edit the database? Something like PG Admin
None of what?
If you don’t have any of the tools, it’s still possible to do this using just docker
Yea there's a pr on site for it
I see Mark made some comments while I was sleeping so ill take a look later
Alright nice
nope, we'll be developing internally for now, but to my knowledge we don't have a repo
The work around right now is to pull up postgres, run the sql manually then pull up the rest
Stop all the containers
And just run postgres
Then get a shell into the postgres container, run psql -Upysite
Then copy and paste the sql from here into the terminal https://raw.githubusercontent.com/python-discord/site/main/postgres/init.sql
Then you can start up the rest as normal
From docker desktop, if you click on a container its the terminal icon on the top right
I'm on mobile rn so can't remember what it's called
try docker-compose up
That’s correct for docker
Did you try docker-compose up before starting the bot again?
Yea, took me about the same when I first set it up, wasn't a nice experience
annoyingly to make it any better, it's a lot of effort, since even using a template, IDs are not the same
We're working on a project that will hopefully improve this experience, but it's slow going atm
Did you update the urls?
in config.yml
urls:
# PyDis site vars
connect_max_retries: 3
connect_cooldown: 5
site: &DOMAIN "web:8000"
site_api: &API !JOIN ["api.", *DOMAIN]
site_api_schema: "http://"
site_paste: &PASTE !JOIN ["paste.", "pythondiscord.com"]
site_schema: &SCHEMA "http://"
site_staff: &STAFF !JOIN ["staff.", *DOMAIN]
paste_service: !JOIN ["https://", *PASTE, "/{key}"]
site_logs_view: !JOIN [*SCHEMA, *STAFF, "/bot/logs"]
# Snekbox
snekbox_eval_api: "http://snekbox:8060/eval"
yea, change yours to this
they will be different, since in prod they are different to dev
Yea, we pinned to v7, to match d.py's pin
For the guild invite filter
literally just copy what I have above and put it in yours
that should be good then
now, the other thing you likely haven't done is redis
at the top, under bot::redis
mmmmmmmm triage time
Set the values to this ```yml
redis:
host: "redis"
password: null
port: 6379
use_fakeredis: false
don't they need to be for strings?
you should only need to rebuild if you change dependancies
or the dockerfile etc
yup, that's gonna happen until my PR is merged
.
just do docker-compose up
you'll need to do it each time you reset the postgres container
site#583 shouldn't be much longer
you should be able to do just docker-compose up without rebuilding
As long as the postgres container isn't destroyed, you don't have to repeat that
It's only destroyed if you do docker compose down or if you rebuild
Closing your PC is fine
Anyways this shouldn't matter by tomorrow 🤞
The arrows are default emoji, so you don't need to worry about that
The help ones are all builtins
Except the trashcan
Which is basically all you need
you can even set the trashcan emoji to an inbuilt one too like ❌
They won't work because the trashcan emoji missing raises an error
so the paginator doesn't run
you need to create a webhook in Discord for that channel
and then copy the webhook ID into the config
mods
To a duck-pond channel
working :p
darn
I'll just request your review for later
👌
oof
site#583 
It's already had a few passes, so likely close to done now
lol yea, I really like writing sql
yea, that's handled in the parse_db_url() func
yea, it'll raise a keyerror if it's not there, and fail validation if it's wrong
Because I've changed the line that Mark commented on

go into the channel settings, goto the integrations section and then webhooks
https://canary.discord.com/api/webhooks/<id>/<secret>
copy the webhook url and then take the id out of it
yup
ah 😄
docker-compose up --build bot
you shouldn't need to rebuild though
if you only changed config
remove the last bits
just have ":x:"
no < > either
only if you ever kill the portgres container manually
IE with docker-compose down or if you delete the container via docker desktop
or if you do docker-compose up --build
That's why we recommend doing docker-compose up --build bot since that only rebuilds the bot
rather than all containers
yea, docker-compose has a volume in it
so just code/config changes automatically get put in, without a rebuild
if you change the Dockerfile, or the dependencies in the pyproject.toml file then you'll need to rebuild
👌
!charinfo ❌
\u274c : CROSS MARK - ❌
try "\u274c"
@clever wraith your zip file url is asking for password
yea
also can you generate template of your test server, so i can get thse emojis 
afaik templates don't include emoji
category emojis
ahh
Did you put the quotes there too?
What's on line 70-75 of your config.yml file
you have those numbers in thjere?
hm that's odd
I have the same in my config and it works fine
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
Could you put your config file in here
I just pasted that into my bot and it worked fine
Maybe its a weird line ending
copy from the paste service and paste it into your config
ok
I'm merging
the wikipedia guess game
it works well, I want this PR gone and shoved into main
@short snow mind if I squash it
your choice 🙃
I'm squashing it
okay
lol, what happened
xith here is your 🍪
@short snow Question: Do we actually need this? I'm confused as to why it's necessary as a PR.
It break if the status of the PR changes while you are trying to merge
Yeah, we do, think stuff like the latex cog we had to keep unloading
ugh the latex cog
basically this was needed very much during the latex bug, because you had to keep unloading the cog everytime the bot restarted
and this can be a issue in future
Check the first few lines
is it literally because of the latex cog that this is needed
so it was decided to have this feature
We had to add an early return in the loading code to stop it from loading anymore
and nothing else
I imagine you copied some of the other buttons on that page
That may happen later
god dammit latex
Like, if an important bug occurs we want to quarantine the cog
y u no not break
quarantine the cog, i like it lol
Having to unload every time is a pain
@short snow shouldn't we ping devops and not all core devs when a cog is getting borked?
👀
I don't think core devs would enjoy that
we rarely ping core devs, if something is exploding, devops should be pinged instead
@gritty wind shouldn't we ping devops instead?
The reasoning was dev-core are more relevant because they are managing the cogs
It’s unlikely that the described situation is a problem with our actual cache
Do we need a ping?
Most likely it would be to someone moving a cog, or one getting deleted, etc
You do?
yea
we do
If you want, you can forego the ping
Sentry would be fine, yeah
If it is really important, could do an at-here in #dev-alerts
The importance of it will depend on why things are added to that list in the first place
The main driving factor for this was the latex cog
And I’d say keeping that unloaded was pretty critical since it was OOMing us
The bot has to be able to mute you, don't think there's more to it if everything else is set up
Does your bot have permissions to mute?
@timid sentinel FYI, in bot#1813 I removed the previous nominations message as we discussed a few days ago
does it output an error in the console?
How do you know it failed to apply?
Could you paste the log here from when you did it?
Does the bot have a higher role than the mute role?
otherwise it cannot issue the role
jsut give the bot a super bot role
ty for the review xith
do you have any in the db?
It does it at midnight
Not right now no
There's an issue for it tho
you could change the time it runs though
or change the logic to do it more often
bot.exts.fun.off_topic_names
the first function is the loop, so just change that
Oh wow, is that set up for python-discord/bot?
My sir-lancebot setup is just my own "first" server with dedicated channels lol
Works is a loose term
if you use docker it should just work
we can have a contrib server now, int e is owner restricted :yay:
Can we Use bs4, for getting any info?
In what context? For a bot command?
Yes, for Bot commands
Hmm I'm going to let a core dev chime in on that one. I think if it is not malicious it should be fine, otherwise I would look for an API.
Depends on what you use bs4 for, if its to parse scraped content, then it would depend on the website's rules
preferably use an API, as it's far less likely that an API will have breaking changes
If any free API is not available, than should I go for bs4.beautifulsoup
Again, it depends on whether the website allows scraping of it's content. Even then it's not a good idea, as a page's DOM is likely to change given enough time, compared to an API
which issue are you trying to mention? If you are working on the bot
I had not created the Issue till now, I was firstly planning for it
oh yeah! check our the codewars kata issue. As far as I can tell, we can use bs4 because it at no point disallows automation
which repo?
codewars has an api for katas 
lance
the api is v1 and very limited
i'll take a look
oh yeah i used bs4 in my project too
You would need to use scraping or manual compilation to get anything usable
yea, it seems fine
as a precaution it would be good to include a mention and link to the FreeBSD 2-Clause License in the embed, since that's what challenges are licensed under
I haven't used codewars too much myself
are there many cases of offensive/troll challenges posted?
@dim pelican the WTF Python PR should also parse the README.md with help of a markdown parser possibly https://mistune.readthedocs.io/en/latest/, and then show that markdown instead of the link in the embed description. This was the reason it was in WIP state
Copy that, so instead of sending the link in the embed description, send the relevant markdown section that matches the fuzzy matched search.
The last I saw was that the PR needed to change from fuzzywuzzy to rapidfuzz, so I will need to see how to get the markdown parsed and formatted to the embed correctly.
yeah 👍
this is how i was gonna progress upon that, but that time never came:
- example start with
<!-- Example ID: 11111-1111-111-111111 ---> - end with a line containing
:bulb: Explanation - the last block ends before
### :arrow_forward: Minor Ones
you can search for the header and after that the example id, and including everything until the explanation block on the first page (pagination) and the explanation on the next++
there were a few exception cases which I don't remember, just go through the readme to check if possible, i may be wrong
defcon is one of our raid mitigation tools
It'll allow us to reject accounts that are of a certain age. It's also what allows us to do a complete server shutdown with one command
I've seen !shh in action twice
!defcon shutdown and !defcon unshutdown
It'll remove write permissions for everyone from every channel and kick people from VC and remove speaking perms. It's incredibly convenient
A lot of it will move to Black Knight as we look to upgrade them
We want to expand what our defcon cog can do, especially in terms of quarantining accounts that meet specific parameters. But we don't want to reveal what those specific parameters are.
So it's harder for raiders to circumvent our raid mitigation. It lets us stay a bit ahead of the cat-and-mouse game for a bit longer.
I mean, are they expected to prepare more than let's make accounts and spam shit?
We did have that one raider that specifically targeted our help channels. That was mildly annoying
I'm glad you guys put some high quality thought into the anti-raid though. Better to have it and not need it than vice versa
Absolutely agreed.
shom is fast
I remember one of those
oh you've worked with that before too?
I'll add that to the footer
yeah
Should I just say Challenges are licensed under FreeBSD 2-Clause License?
old picture but :P
That's pretty cool!
this is how it is currently formatted
i cut off the description fairly early
not sure if i should do that
hmmmm, I wonder how that would look with fields
Like a field for Languages and Tags
imo the question itself should be most visible
hm yea
that would be nice! how does a button work with dpy 2.0 again haha
Anyway, I think this is a super neat feature. I'll see if I can carve out time to review it
Thank you!
I'll try and see if I can add buttons
wdym?
I do want to review the AoC thing today. Pretty pumped that got completed so quickly
is it the new leaderboard?
This might help you out:
https://stackoverflow.com/questions/60686677/discord-py-emoji-all-servers-bot-in
The per-day leaderboard
Ooh, that feature is pretty cool
Advent of Code are those challenges in december right?
from the first to the 25th of december?
yup!
It's really fun
It's like the release of the qualifier but like... every day for 25 days
Plus I'm figuring out how to do a similar spoilers-allowed channel for easy solution discussion
These discord buttons are really cool
I'm gonna see how I can incorporate them to the challenge command
Ooh, that sounds really fun
I’m looking back at the code for my qualifier for the code jam and it is atrocious haha
AoC is a very similar style of "it just needs to works"
To thoroughly derail this channel, AoC is also one of the more unique events for this server because we tend to get some very good programmers coming out of the woodwork. Like, the people who participate on our leaderboard and in this server frequently also make it into the global leaderboard for AoC. Which is downright terrifying
AoC sounds really fun, I’m guessing I’ll likely lag behind because I can’t do the first four days of it due to an exam
But I enjoy challenges like the code jam qualifier
It's fine~ You can complete them as you go. I think I only made it to day 8 last year
Ah alright, thanks!
Go buttons!
I'm gonna mess around with the UI and see if I can come up with something that looks really nice
Goddamn that's nice
We need to start buttoning lancebot commands
Agreed
But I would like to see more info about the kata itself in the description and maybe condense some of the kata meta-info
Yeah, I'm going to have the first slide be only about the difficulty and the description
and maybe have a pagination with the other embeds containing other information
Nice!
Might be a good idea
this is the base, i have to clean some stuff up but yeah
Here's your reminder: fix the skip of the thing and do the other thing, tldr king-arthur#10 probably need another change
see this section for what to add to the bottom of lint-build-deploy. https://github.com/python-discord/bot/blob/26cb61d15f30dfa170bb9ef61a167376ee0e3c52/.github/workflows/lint-test.yml#L135 Might need to refactor workflow to be like the below actually https://github.com/discord-modmail/modmail/blob/0ed105fd956a0455dc1ca1d19903149bacb0524f/.github/workflows/lint_test.yml#L171
[Jump back to when you created the reminder](#dev-contrib message)
when will what?
so there is no set end date. We have our own internal guidelines for when a vote is actioned/retired, but it changes every once in a while
double checking, you shouldn't need it, since its the solutions that are licensed, not the questions themselves
When you react with
or
it'll archive the vote appropriately
whoa secret server 👀
Ah alright
thats quite nice
should be better now that we specify docker runs on a x86 vm
So as long as you get docker installed, it should work 😄
!help voiceverify
!voice_verify [_...]
Can also use: voice-verify, voiceverify
You cannot run this command.
*Apply to be able to use voice within the Discord server.
In order to use voice you must meet all three of the following criteria:
- You must have over a certain number of messages within the Discord server
- You must have accepted our rules over a certain number of days ago
- You must not be actively banned from using our voice channels
- You must have been active for over a certain number of 10-minute blocks*
Yea, I can imagine. quite a few deps don't have wheels for arm
but we now tell docker to force the vm to run on x86, so it should be fine
we only added that a few days ago
not yet no
!remind 2h t
Your reminder will arrive on <t:1631042975:F>!
Hmmm do we have an example somewhere of MaxConcurrencyReached being raised directly?
Lmfao @vale ibex a command that an admin cannot run 😛
Yeah lmfao
No, but I believe that's from the dpy decorator
Iirc it is used on Lancebot for a few of of the games
hah yea, it can only be ran in #voice-verification
And I think is locked to only those w/out the role
I don't have the role 😄
Yep
Lmao
Badmin smh
@stable mountain down or discord bug?
!ping
You are not allowed to use that command here. Please use the #bot-commands channel instead.
nvm, seems like a discord bug
Probably just a cache thing
Task failed successfully
lmao
could be
Lmao
https://github.com/python-discord/sir-lancebot/issues/848
I'm not sure this should be assigned wtih the label category: fun
Description The .challenge command would pull a random kata (challenge) from codewars.com, and the user can filter with either the query or the kyu (difficulty), 1 being the hardest, 8 being the ea...
It's more like utilities imo
Yeah I can agree with you
It's technically fun if it's a game
It'snot really a game
it's just grabbing a kata
I see the thread pool executor for images, but not the dpy decorator
Hmm
I think I found something online
yeah that's it, thanks
bot/exts/utilities/latex.py line 75
@commands.max_concurrency(1, commands.BucketType.guild, wait=True)```
Well it says one at a time per server no?
yeah, but that should be a command bucket given that the purpose of that bucket is to keep the RAM usage down
king-arthur#10
king-arthur#10
first status embed from king arthur btw
Nice 😄
Hey @vale ibex , when you have a moment, could you please review sir-lancebot#847? I would greatly appreciate it. Thanks so much!
Could you describe what madlibs is, and what you expect the output of the game to be?
In the issue
Sure, one sec
No rush, I'm about to have dinner so likely won't be able to look right away
but in future, please try to fill out each part of the issue with what is it you plan to do.
Ok, I will try my best. Thanks!
Hmm, good point...
Well if that happens it's not really my problem...that would be something the mods would take care of imo
Done, let me know if I'm still missing something
Also Madlibs gets pretty spammy with consecutive inputs
True
Here's your reminder: t
[Jump back to when you created the reminder](#dev-contrib message)
done ^
Nah, not unless you delete the docker container. You just need to start the bot
@fallen patrol would rather not have separated workflows
we'll probably migrate all repos to single file workflows in future given the new reusable actions features
wdym?
you've split the workflow into 3 files
huh wow
but yeah, basically on my domain projects at least we're doing single file workflows
i split it to get the indicators at the bottom of every pr, since it was a nonconditional skip that would be at the bottom of every pr; will revert
skipped jobs are fine by me, the UI much better displays single file workflows in actions tab
and uhhhh
eventually my domain projects might use something like https://danger.systems/
so the actions under the PR aren't hugely important
https://github.com/python-discord/sir-lancebot/issues/862#issuecomment-914569280 Me not good with Python
i mean, nearly every public project on pydis has it
even kubernetes has it iirc
I know, I'm just not a huge fan of the artefact stages everywhere
yes, but kube doesn't actually go to #dev-log lol
No, it doesn't
The status embed does, the actual git traffic goes to our internal dev ops channel lol
ah, yes I was talking about the status embed in response to this
changed, gibe thoughts
yeah looks better
artefact stage is sad though
why are we running a separate flow for status embeds
it makes sense for multi manifests but not single
if I slap it in the bottom of any one of the stages, it could pose a problem ¯_(ツ)_/¯
only if you want it to only inform about linting, ig
separate stage that always runs or something
ohhh
you mean the second file
so the reason it can't be is documented in the comments
eh, it isn't
if a fork is the pr, then what occurs is the fork does not have access to the respository secrets
that means that it won't run with the proper secrets for the countless forks that create a pr.
hmm
this could be moved to the bottom of the lint-test job
Easy PR for review
https://github.com/python-discord/site/pull/585
as it only reports on lint test for all other pydis embeds
reviewed 😛
Thanks 😄
actually I had already looked at it before you linked it here 👀
nope, but since I'm doing the king arthur workflows rn, I had been watching
@patent pivot to further prove the point ; this happened when I renamed the workflow to what was configured on the status_embed.yaml which is on main #dev-log message
but it did not run when the workflow was renamed back to its current name #dev-log message
I know it doesn't work, yeah

It's used in one place 
cpr = "!cd ${GIT_PREFIX:-.} && git fetch upstream refs/pull/${1}/head && git checkout FETCH_HEAD #"
!cd ${GIT_PREFIX:-.} will cd to the project root dir
git fetch upstream refs/pull/${1}/head will fetch the given pull request number from upstream
git checkout FETCH_HEAD # will checkout that pulled PR
?
Hmm how would I use VSC to attach to the bot container and debug it?
I'll just try the tutorial
feels like running it locally would be the simplest
Hmmm can I run bot localy and site in docker?
yes I've been doing that for years
You can select which services to start with docker-compose
docker-compose up -d web
You just need to change the API url to localhost
You can double check the contrib guide, it explains how
hey @brisk brook, what did you mean regarding https://github.com/python-discord/sir-lancebot/pull/849#discussion_r703760977
My question is, why are you using .get()?
It's usually used when you think that a key is missing, but you never have any if-statements checking for it
I use the docker override file to completely ignore it
fair ill get on that
huh
Hmm it only says this https://pythondiscord.com/pages/guides/pydis-guides/contributing/bot/#run-on-the-host
A guide to setting up and configuring Bot.
Site is running, checked localhost:8000, but bot can't connect
what does the config look like?
urls:
# PyDis site vars
site: &DOMAIN "localhost:8000"
site_api: &API !JOIN ["api.", *DOMAIN]
site_paste: &PASTE !JOIN ["paste.", "pythondiscord.com"]
site_schema: &SCHEMA "http://"
site_staff: &STAFF !JOIN ["staff.", *DOMAIN]
paste_service: !JOIN ["https://", *PASTE, "/{key}"]
site_logs_view: !JOIN [*SCHEMA, *STAFF, "/bot/logs"]
It is explained in the config section
Set urls.site:
If running the webserver in Docker, set it to "web:8000".
If the site container is running separately (i.e. started from a clone of the site repository), then COMPOSE_PROJECT_NAME has to be set to use this domain. If you choose not to set it, the domain in the following step can be used instead.
If running the webserver locally and the hosts file has been configured, set it to "pythondiscord.local:8000".
Otherwise, use whatever domain corresponds to the server where the site is being hosted.
I guess you fall under the last point
I use localhost and it works. Maybe check docker ps to see how the service is being exposed on the network
1f8190b9efc4 ghcr.io/python-discord/site:latest "python manage.py ru…" 44 minutes ago Up 45 minutes 127.0.0.1:8000->8000/tcp bot_web_1
Can you access it in your browseR?
yep
what's the error when the bot fails to connect
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.localhost:8000 ssl:default [None]
2021-09-08 00:56:26 | bot | CRITICAL | Could not connect to site API. Is it running?
Maybe you are missing site_api_schema: "http://"? I have it in my config.
Not sure if it is actually being used though
Here's your reminder: t
[Jump back to when you created the reminder](#dev-contrib message)
I'll add it to config.yaml, but it should be pulling it from config_default
same thing
Does http://api.localhost:8000/bot/ work in your browser?
Yeah that's how it should be. I am running out of ideas. If your browser can connect I see no reason why the bot cannot
Are you on win? I also get a DNSError if I try to use localhost but the domain from the hosts file works
I'm on windows yeah
Try 127.0.0.1 first
that had the same error on my machine
Works fine for me on Windows 🤷♂️
no idea then, but worth a try at least
no dice
Can you connect at all from python e.g. requests.get("http://api.localhost:8000/bot/")
socket.gaierror: [Errno 11001] getaddrinfo failed
I don't know why that happens, sorry
I think that is because of the subdomain, but the bot fails before that afaik
Looks like it connects if I leave out the subdomain so there could just be some weirdness around that
I'd just set the domains in the hosts file and that should work I believe
127.0.0.1 pythondiscord.local
127.0.0.1 api.pythondiscord.local
127.0.0.1 staff.pythondiscord.local
127.0.0.1 admin.pythondiscord.local
Is in my hosts file
For the bot? no, I only have the bot token
change the localhost to the pythondiscord.local and I think that shouldwork
In the config? that didn't work
What's the whole traceback?
sec
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\_\Desktop\pydis\bot\bot\__main__.py", line 15, in <module>
bot.instance.run(constants.Bot.token)
File "C:\Users\_\AppData\Local\pypoetry\Cache\virtualenvs\bot-uy3Tm0_t-py3.9\lib\site-packages\discord\client.py", line 723, in run
return future.result()
File "C:\Users\_\AppData\Local\pypoetry\Cache\virtualenvs\bot-uy3Tm0_t-py3.9\lib\site-packages\discord\client.py", line 702, in runner
await self.start(*args, **kwargs)
File "C:\Users\_\AppData\Local\pypoetry\Cache\virtualenvs\bot-uy3Tm0_t-py3.9\lib\site-packages\discord\client.py", line 665, in start
await self.login(*args, bot=bot)
File "C:\Users\_\Desktop\pydis\bot\bot\bot.py", line 256, in login
await self.cache_filter_list_data()
File "C:\Users\_\Desktop\pydis\bot\bot\bot.py", line 87, in cache_filter_list_data
full_cache = await self.api_client.get('bot/filter-lists')
File "C:\Users\_\Desktop\pydis\bot\bot\api.py", line 80, in get
return await self.request("GET", endpoint, raise_for_status=raise_for_status, **kwargs)
File "C:\Users\_\Desktop\pydis\bot\bot\api.py", line 75, in request
await self.maybe_raise_for_status(resp, raise_for_status)
File "C:\Users\_\Desktop\pydis\bot\bot\api.py", line 67, in maybe_raise_for_status
raise ResponseCodeError(response=response, response_json=response_json)
bot.api.ResponseCodeError: Status: 401 Response: {'detail': 'Invalid token.'}
You'll need BOT_API_KEY=badbot13m0n8f570f942013fc818f234916ca531 in your env vars
Worked, tysm 👌
@thorny obsidian I think you were interested in seeing the product with the UI added for challenges: I basically added a link button along with a few dropdown options to switch
ooooh neat
I'm probably gonna do some code cleanup and then I think I'll unmark it from the draft label
good stuff
does it automatically request a review from a code owner?
yes
Ah alright, thank you
suggestion, reverse dropdown menu and button
never going back
Damn going to school will significantly impede my ability to program all day
I started school and I can still program for an hour or two a day
Staying at school is what will allow you to keep programming in your free time. Listen to your teachers 
ik
@static canyon Thanks for the !i l PR, it has been merged.
@vocal wolf no solution yet - we're blocking that on https://github.com/python-discord/kubernetes/issues/96
alrioght
Yeah same it sucks 😢
Did https://pythondiscord.com/ allow web scrapping?
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.
generally, if a site does not have a present robots.txt, web scraping is considered permitted
so we do permit that, yes
in fact
And we actually need to have a robots.txt file