#dev-contrib

1 messages · Page 112 of 1

dry folio
#

i followed all your instructions and opened this pr 3 days ago https://github.com/python-discord/sir-lancebot/pull/726. after some reviews and hours of debugging, we finally got three staff approvals and only need one last core dev to review. would you mind looking at it a little and see if you can review if you have time? thank you in advance Zig!

short snow
#

!remind 11h resolve this merge conflicts lemon_pensive

stable mountainBOT
#
Sure thing!

Your reminder will arrive in 11 hours!

stable mountainBOT
#

@vale ibex

It has arrived!

Here's your reminder: this.
[Jump back to when you created the reminder](#dev-contrib message)

dry folio
#

!remind 2y remember objects, you have an eight-year reminder

stable mountainBOT
#
Affirmative!

Your reminder will arrive in 2 years!

vocal wolf
#

@green oriole ty for .. syntax PR

patent pivot
#

lol, I went through all the reminders last night

#

some are fantastic

vocal wolf
#

did you see mine

vocal prairie
#

I like mine

dry folio
vocal prairie
vocal wolf
vocal prairie
#

You can see yours with !remind list though

patent pivot
vocal wolf
#

heh

#

!remind list

stable mountainBOT
#
Reminders for Xithrius#1318

Reminder #1729: expires in 10 months, 3 days, 3 hours, 11 minutes and 55 seconds (ID: 1729)
make pyday logo

vocal wolf
#

don't remember setting this

thorny obsidian
#

I think we have that now

vale ibex
vocal wolf
#

!remind delete 1729

stable mountainBOT
#
Sure.

That reminder has been deleted successfully!

stable mountainBOT
#
Reminders for Object#9891

Reminder #2098: expires in 1 year, 11 months, 29 days, 23 hours, 56 minutes and 44 seconds (ID: 2098)
remember objects, you have an eight-year reminder

Reminder #1959: expires in 7 years, 11 months, 8 days, 15 minutes and 33 seconds (ID: 1959)
if you see this in 2029 and are still in this server, hello future object

dry folio
#

heh

dry folio
#

i don't know if you used that tho lmao

clever wraith
#

@sleek steppe wow u became a helper

#

congrats

sleek steppe
#

Thanks!

clever wraith
#

!remind list

stable mountainBOT
#
Reminders for Kronifer#5647

Reminder #2096: expires in 1 day, 2 hours, 13 minutes and 54 seconds (ID: 2096)
go remote

Reminder #2105: expires in 3 days, 11 hours, 57 minutes and 14 seconds (ID: 2105)
check for 200k

dry folio
#

!remind 1h check pr

stable mountainBOT
#
ROGER THAT

Your reminder will arrive in 1 hour!

stable mountainBOT
#

@dry folio

It has arrived!

Here's your reminder: check pr.
[Jump back to when you created the reminder](#dev-contrib message)

clever wraith
#

When I use api, and it requires api key

#

can i still contribute

#

ill give u api key

gritty wind
#

Tell us the website, and we'll sign up for one ourselves

#

But first, you should have it be cleared

clever wraith
#

nevermind, i found one without api key

#

i making anagrams

#

so i need to check

#

if a user input is a valid word

#

so that why

#

i try to check

#

unless there easier way

patent pivot
#

hmmmmm

#

you could pull in a word list

clever wraith
#

wdym

patent pivot
#

a text file of words

clever wraith
#

i was given a link to a github with 20k english words

#

but

#

20k

#

too much

#

one line is probably like half a byte but still

#
      if check1:
        try:
          async with aiohttp.ClientSession() as session:
            async with session.get(f'https://api.dictionaryapi.dev/api/v2/entries/en_US/{user.content.lower()}') as response:
              data = await response.json()

          if data[0]["word"]:
            await ctx.send("GOod")```
#

this is the check

dry folio
dry folio
clever wraith
dry folio
#

yeet, verb - to throw something forcefully in a specified direction.
yeet, exclamation - expressing a strong emotional reaction, often for humorous effect

examples:
"i yeeted my dog yesterday"
"YEET!"

fervent sage
#

yeet, verb - to throw something forcefully in a specified direction.

examples:
I yeeted the key out of the dict

sleek steppe
#

examples:
yeet > del

thorny obsidian
#

This dict empty, yeet

fervent sage
#

when i get to know cpython a little better I'll probably stream hideously mutilating it in a fun way

sleek steppe
#

PCBuild for cyeethon still fails for me 😔

clever wraith
#

how do i create a new issue?

#

so

#

i can submit my anagrams

gritty wind
#

Which project?

clever wraith
#

i think i need to make an issue

#

i dunno what’s the different between issue and pull requests

clever wraith
gritty wind
#

An issue is a description of something that should be changed or added. A PR is a request to add that code.

clever wraith
#

oh ok

#

i guesss me open a issue

#

what does it take for a command to be added

#

like what are the procedures

gritty wind
#

First, you open an issue

clever wraith
#

m first time contributing to anything

gritty wind
#

A core dev will approve it at some point, possibly after some discussion. Once an issue is approved, anyone is free to work on it, and make a PR. That PR then gets reviewed, and once it has approval, it's merged to the bot.

clever wraith
#

hm this link glitched

#

i can’t open it

gritty wind
#

does this load

clever wraith
#

okay ty

#

let me try

#

nope

#

i have the github app

#

m go on there

vocal prairie
gritty wind
#

Yes, so

#

That's the plan eventually

#

Previously, the github link did have all the info

#

but then we wanted to standardize it across all repos

#

So we put a link to one page

#

We can't update anything right now though, because we are in a wiki freeze

#

All part of the django site migration

vocal prairie
#

Got it.

#

So it would have to be changed on the markdown pages after dewikification is farther along?

gritty wind
#

That's the plan + the guidelines themselves have had a major rewrite

#

You can tell the current guide isn't exactly high quality when it says "use black"

vocal prairie
#

That's a very long issue title

#

I should shorten that

#

Much better

gritty wind
#

Hmm I take it back

#

those are the new guidelines

#

Well, I'll get that black part removed as soon as I can

#

I think

Do not open a pull request if you aren't assigned to the issue. If someone is already working on it, consider offering to collaborate with that person.

Covers that though

#

It doesn't explicitly state the process

#

but you obviously can't get assigned if no issue exists

vocal prairie
#

My only issue with that was that many people are new to GitHub and open source projects in general. They might not understand unless it's explicit.

clever wraith
#

Did i do the issue correctly?

stable mountainBOT
#

@short snow

It has arrived!

Here's your reminder: resolve ![this](https://cdn.discordapp.com/emojis/470903994118832130.webp?size=128 "this") merge conflicts ![lemon_pensive](https://cdn.discordapp.com/emojis/754441880246419486.webp?size=128 "lemon_pensive").
[Jump back to when you created the reminder](#dev-contrib message)

short snow
#

@gritty wind So for the preserve unloaded extensions issue, for the extensions found in cache but not on the bot, I will send a embed in (i) in which channel, and (ii) Will i add reactions incident_actioned incident_unactioned for clearing those items from the cache and wait for (iii) x amount of time.

Also whom should the message ping?

#

admins?

gritty wind
#

Send it to #dev-alerts, ping core devs, and don’t add any special reaction logic, just immediately remove it from the cache

short snow
#

cool

short snow
#

@gritty wind dev alerts channel id?

gritty wind
#

820712029245538314

short snow
#

k ty

short snow
#

How can i test this feature? On every run, the cache gets reset for me

gritty wind
#

Are you using fake redis?

eager fable
#

What's fake redis?

gritty wind
#

An implementation of redis purely in python

#

It’s a pypi package

short snow
#

yeah i am using fake redis

gritty wind
#

I guess you could insert the values during program startup before you get to the step that checks

#

It would probably be easier to use redis

twilit juniper
#

are we gonna allow users to use helpdm on/off in a help channel and just delete the command message or no? I am assuming no but just want to make sure.

gritty wind
#

Why not make this a global opt in?

#

I haven’t followed discussions

gritty wind
twilit juniper
#

Yeah, that's what I am doing.

#

But should we allow users to be able to use that command in help channels.

#

If that makes sense

brazen charm
#

Don't think that's necessary

twilit juniper
#

Ok, that's what I am thinking as well

#

This is what the embed that will be sent to the users dm looks like as of now.

#

Basically the same as the claim but without the first message field.

short snow
#

I went through my pr again sir-lancebot#618 , and didn't find the need to break the code into many files, and rather break it done into two classes, Game, and the cog itself, where, Game contains the logic for the game, and the cog contains the discord stuff

dusky shoreBOT
cold island
#

For that cleanup PR it might be best to make it several PR's. Get the changes for some of the cogs merged, and then move on

#

Otherwise you're going to have to resolve conflicts for every single PR that's merged in the meanwhile

short snow
#

or maybe do a freeze and let the spring cleanup PR get merged?

cold island
#

I'd rather split the clean into parts. Even if we do a freeze we won't have to freeze everything

short snow
#

Splitting it into PRs is gonna take some effort, and the PR is currently in the final stages, with most of the cleanups mentioned

cold island
#

Why is it going to take effort?

#

Also keep in mind that just because you wrote most of the changes you wanted, it doesn't mean it's going to be merged in the next couple of weeks. It still needs to be properly reviewed and tested

patent pivot
#

splitting it shouldn't be too crazy

#

could cherry pick most stuff

cold island
#

My suggestion is that you stop working on additional cogs and PR what you're done with

#

The feedback you get might change how you address the cogs you you're not done with yet

short snow
dry folio
#

@green oriole your change requests have been applied :D

short snow
#

I left few comments on my review comments, did you have a look at them

dry folio
lapis marlin
#

installation of env for the bot is messed up on linux.

#
  File "/usr/lib/python3.9/site-packages/pipenv/project.py", line 24, in <module>
    from .environment import Environment
  File "/usr/lib/python3.9/site-packages/pipenv/environment.py", line 16, in <module>
    import pkg_resources
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 559, in _build_master
    ws = cls()
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 552, in __init__
    self.add_entry(entry)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 608, in add_entry
    for dist in find_distributions(entry, True):
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2063, in find_on_path
    for dist in factory(fullpath):
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2121, in distributions_from_metadata
    if len(os.listdir(path)) == 0:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.9/site-packages/i3ipc-2.2.1.dist-info'
vale ibex
#

The bot uses python 3.8, but it seems you're using 3.9

#

What command did you run to get this error?

#

fwiw, many of us also develop on linux, so I don't think there's an issue with the env installation being messed up on linux.

short snow
#

weird, never came across this, i also develop on linux

lapis marlin
#

using archlinux

#

installed pipenv systemwide

dry folio
short snow
short snow
#

but the issue you are having seems to be something else

dry folio
#

i just realized- 163 messages... insane

fervent sage
#

lol

dry folio
#

i just need to wait for aka rys now

lapis marlin
lapis marlin
dry folio
lapis marlin
#

yes

#

however in C

#

you do have a limited space for alocation

dry folio
#

ah yes

lapis marlin
#

and in any point in computer science

dry folio
#

so there's an upper limit

lapis marlin
#

even in python specific classes for nums

dry folio
#

well in python we have float("inf") to represent infinity, and it's like a special value in the float class

lapis marlin
#

btw yes there is much more interesting thing in python. Called bitarray 🙂

balmy pulsar
#

what's the problem

#

i m new in this

lapis marlin
#

for example if you are doing a sieve for prime nums or something similar you want to not use full byte for storing only two possible bits as it would be a for example array of 10000000 nums so instead of using 10000000bytes you use that many bits. 🙂

#

8 times more space efficient. 🙂

dry folio
#

w o w

lapis marlin
#

its different thing but nice to know about.

balmy pulsar
vale ibex
#

Which of our projects is this for?

balmy pulsar
#

resume porfolio

vale ibex
#

This channel is for discussing Python Discord projects. If you need help with your own projects, please take a read of #❓|how-to-get-help

sleek steppe
#

bump

short snow
# sleek steppe bump

Porting the help command from bot fixes this issue. There is a pr already open for that

sleek steppe
#

Which one?

short snow
fervent sage
#

there's a pr that ports command suggestions but not help

sleek steppe
#

sir-lancebot#470 is the issue

dusky shoreBOT
short snow
#

Ah yes, I thought there was a Pr for that too

fallen patrol
#

What migration is occuring?

vocal wolf
#

We moved the reddit cog from @stable mountain to @dusky shore a few days ago

fallen patrol
#

Oh

patent pivot
#

yep

fallen patrol
#

Cool so Lance has manage message perms there, nice

vale ibex
#

Shortly after migration it was given them yes 😄

#

since we realised it didn't when it spewed errors lol

patent pivot
#

hahahahahha ya i saw that

fervent sage
#

oooh poetry 👀

gritty wind
#

I'll fix CI, and soon we will finally be ready

dry folio
#

i just realized my pr also broke the commits record- almost 50 commits

patent pivot
#

lol

#

commit record is for sure higher

tawdry vapor
#

I think the record is over 4x that

vale ibex
#

Yea docs pr was >250

#

Broke policy bot

patent pivot
#

ohhh that's right lol

tawdry vapor
#

Not that it's a record you should be trying to break

patent pivot
#

yeah

dry folio
dry folio
fallen patrol
#

@dry folio did you work on that pr with cat group & what ide do u use

dry folio
fallen patrol
#

Ah & ah

dry folio
#

.quiz math

#

ah sad

dry folio
fallen patrol
#

Have my own bot so I can checkout the pr myself

fallen patrol
#

Also busy working on @slow bone

short snow
#

is there a way I can test raw_message_edit?

gritty wind
#

Wdym? just edit a message while your bot is online

#

the event should fire

clever wraith
#

i have question

#

about the python bot should i ask here

gritty wind
#

yeah

clever wraith
#

ok so

#

u guys have temp mute and tempban right

#

how do u guys unmute and unban after times up without using json

gritty wind
#

Well, we still use a database

#

JSON files are not the only form of data storage

#

We have a postgres DB

clever wraith
#

so how do u guys know when to unmute and unban

gritty wind
#

The unmute time is stored in the database

#

When the bot starts up, it fetches them all

#

The bot then uses a "scheduler" to unmute or unban once the expiration time is reached

stable mountainBOT
#

bot/exts/moderation/infraction/_scheduler.py lines 43 to 55

async def reschedule_infractions(self, supported_infractions: t.Container[str]) -> None:
    """Schedule expiration for previous infractions."""
    await self.bot.wait_until_guild_available()

    log.trace(f"Rescheduling infractions for {self.__class__.__name__}.")

    infractions = await self.bot.api_client.get(
        'bot/infractions',
        params={'active': 'true'}
    )
    for infraction in infractions:
        if infraction["expires_at"] is not None and infraction["type"] in supported_infractions:
            self.schedule_expiration(infraction)```
gritty wind
#

This code is run on startup

clever wraith
#

oh

short snow
#

Whats the alternative for this? So that I can call await on it?

gritty wind
#

AsyncMock

#

where are you defining channel?

#

(from channel.fetch...)

fallen patrol
stable mountainBOT
#

bot/exts/moderation/incidents.py lines 522 to 527

try:
    channel = self.bot.get_channel(int(payload.data["channel_id"]))
    msg_after = await channel.fetch_message(payload.message_id)
except discord.NotFound:  # Was deleted before we got the event
    await self.delete_msg_link_embed(payload.message_id)
    return```
gritty wind
#

right, so the next question is where are you defining bot

short snow
#

the bot.Bot

#

in the cog

gritty wind
#

No, where are you defining it in your tests

short snow
#

self.cog_instance = incidents.Incidents(MockBot())

gritty wind
#

Right, so

#

you basically want to define the get_channel method of mockbot to return a MockTextChannel

short snow
#

ah got it

#

ty

gritty wind
#

And you want to define that MockTextChannel to have an AsyncMock called fetch

short snow
#

yep

fallen patrol
#

Is writing tests basically just reimplementing the library itself?

gritty wind
#

(unit)Tests basically check that a unit of code performs the expected function

fallen patrol
#

So how do you test the tests?

gritty wind
#

If you have the following function:

def xyz(number):
  return number + 2

You can throw at it different inputs, and check that the return is the expected value. A good testing suite would throw all different sorts of inputs to make sure the function behaves as intended. You could for example test this function with a positive number, a negative number, a decimal, a really big number, a really small number, not a number, etc.

There are no hard rules for unit tests, and you test what you think is important. Unit tests just help confirm that a unit of code performs the expected behavior

short snow
#

so this is what i did, but i get this error:

AttributeError: 'coroutine' object has no attribute 'fetch_message'
gritty wind
#

get_channel isn't async

short snow
#

fuck yes 🤦‍♂️

short snow
short snow
dry folio
#

we passed 50 commits lol

#

hopefully get this done before 100-

short snow
#

@dry folio I had left a comment on the default 0 issue

dry folio
#

You can say "oh, that embed's in blue, i want it in orange" and request changes.

#

It is inherently the same thing as to what you're doing right now.

#

We can debate about this for years, if you'd really like; but I prefer not wasting my time on a problem of purely subjective opinions.

fervent sage
#

which issue is this? can someone link me the pr comment

short snow
#

There are three more ppl agreeing with this.. Thankyou

#

one sec alec

dry folio
#

you gotta be kidding me- this keeps on going

#

it is literally pointless

#

a matter of opinion, like i've already said

#

you don't like it, i like it

fervent sage
#

Ok i dont have time right now to dive deep into the code, if there's something that can break that needs to be fixed, unexpected errors shouldn't be able to exist

dry folio
fervent sage
#

Ok I'm going to clarify on

I disagree, if it were half way through execution or something that might make sense, but given its an initial argument it should just error

There are two sides to this:

  1. If the user is running the command they clearly want to play the quiz, so 0 should go to a default
  2. There is no reason that the user should be explicitly entering the value 0 for the amount of questions, it just doesn't make sense to do so.

In my opinion - and this is generally agreed upon in software - things shouldn't do 'weird' things that you wouldn't expect. A function should be conservative in what it accepts, and shouldn't (generally) try to compensate for 'weird' inputs, which can lead to said 'weird' behaviour. In addition to this existing Lancebot commands already error if 0 is entered and they expect a positive integer, for example .mosaic, so for the sake of consistency it's better to follow that pattern.

tl;dr: The command should behave in a consistent and predictable way, which is not something the current system does where you can enter 0 and it goes to the default. Instead I propose you check whether questions is None, if so you set a default, else check if it's a valid positive integer, if so then set that, else raise an error explaining that you should leave it blank or use a valid number

dry folio
trim cradle
#

I have a bot instance running on the test server and I don't know which process it is or why it's still running 😦

short snow
#

Spam the bot, and keep htop open. The process you see rising would be the bot lol.

Docker or pipenv?

green oriole
#

and Docker or not docker

sleek steppe
#

!int e exit()

dry folio
#

one last core dev approval c'mon...

#

let's see if it's possible for the pr to be approved and merged before it reaches 200 messages

dry folio
# green oriole and Docker or not docker

hey akarys, yesterday you requested some changes on sir-lancebot#726 and i immediately applied them, along with some other refining. would you mind taking a look if you are currently available? thank you very much! :D

fervent sage
#

while you've been pinged could you take a quick peek at this tag suggestion :P bot#1585

dusky shoreBOT
vocal prairie
#

That tag seems like a nice idea

short snow
#

Should there be a spring cleanup on python bot too?

fervent sage
#

python bot spring clean up be like:

  • add tests
  • add tests
  • add tests
  • add tests
  • add tests
short snow
#

Huh? Does adding tests come up in cleanup pithink

fervent sage
#

thats a really big gif, you should probably make it into an emoji so that it doesnt take up as much room

short snow
#

No nitro ig lol

patent pivot
#

I would probably not go down the route of another cleanup PR

#

from a review POV

#

do a single change per PR, and do many PRs

dry folio
patent pivot
#

Streamlines things a lot

short snow
#

Lol, maybe if we take zig’s suggestion into picture?

fervent sage
#

yeah, when it gets to the point where im glad i cant review because i committed its probably too big

short snow
#

Yeah single change per pr

fervent sage
#

poor anand

balmy sparrow
#

😔

short snow
#

Lol, black helped me do most of the review

balmy sparrow
#

yeah small PRs should be much better

dry folio
green oriole
sleek steppe
short snow
#

in 14 hours lemon_pensive

balmy sparrow
#

I'll uh... Try tomorrow

sleek steppe
#

Should sir-lancebot#348 be closed?

dusky shoreBOT
vale ibex
#

have the issues been resolved?

#

or should I transfer the issue to lance?

#

oh, it's already in lance, nvm

#

Have all the issues listed been resolved?

sleek steppe
#

Yep

trim cradle
green oriole
#

Can you run docker ps?

trim cradle
green oriole
#

docker kill $id

#

Although you may just have forget to docker-compose downbefore shutting down

trim cradle
#

makes sense

#

could be. it appears to have worked though

#

thanks!

green oriole
#

Anytime!

granite plaza
#

Hi I just finished my first PR on another repository. (just updating a text file)
There is something that i would like to contribute to @dusky shore. Do i make an issue on github and ask that it is assigned to me?

vocal prairie
#

If you wish to contribute to an existing idea, you can check out the issues on the Lancebot repository that haven't been assigned. If you have an idea for a new command that you'd like to implement, you can open an issue on the repository or discuss it here.

granite plaza
#

Its and upgrade to a command is that ok?

sleek steppe
#

Yep that's fine

vocal prairie
#

You can discuss that here or open an issue on the repository.

granite plaza
#

:) i will go create an issue now. ||that sentence sounds weird when you say it XD||

dry folio
#

!remind 999y yeet

stable mountainBOT
#
Aye aye, cap'n!

Your reminder will arrive in 999 years!

dry folio
#

LMFAO YESSSSS

clever wraith
#

!remind 1000y hmm

stable mountainBOT
#
Alright.

Your reminder will arrive in 1000 years!

clever wraith
#

heh

vale ibex
#

One of my first bot PRs was fixing an overflow for that command

vocal wolf
#

just wondering, nothing serious

fervent sage
#

im pretty sure i started using a gpg key after that point

vocal wolf
fervent sage
#

before then i just never used one

vocal wolf
#

I see

#

Understandable, have a nice day.

vale ibex
#

Am here but on phone lul

vocal wolf
#

oof

vale ibex
#

Lemme try and landscape review

vocal wolf
#

@vale ibex nevermind, we're good

#

thank you, @sleek steppe and @balmy sparrow

balmy sparrow
#

lmao i was a second late

#

i spent 3 seconds deciding on what emoji to put in the review comment

sleek steppe
#

lol, did you test though 👀

balmy sparrow
#

😔

fervent sage
#

my code is so good it doesnt need testing smh /s

sleek steppe
#

I always use shipit

vocal wolf
sleek steppe
#

yes it's the best way to test

granite plaza
#

I sent my issue now i just wait until it gets assigned to me/approved?

vocal wolf
#

yes

granite plaza
#

👍

vocal wolf
#

interesting idea

#

I'm not sure what to think about it though

#

brain is fried atm

granite plaza
vocal wolf
#

I woke up and immediately had a final, I've been awake for 2 hours lol

#

no food tho

granite plaza
#

got to have the food!

sleek steppe
#

Xith is always tired Sadge

vocal wolf
#

I'm ordering the food now!

vocal wolf
sleek steppe
#

lmao

vocal wolf
#

@valid condor I'd rather you not

#

Channel descriptions apply to all.

balmy sparrow
#

that gif was fucking up my client

vocal wolf
#

User removed

balmy sparrow
#

is this part of being a bot

vocal wolf
#

lol

granite plaza
vale ibex
#

Aren't there already images returned for 404s?

#

Ones that are designed by the websites

#

oh wait, i misread

#

So this would be calling the group directly and then randomly choosing which subcommand to run

granite plaza
#

yes.

vale ibex
#

Cool

#

approved

granite plaza
#

I dont currently have a linter. What is recommended?

#

For pycharm if that matters

#

or is there one already on pycharm?

vale ibex
#

the pre-commit uses flake8

gritty wind
#

So, you're definitely going to want to follow your IDE's recommendations

#

but we also have a flake8 config which you should use

#

(You should use the project one because it has a ton of plugins)

#

On top of that

#

we have a style guide

gritty wind
#

flake8 can't enforce everything, so it's good to go over that too

vale ibex
#

I'm pretty sure if you do pipenv sync --dev pycharm will pick up the linter

granite plaza
#

thank you :)

fervent sage
stable mountainBOT
#

bot/exts/evergreen/timed.py line 38

await new_ctx.command.invoke(new_ctx)```
fervent sage
#

that actually probably makes more sense if you look at the whole file than just the snippet lol

granite plaza
#

ok noted.

sleek steppe
#

Yeah, because ctx.invoke runs checks

fervent sage
#

^

vocal wolf
gritty wind
#

Heya, welcome to the server

#

This channel is meant for discussion about our projects at python discord

#

If you'd like to introduce yourself, and meet the people here

#

pop over to

#

!ot

stable mountainBOT
gritty wind
#

The first one seems quite at the moment

vocal prairie
#

Uh, I had an instance of Lancebot running on Docker a couple days ago, and when I restarted my computer, that Lancebot just turned on again and now I can see it in Docker Desktop. Is that something I can avoid?

tough imp
#

Running with Compose? looks like it sets an always restart policy

stable mountainBOT
#

docker-compose.yml line 10

restart: always```
vocal prairie
#

Yeah, I ran with compose

tough imp
#

that's probably causing the container to restart on system reboot

granite plaza
#

Is it ok if var names have "typo in word" notices. Im getting one with subcmd

gritty wind
#

Yeah

#

Your IDE is probably looking for english words

#

not all programming terms will meet that criteria

#

So as long as it's not an actual typo, you're fine

clever wraith
#

hi

#

m almost done with the anagrams cmd

#

that m wann aad

clever wraith
#

This is the anagrams command

#

is it worthy of being submitted to sir lancebot?

#

the reactions where supposed to be a green check mark

dry folio
dry folio
clever wraith
#

tyyy

dry folio
#

hey, does anyone know what the type: enhancement means? because for me it kinda means the same thing as type: feature lol

clever wraith
#

enhancement is like good

dry folio
vocal prairie
#

Usually enhancement is an improvement to an existing thing while feature adds a new thing

granite plaza
#
sir-lancebot\bot\exts\evergreen\status_codes.py:74:0: C0301: Line too long (103/100) (line-too-long)
sir-lancebot\bot\exts\evergreen\status_codes.py:1:0: C0114: Missing module docstring (missing-module-docstring)

Got this while linting
Should i fix the first one even if it wasent me who made it? also im not sure what the second one means

gritty wind
#

The line length for lancebot is 120, not 100 as that error suggests

#

It seems you are not running flake8 correctly

#

which folder are you running it from?

granite plaza
#

the sir_lancebot folder

#

wait that is my project folder

gritty wind
#

You should be running from the folder that has the file tox.ini

granite plaza
#

ok 👍

#

OK so flake8 did not output anything. Dose that mean i passed or i did something wrong?

gritty wind
#

no output should be good

#

You could also run the rest of the checks

granite plaza
#

ok. ||THere should be a all tests passed message||

gritty wind
#

we have other checks such as line endings, and trailing whitespace

gritty wind
#

pre-commit does give you that message

#

and it runs flake as well as the other tests

#

pipenv run lint

fervent sage
#

hey @short snow i just found something amazing for merging 2 dicts in quackstack so I'm gonna go make it so all options are optional: https://pypi.org/project/deepmerge

fervent sage
#

@sleek steppe you around in 10 mins to approve another mmLol

sleek steppe
#

lol yes

fervent sage
#

im gonna stick the redoc generated stuff on /docs instead of the swagger docs since they're far more useful at a glance and switch normal docs to /swagger_docs

#

joe that was speed lmao

patent pivot
#

PR speedrun

fervent sage
#

next up, making the details endpoint deal with manducks too

sleek steppe
#

Whaat... I look away one second and it's merged

patent pivot
#

LOL IT DOES"T WORK

fervent sage
#

wat

patent pivot
fervent sage
#

it works perfectly localy?

patent pivot
#

this is why we don't PR speedrunn

fervent sage
#

pain

patent pivot
#

lol

sleek steppe
#

Service unavailable Sadge

patent pivot
#

oe sec

fervent sage
#

will open a fix pr

vocal prairie
#

What doesn't work?

#

Oh

sleek steppe
#

two fixes?

patent pivot
#

nah I've got it

fervent sage
patent pivot
#

lol

fervent sage
#

i WaS fiRsT

patent pivot
#

LOL

fervent sage
#

ok riddle me this

patent pivot
#

this squirrel mofo is really indecisive about showing up

fervent sage
#

everywhere in code its called manduck

#

except the assets folder which is called duck-person

patent pivot
#

lol

sleek steppe
fervent sage
#

in fact the manduck file structure in general seems odd lol

#

spot the inconsistency mmLol

vocal prairie
#

Eyy

patent pivot
vocal prairie
#

The PR worked

fervent sage
#

redoc is so beautiful compared to swagger imo

vocal prairie
#

Redoc gives more info too

#

At least at first glance

patent pivot
#

once I finish with school I'm going to add S3 + app structure changes to quackstack I think

fervent sage
#

i have structure changes planned alr

#

but yeah we need to stop serving static files from the api

#

or

patent pivot
#

my main structure thing was no main.py in the root lol

fervent sage
#

given pydis infra runs on linode we could use their s3 compatible object buckets

patent pivot
#

ya, that's what I was thinking

fervent sage
sleek steppe
#

I was going to test #42 too but it got merged after 2 seconds lol

fervent sage
#

atjoe

patent pivot
#

all code should generally go in a folder

#

called quackstack ideally

fervent sage
#

issue with that is that its then annoying to stick package stuff in there too, cause eventually the plan was to make a pypi module

patent pivot
#

hmm

#

shouldn't be too triccky

fervent sage
#

its not that its tricky

#

it's just kinda messy

patent pivot
fervent sage
#

I wish i put another hour of thought in before initially starting, the code currently does not spark joy and i feel like i wanna rewrite it before its too late

#

fix all the structure at the same time

sleek steppe
#

Is bot#1565 approved? If so, can I implement it?

dusky shoreBOT
patent pivot
#

hmmmm

#

it crashed

#

oh no maybe nont

#

I think it was just a breaker resetting

patent pivot
#

assigned

fervent sage
#

is there any other outstanding stuff that needs a willing human currently?

sleek steppe
#

Yes

fervent sage
gritty wind
#

Oh hey a few d.py people here

#

What's the best way to invoke a command from code so that it runs checks and converters?

fervent sage
#

ctx.command.invoke

gritty wind
#

That doesn't do checks and converters

fervent sage
#

it does

#

check

gritty wind
#

ctx.invoke doesn't lol

fervent sage
#

.src timed

dusky shoreBOT
#
Command: timed

Time the command execution of a command.

Source Code
gritty wind
#

you changed your message >.>

#

anyways

fervent sage
gritty wind
#

the reason I can't do that is because

#

the command is not actually the command

fervent sage
#

oh?

gritty wind
#

you type in a message, and the bot calls the command for you

#

it's in the error handler

#

!shh

fervent sage
#

ah

gritty wind
#

that calls the silence commmand

#

bot.invoke runs checks, but it doesn't allow you to manually define the arguments

#

which I need in this case

fervent sage
#

in that case you probably want to copy the message object, set the content to the command that should be invoked, and then run bot.process_commands(message)

gritty wind
#

the next best solution I found was to

#

yeah that

#

felt a bit hacky

fervent sage
#

i think that rather comes with the territory of doing hacky commands kek

gritty wind
#

lol

fervent sage
#

but yeah, as far as im aware of there isnt a better way really, and I have a decent knowledge of d.py :P, but there may be something ive just forgotten about

gritty wind
#

!silence

stable mountainBOT
#

✅ silenced current channel for 10 minute(s).

#

✅ unsilenced current channel.

granite plaza
#

Hey im trying to run the bot and am getting this error socket.gaierror: [Errno 11001] getaddrinfo failed
looks like something to do with a SMPT server

fervent sage
granite plaza
#

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

gritty wind
#

Do you have redis running?

fervent sage
#

ah it looks like the redis connection is failing to be created, you should consider using fakeredis instead for testing

gritty wind
#

If you’re not sure the answer is no

vale ibex
#

I'd highly recommend the docker setup, will make things much easier

gritty wind
#

I should port the startup error handler

fervent sage
#

chrisjlmnop lol

gritty wind
#

Are there any deps beside redis

granite plaza
#

I am using fake redis i think?

gritty wind
#

Could you share your .env?

#

Make sure to remove any sensitive data

fervent sage
#

do you have USE_FAKEREDIS=true in .env?

granite plaza
#
BOT_GUILD=678359965081141286
BOT_ADMIN_ROLE_ID=678366948995760128
ROLE_HELPERS=763874843787001878
CHANNEL_ANNOUNCEMENTS=821404230601408522
CHANNEL_DEVLOG=821404230601408522
CHANNEL_COMMUNITY_BOT_COMMANDS=678359965081141291
USE_FAKEREDIS=true
gritty wind
#

Hmm

#

Interesting

vale ibex
#

is REDIS_HOST=redis needed for fake redis?

gritty wind
#

I wonder if the env is loaded

gritty wind
fervent sage
#

wait how are you running it

#

pipenv or just plain python?

granite plaza
vale ibex
#

yea, you should run using pipenv, since it'll load your env

fervent sage
#

because pipenv loads env for you, as does docker compose

vale ibex
#

pipenv run start

granite plaza
#

If it says venv in front of the path in the trerminal that means its pipenv right?

gritty wind
#

Pipenv is an explicit command

#

‘Pipenv run start’

granite plaza
gritty wind
#

That should run the bot using pipenv

#

Hm

vale ibex
#

Could you upload the full output from when you run that command?

granite plaza
#

Would it matter what folder i am in when running the command. (probably :/)

vale ibex
#

yea, it should be in the project root

#

IE the same folder as the readme

fervent sage
#

looks like youre in a non-pipenv virtual environment, which means pipenv isnt doing things it would it its own env

vale ibex
#

I get that same error notice on windows if I run start after pipenv shell lol

fervent sage
#

among the software i install when i set up a new pc is redis so i dont have redis issues anyway LUL

#

though in that regard im very much an atypical user

granite plaza
#

My interpreter is PYthon 3.8 not pipenv. When i try to make it pipenv it wont save for some reason

vale ibex
#

exit out of your venv

#

run python -m pipenv shell

#

that'll get you into a pipenv shell

granite plaza
vale ibex
#

deactivate

granite plaza
#

Im using pycharm. I think it automatically makes one and i dont know how to deactivate it.

vale ibex
#

Ah, right. i'm not to familiar with pycharm's env setup

#

Hopefully someone who is can help you out soon

placid ermine
fallen patrol
#

where is the error handler for @stable mountain?!

short snow
granite plaza
#

wait i think i deactivate it

sleek steppe
stable mountainBOT
#
Cog: ErrorHandler

Handles errors emitted from commands.

Source Code
fallen patrol
#

backend.

granite plaza
#

but now i dont have pipenv installed XD

short snow
dry folio
#

i feel ashamed-
flashbacks to "fix 4th copy paste error"

fallen patrol
#

@dry folio you can make commits via git

#

rather than making every commit on the website

#

it also means that you can edit multiple files per commit

patent pivot
#

we should probably have a policy of squashing PRs with listing commits

fallen patrol
#

wdym

patent pivot
#

drop the ping thing, getting really annoying now.

#

squashing is where you take several commits on a PR, merge them into one and then merge that into the main branch

fervent sage
#

ping thing?

fallen patrol
#

and what's listing commits?

patent pivot
#

oh

#

linting commits

fallen patrol
#

oh

#

lol

dry folio
patent pivot
#

uhhhh

dry folio
patent pivot
#

oh lol thought the changes were the opposite

dry folio
patent pivot
#

I mean, if it gets approvals? lol

dry folio
patent pivot
#

it's got enough approvals now, just waiting for linting

dry folio
#

LESSSSGO

patent pivot
#

hmmm

#

I'm having thoughts

dry folio
#

lint so slowwwww

patent pivot
#

I'm not sure following convention here is appropriate

patent pivot
#

we treat cogs like components of the bot, and I think it's clearer to say that the ErrorHandler, which there will always one of, handles errors

fervent sage
#

I've approved but I'd like to note that I don't think in future this type of small non-important change is really worth doing, plus what joe said

patent pivot
#

Yeah I think we can leave this

dry folio
clever wraith
#

Wait did we get shut down

dry folio
fervent sage
thorny obsidian
#

Why are we placing such emphasis on speedrunning PRs?

fervent sage
#

yeah I really really dont think we should set a precendent of speedrunning code into production

green oriole
#

If it was a really major and urgent P0 feature, sure

fervent sage
#

here it's just 1 character and clearly wont break anything, but what happens when its a few lines and some people say "oh its just a couple of lines its fine i'll approve"

green oriole
#

Otherwise it doesn't seem very wise

short snow
#

didn't want to aim to a user, so deleted it

dry folio
patent pivot
#

I also think for changing things we should really do it in bulk rather than a one line PR to change something that we probably have multiple inconsistencies on

fallen patrol
patent pivot
#

and I'd much rather focus efforts on actual issues and logic things than some single character documentation changes

fervent sage
#

On your own bot i dare say it's not that bad - but @stable mountain is part of pydis' core server infra

dry folio
dry folio
clever wraith
fallen patrol
dry folio
fervent sage
#

I mean, not to be rude but thats exactly what im saying lol

short snow
#

sir-lancebot#732 gosh, i like this but is this going to be "allowed", every variable has type annotations

dusky shoreBOT
green oriole
#

Did you removed the question without an answer?

dry folio
fallen patrol
# short snow sir-lancebot#732 gosh, i like this but is this going to be "allowed", every vari...
GitHub

Relevant Issues

Closes #628
Description

Added Music cog with the command .music. Fetch data from Last.fm via the Last.fm API. Access the API through a custom asynchronous API interface based on ...

short snow
#

huh?

patent pivot
#

that seems normal

fallen patrol
short snow
#

they just structured it alphabetically

fallen patrol
#

oh, GG

clever wraith
#

I like that actually it's quite clean

sleek steppe
short snow
#

main point was those type annotations on every variable, gets more than half of the imports

clever wraith
#

Kudos to them

patent pivot
#

they did make changes there, see the last fm creds

patent pivot
fervent sage
# dry folio ohhhh ok

It is covered in the contributing guidelines, and is something that you should have read before creating a pr

fallen patrol
fallen patrol
dry folio
patent pivot
#

a one char fix wouldn't need to go through an issue, but it's only worth fixing if it's part of a wider inconsistency

clever wraith
#

Hey while y'all are here good job on killing the raid

dry folio
clever wraith
#

Unfortunately it looks like my data projection for 200k by Saturday will be off

trim cradle
#
88e990dc82c8        sir-lancebot_sir-lancebot   "python -m bot"     2 months ago        Up 54 seconds                           sir-lancebot

why is my instance of lancebot going up when I run docker-compose up in the python bot directory...?

dry folio
#

megapoggers

clever wraith
#

Huh

green oriole
fervent sage
#

726 is gonna be squash merged right?

trim cradle
green oriole
#

Well, it may have been running this whole time pithink

trim cradle
#

well fuck

#

anyway how do I destroy it?

trim cradle
#

i hate it i hate it i hate it

fervent sage
#

though hmm

green oriole
#

Try to run docker-compose down in sir lance and systemctl restart docker to see if it worked

fallen patrol
#

is extra imports for type annotations a bad thing?

sleek steppe
short snow
#

yeah that's my question

#

and they amount to half of the imports

balmy sparrow
#

i don't mind them as such

#

dunno if it's worth the effort to make another commit just removing type hints

sleek steppe
#

I don't see the need for limit_key: str = "limit"

short snow
#

and adding them to client sesions, when the variable name say so

gritty wind
#

Actually flake will complain about that

#

Call it useless typehimt when str is inferred

fervent sage
#

typehints should only be there where the type is not already known, normally I'd say the extras were a pretty minor thing, but there are a huge number here and i think some should be removed

balmy sparrow
#

oh didn't know flake8 would complain about that

gritty wind
#

It doesn’t normally

#

One of the plugins does

fallen patrol
gritty wind
#

If you’re thinking of making a PR to remove annotations

#

I’d shoot it down

trim cradle
#

test

green oriole
#

Does it? I typehint those like a dum dum and it never complained

gritty wind
#

We already saw how hard it is with the spring clean Pr

trim cradle
#

I wasn't able to send messages for a while

#

but I was getting them 🤷🏻‍♂️

gritty wind
fallen patrol
#

other stuff like : Bot is good

fervent sage
fallen patrol
trim cradle
#

yes

#

I am banned

#

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

fervent sage
#

Hi banned I'm dad

gritty wind
#

Stele was spending too much time on server and not enough responding to my DMs

#

He’ll have to respond now

trim cradle
fervent sage
#

yeah discord does that sometimes

#

you just have to try again and then usually it works

green oriole
#

Connect call failed ('some_ip_address', 443)
Is it the actual error or you removed discord's ip

gritty wind
#

Stele is locked out again

trim cradle
#

@green oriole the second one

dry folio
#

locked out?

green oriole
#

Okay, good

trim cradle
#

test

#

yay I can send messages on desktop again

#

for now

fallen patrol
green oriole
#

Seems like you are having fun haha

trim cradle
#

I am not

#

I'm mad as hell, and I don't care who knows lemon_hyperpleased

#

!otn a only stelercus gets to be mad

stable mountainBOT
#

:ok_hand: Added only-stelercus-gets-to-be-mad to the names list.

trim cradle
#

@fallen patrol^

fallen patrol
#

wow.

#

meanie.

dry folio
#

@patent pivot i thought about it a bit more, and i would like to suggest... if the untold rule is to NOT use imperative mood in cog docstrings, could we update https://pythondiscord.com/pages/contributing/style-guide/#mood and say this in the Mood section?

fallen patrol
#

no, not at the moment.

#

Dewikification.

patent pivot
#

That talks about methods, which makes sense in method context, I'm not sure classes should be documented there

#

and yes, we're blocked on wiki rn, potentially within next week though we'll be able to

dry folio
patent pivot
#

I know, but the examples are clearly methods

#

either way, we can clarify soon

dry folio
sleek steppe
#

Why did bot#1573 add the Reddit constants back?

dusky shoreBOT
vale ibex
#

It's not upto date with main, so will likely be deleted after the update branch

short snow
vale ibex
#

or, it might have been a mistake on my part when resolving conflicts previously

clever wraith
#

Hey can people who looked at sir-lancebot#699 re-review

dusky shoreBOT
granite plaza
#

I think i might just need to restart the entire venv process becouse i cant get anythin to work

#

Might try docker this time. If it is not to hard.

sleek steppe
#

@vale ibex did you forget config-default.yml 😛

vale ibex
#

that is highly possible

#

don't commit when in a conference call

#

lesson learnt

#

I'll grab it later

sleek steppe
#

Alright lol

vale ibex
#

Done 🎉

patent pivot
#

yeehaw

sleek steppe
#

cool

sleek steppe
dusky shoreBOT
sleek steppe
#

sir-lancebot#718

dusky shoreBOT
short snow
#

oh shit, miss click 🤦‍♂️

celest charm
#

yes, read_text is nice.

dry folio
#

@celest charm i left comments on your change requests and i'm opening pycharm up rn to fix errors (||see what i did there?||). would you mind explaining what's a "dataclass" you want me to make, and why is that better than a type alias? thank you!

gritty wind
#

At this point teaching data classes has become your MO

#

That’s amazing

celest charm
#

MO?

gritty wind
#

.wa short define modus operand

dusky shoreBOT
gritty wind
#

Ofc

celest charm
#

.wa short define modus operandi

dusky shoreBOT
gritty wind
#

Missing an i on the end as well

short snow
celest charm
#

ah i c

#

!e
a dataclass is a shorthand for creating a 'record' class

from dataclasses import dataclass

@dataclass
class QuizEntry:
    question: str
    answer: str

print(QuizEntry(question="life universe n everything", answer="42").question)
print(QuizEntry("life universe n everything", "42").answer)

you can also make them immutable

@dataclass(frozen=True)
class QuizEntry:
    question: str
    answer: str

print(QuizEntry(question="life universe n everything", answer="42").question)
print(QuizEntry("life universe n everything", "42").answer)
stable mountainBOT
#

@celest charm :white_check_mark: Your eval job has completed with return code 0.

001 | life universe n everything
002 | 42
003 | life universe n everything
004 | 42
celest charm
#

@dry folio

#

if you're familiar with namedtuple, it's namedtuple but more flexible

dry folio
celest charm
#

It's often better than just a type alias because you can ask .question and .answer

dry folio
celest charm
dry folio
celest charm
#

Yep.

dry folio
short snow
#

magiccode's music pr is full game of dataclasses 🙃

celest charm
#

if you name a class or method with leading underscore (make it private), does flake8 still demand a docstring on it?

short snow
#

i think so, not sure

brazen charm
#

They aren't required in private definitions or dunders

fallen patrol
celest charm
fallen patrol
#

If you're familiar with named tuple, it's namedtuple....

#

Yes, it is itself.

sleek steppe
#

When there isn't a yaml.loads 😔

celest charm
fallen patrol
#

But what makes it different from itself

#

Ah

short snow
#

since we have this topic on, I was going through magic's music pr, and got one question, whats the difference with between a frozen dataclass and namedtuple?

dry folio
sleek steppe
#

Is there any difference between open(path, ...) and Path(path).open(...)?

short snow
#

yeah i saw that, but it doesn't really mention the difference between a namedtuple and frozen dataclass

dry folio
brazen charm
tough imp
#

namedtuples are tuple extensions so they make sense if you want to maintain e.g. the iterability

celest charm
sleek steppe
#

@celest charm should I be using Path.write_text too?

dry folio
# celest charm <@!769221607888912487>

hey, i have another question... regarding the four related dicts, you would like them to be attributes of instances of a new Game class, yes? how would that work? do i just dump everything in there and refactor the entire code so that they look like self.games[ctx.channel.id].owner_id or something?

#

ooooooof this will take a long time lol

celest charm
#

it's not a small refactoring

celest charm
#

Well, 3 dicts, because one of them is just not used lol

dry folio
clever wraith
#

Hey quick question does quackstack support seeds?

celest charm
#

yeah, literally nobody cares about sports smh

clever wraith
#

awesome

celest charm
dry folio
#

i'm not sure tho, i didn't go thru that part of the code

dry folio
dry folio
celest charm
#

ah ok

#

If you do refactor it into a game state object, try to give it meaningful methods, like I showed in the comment

dry folio
#

@celest charm last thing: how do i enable precommit?

#

i read that it's not good practice of committing just for little bug fixes and lint fails, so i'd have to know

tawdry vapor
#

It's in the contrib guidelines

celest charm
#

I'm a noob

fervent sage
#

pipenv run precommit

celest charm
#

I'm just an architect astronaut wannabe that reviews others' hard work

dry folio
#

guideline only says this lol, doesn't say specific command

tawdry vapor
#

Yes it does

#

Last sentence

dry folio
tawdry vapor
#

No arguments

dry folio
celest charm
#

🪟 lemon_cut

tawdry vapor
#

There shouldn't be any arguments

dry folio
tawdry vapor
#

We'll update the guide to make that clearer

dry folio
#

so how does the code know which file it's precommitting

sleek steppe
# dry folio

It doesn't work like that. pipenv run precomit just installs the pre-commit environment

sleek steppe
dry folio
tawdry vapor
#

It installs a git hook. That's how it will know

sleek steppe
dry folio
dry folio
#

oop-

sleek steppe
clever wraith
#

was my issue rejected?

sleek steppe
#

What was your issue?

clever wraith
#

anagrams

#

i think i posted it right not sure tho

sleek steppe
clever wraith
#

i cant but i can link the webhook

sleek steppe
#

If it was rejected, it would be closed

clever wraith
#

is it closed?

sleek steppe
#

Nope

clever wraith
#

oh

tawdry vapor
# dry folio

You need to install dev dependencies first. I suggest you follow the contributing guide for lancebot. That's on our website too.

dry folio
#

nvm

#

@celest charm your changes have all been implemented :D

dry folio
tawdry vapor
#

Thanks

celest charm
#

@dry folio Can you explain the dynamic_id logic? I don't quite get it

#

It doesn't seem right that some quiz entries are dicts, and some are QuizEntrys

#

I underestimated how complex the questions are lol

#

why are dynamic_ids numbers? why not strings like linear_system?

dry folio
celest charm
#

what are ids even for?

stable mountainBOT
#

bot/exts/evergreen/trivia_quiz.py lines 180 to 189

DYNAMIC_QUESTIONS_FORMAT_FUNCS = {
    201: linear_system,
    202: mod_arith,
    203: ngonal_prism,
    204: imag_sqrt,
    205: binary_calc,
    301: solar_system,
    302: taxonomic_rank,
    303: base_units_convert,
}```
celest charm
#

but it sems overly cryptic

dry folio
celest charm
#

Right, but the quiz entries are still present as dicts taken out of the JSON

dry folio
dry folio
#

but dynamic questions have to then be formatted