#dev-contrib

1 messages · Page 133 of 1

short snow
#

i tried making a bot setup but it wasn't really possible in a 100% sure way (for future updates also), and only possible solution was hard coding

#

since the key vars and the channel names aren't 100% same, and not all all configured channels are contained in the template

gritty wind
#

Currently inactive, not enough manpower/demand

green oriole
#

lol, wait until it passes

#

okay, you can review now

short snow
#

akarys is there a write up for the smart config solution, like how it would be working?

green oriole
#

Uhh, maybe on the PR itself?

short snow
#

nah the pr description isn't really descriptive

#

probably this, lemme go through it smartconfig#5

dusky shoreBOT
green oriole
#

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

short snow
#

you probably can lol, ferrisPensive okay

#

git rebase upstream/main right? to get the new changes into my branch

clever wraith
#

Time to go RTD diving

#

Holy christ

gritty wind
#

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

green oriole
#

Mh. I guess it doesn't hurt anyone as those lines are already changed. I can do that later on.

vale ibex
#

I missed this on the bot too

#

smh

green oriole
#

Honesty I would have requested the same changes if I saw that haha

vale ibex
#

😂

short snow
#

after 8 git rebase --continue, finally solved the conflicts 😄

#

next pR time

green oriole
#

Thank you sir Chris

#

Sir JL dare I say

vale ibex
#

lol

green oriole
#

Did you download them one by one haha

short snow
#

please upload them somewhere for me

green oriole
#

Hahaha

short snow
#

zip and dms

green oriole
#

You know you could have just asked someone to make a zip with an int e?

short snow
#

nor me until now

green oriole
#

Haha

short snow
#

wait can't you just join the test server now

#

rick

vocal prairie
#

That's only staff iirc

green oriole
#

Yep

#

There are some env vars

vocal prairie
#

Nah, there are just a couple env vars

green oriole
#

But for only a few constants, if you wish to add some feel feee

gritty wind
#

All are documented in the page you linked, but you only need to set the ones in the first table

short snow
#

@thorny obsidian I have mentioned your review on sir-lancebot#618 and resolved the $u$king conflicts 🙂

dusky shoreBOT
green oriole
#

Sus-king, hmm

short snow
#
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="![trashcan](https://cdn.discordapp.com/emojis/814274677723365426.webp?size=128 "trashcan")"

USE_FAKEREDIS=true
#

tldr

#

that has two extra for the 745 pr

#

core dev role and devalerts

gritty wind
#

I don't think you need the quotes on any of these lol

#

It's pinned here

vocal prairie
gritty wind
short snow
#

giving them quotes makes it easier for me to read

gritty wind
#

There it is

vocal prairie
#

It's just a lot of copy pasting ids and adding emojis

gritty wind
#

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

dry folio
#

this is so beautiful

#

precommit is finally working

vocal prairie
#

Are you preparing a test server on mobile? You have my eternal respect.

gritty wind
#

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)

#

When I get back to making them public, or you can become a helper :)

vocal prairie
#

What's the blocker to making forms public? Or has it just not happened

gritty wind
#

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

vocal prairie
#

Ahh. I can see if I can update some of the Notion guides to be more friendly

gritty wind
#

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:

  1. 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.
  2. 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

brazen charm
#

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)

vocal prairie
#

I think they could go on site whenever it's ready, it seems pretty good

gritty wind
#

Don't worry, you are always welcome to ask questions

#

That message was in reference to another project though

dry folio
#

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

vocal prairie
#

Cloning a fork allows you to push your changes without changing your remote

#

But just cloning the main repo would work fine, yes

thorny obsidian
#

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

vocal prairie
#

Yeah. If you're just setting up your own bot instance without making code changes, you don't need to fork

gritty wind
#

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

brazen charm
#

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

gritty wind
#

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

brazen charm
#

speaking of all the configuring, any status on bot#1595 ?

dusky shoreBOT
austere hornet
#

@dry folio Thanks so much for reviewing sir-lancebot#843!

dusky shoreBOT
dry folio
#

