#dev-contrib

1 messages Β· Page 149 of 1

cold island
#

!u 409107086526644234

stable mountainBOT
#
Python#4329 <:bot:812712599464443914>
User information

Created: <t:1517609130:R>
Profile: @stable mountain
ID: 409107086526644234

Member information

Joined: <t:1517609268:R>
Roles: <@&270988689419665409>, <@&277546923144249364>

Infractions

Total: 5
Active: 0

cold island
#

Like this?

clever wraith
#

Yeah it does support emojis

cold island
#

Yeah but does it support mentions

short snow
#

try and see it

clever wraith
#

Only one way to find out

#

I don't think it does, and even if it does mobile is awful at mentions in embeds

#
!int e
from discord import Embed
 ctx.send(embed=Embed(title=ctx.author.mention))```
cold island
#

you mean author

clever wraith
#

There

cold island
#

!int e
from discord import Embed
ctx.send(embed=Embed(author=ctx.author.mention))

stable mountainBOT
#
In [13]: from discord import Embed
    ...: ctx.send(embed=Embed(author=ctx.author.mention))
    ...: 
Out[13]: 
  File "/bot/bot/exts/utils/internal.py", line 180, in _eval
    res = await func()
  File "<string>", line 6, in func
TypeError: __init__() got an unexpected keyword argument 'author'```
short snow
#

should be embed.author

clever wraith
#

I thought that was an existing shortcut

#

God, the embed api is so awful

short snow
#

happy late realization

clever wraith
#

Is it author and not title

#

!d discord.Embed

stable mountainBOT
#

class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
short snow
#

!src user

stable mountainBOT
#
Command: user

Returns info about a user.

Source Code
clever wraith
#

Yeah it is title

cold island
#

Title is something else isn't it

short snow
cold island
#

!int e
from discord import Embed
ctx.send(embed=Embed(title=ctx.author.mention))

stable mountainBOT
#
In [14]: from discord import Embed
    ...: ctx.send(embed=Embed(title=ctx.author.mention))
    ...: ```
cold island
#

oh right

short snow
#

await

cold island
#

yeah

#

!int e
from discord import Embed
await ctx.send(embed=Embed(title=ctx.author.mention))

stable mountainBOT
#
<@!512354988157173763>
#
In [15]: from discord import Embed
    ...: await ctx.send(embed=Embed(title=ctx.author.mention))
    ...: ```
clever wraith
#

Yeah since there are two lines

cold island
#

I have to say, the name discord being taken by a dead library is pretty annoying

clever wraith
#

At least that's not their PyPI name

cold island
#

oh it's not?

clever wraith
stable mountainBOT
short snow
clever wraith
#

I don't know if that's better or not

cold island
#

Ah yeah

clever wraith
#

I guess now that it is dead it do be better

#

LOL

#

!pypi discord

stable mountainBOT
short snow
#

bruh

clever wraith
#

Never mind, they take both names

short snow
#

but we can open a pypi issue and get that name

#

its a dead name anyways

cold island
#

Well we don't need it, just thinking of how future code will look like. discord.Embed looks super nice

short snow
#

but anyways you can still name it discord if you don't use the discord.py lib

#

you just can't use the pypi index name

clever wraith
#

It does confuse some IDE that the name of the PyPI package is different from the actual module

short snow
#

@brisk brook is this fine?

brisk brook
#

Yeah that's much better

molten perch
#

I managed to get it working in the end, so the time has come, the first endpoint on the new API! api#25. I would greatly appreciate if someone could take a look at it (mostly the test suite. I'm concerned about it, however it tests the core features of the API and omitting DB calls the same time. πŸ˜„ )

dusky shoreBOT
cold island
#

I like how the contribution graph is just a union of Seb's and Dorsan's contributions

gritty wind
#

That's a lot of changed files. Seems you went with DB in test suite in the end

molten perch
#

Nope, I did not. πŸ˜„

#

I just changed on the flake config, a few of the models, created a module and an init file, the test files and such.

#

Yeah, and of course, the linting workflow πŸ˜„

#

The test mocking part took up most of the time actually πŸ˜„

gritty wind
#

Oh? I was going off the linting file

#

Why do we have a DB in the lint lol

molten perch
#

Well :3

#

So, in order to override a dependency in fast api you have to import it.

#

And there was a chain of imports, I'll have to take a look at it actually.

gritty wind
#

Hmm I wonder

#

Do you think you could get it working without that? Possibly with some flags on the imports? If we do that, we don't have to worry about a test accidentally using the real DB, since it'll be checked by CI

molten perch
#

Yeah, actually I have to move a few things and it should work. Give me an hour or so! πŸ˜„

gritty wind
#

I appreciate you being so flexible lol

molten perch
#

it's all about being flexible πŸ˜„

gritty wind
#

@patent pivot do you think it would be feasible to have metricity track voice channels

#

My most basic idea is to have it track how many users are in VC, and make a new entry when the number changes

#

Perhaps buffered so we don't get like 30 entries in like 3 seconds

patent pivot
#

possibly? I’m not a huge fan of it though, it’s making metricity more time series which is what we wanted to avoid

#

we get some data from discord on voice usage, for those sorts of things I’m more inclined to say graphite is a better choice, but I’m not entirely sure

gritty wind
#

Alright, fair

#

Where could one view the discord data

patent pivot
#

server insights gives total listeners and speakers over last 28 days I think

gritty wind
#

Oh cool

#

Yeah that works

vale ibex
#

Do we push that to statsd atm?

#

hmm, doesn't seem like it

#

we could

patent pivot
#

yea we don’t

#

but could

#

not sure really

vale ibex
#

yea, I guess it would just be an incr on join and decr on leave?

short snow
#

Ooo dorsan opened reminders PR, that reminds me of my otn issue, i will do that soon

#

but volcy's pr should be merged before any of the others... otherwise the functionality won't do any benefit

patent pivot
short snow
molten perch
short snow
#

Hmmm, I will give it a shot while I am working with the otn endpoint

molten perch
#

Of course, but, if you override the database session to return a specific value when a specific argument is passed because that's what the test case needs.. I can't really think of a general solution that could cover all cases.

short snow
#

Drop all data after each test? keep everything else same

molten perch
#

All data? πŸ™‚

molten perch
# gritty wind I appreciate you being so flexible lol

I hate to disappoint you 😦 , but I couldn't find a proper way to do it. I wanted to patch the create_session method so that it won't fail when imported, but by the time it gets patched it'll be already imported and I couldn't find any workaround, like monkeypatching the environment variables or similar, because of the same issue.

gritty wind
#

I was actually thinking more along the lines of conditionally importing it in the main file

#

Unless it needs to always be imported in that?

molten perch
#

Actually, it has to be imported in order to override it. That's a FastAPI convention. (I guess πŸ˜„ )

#

That's the source of the problem, actually.

gritty wind
#

So, to better explain what I'm trying to say:

if os.getenv("Testing") == "true":
    session_factory = mock_session