actually, you could make that into a sub game mode - say, when one puts .hangman hard, then can use those random words

green oriole
brisk brook
dry folio
#

ban

green oriole
#

That is a big no haha, urban dictionary has way too much nsfw stuff

brazen charm
green oriole
#

Alright, that sounds like fair changes, I think you can go for it

#

If that's something you are interested in contributing

vale ibex
#

Most of the constants don't match one to one in the template

#

For simplicity, we merged a lot of the channels

austere hornet
vale ibex
#

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

trail pilot
#

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

vale ibex
#

Just copy a different channel id

#

Eg for this, just use the admins-mods category for both

austere hornet
#

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!

dusky shoreBOT
vale ibex
#

Can take a look on the weekend most likely

austere hornet
clever wraith
#

Hey @austere hornet , can I talk to you about hangman for a second?

trail pilot
#

online*

#

(I'm Shom770 btw)

clever wraith
#

Ty Fronto

#

Can't at the moment, mobiles a bitch

trail pilot
#

Ah alright

#

You can just DM me then and I'll relay whatever you said to him too

clever wraith
#

Anyways I've got you here

#

So

trail pilot
#

Yeah

#

Or just say it here haha

#

anyways

clever wraith
#

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?

trail pilot
#

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

vocal wolf
#

@thorny obsidian we should probably change the labels now in @dusky shore's repo

thorny obsidian
#

:D I can help with suggestions!!

vocal wolf
#

please do lol

#

should we have different colors for the categories?

brisk brook
#

Wait why does the labels need to change? I see, because they're seasonal

thorny obsidian
#

hold on, need to deal with some rando tagging me and saying I should be domain leads???

vocal wolf
#

wack

clever wraith
fallen patrol
#

Also discord-python/bot works too

#

But seasonalbot never existed on discord-python

vocal wolf
#

@thorny obsidian where hath thou gone

thorny obsidian
#

Hi yes!

#

I am here

vocal wolf
#

yes

#

must obtain new labels

vale ibex
#

Yup

dry folio
austere hornet
#

Hey @clever wraith what's up?

thorny obsidian
#

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

austere hornet
vale ibex
vocal wolf
#

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

thorny obsidian
#

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?

vocal wolf
#

yeah that's true

#

(the second part)

#

we don't use frontend often, no

thorny obsidian
#

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

vocal wolf
#

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 since utilities can mean stuff like wolfram when fun can mean cogs like catify

thorny obsidian
#

I'm fine with that too~

clever wraith
vocal wolf
#

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.

vocal wolf
#

Also, we're not doing hacktoberfest this year, right?

dry folio
vocal wolf
#

might as well yeet that label

thorny obsidian
vocal wolf
#

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

vale ibex
trail pilot
#

at this point the python quiz is just memorization

#

and who can type the fastest

dry folio
#

yeah

thorny obsidian
#

the issue you're talking about is sir-lancebot#815?

trail pilot
#

Yep

thorny obsidian
#

oh yeah go for it. I'll overstep my bounds and say that's fine

vale ibex
#

Approved lol

trail pilot
#

Are we allowed to ask if other issues can be approved since everyone is here or should we just wait

thorny obsidian
#

@vocal wolf this can be closed, right? sir-lancebot#803

dusky shoreBOT
vocal wolf
#

closed

#

how does one describe the fun category

trail pilot
vocal wolf
#

needs to be a short description

trail pilot
#

ah

#

fun games and quizzes

vale ibex
#

PyDis mandated fun, you will enjoy.

vocal wolf
#

I was just going to say Features that are fun

trail pilot
#

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

thorny obsidian
#

Games and other fun features

vocal wolf
#

Features related to fun and games

trail pilot
#

yeah that sounds good

green oriole
#

I'd remove "features"

#

Because it can be bug fixes and all

vale ibex
#

It's for the metabase cog, you can ignore those

#

The same folder as the config and dockerfile

green oriole
#

You have to create it in the root of the project, the folder you are in by default when opening github

trail pilot
#

you have to create an application for the bot yourself, and then get the token from the application you made iirc

vale ibex
#

The one from the discord app portal

vocal wolf
#

what events does sir-lance usually contain

#

AoC, Hacktoberfest, something else

green oriole
#

CC @thorny obsidian

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

vocal wolf
#

alright

#

I'll just have those two for examples for now

brazen charm
#

the api key is what's used to authenticate with the site api, it should be somewhere in the guides

vocal wolf
#

time to update like

#

all the issues and PRs

#

the labels are uploaded

thorny obsidian
#

🎉 Xith best triage lead

fervent sage
#

xith > not xith

brazen charm
green oriole
#

badbot13m0n8f570f942013fc818f234916ca531

#

Xith best triage of the whole org

vocal wolf
fervent sage
#

nor me

vocal wolf
#

oh wait

green oriole
#

Nah, that's the default value

vocal wolf
#

no I get it

#

took me a couple seconds

brazen charm
#

the guide could be clearer there, as you can only get it from there, the compose file or the site

fervent sage
vocal wolf
#

lmao

brazen charm
#

only if you plan on working with the reddit cog

molten perch
#

Btw. May I ask what the consensus on implementing dpy 2.0 features (eg.: views) in either of the bots, in the future?

fervent sage
#

iirc it's to use them if you need to, but existing features wont be updated to use them

#

at least rn

green oriole
#

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?

thorny obsidian
#

I'd be interested in adjusting lancebot features as we work on them to incorporate some d.py v2 features

fervent sage
#

a common base for all bots

thorny obsidian
#

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

vale ibex
#

Yea, we found ourselves copying things from python and lance, like pagination, Int e, help command etc

#

No, buttons and select menus are tho

fervent sage
#

we should just use jishaku for eval kek

vale ibex
#

We do for Arthur lol

vocal wolf
#

time to go through every single issue of sir lance

green oriole
thorny obsidian
#

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

green oriole
#

That sounds like a good idea

molten perch
green oriole
#

You need to have both, with the config overriding the default config

green oriole
vale ibex
#

Don't change config default. Those are the values we use in prod

molten perch
vale ibex
#

Any values in config.yaml will Overwrite the default ones

#

Sounds good

thorny obsidian
#

What OS are you on?

#

So you want to use WSL2 if you can

#

Otherwise, you can enable HyperV

#

Once you have docker up and running, just do docker-compose up

green oriole
thorny obsidian
#

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

vocal wolf
#

Alright I've updated the labels in all PRs and issues in @dusky shore.

fallen patrol
thorny obsidian
#

@cursive relic what is giving you this error?

#

The docker-compose up or starting up docker desktop?

vocal wolf
fallen patrol
#

oh, lol

dry folio
#

lol, moderator discussion is needed on whether or not we're allowing these words for sir-lancebot#843

dusky shoreBOT
vale ibex
#

fixing spelling in force pushes so no one notices 👀

dry folio
trail pilot
#

them

#

@dry folio I just ran a regex replace so all the two letter words are removed

cold island
clever wraith
#

could people look at sir-lancebot#849

dusky shoreBOT
clever wraith
#

i could use the reviews

clever wraith
#

we dont want wholesome sir lancebot saying those things

austere hornet
#

I did not notice that

clever wraith
#

lol

austere hornet
#

Yeah ik

#

@trail pilot Did you remove those words?

#

Oh wait yeah you did sry tl;dr

trail pilot
#

Can anyone review

#

If so I'll gladly review

vocal prairie
#

Code reviews are always helpful

trail pilot
#

Awesome!

clever wraith
static canyon
#

I'm not sure if contributor reviews count or not

brazen charm
#

they do

trail pilot
#

Contributor reviews meaning contributors with the contributor role in Python discord itself or just the contributor label on github?

brazen charm
#

role

trail pilot
#

Ah

static canyon
#

It's definitely still worth reviewing btw

brazen charm
#

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

fallen patrol
#

Contributor reviews count

#

But they won't get the green check in github

#

But they do count towards merge

patent pivot
#

policy-bot ftw

#

policy-bot has now learnt how to do team assignments

fallen patrol
patent pivot
#

lol

#

so

#

not a feature they added

#

a bug i fixed

#

1 sec

fallen patrol
#

Did it get merged to main

#

Or only fixed on pydis

fallen patrol
#

You really do make mistakes with config files.....

patent pivot
#

in my defence

#

policy-bot has an endpoint that lints configs

#

and I run all the configs I write through them

fallen patrol
#

No, you don't have a defense

#

King Arthur has black incompatible isort config still

patent pivot
#

i merged that didn't i

fallen patrol
#

I found anoth

#

Because I decided to finally look at isorts docs

patent pivot
#

first i am hearing of it, lol

#

i mean ultimately, I haven't had a problem with it lol

fallen patrol
#

Yeah

#

what's that Github Server?

dim pelican
#

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)