else:
    engine = create_engine(settings.database_url)
    session_factory = sessionmaker(bind=engine)```
#

that's not how you paste code lemon_pika

molten perch
#

I see, I actually thought about that, however I thought using a mock object (or Mock or whatver) in a non-test file is "against the conventions".

#

But, if it's okay, then I'll happily push a patch πŸ˜‚

gritty wind
#

Idk, it might be πŸ˜…

#

I guess I'll check, but it really should only run in a testing context

molten perch
#

Yes, I believe so. πŸ˜„

gritty wind
#

So, what's your opinion

molten perch
#

I believe, it shouldn't be a problem. If we come up with something better along the way we'll change it, however that's the only solution I see.

gritty wind
#

Alright, you've been working on API for a while now, and I'll trust your judgement

#

we'll change it
yeah true

vale ibex
#

@brisk belfry your time has come bot#1928

dusky shoreBOT
molten perch
gritty wind
#

Oh I got confused, and thought you weren't going with this idea

#

Thanks for all your work

#

!remind 15H Review api PR

stable mountainBOT
#
Okay.

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

molten perch
#

Btw. I went with using normal sessions rather than AsyncSessions, since it's still not advised to use it in production environment. (As far as I know! )

gritty wind
#

Oh, cool

fallen patrol
#

i think you just have to do it once

#

you can uh

#

echo "$(poetry env info --path)/bin/python3"

#

smh

#

what i sent would work too

molten perch
#

~~No, they're mine 😈 ~~ Literally every endpoint, except Reminder and OffTopicName. πŸ˜„

green oriole
#

no, it will generate a too massive diff for nothing, we decided to not change them unless a PR is already working on the file when we migrated to 3.9

dusky shoreBOT
green oriole
#

what does it look like if that converter fails?

#

if you pass an invalid value to the converter

vale ibex
#

since it's the thing that does the conversion on built-ins

green oriole
#

actually doesn't the error handler modify that behavior a bit

vale ibex
#

Yea, I'm more talking to what error is raised

#

So that when it comes to the error handler, it behaves the same

stable mountainBOT
#

bot/exts/backend/error_handler.py line 89

elif isinstance(e, errors.ConversionError):```
vale ibex
#

You're the one with the changes locally, you tell us kek

static canyon
#

@clever wraith I think you missed the new PR one

#

Wait

#

I think I'm thinking of the wrong PR that I have

#

Yeah, I am

#

It's a different PR that got merged

#

So I just need to change my PR to use Literal

#

@clever wraith did you test to see if the noqa is still needed?

#

Using typing.Literal may fix the bug with flake8

#

Wherever we had allowed_strings we needed a noqa comment because of a bug in flake8 @clever wraith

static canyon
#

@fallen patrol F722

fallen patrol
#

!flake8 F722

stable mountainBOT
#

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

fallen patrol
#

πŸ‘€

#

since when is that a command

#

@clever wraith F722 syntax error in forward annotation

#

lmao

#

i actually

vale ibex
fallen patrol
#

rm -rf $(poetry env info -p) && poetry install

#

will regenerate it

#

ye

#

i actually use poetry but don't use poetry, if that makes sense

#

okay like.... i maintain a requirements.txt file

#

but wrote a script to generate it, from poetry.lock

#

and to activate my env, I have source $(poetry env info -p)/bin/activate in a script that i run to set up my env

#

installing 100 dependencies

#

ah

#

i have uh

#

over 100 for my project

#

although i've read that ppl don't lock their lint deps into the project

#

because they use pre-commit

vale ibex
#

depends if all the deps have 3.10 wheels

#

we don't really want g++ in any images

fallen patrol
#

black doesn't support all of 3.10 yet

gritty wind
#

mmm snekbox

molten perch
#

I'm not sure. I would be up for it, but it's not my call. Open an issue so that we can discuss it. πŸ˜„

green oriole
#

@clever wraith have you poetry install --remove-untracked?

#

what's the problem?

#

You do need to do that, but why?

green oriole
#

so you opened two PRs from the same branch?

#

Right, you opened from main

#

well, since there are comments on it I'd rather not close and re-open it

static canyon
#

Left a review on bot#1929 @clever wraith

dusky shoreBOT
static canyon
#

Turns out the # noqa comments aren't necessary with typing.Literal

green oriole
#

mmmmmyes but github would see that as a merge

static canyon
#

@rapid igloo I've addressed your reviews on sir-lancebot#919 πŸ‘

dusky shoreBOT
static canyon
#

Would appreciate another re-review

rapid igloo
short snow
#

I don't think names are needed for check-toml, etc. If no names are given, it would use the id, and check-toml is quite straightforward

#

loggging statements should start with a capital letter right?

#

Also, is debug level logging statements be visible in prod?

austere hornet
patent pivot
#

don't think so

short snow
#

Ah thanks, wanted to confirm it πŸ‘

short snow
#

@molten perch Could I base my otn endpoints branch of your PR?

molten perch
short snow
#

yeah, that can be handled πŸ‘

short snow
#

@molten perch Do you have push perms on pythondiscord/api ?

green oriole
#

If you don't, tell me I'll make sure you do haha

short snow
#

Cuz I wanted to keep the merge branch of my PR as yours and that's not possible if yours is based of a fork branch

green oriole
#

Unless you PR to Dorsan's fork, you indeed cannot

short snow
#

yeah

#

wtf zsh

rapid igloo
#

because ?

#

fish does that too

short snow
#

yeah even backticks don't work, that's why I need to use ' if I am committing it from the terminal and not an editor... is there a way to disable/escape it

rapid igloo
#

in fish I can use \ to escape

#

also, you should(always) be comitting with an editor not -m :P

short snow
#

I mostly use neovim to commit, but sometimes they are really short so I just commit them in the terminal

rapid igloo
#

you don't use pycharm's git integration?

short snow
#

Depends which project I am working on (I only use pycharm for some of my projects)

molten perch
short snow
#

Well, if it is possible, could you base your PR of a branch on the repo?

molten perch
#

I could, but actually my pr is migrating a different endpoint, why do you need it as a base? The models are already in the repo

short snow
#

testing setup/dependencies/router module

molten perch
#

Alright, but even if I base my branch on the repo it could drastically change, and you might have to rewrite many things.

short snow
#

How do I mock order_by here?

def get_all_otn(db_session: Session) -> Query:
    return db_session.query(OffTopicChannelName).all()

queryset = get_all_otn(db_session).order_by("used", "?")[:random_items]
#

This is what I tried but it doesn't work

#

the error

clever wraith
#

Could you return a mock query instead?

stable mountainBOT
gritty wind
#

I’m really bad at scheduling apparently

#

!Snooze

molten perch
#

Nice.. sorry. πŸ˜„

cold island
#

@static canyon sorry for the mess in the PR, I keep adding single comments instead of starting a review πŸ˜… . I deleted the comment before I saw you already replied to it

static canyon
#

No worries lol

#

Although I don't seem to be able to reply to your review

#

It just has the option to mark as resolved

cold island
#

Refresh?

static canyon
static canyon
cold island
#

Hmmm

#

hard refresh? lol

#

I can reply just fine