patent pivot
#

hmmm, might need to update the discord.py dependency, we've bumped it to 2.0.0a

dim pelican
#

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

patent pivot
#

try run docker-compose up --build

brazen charm
#

Is there a reason for lancebot having different levels on its file and console handlers when debug is not on?

patent pivot
#

uhhhhh

#

no

brazen charm
#

I'll set both to info like bot does through the logger then

dim pelican
# patent pivot try run `docker-compose up --build`

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... 🤦‍♂️

patent pivot
#

lmfao

dim pelican
#

But I don't know why I'm getting that error

trail pilot
clever wraith
#

is it fine if i just upload the working code

trail pilot
#

Not sure what this is

clever wraith
#

and u guys can just edit edit edit

patent pivot
dim pelican
#

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)

patent pivot
#

what's the full traceback?

thorny obsidian
#

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

fallen patrol
# trail pilot

hm..... arguably the status embed should not be under the same requirements hmmm

dim pelican
# patent pivot what's the full traceback?
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)```
patent pivot
#

how are you calling color

dim pelican
#
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."""
patent pivot
dim pelican
patent pivot
trail pilot
#

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

brazen charm
#

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

trail pilot
#

Ah

brazen charm
#

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

howdy people. changes requested to sir-lancebot#849 have been made

dusky shoreBOT
trail pilot
#

@clever wraith Could you invite me to your testing server so I can test out some edge cases if you're fine with that

clever wraith
#

sure but the bot is offlint

#

offline

#

Invited

clever wraith
#

hey @patent pivot how long are ducks kept on quackstack?

patent pivot
#

until reboot I think

#

cleared when we deploy quackstack

#

when we go for S3 then permanently

clever wraith
#

couldnt that cause problems if someone spam requests

patent pivot
#

this setup is not production ready

fallen patrol
#

screams

#

two prs on king-arthur#10, king-arthur#11

dusky shoreBOT
patent pivot
#

!remind 18h t

stable mountainBOT
#
Absolutely!

Your reminder will arrive on <t:1631052475:F>!

stable mountainBOT
#

.github/workflows/lint-build-deploy.yaml lines 76 to 79

build:
  if: github.ref == 'refs/heads/main'
  name: Build & Push
  runs-on: ubuntu-latest```
fallen patrol
#

!remind 12h fix the skip of the thing and do the other thing, tldr king-arthur#10 probably need another change

stable mountainBOT
#
No problem.

Your reminder will arrive on <t:1631034286:F>!

dusky shoreBOT
fallen patrol
#

!remind cancel 2999

stable mountainBOT
#
Aye aye, cap'n!

That reminder has been deleted successfully!

fallen patrol
stable mountainBOT
#
Yep.

Your reminder will arrive on <t:1631034454:F>!

dusky shoreBOT
stable mountainBOT
#

.github/workflows/lint-test.yml line 135

- name: Prepare Pull Request Payload artifact```
`.github/workflows/lint_test.yml` line 171
```yml
artifact:```
fallen patrol
#

sheesh, three messages for one command.

green oriole
fallen patrol
#

is botcore public?

#

botcore#1

#

...@cold island?

#

going offline, if someone knows please ping me 😄

brisk brook
#

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.

gritty wind
#

just try docker compose up -d first

#

Feel free to ask

#

Yea, but the compose should handle it for you

gritty wind
#

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

vale ibex
#

I see Mark made some comments while I was sleeping so ill take a look later

gritty wind
#

Alright nice

patent pivot
vale ibex
#

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

brisk brook
#

It's the first button

#

>_

vale ibex
#

try docker-compose up

gritty wind
#

That’s correct for docker

#

Did you try docker-compose up before starting the bot again?

vale ibex
#

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

vocal wolf
#

mmmmmmmm triage time

vale ibex
#

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

vale ibex
#

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

dusky shoreBOT
vale ibex
#

or ctrl+d twice

#

or close the window 😛

gritty wind
#

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 🤞

vale ibex
#

The arrows are default emoji, so you don't need to worry about that

gritty wind
#

The help ones are all builtins

#

Except the trashcan

#

Which is basically all you need

vale ibex
#

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

vocal wolf
#

why is suggestion so hard to spell when suggesting something in reviews

#

but I am

vale ibex
#

To a duck-pond channel

vocal wolf
#

@vale ibex

#

wanna review stuff

vale ibex
#

working :p

vocal wolf
#

darn

vale ibex
#

very fun conference call atm

#

||/s||

vocal wolf
#

I'll just request your review for later

vale ibex
#

👌

vocal wolf
vale ibex
#

site#583 evil

dusky shoreBOT
vale ibex
#

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

vale ibex
#

go into the channel settings, goto the integrations section and then webhooks

#

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 ❌

stable mountainBOT
vale ibex
#

try "\u274c"

short snow
#

@clever wraith your zip file url is asking for password

vale ibex
#

yea

short snow
#

also can you generate template of your test server, so i can get thse emojis lemon_hyperpleased

vale ibex
#

afaik templates don't include emoji

short snow
#

category emojis

vale ibex
#

ahh

short snow
#

if you want to review PRs btw, i have a few of them for you

vale ibex
#

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

stable mountainBOT
#

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.

vale ibex
#

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

vocal wolf
#

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

short snow
#

your choice 🙃

vocal wolf
#

I'm squashing it

short snow
#

okay

vocal wolf
#

github broken

#

lmao

short snow
#

lol, what happened

vocal wolf
#

idk it bugged out, had to reload page

#

kept pressing merge and nothing happened

short snow
#

xith here is your 🍪

vocal wolf
green oriole
#

It break if the status of the PR changes while you are trying to merge

green oriole
vocal wolf
#

ugh the latex cog

short snow
#

and this can be a issue in future

vale ibex
#

Check the first few lines

vocal wolf
#

is it literally because of the latex cog that this is needed

short snow
#

so it was decided to have this feature

green oriole
#

We had to add an early return in the loading code to stop it from loading anymore

vocal wolf
#

and nothing else

vale ibex
#

I imagine you copied some of the other buttons on that page

green oriole
#

That may happen later

vocal wolf
#

god dammit latex

green oriole
#

Like, if an important bug occurs we want to quarantine the cog

vocal wolf
#

y u no not break

short snow
#

quarantine the cog, i like it lol

green oriole
#

Having to unload every time is a pain

vocal wolf
#

@short snow shouldn't we ping devops and not all core devs when a cog is getting borked?

short snow
#

i was said to ping the core devs here

#

by some core dev, lemme get the message

placid ermine
vocal wolf
#

I don't think core devs would enjoy that

#

we rarely ping core devs, if something is exploding, devops should be pinged instead

short snow
vocal wolf
gritty wind
#

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

vale ibex
#

Do we need a ping?

gritty wind
#

Most likely it would be to someone moving a cog, or one getting deleted, etc

vale ibex
#

just throw something in dev-alerts

#

we watch that anyway for sentry

gritty wind
#

You do?

vale ibex
#

yea

vocal wolf
#

we do

gritty wind
#

If you want, you can forego the ping

green oriole
#

Sentry would be fine, yeah

#

If it is really important, could do an at-here in #dev-alerts

gritty wind
#

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

fervent sage
#

lol that was funny

#

annoying but funny

brazen charm
#

The bot has to be able to mute you, don't think there's more to it if everything else is set up

vale ibex
#

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

dusky shoreBOT
vale ibex
#

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

short snow
#

jsut give the bot a super bot role

short snow
#

where is the lancebot logo located on branding repo?

#

nice ty

clever wraith
#

ty for the review xith

brazen charm
#

do you have any in the db?

vale ibex
#

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

dim pelican
#

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

vale ibex
#

if you use docker it should just work

green oriole
#

lol imagine

#

I guess outside of disabling fakeredis you don't have much to do

short snow
#

we can have a contrib server now, int e is owner restricted :yay:

keen valley
#

Can we Use bs4, for getting any info?

dim pelican
keen valley
dim pelican
#

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.

vale ibex
#

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

keen valley
vale ibex
#

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

short snow
#

which issue are you trying to mention? If you are working on the bot

keen valley
thorny obsidian
vale ibex
#

which repo?

placid ermine
#

codewars has an api for katas pithink

thorny obsidian
#

lance

thorny obsidian
vale ibex
#

i'll take a look

placid ermine
#

oh yeah i used bs4 in my project too

thorny obsidian
#

You would need to use scraping or manual compilation to get anything usable

placid ermine
#

sad

vale ibex
#

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?

short snow
#

@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

dim pelican
#

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.

short snow
#

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

thorny obsidian
#

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

dim pelican
#

I've seen !shh in action twice

thorny obsidian
#

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

celest charm
#

so far raiders haven't taken advantage of our server specifics

#

that's weird

dim pelican
#

I mean, are they expected to prepare more than let's make accounts and spam shit?

thorny obsidian
#

We did have that one raider that specifically targeted our help channels. That was mildly annoying

dim pelican
#

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

short snow
#

shom is fast

trail pilot
placid ermine
trail pilot
#

Should I just say Challenges are licensed under FreeBSD 2-Clause License?

placid ermine
trail pilot
#

this is how it is currently formatted

#

i cut off the description fairly early

#

not sure if i should do that

thorny obsidian
#

hmmmm, I wonder how that would look with fields

#

Like a field for Languages and Tags

placid ermine
#

imo the question itself should be most visible

trail pilot
thorny obsidian
#

OOOH! A button for like "View the challenge"

#

🤩 buttons

trail pilot
#

that would be nice! how does a button work with dpy 2.0 again haha

thorny obsidian
#

Anyway, I think this is a super neat feature. I'll see if I can carve out time to review it

trail pilot
#

wdym?

thorny obsidian
#

I do want to review the AoC thing today. Pretty pumped that got completed so quickly

trail pilot
thorny obsidian
trail pilot
#

Ooh, that feature is pretty cool

#

Advent of Code are those challenges in december right?

#

from the first to the 25th of december?

thorny obsidian
#

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

trail pilot
#

These discord buttons are really cool

#

I'm gonna see how I can incorporate them to the challenge command

trail pilot
#

I’m looking back at the code for my qualifier for the code jam and it is atrocious haha

thorny obsidian
#

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

trail pilot
#

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

thorny obsidian
#

It's fine~ You can complete them as you go. I think I only made it to day 8 last year

thorny obsidian
#

awwww yeaaaaah

#

That's the CTA I like to see

trail pilot
#

I'm gonna mess around with the UI and see if I can come up with something that looks really nice

clever wraith
#

We need to start buttoning lancebot commands

trail pilot
#

Agreed

thorny obsidian
#

But I would like to see more info about the kata itself in the description and maybe condense some of the kata meta-info

trail pilot
#

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

austere hornet
austere hornet
trail pilot
#

this is the base, i have to clean some stuff up but yeah

stable mountainBOT
# fallen patrol !remind 12h fix the skip of the thing and do the other thing, tldr king-arthur#1...
It has arrived!

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)

thorny obsidian
#

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

vale ibex
thorny obsidian
#

When you react with incident_unactioned or incident_actioned it'll archive the vote appropriately

solar swift
#

whoa secret server 👀

solar swift
#

thats quite nice

vale ibex
#

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

stable mountainBOT
#
Command Help

!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*
vale ibex
#

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

fallen patrol
stable mountainBOT
#
ROGER THAT

Your reminder will arrive on <t:1631042975:F>!

cold island
#

Hmmm do we have an example somewhere of MaxConcurrencyReached being raised directly?

fallen patrol
fallen patrol
#

Iirc it is used on Lancebot for a few of of the games

fallen patrol
#

And I think is locked to only those w/out the role

vale ibex
#

I don't have the role 😄

austere hornet
fallen patrol
severe tangle
#

@stable mountain down or discord bug?

fallen patrol
#

!ping

stable mountainBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

severe tangle
#

nvm, seems like a discord bug

cold island
#

Probably just a cache thing

severe tangle
#

lmao

severe tangle
austere hornet
vale ibex
#

Alright, the issue with the site db on bot has been merged

#

in about 2 minutes yea 😄

trail pilot
#

It's more like utilities imo

austere hornet
fallen patrol
#

It's technically fun if it's a game

trail pilot
#

it's just grabbing a kata

cold island
fallen patrol
#

Hmm

cold island
#

I think I found something online

fallen patrol
#

This is the decorator I was thinking of

cold island
#

yeah that's it, thanks

stable mountainBOT
#

bot/exts/utilities/latex.py line 75

@commands.max_concurrency(1, commands.BucketType.guild, wait=True)```
fallen patrol
#