static canyon
#

Done that too xD

#

Why does GitHub hate me lol

#

Completely restarting my laptop doesn't even fix

#

Wtf

cold island
#

Can you reply through your phone?

static canyon
#

I'm in school so can't get my phone out to check :p

#

Or at least not until like 10mins time

cold island
#

Lol then I'll distract you no further

static canyon
#

In registration at the moment, once I go to PS I can check

clever wraith
#

Hi

static canyon
#

Just checked and I can't do it on my phone either @cold island

#

Exact same screen (can resolve but not reply)

cold island
#

Very weird

#

What are you trying to say anyway? lol

static canyon
cold island
#

No no

#

I mean

#

Make it like in the usual search

#

But change for to by

static canyon
#

Ah right

#

Yeah, I'm doing that

#

And gonna make 100 display as 100+ since 100 could be anything from 100 to infinity (api will return a maximum of 100)

cold island
#

That might be something to change in the other searches as well

static canyon
#

I suppose. It seems unlikely to have 100 received infractions though

#

But if I'm editing the file anyway I suppose I might as well

cold island
#

sec, I can't do it in this channel

clever wraith
#

We would probably want to add a decently sized paginator and update the bot API connector to properly handle it

cold island
#

Yeah that'd be nice

static canyon
#

That's outside the scope of my PR though lol

#

Which is my way of saying I'm not going to be the person doing it

static canyon
#
def format_infraction_count(infraction_list):
     ...```
cold island
#

uuuuh

#

ok I guess

static canyon
#

I think get_infraction_count is a better name

cold island
#

get count sounds like you're expecting an int

static canyon
#

Hmm

clever wraith
#

what do you actually have to do in this function?

static canyon
#

I guess format_infraction_count should take infraction_count then, rather than infraction_list?

static canyon
# clever wraith what do you actually have to do in this function?
    @staticmethod
    def get_infraction_count(infraction_list: list[]) -> str:
        """
        Returns a string-formatted infraction count.
        
        API limits returned infractions to a maximum of 100, so if `len(infraction_list)`
        is 100 then we return `"100+"`. Otherwise, return `str(len(infraction_list))`.
        """
        if (num_infractions := len(infraction_list)) == 100:
            return "100+"
        return str(num_infractions)
```this is what I had
#

It's short but helps DRY 🀷

clever wraith
#

I think format_infraction_count makes sense

clever wraith
#

also I feel like gettext could do that

static canyon
#

No clue what that is lol

clever wraith
#

I don't either, but we saw @cold island use it once and it was rather fancy, heh

static canyon
#
from gettext import ngettext

...
end_msg = f" (#{id_} ; {total} infraction{ngettext('', 's', total)} total)"```this is the only example I can see in bot
clever wraith
#

hmm yeah that doesn't help

static canyon
#

Yeah

clever wraith
#

ngettext(str(len(infractions), '+', total > 99) could work I guess

static canyon
#
>>> help(gettext.ngettext)
"""
Help on function ngettext in module gettext:

ngettext(msgid1, msgid2, n)
"""```thanks python
#

Very helpful

#

lol

clever wraith
#

lol

cursive relic
#

has anyone assigned sir-lancebot#933 yet/doing it yet?

dusky shoreBOT
clever wraith
static canyon
#
    @staticmethod
    def format_infraction_count(infraction_count: int) -> str:
        """
        Returns a string-formatted infraction count.

        API limits returned infractions to a maximum of 100, so if `infraction_count`
        is 100 then we return `"100+"`. Otherwise, return `str(infraction_count)`.
        """
        if infraction_count == 100:
            return "100+"
        return str(infraction_count)