Huh

#

That bucket seems wrong actually

cold island
#

Well it says one at a time per server no?

fallen patrol
#

king-arthur#10

dusky shoreBOT
fallen patrol
#

king-arthur#10

fallen patrol
#

first status embed from king arthur btw

vale ibex
#

Nice 😄

austere hornet
#

Hey @vale ibex , when you have a moment, could you please review sir-lancebot#847? I would greatly appreciate it. Thanks so much!

dusky shoreBOT
vale ibex
#

Could you describe what madlibs is, and what you expect the output of the game to be?

#

In the issue

austere hornet
vale ibex
#

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.

austere hornet
austere hornet
#

Hmm, good point...

#

Well if that happens it's not really my problem...that would be something the mods would take care of imo

austere hornet
dim pelican
#

Also Madlibs gets pretty spammy with consecutive inputs

stable mountainBOT
fallen patrol
#

done ^

thorny obsidian
#

Nah, not unless you delete the docker container. You just need to start the bot

vale ibex
#

The issue is fixed now anyway

#

so no need to manually migrate metricity each rebuild

patent pivot
#

@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

patent pivot
#

you've split the workflow into 3 files

fallen patrol
#

reusable actions?

#

link

fallen patrol
#

huh wow

patent pivot
#

but yeah, basically on my domain projects at least we're doing single file workflows

fallen patrol
patent pivot
#

skipped jobs are fine by me, the UI much better displays single file workflows in actions tab

#

and uhhhh

#

so the actions under the PR aren't hugely important

fallen patrol
#

huh, okay

#

in that case

#

gonna do something like this

patent pivot
#

tbf we could also remove status embed

#

lol

viscid coral
patent pivot
#

and turn off the GitHub ones too

#

for KA they're not hugely necessary

fallen patrol
#

even kubernetes has it iirc

patent pivot
#

I know, I'm just not a huge fan of the artefact stages everywhere

patent pivot
fallen patrol
#

it doesn't?

#

(it does)

patent pivot
#

No, it doesn't

#

The status embed does, the actual git traffic goes to our internal dev ops channel lol

fallen patrol
#

changed, gibe thoughts

patent pivot
#

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

fallen patrol
#

only if you want it to only inform about linting, ig

patent pivot
#

separate stage that always runs or something

fallen patrol
#

ohhh

#

you mean the second file

#

so the reason it can't be is documented in the comments

#

eh, it isn't

fallen patrol
#

that means that it won't run with the proper secrets for the countless forks that create a pr.

patent pivot
#

hmm

fallen patrol
cold island
fallen patrol
#

as it only reports on lint test for all other pydis embeds

cold island
#