```this is what I've got at the moment
clever wraith
#

BUGS
The return type ought to be const char *, but is char * to avoid
warnings in C code predating ANSI C.
KekW

#

I think that function is fine, we can just slap it as a function

static canyon
#
        embed = discord.Embed(
            title=f"Infractions by `{actor}` ({self.format_infraction_count(len(infraction_list))} total)",
            colour=discord.Colour.orange()
        )
#

Does that seem okay or should I make the return value a variable?

#
        formatted_infraction_count = self.format_infraction_count(len(infraction_list))
        embed = discord.Embed(
            title=f"Infractions by `{actor}` ({formatted_infraction_count} total)",
            colour=discord.Colour.orange()
        )
#

Think I prefer the latter

cursive relic
#

imo the first one would be better, or if you want to have more readable code for people like me, then the second

static canyon
#

Thoughts? @clever wraith @cold island ^

cursive relic
#

how can restrict_to_user in paginator be used to limit some actions?

clever wraith
#

I would say the later, logic in f-string is usually a bad pratice

vale ibex
#
len = len(infraction_list)
f"Infractions by `{actor}` ({len}{'+'[:len>99]} total)"
``` ![kek](https://cdn.discordapp.com/emojis/585617800257863727.webp?size=128 "kek")
static canyon
#

Sent by a core dev so that must be good code

#

lol

vale ibex
stable mountainBOT
#

bot/exts/utils/utils.py line 169

name=f"Snowflake{'s'[:len(snowflakes)^1]}",  # Deals with pluralisation```
green oriole
vale ibex
#

!e It's relying on the fact that this works ```py
print("+"[:True])
print("+"[:False])

stable mountainBOT
#

@vale ibex :white_check_mark: Your eval job has completed with return code 0.

+
static canyon
#

I love how it's infraction_list and not len(infraction_list) too

#

You just send the entire dictionary

#

Possibly with a + at the end

vale ibex
#

implementation detail

vale ibex
green oriole
vale ibex
#

I made it better

#

now it also overwrites a builtin

green oriole
#

oof

vale ibex
#

because screw the rest of the code in that file

cursive relic
dusky shoreBOT
stable mountainBOT
#

bot/utils/pagination.py lines 91 to 95

async def paginate(cls, lines: Iterable[str], ctx: Context, embed: Embed,
                   prefix: str = "", suffix: str = "", max_lines: Optional[int] = None,
                   max_size: int = 500, empty: bool = True, restrict_to_user: User = None,
                   timeout: int = 300, footer_text: str = None, url: str = None,
                   exception_on_empty_embed: bool = False) -> None:```
cursive relic
#

mainly the restricting the user

vale ibex
#

use the restrict_to_user param

#

and give it a user object

clever wraith
#

does it have the mod bypass like python does

vale ibex
#

It doesn't

clever wraith
#

sadge, we really botcore

#

did Zig (I think it was Zig?) made any progress on it?

cold island
#

Nope, don't have the capacity for that

#

Most of the dev time I'll have in the next several months will go to the filters system

clever wraith
#

that's pretty fair

vale ibex
#

Did you make much of a start on it?

#

IE do you have anything locally that isn't in the repo?

cold island
#

I started with a repo setup, but if anyone picks that up they'll be able to do it pretty quickly

clever wraith
#

there is an empty private repo, that's a good start

#

you haven't pushed though

cold island
#

yeah, I got stuck on CI and setup.py and never made time for it again lol

#

It would have been a nice learning experience, but I just don't have time for it atm

vale ibex
#

could you git add . and git commit?

clever wraith
#

We may have time to get the ball rolling this weekend, as week 6 exam is nothing

vale ibex
#

πŸ˜„

static canyon
#

@cold island have pushed the fixes to your review on bot#1926

dusky shoreBOT
clever wraith
#

do you wanna push what you have to a branch?

cold island
#

I don't think it's much of anything, so I think it's better to start from scratch than trying to fix whatever I did

clever wraith
#

lol okay

cursive relic
clever wraith
#

what was the conclusion on distributing the package? I/we quite like the idea of uploading an artifact using the CI and have a worker serve the latest

cursive relic
cold island
vale ibex
cold island
#

But joe says it'll be easy to start again

clever wraith
#

yeah I remember it got nuked, don't remember why

cold island
#

Was just unused

clever wraith
#

really? wasn't it memory leaking or something

cold island
#

idk

clever wraith
#

I'll ask Ak to have a look

cursive relic
vale ibex
#

when you call paginate give it a user/member object

#

await paginate(lines, restrict_to_user=ctx.author)

#

or whatever

cursive relic
#

Oh now I see

green oriole
#

joe took it down after a super long crashloop due to linode rate limits, and we apparently prefered to use zips over a custom pypi

clever wraith
#

I don't think you can use two servers for different packages using Poetry anyway

cursive relic
#

so, if I want to make a fix to something I need to create a pr?

green oriole
#

sure thing

cursive relic
#

how do I create a pr for a issue that is open?

green oriole
#

have you ever opened a PR?

cursive relic
#

nope πŸ˜…

#

never had a use case for it before

green oriole
#

Cool! How much do you know about Git and pushing branches?

cursive relic
#

I know the general usage, I can make commits and pushes without problem with git (except the few times I nearly destroyed my whole repo)

#

and iirc if you want to push a commit to non main branch it will create a pr for it

gritty wind
#

The PR won’t be created automatically, but once you open the repo on GitHub after pushing, it’ll show a prompt to create one

#

Do you have a fork?

cursive relic
#

nope

#

I can make one if needed

green oriole
#

you'll need one, yeah

gritty wind
#

Try looking up β€œfork and pull model”

#

There are many guides on it

cursive relic
#

oh.. I alrd forked

gritty wind
#

I’d get you one, but I’m on mobile

#

Good, that’s one step out of the way

cursive relic
#

np πŸ˜„

green oriole
#

Can you run git branch -v?

cursive relic
#

erm that would take a while to get repo to vsc

cursive relic
#

well now I have made the possible fix in my code

#

if that is correct, then I would need to know how to make a pr from that

clever wraith
#

ah, he meant git remote -v

cursive relic
#

Oh...

#

Well I don't have access to laptop for 80-90 mins..

clever wraith
#

haha, okay

cursive relic
#

But at a time, how do I create a pr from the code I added?

gritty wind
#

Make a commit with your code, push it to your fork. Open the fork on GitHub

#

There’ll be a β€œCreate Pull Request” button

clever wraith
#

*make a new branch first

cursive relic
#

Called?

cursive relic
obtuse arrow
#

I usually name my feature branches "feature/description-of-issue-here"

vale ibex
clever wraith
#

we usually do $type/$issue/$description

obtuse arrow
#

$issue as in issue ID?

clever wraith
#

in that case it would be something something wikipedia/933/lock-paginator-to-author

#

yeah

obtuse arrow
#

And what's "type"?

clever wraith
#

it makes it way easier for us to checkout the right branch, as you can just type the issue number and press tab

cursive relic
#

mayhabs a file

gritty wind
#

TFW gh cli and editor integration mean you never have to type anything

clever wraith
#

type is what we use at the beginning of our commit, I guess field would be better

#

it is like what very specific part of the app is affected by this commit

obtuse arrow
#

Such as what?

vale ibex
clever wraith
#

like here the commit would be something along the lines of Wikipedia: lock paginator to author

#

oh, by we I meant Ak and I

vale ibex
#

Ah lol

obtuse arrow
#

Oh, ok

clever wraith
#

lmao

obtuse arrow
#

I thought you meant we the community

clever wraith
#

yeah, nah

vale ibex
#

my last two branches: remove-d0rs4an kill-threadevere

clever wraith
#

not part of the staff, wouldn't make sense anyway

clever wraith
gritty wind
#

Chris why are your commits so violent

clever wraith
#

yeah, feel free

vale ibex
obtuse arrow
#

I tend to label feature branches with issue ID at work, but I didn't see anyone else doing that with the pydis repos, so I haven't so far.

gritty wind
#

We don’t have a general policy

clever wraith
obtuse arrow
#

It's nice when an issue requires multiple PRs.

gritty wind
#

Just do whatever you feel like

clever wraith
#

it could be interesting to slap some suggestions in the contrib supplemental info page

gritty wind
#

It really doesn’t matter too much at the end of the day

obtuse arrow
#

There's not much value to it if I'm the only one doing it anyway, so meh.

cursive relic
#

ehh I have mistaken something, right? ```
git checkout --no-track -b wikipedia/933/lock-paginator-to-author upstream/main
fatal: 'upstream/main' is not a commit and a branch 'wikipedia/933/lock-paginator-to-author' cannot be created from it

gritty wind
#

The only place it’ll show up is the merge message if left I modified

#

You have that extra

#

β€œUpstream/main”

vale ibex
#

git remote add upstream https://github.com/python-discord/sir-lancebot.git first

gritty wind
#

At the end

vale ibex
#

Ah

cursive relic
#

needs to be my repo..?

cursive relic
gritty wind
#

You should be able to just check out without it and it’ll use the current head as base

obtuse arrow
#

Did you do git fetch upstream ?

cursive relic
#

now it worked when I removed the last thing

gritty wind
#

It should in theory work with it too, assuming you have the branch

#

You can verify with git checkout upstream/main

obtuse arrow
#

Wait, what's the last argument supposed to do when creating a new branch?

gritty wind
#

Specifies base

obtuse arrow
#

I usually bind the upstream when I push the branch, not when I create it.

cursive relic
#

Well I guess it worked so far

obtuse arrow
#

Well, you can bind the upstream later anyway

gritty wind
#

<start-point>
The new branch head will point to this commit. It may be given as a branch name, a commit-id, or a tag. If this option is omitted, the current HEAD will be used instead.

cursive relic
#

so after adding, do i need to commit + push?

gritty wind
#

Yes

cursive relic
#

does it need a meaningful commit message?

gritty wind
#

Yes please. It doesn’t need to be too elaborate, just a basic idea of what the commit is

cursive relic
#
git commit -m "Limited user reactions by adding user restricting"
gritty wind
#

We have guidelines for that, one sec

cursive relic
#

aha, I'll read about it

obtuse arrow
obtuse arrow
#

The article, not the picture, lol

#

Oh, that links to my article, haha

gritty wind
#

I wouldn’t recommend you use the m option, as it’s harder to write out meaningful things

#

Yeah hah

obtuse arrow
#

(the article I posted, not the one I wrote)

cursive relic
#

but -m would work as well?

obtuse arrow
#

I use -m when I know for a fact I won't need multiple lines, but it tends to make you lazy.

gritty wind
#

It would, but you’re only giving it a title, and no body

cursive relic
#

so I would not make it like this```
git commit -m "Limited user reactions to prevent them from removing message by adding user restricting"

gritty wind
#

That’s a bit long for a title

#

It’s good for a body, but to do that you’ll need multiple lines

#

If you try to commit without it, it’ll open your default text editor

obtuse arrow
#

The title should be max 50 characters

#

And in the imperative mood

cursive relic
#

erm how do I use smth else thab -m?

obtuse arrow
#

So "Limit user reaction...", not "Limited"

gritty wind
#

Just don’t put anything

#

Git commit

obtuse arrow
cursive relic
#

ok, and now?

gritty wind
#

So, write a shorter β€œtitle” on the first line, which describes your commit

#

Leave one empty line

#

Then you can put the longer form description, aka β€œbody”

obtuse arrow
gritty wind
#

We don’t really enforce commit quality beyond β€œmake sure you actually have commits, and they aren’t spam”, but we do appreciate when someone puts in the effort for nicer commits

cursive relic
#

I have never ever written anything close to good as commit message, and this is what I came up by

brazen charm
obtuse arrow
#

In English grammar.

cursive relic
#

nope, never heard about it

obtuse arrow
#

Imperative mood means commands

#

Like "Clean your room!"

#

One of the rules is to write the title in the imperative mood

cursive relic
#

so some sort of clean message?

obtuse arrow
#

No, like "Take out the trash" "Write a good commit message" <- These verbs are in the imperative mood, because they are commands.

#

You should write the commit title in the imperative mood as well.

#

So instead of "Limited user reactions", it should be "Limit user reactions"

#

You can think of it as describing the effect the commit will have

#

Not what effect it had

cursive relic
#

I suck at writing these πŸ˜…

cursive relic
obtuse arrow
#

Yes

#

You should follow all the rules in the list in the article

cursive relic
#

I just can't really tell about it

obtuse arrow
#

Tell what?

cursive relic
#

anything to commit message, I just can't come up with anything

short snow
cursive relic
#

all commit messages I have written are sort of "quick fixes", "fixed typo" or smth

obtuse arrow
cursive relic
#

fixed a "bug" or added a missing feature

short snow
obtuse arrow
cursive relic
#

that the user can remove a message even when they are not a author of command

obtuse arrow
#

"Prevent non-author from removing message" ?

cursive relic
#

kind of

obtuse arrow
#

Kind of? What's wrong with it?

cursive relic
#

ehh was that example to commit message..?

#

There was nothing wrong about it, I just thought it in another subject

obtuse arrow
cursive relic
#

Well imo, no it does not miss anything. But I'm quite sure that something may be missing

obtuse arrow
#

You don't have to second-guess yourself forever. If you think it's accurate and it obeys the seven rules, go with it. Writing good commit messages is a skill that requires practice to master.

#

You can't go straight to writing perfect ones overnight.

cursive relic
#

well, this is what it has now :/

short snow
#

Everytime you think over the commit message, you will get something new. Think once, the commit message should just be a short summary of your change such that the person doesn't need to look at your code

#

yeah that's perfect

#

Limiting user reactions on embed pagination could also be used as commit title imo

green oriole
#

That's why I like adding Wikipedia: at the beginning of the commit, so you can clearly see what part of the app it is changing

obtuse arrow
cursive relic
#

nope

#

waiting still

obtuse arrow
cursive relic
#

I don't quite know what that is, even if tried to explain

brazen charm
obtuse arrow
#

As if you were telling someone to do something

#

When you tell someone to clean their room, you don't say "Cleaned your room!"

short snow
#

I follow this outside pydis - the type/scope part

obtuse arrow
#

When you write a commit message subject, you don't write "Limited user reactions"

green oriole
cursive relic
#

then comes up next problem, I don't know how to format it as a command

obtuse arrow
#

It's that simple

#

"Limit user reactions" can be read as a command

#

"Limit user reactions, immediately!"

cursive relic
#

so not talking as past?

obtuse arrow
#

No, talking as if you were telling someone to do something

cursive relic
#

better?

obtuse arrow
#

Yes!

#

Good work!

#

Much much better

cursive relic
#

so now I just close the file?

obtuse arrow
#

Save and close it

#

That will commit

cursive relic
#

now just git push?

#

I never made a remote...

obtuse arrow
#

Sorry, I didn't follow along with the previous conversation. You're going to create a PR from your fork?

cursive relic
#

I'm making pr to my fork of sir lancebot

obtuse arrow
#

Right. Which remotes do you have currently?

cursive relic
#

none, I never did it

obtuse arrow
#

git remote -v

#

What does that give you?

cursive relic
#
git remote -v
upstream        https://github.com/python-discord/sir-lancebot.git (fetch)
upstream        https://github.com/python-discord/sir-lancebot.git (push)
obtuse arrow
#

Alright, so you want to add your fork as a remote git remote add origin https://github.com/<your-github-user>/sir-lancebot.git

cursive relic
#

and now?

obtuse arrow
#

Assuming you put the correct url, you should be able to go git push

#

You might get an error telling you to configure the upstream branch

cursive relic
#

in which branch?

obtuse arrow
#

Which branch did you just commit to?

cursive relic
#

excellent question

#

because I don't know

obtuse arrow
#

Type git status

#

It should tell you which branch you're on

cursive relic
#
git status     
On branch wikipedia/933/lock-paginator-to-author
nothing to commit, working tree clean
obtuse arrow
#

Ok, nice

#

Then you're fine

cursive relic
#

good to know

#

brb

obtuse arrow
#

Just go git push

#

It'll push to the origin remote by default, and to the configured upstream branch of the current branch

cursive relic
#
git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>
obtuse arrow
#

Can you go git remote -v again?

#

And show the output

cursive relic
#

i think it worked

obtuse arrow
#

Not based on that output

cursive relic
#
git push --set-upstream oorigin wikipedia/933/lock-paginator-to-author
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 577 bytes | 192.00 KiB/s, done.
Total 6 (delta 5), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (5/5), completed with 5 local objects.
remote: 
remote: Create a pull request for 'wikipedia/933/lock-paginator-to-author' on GitHub by visiting:
remote:      https://github.com/Nipa-Code/sir-lancebot/pull/new/wikipedia/933/lock-paginator-to-author
remote:
To https://github.com/Nipa-Code/sir-lancebot.git
 * [new branch]        wikipedia/933/lock-paginator-to-author -> wikipedia/933/lock-paginator-to-author
Branch 'wikipedia/933/lock-paginator-to-author' set up to track remote branch 'wikipedia/933/lock-paginator-to-author' from 'oorigin'.
obtuse arrow
#

Aah, you misspelled origin

cursive relic
#

ye ...

obtuse arrow
#

That's why git push didn't work

#

"origin" is the default remote

cursive relic
#

i see, what do I do next?

obtuse arrow
#

If I were you, I would fix that typo, because it'll be inconvenient to have to type out the remote name for every command later

cursive relic
#

press it?

obtuse arrow
#

But it's not strictly necessary

#

Yes, you can do that to create the PR

#

The destination should be the main branch on the main (not your fork) repo

cursive relic
#

so I need to fix smth?

short snow
#

nope

#

it should be set by default

cursive relic
#

ok so just click the green button?

obtuse arrow
#

Lots of git commands take a remote as a parameter, where you specify which repo you want to operate toward. If you don't explicitly specify a remote, it will use "origin" as the default.

#

Since you don't have a remote called "origin", you will need to explicitly specify the remote for every command.

#

This is kind of inconvenient.

cursive relic
#

hmm, how do I fix it

obtuse arrow
#

You can fix this, if you want to, but you don't have to.

cursive relic
#

i can do that

obtuse arrow
#

the alternative is to always type out the remote name

green oriole
#

You can set the default remote to be something else

obtuse arrow
#

Although actually, renaming the remote is just as easy

short snow
#

gh repo clone auto adds upstream remote if you are cloning a fork

obtuse arrow
#

git remote rename oorigin origin

green oriole
#

Yeah

#

That's probably better

obtuse arrow
green oriole
#

Origin is the fork, right?

cursive relic
#

done πŸ˜„

obtuse arrow
#

Yes

#

origin is the fork, upstream is the main repo

short snow
green oriole
#

Perfect

short snow
#

origin would be the fork i made

cursive relic
#

now I click the button of doom

short snow
#

yes, the magic green button

obtuse arrow
#

Click the button of doom and it'll take you to the form of doom where you can fill in your PR title and description of doom.

short snow
#

lol

cursive relic
#

oh god

green oriole
short snow
#

this is a 1-minute process once you get familiar with it πŸ™ƒ (excluding the pr description)

cursive relic
#

I need to write more text?

green oriole
#

Do you need a do not merge label on your PR Jason

green oriole
cursive relic
#

:sad_face_of_smth:

green oriole
#

Done

short snow
#

ty

cursive relic
#

somehow kinda hard to explain all what I have done because all I did was ```py
restrict_to_user=ctx.author

short snow
#

add that limit... line in description and put the relevant issue

#

click the ticks

#

and you are done

cursive relic
#

do what..?

short snow
#

Finally πŸŽ‰

cursive relic
#

what do I need to write in Relevan issue I did not understand

dim pelican
#

Usually a PR closes an issue

short snow
# cursive relic do what..?

Hmm, Move that limit users... line (your commit description) to the description section, then add the relevant issue in form of Closes #XXXX (read the commented section below it- in raw mode) and click the relevant ticks you have followed and press the magic green button

cursive relic
#

looks good?

short snow
#

uhh yeah

cursive relic
#

ok aight, I will blame you if smth goes wrong /j

green oriole
#

Looks about right

short snow
#

if everything goes correct?

#

i want a cookie

cursive relic
#

button of doom was activated

green oriole
#

Good stuff

short snow
cursive relic
#

what is that?

short snow
#

you passed the linting test πŸ’―

#

Basically runs pre-commit hooks and flake8 against your code and sees if everything is okay

cursive relic
#

don't even know what that is but not suprising when all I did was 1 single argument

short snow
#

yep, now you got to wait for two staff approvals

#

shouldn't be long for a short PR

obtuse arrow
#

If it wasn't, it would fail and you would have to fix it before you can merge the PR.

cursive relic
#

I see

#

Thx a lot for explaining this thing and helping, thx πŸ˜„

obtuse arrow
brisk brook
cold island
#

@static canyon you want to open a separate PR for the 100+ thing?

short snow
static canyon
#

If you really want me to then I can I guess, although I'd have to wait for the current one to get merged first

cold island
#

I don't know, you didn't add it there. I mean for the other places where it should be used as well

clever wraith
#

Mh the webhook settings for api aren't correct and Ak doesn't have access to the settings

#

Need an owner

static canyon
#

bot#1929

dusky shoreBOT
static canyon
#

Wrong one

#

bot#1926

dusky shoreBOT
cold island
#

I only see it for infractions by

static canyon
#

Ah yeah

#

I forgot to add it to the others

#

Should I add in this PR or make another?

cold island
#

Here is fine I think

static canyon
#

I suppose this one

#

Yeah

#

Sorry, apparently I forgot to add the others

cold island
#

nw

static canyon
#

!remind 2h this ^

stable mountainBOT
#
Yeah okay.

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

static canyon
#

!reminder cancel 3403

stable mountainBOT
#
Sure.

That reminder has been deleted successfully!

static canyon
#

@cold island have just squash-pushed ^^

worn swallow
#

@thorny obsidian You told me to ping you here if I ran into issues with setting up evalbot πŸ™‚

#

I was wondering if Docker is necessary? I have no experience with it at all, so I just tried running __main__.py in vscode. I had to install a few modules but the when I try to install the bot module with pip i get ModuleNotFoundError: No module named 'keyring.backends.macOS' ERROR: Could not find a version that satisfies the requirement bot ERROR: No matching distribution found for bot

#

Thought I should ask first before doing anything, perhaps this isn't an issue if I were to use docker

green oriole
#

What is eval bot?

dim pelican
#

Maybe the snekbox? But Docker is strongly recommended

worn swallow
#

I asked if I could use @stable mountain in my own server, this isnt possible but I got recommended evalbot which is is the !e side of the python bot

dim pelican
#

@gritty wind this might be a good one for you ^^

gritty wind
#

Oh hi

worn swallow
gritty wind
#

It isn't installable

#

I'm assuming you ran pip install bot or similar?

worn swallow
#

yes, pip install bot

gritty wind
#

It isn't packaged onto pypi. If you want to use it, clone it from source, or use the docker container I publish

worn swallow
#

In the file log.py there is a from bot import constants, I tried pip install bot.constants but I kinda knew that wouldnt work cause I assume pip would think bot.constants is a single module

gritty wind
#

Which would you prefer?

#

bot is just the name of the folder that houses the code

#

if you run python -m bot it will work

worn swallow
#

Cloning it from the source sounds less confusing, I'll try that

gritty wind
#

(Assuming you installed the other dependencies)

worn swallow
#

I'll try πŸ˜…

gritty wind
#

I don't have instructions for it, because it was never an official project. Just something I spun up for a little while and forgot to take down

#

The general process is though:

pip install poetry
git clone https://github.com/HassanAbouelela/evalbot/
cd evalbot
poetry install
poetry run python -m bot
#

(poetry is a package manager which installs the other dependencies for you)

worn swallow
#

poetry oh I had trouble with poetry in the past

#

couldnt tell you why though

#

I will try this

gritty wind
#

Give it a shot now, if it still gives you trouble, you can still manually install all the dependencies

worn swallow
#

progress has been made, I'm just told now that ModuleNotFoundError: No module named 'aiohttp' so I'll be installing modules for now

gritty wind
#

At which step do you get that error?

worn swallow
#

last step, poetry run python -m bot

#

Am I safe to just install the required modules with pip?

gritty wind
#

Hm, did the poetry install throw any errors?

#

Yeah

worn swallow
#

actually no, poetry install ran just fine

#

Actually, I'm looking over it now

#

there's a lot of JSONDecodeError in red font, bold

#

This might help,

#
β€’ Installing idna (3.2)
  β€’ Installing mccabe (0.6.1)
  β€’ Installing multidict (5.1.0)
  β€’ Installing pycodestyle (2.7.0)
  β€’ Installing pyflakes (2.3.1)
  β€’ Installing async-timeout (3.0.1): Pending...
  β€’ Installing attrs (21.2.0): Failed
#

The first 5 dependencies installed, async-timeout is stuck on pending and attrs failed

#

The poetry install finished executing I just still have this Pending... next to async-timeout

gritty wind
#

Ironic considering the module name

#

I'm a bit preoccupied rn, but I can get back to you in 10 minutes or so

worn swallow
#

yeah of course, no rush πŸ™‚

#

just @ me whenever you're back

atomic ivy
#

@worn swallow, the JSONDecodeErrors could be because of the Python version

worn swallow
#

vscode is using python3, I checked the version

#

Python 3.9.7

atomic ivy
#

hmm. I got the same error with 3.10, but not with 3.9.7

cold island
#

Check which version poetry uses

worn swallow
#

I'm not sure how to check this myself but I searched it up: Poetry requires Python 2.7 or 3.5+

#

poetry --version outputs Poetry version 1.1.11

atomic ivy
#

what does poetry env list print?

worn swallow
#
  RuntimeError

  Poetry could not find a pyproject.toml file in /home/stivens or its parents

  at .local/lib/python3.9/site-packages/poetry/core/factory.py:369 in locate
      365β”‚             if poetry_file.exists():
      366β”‚                 return poetry_file
      367β”‚ 
      368β”‚         else:
    β†’ 369β”‚             raise RuntimeError(
      370β”‚                 "Poetry could not find a pyproject.toml file in {} or its parents".format(
      371β”‚                     cwd
      372β”‚                 )
      373β”‚             )
#

Am i just an idiot or what

#

I was supposed to do that in the evalbot folder, right..?

atomic ivy
#

yep

worn swallow
#

Sorry, i only managed to get 5 hours of sleep today and am running on a tasty cup of java

#

evalbot-dJNuoo1j-py3.9 (Activated)

#

Is the output

atomic ivy
#

so it is actually Python 3.9, weird.

dim pelican
#

Thats how it is defined in the pyproject.toml

stable mountainBOT
#

pyproject.toml lines 8 to 9

[tool.poetry.dependencies]
python = "3.9.*"```
gritty wind
#

poetry run python -VVVV

worn swallow
#
[GCC 11.2.0]```
gritty wind
#

Hmm, should be right, I'm still busy rn, but I have it in the back of my mind

fallen patrol
#

@worn swallow reinstall poetry using pipx πŸ’€

#

There's too many issues with poetry's own installer

#

It creates its own venv and manages it when using the installer

#

Ofc every update breaks that venv

worn swallow
#

to reinstall I suppose I must delete my current version of poetry?

fallen patrol
#

Yeah

worn swallow
#

Through apt remove and apt purge?

fallen patrol
#

How did you install poetry?

worn swallow
#

yess pip but I do not know the command for removing

#

uninstall ok

fallen patrol
#

Ahhh, interesting

#

I'm also too tired for this

worn swallow
#
  installed package poetry 1.1.11, Python 3.9.7
  These apps are now globally available
    - poetry
done! ✨ 🌟 ✨
``` ....pretty πŸ™‚
#

lol same I'm just procrastinating while I drink my coffee

#

I'm unsure what bot is in import bot, but it's also the name of the directory inside evalbot , evalbot contains everything from github

gritty wind
#

It is the bot folder, it's how python modules work

#

What step are you at now

worn swallow
#

I reinstalled poetry using pipx as suggested and ran poetry run python -m bot

gritty wind
#

Did you run poetry install?

#

(Also did you get rid of the old virtual environment)

worn swallow
#

Yes, and this time nothing failed I dont think. Let me check

gritty wind
#

Ok, nice

#

What's the output of the run

worn swallow
#

I wont copy and paste the poetry install but there were no fails

worn swallow
#

since when was there a virtual environment

#

what is going on, why so much chaos

#

such difficult questions

gritty wind
#

haha

#

what's up

worn swallow
#

idk if im perfectly honest, poetry run python -m bot still tells me there is no module named bot and I have no Idea when this vitrual environment came into play

gritty wind
#

Which folder are you currently in

worn swallow
#

/home/stivens/.cache/pypoetry/virtualenvs/evalbot-c3UWB7ZP-py3.9/bin/python: No module named bot

#

I ran this inside the bot folder through vscode and I feel even more like an idiot the more I type

#

But I will still take it like a gentleman

gritty wind
#

You need to run the commands in the folder that has the pyproject.toml file

#

It comes with experience

dim pelican
#

Should be from a command line / terminal, from the evalbot directory. Just gotta cd to the right folder location that you cloned

worn swallow
#

Oh my gosh we have progressss

#

So I created a 2nd folder for evalbot because I was messing around with the fist one I cloned - my only error now is that BOT_TOKEN is not defined but this is jsut something I forgot to do in the 2nd folder

slow steppe
#

Since there are plenty of seasonalify commands, such as .spookify for Halloween, shouldn't there also be a .christmasify command or something like that?

gritty wind
slow steppe
#

Sure

gritty wind
slow steppe
#

Wait do I need to follow the format for the issue?

gritty wind
#

I forget what the template is like

#

Probably just a couple sentences for description and reasoning

slow steppe
#

Alright

gritty wind
#

implm is optional, but it's basically just the same details as the other commands lol

dim pelican
#

It should be built in

worn swallow
#

Oh yes, this is a question that I wanted to ask about the environment variables

#

I have BOT_TOKEN set up, but I'm not sure what to put for the CHANNELS environment variable?

gritty wind
#

The IDs for the channels you want the bot to be enabled in. You can get that by right clicking on the channel name and selecting copy ID

worn swallow
#

Because I tried something like CHANNELS=[general,brainstorming] and I get ValueError: invalid literal for int() with base 10: '[general, so I thought perhaps I needed channel IDs separated by commas

#

there you go πŸ™‚

#

Thanks, thought I done something silly there

gritty wind
#

Tbh the documentation on the project is quite lacking, it was never intended to stick around as long as it did, or get used by anyone

dim pelican
gritty wind
#

Normally, yes, but for this project specifically, I want to kill it eventually, not keep it around. It's already going out of sync with our actual bot implementation.

worn swallow
#

It runs... It's alive! lemon_grimace

gritty wind
#

Maybe one day we could migrate the eval stuff out of the main bot, so people could actually use it for their own bots

#

I wonder if d.py has a nice way to do that

worn swallow
#

Thank you very much for your help everyone, couldn't have figured this out by myself πŸ™‚

gritty wind
#

It's alright, feel free to ping me if you run into any more problems

worn swallow
#

Will do

slow steppe
#

Just submitted an issue :)

gritty wind
#

thanks, approved

fallen patrol
#

see jihtsu or however you spell the name

#

but tldr to load it, bot.load_extension('jistaku')

molten perch
#

Hey! Could someone take a "quick" look at api#25? πŸ™ƒ

dusky shoreBOT
gritty wind
fallen patrol
#

(ping me when you have it :P)

gritty wind
#

my ide is being fucky

worn swallow
#

What should the default command prefix be for evalbot?

#

There is a section in main.py, when defining the bot, prefix=prefix, I was thinking of setting this to prefix="!" but I didnt want to tamper with the code again

gritty wind
#

You just need to set this in your environment settings

#

You can do something like:
VARIABLE_ONE=value VARIABLE_TWO=value poetry run python -m bot

#

Or you can use a .env file

worn swallow
#

I have a .env file with the bot token and channels

#

I assume there is a PREFIX variable too?

#

So I can set this to something like BOT_PREFIX=!?

gritty wind
# fallen patrol (ping me when you have it :P)

There are ~896 LOCs to get the bare minimum needed to run the bot. 115 more if you count the internal eval stuff. Of those, only half (408) are directly snekbox. The others are all utilities and other stuff that's also used in Python. If we were to use an extension, that's standalone, we'd have to duplicate half of the project in both repos

gritty wind
#

The readme has all the available variables and descriptions of them

gritty wind
#

i knew you'd be here πŸ™ƒ

#

not really, I just forgot

fallen patrol
#

;-;

molten perch
#

Nah, actually it's just two in overall. The rest is like adding default=True to the models and such πŸ˜‰

worn swallow
#

Is there another channel I should go to if I have anotehr question relating to evalbot, or can I ask here?

fallen patrol
#

just ask here

#

or go to scale's personal server 🀑

gritty wind
#

is that my DMs

fallen patrol
#

yes

gritty wind
#

nice

fallen patrol
#

ik, ik im the only member right now

worn swallow
#

The bot responds to !help but when I try !e or !eval I get Cannot connect to host snekbox.default.svc.cluster.local:80 ssl:default [Temporary failure in name resolution]

clever wraith
fallen patrol
#

ye, a snekbox also has to be running

gritty wind
worn swallow
#

more googling lemon_fingerguns

#

Nope, not yet

gritty wind
#

Well, it's a python discord project

fallen patrol
#

snexbox#1

gritty wind
#

So we can still help you lol

fallen patrol
#

idk how else to link it so fast

#

snekbox#1

dusky shoreBOT
fallen patrol
#

MAYBE if i spelled name correctly

gritty wind
#

For this one, I would actually recommend running in docker directly, setting it up locally is very difficult

#

Impossible on a lot of devices lol

gritty wind
worn swallow
#

Guess it's time to learn about docker

gritty wind
#

Luckily, there isn't much to learn

#

You just install it and run a command or two :D

worn swallow
#

I've seen explanations for what it does but I dont know how to use it or what it does lemon_fingerguns

#

interesting

#

For snekbox, should I git clone this into the same folder as my evalbot folder?

fallen patrol
gritty wind
fallen patrol
#

smh

gritty wind
worn swallow
#

if i dont need to clone it... what else can I do with it? πŸ˜…

gritty wind
fallen patrol
#

anyways, i need to go write some more tests,

worn swallow
#

I see, I'll try this

fallen patrol
#

i have like 30 more tests to write for this one file ;-;

#

at a minimum

gritty wind
#

Did you manage to install docker already?

#

That would be a world record I think

worn swallow
#

Just finished

gritty wind
#

well then, nice

worn swallow
#

docker run --ipc=none --privileged -p 8060:8060 ghcr.io/python-discord/snekbox in the same folder as evalbot I presume?

gritty wind
#

any folder is fine actually

clever wraith
worn swallow
#

Alrighty, I'll run it in evalbot just to be safe

clever wraith
#

They are the true shitposters

fallen patrol
#

more importantly, how would you glare

#

smh @green oriole stop sharing your thoughts with her πŸ’€

gritty wind
#

alts, many, many alts

fallen patrol
#

but also, he?!

#

smh

#

yes, i know

#

πŸ™ƒ

worn swallow
#

Oh boy

#

I still get the same Temporary Fail in Name Resolution error

green oriole
#

Not like I can, or at least want to

worn swallow
#

docker... image(? ) runs, I can send the output

gritty wind
#

what URL did you use for snekbox?

#

(in your env)

worn swallow
#

I ran

#

sudo docker run --ipc=none --privileged -p 8061:8061 ghcr.io/python-discord/snekbox

gritty wind
#

Provided you didn't see any errors, you shouldn't have any problems with that

#

but what's the URL you configured for the bot :)

dim pelican
worn swallow
#

Damn if only I knew lol, I'll try to find it oh that's an environment variable isnt it

#

i remember

#

here we go again πŸ™‚

gritty wind
#

For your case, it's most likely going to be something like http://localhost:8061/eval

worn swallow
#

so should I set SNEKBOX_URL=http://localhost:8061/eval or SNEKBOX_URL=ghcr.io/python-discord/snekbox?

#

2nd one, no?

gritty wind
#

In your env file, it would be the first one

#

It's basically telling the bot where snekbox is running on your PC

fallen patrol
worn swallow
#

Oh I see

#

I'm going to set up all environment variables listed on the github except the optional ones

gritty wind
#

haha that's a wise idea

worn swallow
#

PASTEBIN_URL can just be https://pastebin.com/ no?

gritty wind
#

so uh actually, I don't know if this is compatible with the pastebin API

#

We actually use our own hosted hastebin

#

which we call pastebin lol

gritty wind
#

you can use https://paste.pythondiscord.com/{key}, or any other hosted hastebin instance

fallen patrol
#

actually

gritty wind
fallen patrol
#

this is the original's new endpoint https://www.toptal.com/developers/hastebin

#

given this one deletes pastes after 7 days i would use it lol

#

pydis deletes after 3 months of no access

worn swallow
#

So I can use this toptal one you sent?

fallen patrol
#

hopefully πŸ˜“

gritty wind
#

make sure to add /{key} to the end of w/e you use

worn swallow
#

what is {key}?

gritty wind
#

it's a string template that gets replaced by the bot in certain places

#

"https://a.com/{key}.format(key="something") = "a.com/something"

fallen patrol
#

lol

#

I'm a developer @clever wraiththub where I develop software that helps developers develop software.

#

...

#

sorry random user

fallen patrol
worn swallow
fallen patrol
#

SyntaxError: Unclosed String literal on line 1

worn swallow
#

Oh shit i get what you mean about string template

#

Slowest progress ive made in my entire life but we move

fallen patrol
#

.bonk @gritty wind

#

...

gritty wind
#

Damn your like my IDE. Complaining about unfinished code

#

Thanks

#

I coulllldd share my own .env lol

worn swallow
#

please

gritty wind
#

Actually, there isn't anything left that's reusable for your case

fallen patrol