Thanks 😄

fallen patrol
#

actually I had already looked at it before you linked it here 👀

cold island
#

Do you have alerts for all messages sent in #dev-log ? lol

fallen patrol
#

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

patent pivot
#

I know it doesn't work, yeah

fallen patrol
cold island
#

It's used in one place shrug

brazen charm
#

cpr = "!cd ${GIT_PREFIX:-.} && git fetch upstream refs/pull/${1}/head && git checkout FETCH_HEAD #"

vale ibex
#

!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

fallen patrol
#

lmao

#

@vocal wolf be yoda, you will

vocal wolf
#

?

cold island
#

Hmm how would I use VSC to attach to the bot container and debug it?

#

I'll just try the tutorial

brazen charm
#

feels like running it locally would be the simplest

cold island
#

Hmmm can I run bot localy and site in docker?

tawdry vapor
#

yes I've been doing that for years

#

You can select which services to start with docker-compose

#

docker-compose up -d web

cold island
#

And are there changes I need to do in the config?

#

Almost 5 years

tawdry vapor
#

You just need to change the API url to localhost

#

You can double check the contrib guide, it explains how

clever wraith
brisk brook
#

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

brazen charm
fallen patrol
#

huh

cold island
#

Site is running, checked localhost:8000, but bot can't connect

brazen charm
#

what does the config look like?

cold island
#
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"]
tawdry vapor
#

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

cold island
#

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

tawdry vapor
#

Can you access it in your browseR?

cold island
#

yep

tawdry vapor
#

what's the error when the bot fails to connect

cold island
#
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?
tawdry vapor
#

Maybe you are missing site_api_schema: "http://"? I have it in my config.

#

Not sure if it is actually being used though

stable mountainBOT
cold island
#

I'll add it to config.yaml, but it should be pulling it from config_default

#

same thing

tawdry vapor
cold island
tawdry vapor
#

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

brazen charm
#

Are you on win? I also get a DNSError if I try to use localhost but the domain from the hosts file works

cold island
#

I'm on windows yeah

tawdry vapor
#

Try 127.0.0.1 first

brazen charm
#

that had the same error on my machine

tawdry vapor
#

Works fine for me on Windows 🤷‍♂️

brazen charm
#

no idea then, but worth a try at least

cold island
tawdry vapor
#

Can you connect at all from python e.g. requests.get("http://api.localhost:8000/bot/")

cold island
tawdry vapor
#

I don't know why that happens, sorry

brazen charm
#

I think that is because of the subdomain, but the bot fails before that afaik

brazen charm
cold island
#
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

brazen charm
#

change the localhost to the pythondiscord.local and I think that shouldwork

cold island
brazen charm
#

What's the whole traceback?

cold island
#

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.'}
brazen charm
#

You'll need BOT_API_KEY=badbot13m0n8f570f942013fc818f234916ca531 in your env vars

cold island
#

Worked, tysm 👌

trail pilot
#

@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

thorny obsidian
#

ooooh neat

trail pilot
#

I'm probably gonna do some code cleanup and then I think I'll unmark it from the draft label

trail pilot
#

does it automatically request a review from a code owner?

brazen charm
#

yes

trail pilot
#

Ah alright, thank you

fallen patrol
trail pilot
#

yep, i reversed it a few minutes ago

#

right after the video cause it looked weird

cold island
clever wraith
#

Damn going to school will significantly impede my ability to program all day

trail pilot
cold island
#

Staying at school is what will allow you to keep programming in your free time. Listen to your teachers ok_handbutflipped

clever wraith
#

ik

vocal wolf
#

@static canyon Thanks for the !i l PR, it has been merged.

patent pivot
keen valley
#

Did https://pythondiscord.com/ allow web scrapping?

patent pivot
#

generally, if a site does not have a present robots.txt, web scraping is considered permitted

#

so we do permit that, yes

#

in fact

green oriole
#

And we actually need to have a robots.txt file

patent pivot
#

please hold

#

i hav an idea

#

i retract my idea let's just add one to django