#dev-contrib

1 messages Ā· Page 6 of 1

surreal veldt
#

I check with git status and stage with git add right?

static canyon
#

Sounds about right, yeah

#

Again, I just use pycharm ui to do the commands for me 🤷

#

It'll also error when checking out to a different branch if there's uncommited (and unstashed) changes iirc

surreal veldt
#

yeah, just got this error ```
PS C:\Users\tenuk\sir-lancebot> git checkout main
error: Your local changes to the following files would be overwritten by checkout:
bot/exts/utilities/bookmark.py
Please commit your changes or stash them before you switch branches.
Aborting

static canyon
#

Yeah

#

So the correct think to do here is I believe stash things

#

But I always commit and then rebase to drop the commit

#

Since I don't know how to stash 😬

surreal veldt
#

doesn't git add do the commit changes?

cold island
#

It adds them to the staging area

#

git commit then commits whatever is in that area

surreal veldt
#

so if I want to checkout to main and do git pull, do I do git commit in the branch i'm in?

static canyon
#

(usually git commit -m "commit message")

static canyon
cold island
#

If you don't want to commit you can stash yeah. I'd avoid stashing before a merge because then unstashing might cause its own conflict and that's just a mess of its own

#

If you just want to change branches then yeah you can stash, and then unstash when you come back

static canyon
#

So git add then git commit -m "Temporary Commit" or something

cold island
#

yeah I'd personally commit whatever you have and then amend that later

surreal veldt
#

and unfortunately..i used the black formatter but flake8 doesn't complain much. is it okay?

static canyon
#

It's fine for now

#

We can sort that out later

#

Or

#

Have you committed yet?

#

If not we can setup the pre-commit stuff

fossil veldt
#

You can run flake8 and isort, since those are the ones used by CI checks. Or just do the poetry run lint.

cold island
#

flake8 won't complain about code formatted with black, but... did you format your changes specifically?

surreal veldt
#

the whole file. On VSCODE, I had it enabled for using the black formatter on the current file when I save it

static canyon
#

Then you'll have to do undo that lemon_sweat

fossil veldt
static canyon
surreal veldt
# static canyon Or

i'm waiting for a response on sir-lancebot#932 before doing the second commit. I made a PR already (or were you talking about the temporary commit?)

static canyon
#

If you have already done it no big deal

surreal veldt
#

when I switched to main and did git pull, it looks like it copied the changes from the other branch i had

static canyon
surreal veldt
#

no 6f860961 (HEAD -> main, origin/main, origin/HEAD) Fix lint issues b8badc81 Use buttons for allowing others to receive a bookmark b63cc91e Empty commit for CI a7624603 Add jokes command (#1081) c812b610 Fix incorrect type hints (#1073) 195a2438 Bump lxml from 4.7.1 to 4.9.1 (#1068) b55e6439 Bump pycares from 4.1.2 to 4.2.0 (#1067) 1cd363ee Update .uwu to work with replies (#1070) 26cfbe1e Merge pull request #1066 from python-discord/ichard26/remove-redundant-space-in-alias-help 53a5b323 Help: remove redundant space in subcommand aliases c245348a RealPython home page displayed on no user search. (#1063) ce55771d Merge pull request #1058 from PH-KDX/patch-1 db1e80d2 Merge branch 'main' into patch-1

static canyon
#

Then it hasn't got the changes from your branches presumably

cold island
#

sec

static canyon
#

The bookmark stuff is probably from the PR that was just merged

cold island
#

On your fork, are you developing on the main branch?

surreal veldt
#

nope

#

when I did git pull on main, it just copied what I had from by bookmark branch to main

timid sentinel
#

What does this mean when running docker-compose up?

ERROR: Service "snekbox" was pulled in as a dependency of service "bot" but is not enabled by the active profiles. You may fix this by adding a common profile to "snekbox" and "bot".
cold island
#

What do you get for git remote -v?

surreal veldt
#

What if I try to get the updates from github itself. I made a clone of the folder so it's okay if code gets messed up

#
origin  https://github.com/Diabolical5777/sir-lancebot.git (fetch)
origin  https://github.com/Diabolical5777/sir-lancebot.git (push)```
vale ibex
#

We changed it up recently, so that the 3.11-dev image is the default

cold island
surreal veldt
#

i need to press the sync fork button right?

cold island
#

Sounds right? I don't use the github UI for this šŸ˜…

#

@fossil veldt merged šŸŽ‰

fossil veldt
surreal veldt
#

and..after doing sync fork i did git pull and messed the file..yikes

#

I have some >>>>>>> 950a7fb290fe4e8acfab33847d3f2edaec421d93 lines scattered between lines

vale ibex
#

!mute @cold island 2h lets test the new feature!

stable mountainBOT
#

:incoming_envelope: :ok_hand: applied mute to @cold island until <t:1660944260:f> (1 hour and 59 minutes).

cold island
#

Testing in prod smh

fossil veldt
#

Eh

vale ibex
fossil veldt
#

Oh is it not deployed yet

vale ibex
#

ah lol

cold island
#

This is likely because your local main has your changes

surreal veldt
#

i'll just make a new repo so the changes are there

vale ibex
cold island
surreal veldt
#

but if i make a new one, the new code will be there

cold island
#

His local main has his changes from another branch

vale ibex
#

there are merge conflicts because the same file has bene changed, and git is asking you which change you want to keep

fossil veldt
#

!help ban

stable mountainBOT
#
Command Help

!ban <user> [duration_or_expiry=None] [reason=None]
You cannot run this command.

*Permanently ban a user for the given reason and stop watching them with Big Brother.

If a duration is specified, it temporarily bans the user for the given duration. Alternatively, an ISO 8601 timestamp representing the expiry time can be provided for duration_or_expiry.*

fossil veldt
#

Alright it's live now I guess

vale ibex
#

!mute @vocal wolf 4h thanks

stable mountainBOT
#

:x: According to my records, this user already has a mute infraction. See infraction #68435.

fossil veldt
#

Lol

vocal wolf
#

thanks

vale ibex
#

!mute @timid sentinel 4h thanks

stable mountainBOT
#

:incoming_envelope: :ok_hand: applied mute to @timid sentinel until <t:1660951622:f> (4 hours).

vale ibex
#

Nice

timid sentinel
#

Damn that's neat

#

For both meanings of the word

surreal veldt
#

sorry but can I bump sir-lancebot#932 so that I can PR it?

vale ibex
#

it already seems approved?

surreal veldt
#

the last comment

vale ibex
#

oh

timid sentinel
vale ibex
#

I thought I already said that sounded fine?

#

didn't realise you were waiting for it still

vale ibex
timid sentinel
#

Yeah

vale ibex
#

cool cool

#

if you want 3.10 too, you can do --profile 3.10

#

in your docker command

fossil veldt
#

Uh

#

What's up with this merge?

#

It's showing +0 -0 ?

vale ibex
#

github having issues

#

it's not merged

#

the fork was reset

fossil veldt
#

What on earth

#

Is this just gh mobile being 🄓

vale ibex
#

yea github also thinks main was forcepushed too šŸ˜…

#

we cna just ignore it

fossil veldt
#

I was wondering why that issue wasn't auto closed since the PR was merged

#

Then followed the PR link into that šŸ™ƒ

surreal veldt
#

how does the unbookmark command work? I invoke it in DM's replying to a bookmark embed sent by the bot?

static canyon
#

.help unbm

#

Welp

surreal veldt
#

So...what's the point exactly of it?

static canyon
#

To declutter the dms ig

#

Get rid of old bookmarks that you don't care about anymore

surreal veldt
#

are PR's tested by a sir lancebot clone before being merged?

static canyon
#

People clone your PR and then run it on their own bot (in a separate server)

austere hornet
#

Would anyone like to take over working on sir-lancebot#985 for me? I'm soon not gonna have a lot of time to work on it due to school starting soon for me so it would be nice if someone could take over for me. I have started working on it earlier so I recommend you continue working off of the code that I have written thus far -- you can view it here: https://github.com/DMFriends/sir-lancebot/tree/sudoku-take-3/bot/exts/fun/sudoku
Thanks!!

dusky shoreBOT
fossil veldt
#

Also anyone know what's up with the current skipped test in bot?

#

Do we have a plan to make that work or remove it? pithink

torpid crescent
#

Thought you should know about this unique specimen

#

I don't think it's supposed to send 4 messages

#

Reproducible in this channel too

fallen patrol
#

ah

#

.close

#

lmao how does that occur

static canyon
#

sir-lancebot#1090

dusky shoreBOT
static canyon
#

The issue is that for invalid commands, it'll look for similar commands and then for each of the similar commands see if the user can run them before recommending.

However, there was a bug in the PR that added this which wasn't caught in that we forward any errors the command.can_check raises, but in reality we want to suppress any exceptions and move to the next command to see if that one can be run

#

Cc @fallen patrol if you're interested

fallen patrol
#

not interested, sorry

#

but thank you tho

fossil veldt
#

....is this still broken

#

.close

fossil veldt
static canyon
#

E.g. .ha causes it because it goes for the different hacktober commands, which can only be run Sep-Nov

#

.ha

fossil veldt
#

oh wait what

#

I thought that only searches for commands

#

it attempts to run them as well?

static canyon
#

Yeah

#

That's how command.can_run works

#

It runs all the checks

fossil veldt
#

oh it...

#

huh

static canyon
#

(it doesn't try to run the command, it just runs the checks)

fossil veldt
#

but...

#

isn't it catching CommandError from can_run?

static canyon
#

Yes

fossil veldt
#

how is it sending a ctx message?

static canyon
#

But the issue is that we then pass the catched error to on_command_error (which sends the ctx message)

#

Which we shouldn't

#

It's all better detailed in the issue

static canyon
fossil veldt
#

right...

#

why was it passed to on_command_error in the first place?

static canyon
#

🤷

fossil veldt
#

does it do something we need?

static canyon
#

Note that prior to #1064 we called on_command_error so removing the call may break other parts of the bot that call this function (would have to check to see what's best implementation wise).
From the issue

#

No clue if we care or not

#

(Also the isn't hasn't been approved yet, so you shouldn't be assigning yourself/anyone) @fossil veldt

fossil veldt
#

oh

#

uh

#

fk I made a branch as well

#

šŸ™ƒ

static canyon
#

lol

#

It's probably fine, but for now I wouldn't work on it until it's approved

fossil veldt
#

I'll leave it there I guess

#

but I assume we want to fix it? Behavior clearly broken

static canyon
#

Yeah, but there may be a different approach wanted etc.

fossil veldt
#

well here's the diff for 1064

#

I guess... we used to call if not cmd.hidden?

#

is that maybe allowing some extra commands into the final stage

static canyon
#

Nah I doubt it

fossil veldt
#

hm..

static canyon
#

!d discord.ext.commands.Command.hidden

stable mountainBOT
fossil veldt
#

ah well

#

we used to return after the error

#

now we continue

#

I guess maybe it was broken before but just happened once only

#

so nobody noticed it

static canyon
#

Yeah I guess

fossil veldt
#

oh it also self deletes right

#

no evidence šŸ˜‚

static canyon
#

Or maybe it was wanted then but not anymore (seems unlikely though)

fossil veldt
#

when lancebot unit tests šŸ‘€

fossil veldt
#

Though honestly should we add some tests for at least the core functions of lancebot?

#

I get the more external utils and fun cogs should have a low level of entry for contrib but as it grows issues like this will be harder to test and reviews is gonna take longer.

gritty wind
#

We’ve historically had a very bad time with tests for d.py bots, we don’t have a good strategy for them to keep them easy to understand for people who aren’t familiar with testing

#

99% of our test code is just mocking stuff because we can’t do network requests

fossil veldt
#

I mean. Yeah that's fair I guess

static canyon
static canyon
# dusky shore

@gritty wind if you're able to give it a check, can we get an approval on this?

gritty wind
#

Part of the issue process is discussing an approach if we think it’s necessary

#

I don’t have a PC on hand, so I can’t look into the possible approaches

static canyon
#

Right, fair enough

#

For reference, I'd say there's three approaches:

  • leave as it is (which I don't think is the move given that 2 people have separately reported this behaviour as buggy)
  • return instead of continue (go back to behaviour before #1064)
  • remove the call to on_command_error, which imo is a bug and shouldn't be there
fallen patrol
fossil veldt
static canyon
fossil veldt
#

I mean that's reasonable for not spamming a bunch of errors on missing commands

static canyon
#

!e

stable mountainBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

static canyon
#

I mean @stable mountain doesn't but 🤷

fossil veldt
#

.uwu

dusky shoreBOT
#
I can't believe you've done this

Your input was invalid: Your message must have content or you must reply to a message.

Usage:```
.uwu [text]

fallen patrol
#

it may be a good concept but the execution is confusing

fossil veldt
#

Does this one not self delete

#

Huh

fossil veldt
dusky shoreBOT
#
i can't b-bewieve you've d-donye this

youw input was invawid: youw message must have content o-ow you m-must w-wepwy t-to a message.

usage:```
.uwu [text]

fallen patrol
#

there's not much consistency between @dusky shore and @stable mountain or even within themselves (at least with this)

fossil veldt
#

I don't know the history fully though

fallen patrol
#

i feel like the help and errors should probably be somewhat consistent between the two but its not mine to call

static canyon
fallen patrol
#

just leads to a confusing user experience

static canyon
#

And it's after 7.5 secs

fossil veldt
#

Ah

fallen patrol
#

meanwhile python deletes help, cooldown, check, invoking, and more messages etc

fossil veldt
#

I honestly don't see a path where raising the error from the fuzzy check is useful in any way so far

fallen patrol
#

sometimes the trashcan deletes the invoking message, sometimes it doesn't

#

its just all very uneven

fossil veldt
#

Oh yeah I've noticed any reaction deletes the message?

#

Not just the bin

#

!eval

stable mountainBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

static canyon
#

Any reaction based deletions use the wait_for_deletion util iirc

#

Which should check the reaction being added matches

fallen patrol
#

why don't they use components 🄲

fossil veldt
#

I wouldn't really do a delete component

#

That's a lot of vertical space on a lot of messages

static canyon
#

I've also realised this issue & corresponding PR should probably be moved to bot-core, seeing as the util applies to both @stable mountain and @dusky shore

gritty wind
#

We’ve been struggling to move a lot of the shared cogs into bot-core for a while

#

We can’t agree on a way of sharing constants

static canyon
#

Right

#

I mean do we need constants here?

gritty wind
#

There are portions that do, for instance the error message says go to x channel

static canyon
#

Right

gritty wind
#

That’s a part of the constants

#

But it also applies a lot more to some of the other dogs

fallen patrol
gritty wind
#

Which check roles and whatever

static canyon
gritty wind
#

Or #bot-commands

stable mountainBOT
#

bot/exts/backend/error_handler.py line 238

await ctx.send(embed=e, delete_after=10.0)```
static canyon
#

🤷

gritty wind
#

I’m referring to the rest of the error handler

static canyon
#

Right, but can we not just extract this part?

#

I mean I can see that maybe we wouldn't want to have handling in different places

fallen patrol
#

one of these is a lot easier to see and appears instantly

gritty wind
#

Yes we can, is it used in bot?

fallen patrol
#

using buttons is about 1.25 seconds faster than using reactions for a paginator

static canyon
# gritty wind Yes we can, is it used in bot?

This specific function is in bot and sir-lancebot, with a couple minor differences (a return vs continue upon a command not being runnable, lancebot not checking cmd.hidden, etc)

gritty wind
#

ā€œOh I think this looks worseā€
ā€œNo, you’re wrongā€

fallen patrol
#

buttons: appear instantly
reactions: take at least 1.25 seconds to fully appear for a paginator

gritty wind
#

I think a 1.5 second improvement is not really noteworthy here

#

It’s nice if we can have it, but not if we sacrifice something else

hoary haven
#

we're not decided against buttons are we? i would welcome them on infraction search embeds

fallen patrol
gritty wind
brazen charm
#

while their bigger size sucks, I'd prefer buttons as the bot's a bit limited with reactions disabled

#

I suppose you can't do one of those single user only messages from a normal text command?

split compass
#

Nope

#

Buttons allow ephemeral responses, show up immediately and don't use extra API requests unlike reactions

#

They can also be disabled

austere hornet
#

I think for the bookmark command, instead of saying "Bookmark", put the link to the original message and delete it from the bottom of the embed, like so:
What do y'all think?

fossil veldt
#

if you provide a title it uses that

austere hornet
#

Ohhh right

#

Nvm then

timid sentinel
#

Am I right in thinking discord only resolves mentions that ping?

#

working on bot#1917 and wondering if it's possible to make the user mentions show properly without pinging the user

dusky shoreBOT
fossil veldt
#

Like converts the ID to name?

timid sentinel
#

yeah, so it doesn't look like most of these

fossil veldt
#

hm..

timid sentinel
#

A normal text message with allowed mentions set to not mention doesn't seem to work either

fossil veldt
#

this works though?

#

I can ping someone outside of the channel at least on client

#

!raw 1010587895251337297

stable mountainBOT
#
== Raw message ==

@brave ether
gritty wind
#

I think it’s just cache

timid sentinel
#

Yeah, I guess if they aren't cached pinging the users makes discord get them then? Otherwise it doesn't try

#

Maybe if there's another way of making them cached, I guess if the roles were shown in the member list there's a higher chance?

gritty wind
#

It’s your cache, not boy cache

timid sentinel
#

yeah

fossil veldt
#

I wonder if it's because of the deprecated exclamation point mention flag

gritty wind
#

We’ve had it for a long time in mod commands, there’s no good fix

#

However

#

It’s probably fine to just show the name here instead of a mention

timid sentinel
fossil veldt
#

hm...

timid sentinel
fossil veldt
#

is that in this server?

#

or in the test one

timid sentinel
#

in this one

fossil veldt
#

huh

#

is it only people not in the channel who are IDs?

#

if it's caching issues it should at least fix itself pretty quickly

timid sentinel
#

I'll send it here, one sec

fossil veldt
#

looks like this case it's broken continuously

timid sentinel
#

!int e

import discord
from bot import constants

PATREON_TIERS: list[tuple[int, int]] = [
    (3, 743400204367036520),
    (2, 743399725914390631),
    (1, 505040943800516611),
]
def get_patreon_tier(member: discord.Member) -> int:
    for tier, role_id in PATREON_TIERS:
        if any(role_id == role.id for role in member.roles):
            return tier
    return 0

guild = self.bot.get_guild(constants.Guild.id)

embed_list = []
for tier, role_id in PATREON_TIERS:
    role = guild.get_role(role_id)

    # Filter out any members where this is not their highest tier.
    patrons = [member for member in role.members if get_patreon_tier(member) == tier]
    patron_names = [f"{patron.mention} ({patron.name}#{patron.discriminator})" for patron in patrons]

    embed = discord.Embed(
        title=f"{role.name}",
        description="\n".join(patron_names),
        colour=role.colour
    )
    embed_list.append(embed)

main_embed = discord.Embed(
    title="Patreon Supporters",
    description=(
        "Thank you to the users listed below who are already supporting us!"
    ),
)

await ctx.send(embeds=(main_embed, *embed_list))
stable mountainBOT
#
Patreon Supporters

Thank you to the users listed below who are already supporting us!

Patreon III

@hoary haven (mina✯✩✯#0001)
@woven moss (l’éclisse#7776)
@wispy goblet (CK#2121)
@tranquil topaz (eivl#1134)

Patreon II

@boreal arrow (UltimateChaos#8390)
@silent wing (Monterey#8302)

Patreon I

@rustic zephyr (Network2501#0932)
@bronze sand (doodspav#4727)
@strong knoll (Kanin#0001)
@plain portal (Moros#0741)
@kind compass (DraĆ­ocht i mo chroĆ­#3333)
@haughty citrus (Refisio#9732)
@fossil veldt (ionite#7700)
@blazing magnet (Fisher#0060)
@severe hearth (Achlys#0227)
@mellow trench (BrainDead#6105)
@paper robin (Deleted User bf9c8f73#3065)
@vocal wolf (Xithrius#1318)
@spice gorge (Pythonic#6090)

#
In [4]: import discord
   ...: from bot import constants
   ...: PATREON_TIERS: list[tuple[int, int]] = [
   ...:     (3, 743400204367036520),
   ...:     (2, 743399725914390631),
   ...:     (1, 505040943800516611),
   ...: ]
   ...: def get_patreon_tier(member: discord.Member) -> int:
   ...:     for tier, role_id in PATREON_TIERS:
   ...:         if any(role_id == role.id for role in member.roles):
   ...:             return tier
   ...:     return 0
   ...: guild = self.bot.get_guild(constants.Guild.id)
   ...: embed_list = []
   ...: for tier, role_id in PATREON_TIERS:
```... response truncated; full contents at https://paste.pythondiscord.com/eyinixagis.py
fossil veldt
#

hm..

#

are those people not in the server?

#

@strong knoll@kind compass

#

oops

#

sorry about that

timid sentinel
#

:P

fossil veldt
#

so it's just...

#

random?

timid sentinel
#

not quite, if they're in your cache you'll see them shown properly

#

so for example with the two you pinged they should now show in the embed

fossil veldt
#

very strange

strong knoll
#

e

#

If a user isn't in your local cache their mention won't display properly

#

Once they're added it updates

fossil veldt
#

Canary doesn't seem to be different

#

I think with normal messages when the cache resolves the name does as well

#

but with embeds apparently it stays forever?

gritty wind
#

Try refreshing?

vocal prairie
#

Can we un-italicize the docstring in a !help <command>? I feel like it makes it harder to read for no reason.

austere hornet
#

Yeah I agree ^ although I wouldn't say it's harder to read personally, it just doesn't look good imo

fossil veldt
#

!help eval

stable mountainBOT
#
Command Help

!eval [python_version] <code, ...>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.

By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

fossil veldt
#

hm...

fading galleon
thorny obsidian
#

Why are we getting lance spitting out multiple error messages with one "command"?

#

Ah, I see the lance issue now

gritty wind
#

Site 3.10 is now ready, but blocked on site#768

dusky shoreBOT
gritty wind
#

Both pretty simple PRs, the one above is like 3 changes

vale ibex
#

but it's not available on pypi yet

#

tylerwince/flake8-bandit#25

dusky shoreBOT
fossil veldt
#

Been asking them to release, they haven't made a pypi release in 3 years.

#

The GitHub version is a major version and a half over the pypi one

vale ibex
#

A fairly minimal code diff, but the bump to 3.10 and stable 2.0 should warrant some testing metricity#27

vale ibex
#

I've done my own testing and it seems to be alright.

#

This is a very small PR that is very low risk king-arthur#17

vale ibex
#

(The high risk ones are coming, don't worry)

austere hornet
#

Could a core dev please take a look at sir-lancebot#1000 and maybe approve? Thanks!

dusky shoreBOT
gritty wind
#

I've finally figured out why my tests broke after updating pycharm

#

The plugin I use for loading the .env file is broken, and pycharm hasn't managed to add it in 11 years :D

#

I know someone here has jetbrains contacts, can we have it please? 🄺

austere hornet
gritty wind
#

Thanks

#

There’s a ticket open already, it just needs someone to push it

surreal veldt
austere hornet
fossil veldt
#

Can bot#2244 potentially be approved as a lance bot feature (invoke only without monitoring) since that might fit the scope more?

dusky shoreBOT
sweet glacier
#

Hello can someone help me run the @stable mountain bot on dedicated server that I hosted on pterodactyl

fossil veldt
#

That lists how to get it running with docker I guess

#

Though it will require you to host the site and other things as well, it's not really that general purpose

sweet glacier
#

thanks

sweet glacier
#

Hello

#

can someone tell me how to host the bot locally

#

Im using Vs code

#

Please do turn the mention on while replying šŸ™

vale ibex
sweet glacier
#

It says I can't find the module botcore

#

I did pip install botcore

#

and it installed it

#

Still it shows the same error

#

I had pip installed other modules like discord too

vale ibex
#

Did you use poetry to install the dependencies?

sweet glacier
#

how do I do it?

#

I typed pip install modulename

vale ibex
#

It's under "Setting up a development environment" section in the guide.

sweet glacier
#

Ok one sec lemme try

gritty wind
#

If you’re not interested in developing the bot, you’ll have a much better time extracting the functionality you want into a separate bot

#

@stable mountain is a very bespoke project with a very intensive setup required

static canyon
#

So if I'm understanding this correctly @cold island, for the re-run part of sir-lancebot#1062, we want:

  • A PR on bot-core adding the util (invocation -> response -> edit invocation -> reaction -> return new content or None)
  • A PR on bot removing the snekbox util that does this and replacing with the new bot-core util
  • A PR on sir-lancebot adding re-run functionality to .latex, using the bot-core util

And then another PR for the interaction part of #1062 (adding āŒ to delete etc.)

Does this sound right?

dusky shoreBOT
cold island
#

I guess so. My one worry is that it might make the re-eval functionality less configurable if we ever want to change it

static canyon
#

Right, yeah

#

I mean I don't see us ever changing the functionality for one and not the other (changing eval but not latex and vice-versa)

#

So I don't think it's an issue personally

#

I don't see any reason for having them independent of each other (as in, I don't think we'll ever want the functionalities different)

gritty wind
#

Yup it’s because discord has wonky behavior for invites

#

Check the security advisory

#

Iirc a TL;DR example is included

cold island
#

mm where do I find it

#

found it

gritty wind
#

I vote to ignore it

#

What we have now is pretty conservative to account for discord doing whatever they want in terms of implementation

cold island
#

After playing with it some more it looks like it only works with a question mark

#

With other characters it continues parsing the invite code

#

We could just make it look at the last /[characters] before a whitespace or a question mark

#

since that's what Discord does it seems

gritty wind
#

The behavior is not consistent on different platforms

#

It might only parse x on PC and iOS, and do y on android

#

Iirc that was the way it was split up

cold island
#

hmm the question mark seems to work the same on Android

gritty wind
#

In terms of which server it links to?

cold island
#

yeah

#

it stops parsing at the question mark

#

as if it's a space

surreal veldt
#

Why are you not allowed to send a .txt file?
Edit: I think I should have used #community-meta, my bad

static canyon
#

At least I believe that was the reasoning

surreal veldt
vale ibex
#

You wouldn't expect by uploading a file, it would be deleted and then reuploaded to a 3rd party service, without your consent

#

we also don't have a way for users to delete their own pastes.

sweet glacier
gritty wind
#

When installing poetry, you can install it anywhere as long as it’s in your system’s python install

#

When running poetry install, that’ll be in the bot project’s folder

sweet glacier
#

what should I do next?

gritty wind
#

What happened when you ran it?

sweet glacier
#

I did poetry install

#

It shows this

#

How do I run it now?

gritty wind
#

If you’ve followed the setup guide and have your environment and server variables set up, you can run poetry run task start

sweet glacier
#

Ok

gritty wind
#

What do you have in there?

#

And what do you have in your config file under the bot token section

sweet glacier
gritty wind
#

That looks correct, what about the config?

sweet glacier
#

I used the alternate config file provided in the guide

gritty wind
#

It’s nested as fields, so it’ll be a field called token under a section called bot

sweet glacier
#

Uhh I cant seem to find it

gritty wind
#

Not necessarily in the config file, it combines both

#

It does appear however to have not found it in either

#

Try adding it to the config just in case

#

It looks like:

#

token: !ENV "BOT_TOKEN"

sweet glacier
#

ok

gritty wind
#

You can put it right under the prefix key in the screenshot

sweet glacier
#

and add bot token inside the inverted commas - ""?

gritty wind
#

Nah just what it looks like above

#

It’ll read it from the .env file

sweet glacier
#

Oke

#

OKE

sweet glacier
#

Should I delete the old defualt-config.yml?

gritty wind
#

That has to stay

#

I have to run right now, but hopefully people will be coming online soon

#

Otherwise I can help later today

sweet glacier
#

I have both of them

sweet glacier
#

šŸ‘

#

@gritty wind Btw I found what was causing the issue, I had accidently placed the .env file in bot folder instead of the main project folder. but now I have another issue.

gritty wind
sweet glacier
#

How do I do that?

gritty wind
#

You can do all that with docker compose up provided you have docker

gritty wind
#

You don’t have docker installed

#

Since you’re on windows, go to the docker website and install ā€œdocker desktopā€

#

It should have all you need to start with docker

sweet glacier
#

ok

sweet glacier
#

@gritty wind I downloaded docker

#

what now?

gritty wind
# sweet glacier what now?

Make sure it started (you’ll see a docker desktop application in your taskbar), then in the project folder run docker compose up -d

#

This will start the bot as well, provided the configuration is set for docker. If you don’t want that, you can stop the bot-bot_1 container from the docker desktop application

sweet glacier
#

it says docker desktop stopped

#

in the taskbar

gritty wind
#

Have you followed the steps linked there to update WSL?

#

It should be a few commands to copy pasta

sweet glacier
#

I did upto this

#

and downloaded ubuntu 20.04

gritty wind
#

Oh great, restart your PC and docker should work

sweet glacier
#

then it says this

#

but when I opened ubuntu it says press any key to conitnue and it auto closes

#

nothing happens after that

gritty wind
#

How are you opening it

sweet glacier
gritty wind
#

Open cmd and type ubuntu instead

sweet glacier
#

ohk

gritty wind
#

You might need to restart your PC first

sweet glacier
#

tried powershell too

sweet glacier
gritty wind
#

Gl

sweet glacier
#

:/

gritty wind
#

Oh fun

#

Still nothing when you type ubuntu?

sweet glacier
#

lemme try that

#

nope

#

im dowloading a diff version

#

instead of downloading from appstore

sweet glacier
#

Ok I just found what the issue was about

#

I had to update wsl to wsl 2

#

aah yes

sweet glacier
#

@gritty wind "Could not connect to site API. Is it running?" it's showing the same in docker

gritty wind
#

You have to specifically set the environment variables for docker if you want to run the bot in docker

sweet glacier
#

I managed to reach this far

gritty wind
#

We just need the site and the other deps running, you can choose where to run the bot

gritty wind
#

In your config.yml, you'll want to set the url in the urls.site and bot.redis.host sections

#

For running the bot locally, it'll be something likelocalhost:8000, and for docker it'll be web:8000

#

That's for the site specifically

#

Redis would be localhost and redis for running locally and in docker respectively

#

There's also another one, snekbox, but that doesn't need to be set to start the bot, just to run !e

sweet glacier
#

I mainly need that

#

!e

gritty wind
#

I figured, like I said this is an insane amount of setup to get eval running

#

Instead check out

#

It takes the relevant code from the bot repository to make eval work

sweet glacier
#

ok :(

gritty wind
#

If you want to continue with the setup for bot, you can, it's just a matter of setting the correct variables for the links at this point

sweet glacier
#

How many people have done this before ?

gritty wind
#

Set up the bot in general, or set it up for snekbox?

sweet glacier
#

general

gritty wind
#

A lot, but most people tend to go through the guide šŸ˜…

#

There's ~150 contributors on the bot project

#

i.e people who've submitted code to be added

sweet glacier
#

oh

#

right?

gritty wind
#

Are you going to be running the bot in docker, or locally?

gritty wind
#

Yup, that's correct

sweet glacier
#

where do I find this ?bot.redis.host

gritty wind
#

Probably a few lines above the one in your screenshot

#

It's line 5 in the template on the site

sweet glacier
#

oke

#

what should I put?

#

should I keep it the way it is?

#

@gritty wind is the api issue caused because of this

#

I copied it from the guide

#

and put it on .env

gritty wind
#

No, that key is incorrect, and the error is unrelated

gritty wind
sweet glacier
#

key is incorrect?

gritty wind
#

Sorry, correct*

sweet glacier
#

what should I put then

#

Oh lol

gritty wind
#

Are you still getting the error when you run docker compose up -d?

sweet glacier
#

lemme try

sweet glacier
#

bot-1 always gets the error of api

gritty wind
#

That's because of the issue above, the API is not starting

sweet glacier
#

yes

gritty wind
#

Do you have something already running on that port?

sweet glacier
#

noo

#

I never did stuff like this lol

gritty wind
#

Alright, could you open the docker-compose.yml file?

sweet glacier
#

Oke

#

should I send the whole file?

gritty wind
#

Not unless you modified something in it

#

It should just match what's in the repo

sweet glacier
#

Should I delete it and reinstate it ?

gritty wind
#

Nope

#

Delete lines 26 through 30 of that file

#

Then run docker compose down followed by docker compose up -d --build

sweet glacier
#

that includes both 26 and 30right?

gritty wind
#

Yeah, it should look like:

    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U pysite"]
      interval: 2s
      timeout: 1s
      retries: 5
sweet glacier
#

Ok

gritty wind
#

This is the deleted portion

sweet glacier
#

done

gritty wind
#

Yup

sweet glacier
#

oh its removing those umm.. smthn

gritty wind
#

Yup, it'll delete the containers and recreate them, which should allow us to make sure things are still fine

sweet glacier
#

Oke

#

its building now (I ran docker compose up -d --build)

#

oh god this postgres is always unhealthy

#

but it's running

gritty wind
#

If you press the run button beside that web-1 container, does it turn green?

sweet glacier
#

one sec

#

yes

#

it's green

gritty wind
#

Right, now do that with the bot container

sweet glacier
#

its running

#

green

gritty wind
#

Great, the bot should now be live in the server you configured it for

sweet glacier
#

nope

#

web1 just auto restarted

gritty wind
#

Could you click into it and see what is written there?

sweet glacier
sweet glacier
#
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL:  database "metricity" does not exist```
gritty wind
#

Have you followed the section in the guide on setting up metricity?

sweet glacier
#

O_O

#

Let me check

gritty wind
#

You probably don't want metricity, it should have auto created those tables

#

Trying to figure out why it didn't

gritty wind
sweet glacier
gritty wind
#

Now run the site again

sweet glacier
#

Ill do it one by one

gritty wind
#

Check that it says everything is good in the logs

sweet glacier
#

first metricity

gritty wind
#

Yup

sweet glacier
#

then site

#

then bpt

gritty wind
#

Yup

#

Metricity will start then stop

#

That's intentional

sweet glacier
#

yeah it did stop before

#

Ill bb in 15 mins after my dinner

#

my mom's screaming at me ffs

#

😩

vale ibex
#

Could someone take a look at sir-lancebot#1094

dusky shoreBOT
spare plaza
#

or is there a active fault/issue with the bot? if so, could you link

cold island
#

Bots without the intent won't get message content anymore

spare plaza
#

alright, I'll stick that on the PR and approve it. so anybody viewing it can understand why

#

probs should have just googled it kek

vale ibex
#

This PR is just here because the other PR is large, and unlikely to be merged before end of the month

sweet glacier
#

@gritty wind the metricity one auto - exits

vale ibex
#

it's intentional. If you aren't working with metricity, it will just run the migrations and exit

#

of course, if instead there are error logs from that pod, do let us know

sweet glacier
#

what about this?

#

one sec

#

this^

vale ibex
#

that's saying it can't connect ot the site

#

is the web container running?

sweet glacier
#

it is

#

web 1 is running

vale ibex
#

are there any logs in it?

sweet glacier
#

which one?

#

web?

cold island
#

If it's running properly then it's probably the bot config

vale ibex
#

hat's what I thought, but the url looks fine, sine the bot log says it's trying to connect to web:8000

vale ibex
cold island
#

And it was started with docker compose?

stable mountainBOT
#

Hey @sweet glacier!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

sweet glacier
#

bruh I cant upload text file

vale ibex
#

read the message the bot sent.

sweet glacier
vale ibex
sweet glacier
#

2022-08-28 17:12:30 | discord.client | WARNING | PyNaCl is not installed, voice will NOT be supported
2022-08-28 17:12:31 | bot | INFO | Attempting site connection: 1/3
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/bot/bot/__main__.py", line 78, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/bot/bot/__main__.py", line 74, in main
    await _bot.start(constants.Bot.token)
  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 781, in start
    await self.connect(reconnect=reconnect)
  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 707, in connect
    raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
Found `config.yml` file, loading constants from it.
2022-08-28 17:12:39 | botcore.utils._monkey_patches | DEBUG | Patching send_typing, which should fix things breaking when Discord disables typing events. Stay safe!```
sweet glacier
atomic ivy
#

read the log message

#

you have privileged intents disabled

cold island
vale ibex
#

This is all explained in there

sweet glacier
#

what wait , I dont get it

sweet glacier
#

What do I have to do? about the priviliged intend?

vale ibex
#

Read the section of the guide I linked above.

sweet glacier
#

ok

#

btw scaleios deserves a promo

#

frfr

#

he hung along all the way from beginning and patiently helped me out throughout the journer

cold island
#

@gritty wind do you want to be promoted to admin?

gritty wind
#

Lmao

sweet glacier
#

why not :)

gritty wind
#

If you want to be in on the joke, I was an admin and stepped down

sweet glacier
#

tf

austere hornet
hoary willow
#

@viscid badge status

versed blade
#

Does anyone if the official cpython devs have a discord? Or if I have a question can I write it here?

vocal prairie
#

There's no official Discord.

versed blade
#

Not particularly a question. I opened my first PR (very simple, nonbreaking changes) in CPython but it was (somewhat) buried and received no reviews. Was hoping to request any core-devs to review it and provide feedback/merge it

fossil veldt
#

anyone have opinions on bot#2244 ?

dusky shoreBOT
fossil veldt
#

Could move it to be implemented on sir-lancebot as well

cold island
#

I'd rather people didn't upload weird links or files here

#

Also something to keep in mind is that in the filters redesign "Anti-Malware" is just a file extension filter, because that's really all it is atm

#

Not that it should block any work that we think is necessary

#

In short, adding the API to the filter is something to think about, but not in favor of having it on lance

subtle kraken
#

Its probably worth keeping in mind that virustotal collects anything that is sent to them which sounds like something that isnt in line with our privacy policy at the moment as I understand

if you submit Samples to the Services, we will collect all of the information in the Sample itself and information about the act of submitting it

#

Am unsure at the moment if frequency of malicious files being sent in our server is high enough to compromise privacy of all users

sweet glacier
gritty wind
#

I realize this is actually going to stop working in a few days because it needs d.py updated, but I don’t have the bandwidth for that right now

#

Maybe later

gritty wind
#

I've done a bit of it, but there's just so much more now because of all the things @stable mountain supports. Bumping to 3.10, d.py 2, and even bumping the internal and error_handler cogs, and the utils is pretty easy, but keeping the snekbox cog in sync is a pain. I might just push what I have now and have the project deviate from @stable mountain

static canyon
#

Hello World

static canyon
#

The message the bot links to in this message seems to be the wrong message?

#

It links to my .bm message, rather than the "Hello World" message (which is what the bookmark is to)

stable mountainBOT
#

bot/exts/utilities/bookmark.py lines 115 to 121

reaction_embed = discord.Embed(
    description=(
        f"React with {BOOKMARK_EMOJI} to be sent your very own bookmark to "
        f"[this message]({ctx.message.jump_url})."
    ),
    colour=Colours.soft_green
)```
static canyon
#

Or is this an intentional thing that just has bad wording?

subtle kraken
#

previously you couldnt bm on reply so it would bookmark to the command invocation so it was correct before

static canyon
#

Right, I see

#

Is this something we want to update?

#

I.e. if the .bm is a reply, then the link goes to the reply

static canyon
#

Since you'd still pass a link to the message you were bookmarking

#

The bookmark content wasn't in the message (the title of the bookmark is)

#

So even before the reply-bm functionality it should still have linked to target_message and not ctx.message

subtle kraken
#

yeah because it was required

#

later it was made optional

#

so it made more sense to link to the invocation I suppose

#

since you could do .bm check <some-link> or what have you

#

I suppose we could differentiate between the two and link accordingly though

static canyon
static canyon
#

You either provide a message, or reply to a message

subtle kraken
#

yeah

static canyon
#

So it was never truly optional

subtle kraken
#

but since the message is optional you cant link to something that doesnt exist

static canyon
#

Meaning you should just always link to target_message

static canyon
subtle kraken
#

I mean when it isnt a reply

#

.bm like this

#

ok fair

#

I misunderstood completely

#

I think I mistook that command for syntax for other bot, apologies

static canyon
#

You have to provide a message or a reply. Whichever you provide will be set to target_message. If you provide neither, then an error is given, meaning target_message is always defined

subtle kraken
#

Yes yes I understand now, sorry

static canyon
#

If not, I'll create an issue for reverting it back to target_message.jump_url

surreal veldt
dusky shoreBOT
static canyon
vale ibex
#

feel free to fix

static canyon
#

I'll leave it since it seems that @surreal veldt's PR will already fix it

#

@surreal veldt is your PR finished (aside from review)?

static canyon
stable mountainBOT
#
No problem.

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

surreal veldt
#

Can someone help me fix this error? ```
File "C:\Users\tenuk\sir-lancebot\bot\exts\utilities\bookmark.py", line 173, in bookmark
await ctx.send(embed=embed, view=view)
File "C:\Users\tenuk\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-gb-kPGWv-py3.9\lib\site-packages\discord\abc.py", line 1370, in send
components = view.to_components()
File "C:\Users\tenuk\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-gb-kPGWv-py3.9\lib\site-packages\discord\ui\view.py", line 197, in to_components
children = sorted(self.children, key=key)
AttributeError: 'SendBookmark' object has no attribute 'children'

#

Actually, I realized I forgot the super call

fossil veldt
cold island
#

It might be ok as a moderation command, but at that point it might be better to use the website

surreal veldt
#

I deleted the repo from which I made the sir-lancebot#1091 and replaced it with sir-lancebot#1095 (sorry if that was bad, but I had a lot of problems on the first one)

outer oasis
#

Go ahead and leave a comment on the new one saying that it's a replacement for the old one

#

What issues are you having?

outer oasis
# surreal veldt I deleted the repo from which I made the sir-lancebot#1091 and replaced it with ...

I noticed you're working off of your main branch in both of your forks.
When you create a fork, you get the big green "sync fork" button, which takes all the new commits on the main branch from our repo and adds them to the main branch on your forked repo.

So, when you create commits on the main branch on your fork, and then you create a PR, once that PR gets merged, those commits will be added onto the main branch of our repo.
The problem with that is, when you try to "sync fork", GitHub will get confused because it thinks it sees duplicate commits, and it won't let you sync.

You'll always need to create a new branch when working with forks

surreal veldt
#

Oh...I keep forgetting to make a new branch whoops. Also you mean git checkout right?

outer oasis
#

You can, yeah
git checkout -b <branch-name>
You need the -b when creating new branches

surreal veldt
#

Thanks

#

I added the comment

tough tide
#

how can i contribute

#

to what

#

that is the question

vale ibex
#

!contribute

stable mountainBOT
#

Contribute to Python Discord's Open Source Projects
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!

Projects to Contribute to
• Sir Lancebot - our fun, beginner-friendly bot
• Python - our utility & moderation bot
• Site - resources, guides, and more

Where to start

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
vale ibex
#

This tag has a lot of info

gritty wind
#

We have the contrib guides on our site (run !contribute), but you can start by having a look through the issue trackers for something you wanna work on

sweet glacier
#

can someone help me with eval bot?

hoary haven
#

hi, this channel is to discuss contributions to our repos directly

#

so we can assist with setup if you're thinking of contributing

versed blade
#

Hi, new contributor and also the author of https://github.com/python-discord/site/pull/771. My changes were trivial yet I fail multiple netlify checks and it reports Deploy Preview forĀ pydis-staticĀ failed., any reason for this?

GitHub

GitHub is where people build software. More than 83 million people use GitHub to discover, fork, and contribute to over 200 million projects.

gritty wind
#

The netlify builds have been broken for a while, there’s a PR up to fix them, but it’s pending review

#

In terms of your PR, you just need to worry about the ones marked Required

#

Please clean up the PR body though, mention what it does and what issue it closes

#

I’m pretty sure the grammar change in the first one is wrong though ("what contributing … involves"), and I think the second sentence reads better without the of

hoary haven
#

i agree with Scale
the third change of the comma is fine though.

versed blade
#

Ok, no problem. I have reverted the first two changes

#

Thanks for the feedback :)

hoary haven
#

was there an issue for this, or did you ask about this in the channel earlier? (i remember someone did, but not sure if it was you)

surreal veldt
#

I finished with sir-lancebot#1095, can I bother someone to check? I think there's another PR waiting on this that's why

dusky shoreBOT
versed blade
#

I am fairly new to the discord, so just asking as to learn the best practices

hoary haven
#

yes, typically an approved issue is required on the repo, or an approval from a core dev on discord <@&587606783669829632> < this role

outer oasis
hoary haven
#

though this is not a "discord thing," but an us/python discord thing

edit: i misread your message but o well

surreal veldt
#

What happens if you ask a helper and they say OK? Just curious

static canyon
gritty wind
#

We typically ask you open issues first so we can coordinate features and work, and make sure what you’re working on is in fact desired

#

Yup, helpers can’t approve, but we try our best to give everyone involved the best experience

static canyon
versed blade
#

Good to know, thanks. Will seek approval from core dev before opening PRs in the future

hoary haven
outer oasis
#

But it's actually a different issue

#

And that one is already merged

cold island
#

It's not merged

#

github did a derp

outer oasis
#

oh it's that one?

cold island
#

yeah

outer oasis
#

oh

#

That same thing happened in another project I was working on

#

Because the PR also came from main

#

Lemon was actually the one that figured it out

#

I just did

gh repo clone
gh pr checkout
git status
# new commits? I haven't done anything yet? Let's see what they are:
git push

And then the PR was merged

vale ibex
# surreal veldt BTW ^

can't do a full review right now, but it seems like a lot of lines are being broken up when they don't need to

#

the project's line-length is set to 120

#

I'm guessing you ran black against the file?

#

We don't have a black config, so it will use defaults.

surreal veldt
#

I don't think so - let me check

outer oasis
gritty wind
#

You can run black on our files, sort of, so long as you limit to the file you’re working on and pass it the line length option. Wouldn’t recommend it though because our style isn’t 1:1 with black. Lint with pre-commit, if it passes, you’re probably fine. If you haven’t seen it before, read our style guide

vale ibex
#

Also, we use multi-line splits in this project EG py embed = discord.Embed( title=title, description=target_message.content, colour=Colours.soft_green ) Rather than ```py
embed = discord.Embed(
title=title, description=target_message.content, colour=Colours.soft_green
)

surreal veldt
#

I did poetry run task lint and it passed all

#

Do I still need to re-format?

vale ibex
gritty wind
#

Yup, not everything can be enforced with pre-commit, hence it’s a good idea to read the style guide to get the big picture

gritty wind
surreal veldt
#

Can I get one example of a line that's too broken up?

vale ibex
#

bookmark_function in the SendBookmark function sig

#

that's the first one

#

also, I'm not sure Callable is the right typehint there

#

I think collections.abc.Awaitable is the correct one

#

maybe colelctions.abc.Coroutine

#

I can't remember

surreal veldt
#

But isn't callable for funds?

cold island
vale ibex
#

callable is for normal funcs, bookmark_function isn't a normal function

#

it's a coro

surreal veldt
#

oh because it's async, right

#

Did you get the type hint?

vale ibex
#

Yea, it's a coroutine that can be called and awaited

#

I can leave a proper review in a couple of days

surreal veldt
#

I'll try to not make the lines so short in the meantime

vale ibex
#

It's worth pointing out that my sir-lance PR that bumps the d.py version will break this

#

duscord.ui.Button.callback has ti's button and interaction args swapped

#

to be consistent with app commands

#

so we will just need to remember to fix it in whichever PR gets merged second

surreal veldt
#

okay

hoary haven
# stable mountain

@ornate kayak hi there and welcome! this channel is for discussing our open source projects listed above ^^^

sweet glacier
#

@gritty wind Can I host @stable mountain using heroku?

gritty wind
#

Not really because it needs to have access to the site database, and the other dependancies (especially snekbox in your case)

#

You’d need to host those separately

#

Anyway heroku is removing the free tier soon šŸ‘€

sweet glacier
#

other than docker

#

docker is not functioning properly on my pc

vale ibex
gritty wind
#

Setting the bots up outside docker is not something we really assist with because there's a lot of setup you'd have to manually do

#

It's an unwritten expectation that the more one deviates from the guide on the site, the less help they should expect to get

fossil veldt
#

cloud compute provides a free 2 core 1GB VM instance monthly

sweet glacier
fossil veldt
#

though uh, our bot functions are pretty specific to here, I'm not sure how well it would work in other servers

#

there are a lot of config options required, but if you supply reasonable values and channels for all of them it should be fine

sweet glacier
#

Well the defualt-config is completely specific to this server but the guide provided online comes with a custom config.yml for local servers

#

it's provided here

#

in the #configure-the-bot section

gritty wind
#

That is still a template, you’d need to specify the channels yourself to avoid errors

sweet glacier
#

Im just facing issues with the wsl

#

now

#

That's the reason docker won't operate properly

austere hornet
sharp crag
#
ClientConnectorError: Cannot connect to host snekbox-311.default.svc.cluster.local:80 ssl:default [Temporary failure in name resolution]

Trying to run python-discord/bot through docker, why is it looking for snekbox-311? I just want it to run snekbox

vale ibex
#

3.11 is the default now. You can update your config.yml with the path to snekbox, or you can set the SNEKBOX_311_EVAL_API env var

sharp crag
#

Oh also, I've switched to running it locally because it's easier for development. How would the URL be different now?

vale ibex
#

Ah, if you're running the bot locally, it'll be localhost:port/eval

#

where the port is the one on the left in the docker-compose

#

can't remember off the top of my head

sharp crag
#

So for snekbox-311:

    # Snekbox
    snekbox_eval_api: "http://localhost:8065/eval"
```?
#
  snekbox-311:
    << : *logging
    << : *restart_policy
    image: ghcr.io/python-discord/snekbox:3.11-dev
    init: true
    ipc: none
    ports:
     - "127.0.0.1:8065:8060"
    privileged: true

docker-compose.yml

vale ibex
#

looks right to me

#

does it work?

sharp crag
#

let me try that

sharp crag
# vale ibex does it work?

Nope, different error though:

ClientConnectorError: Cannot connect to host snekbox-311.default.svc.cluster.local:80 ssl:default [nodename nor servname provided, or not known]
#

Only bot is running locally, snekbox and web are running in the docker instance

vale ibex
#

doesn't look like the config.yml isn't being loaded

vale ibex
#

it's snekbox_311_eval_api

sharp crag
#

Do I have to manually edit the key, because snekbox_eval_api is the only one i see

vale ibex
#

add a new one

#

it was added new with the 311 update

#

snekbox_eval_api points to 3.10

sharp crag
#
    # Snekbox
    snekbox_eval_api: "http://localhost:8060/eval"
    snekbox_311_eval_api: "http://localhost:8065/eval"

like so?

vale ibex
#

yea

sharp crag
#

let me give that a shot

sharp crag
#

at least it's trying to run it now lol

vale ibex
#

anything in the snekbox logs?

sharp crag
#
pydis-bot-snekbox-311-1  | 2022-09-02 19:11:20,522 |    11 |                 snekbox.nsjail |     INFO | Executing code...
pydis-bot-snekbox-311-1  | 2022-09-02 19:11:20,606 |    11 |                 snekbox.nsjail |  WARNING | clone(flags=CLONE_NEWNS|CLONE_NEWCGROUP|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET) failed: Invalid argument
pydis-bot-snekbox-311-1  | 2022-09-02 19:11:20,606 |    11 |                 snekbox.nsjail |    ERROR | Couldn't launch the child process
pydis-bot-snekbox-311-1  | 2022-09-02 19:11:20,607 |    11 |                 snekbox.nsjail |     INFO | nsjail return code: 255
pydis-bot-snekbox-311-1  | 2022-09-02 19:11:42,035 |    11 |                 snekbox.nsjail |     INFO | Executing code...
pydis-bot-snekbox-311-1  | 2022-09-02 19:11:42,114 |    11 |                 snekbox.nsjail |  WARNING | clone(flags=CLONE_NEWNS|CLONE_NEWCGROUP|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET) failed: Invalid argument
pydis-bot-snekbox-311-1  | 2022-09-02 19:11:42,114 |    11 |                 snekbox.nsjail |    ERROR | Couldn't launch the child process
pydis-bot-snekbox-311-1  | 2022-09-02 19:11:42,115 |    11 |                 snekbox.nsjail |     INFO | nsjail return code: 255

yeah

atomic ivy
#

macOS?

sharp crag
#

..yeah

atomic ivy
#

I faced the same issue on macOS too, works on Linux.
last time this was discussed, we just ended up deciding not to debug it further, because it works on Linux.

sharp crag
#

oh

#

shoot

#

any temporary solutions or anything?

atomic ivy
#

other than using Linux, not AFAIK.

sharp crag
#

yikes okay

#

i do have a linux system but i honestly have everything set up here already

atomic ivy
#

you'd have to debug the snekbox container, which I did, but tweaking the clone options for the process didn't help much.

vale ibex
#

and alt solution is to run the snekbox container on a linux system and make it available to your mac machine

sharp crag
#

i could do that, how exactly would that work though? i haven't done anything like that before

atomic ivy
#

provided they can be on the same network and ssh probably.

sharp crag
#

yup, same network

vale ibex
#

it would be a case of making the 8065 port available on your lan

#

ufw is a decent way

static canyon
#

@sharp crag is there an issue for bot#2269?

dusky shoreBOT
static canyon
#

If so you should link it by putting "Closes #xxxx" somewhere in the description

sharp crag
#

I believe it was by @outer oasis

dusky shoreBOT
sharp crag
#

Oh oops, I was confusing it with sir-lancebot#1089

dusky shoreBOT
sharp crag
#

yikes yeah

outer oasis
#

I made one for bookmarking but not eval I don't think

#

jinx

sharp crag
#

I thought it was eval for some reason.. i'm dumb

#

I'm going to delete the PR and make a new issue.. if the issue is approved i'll just PR again and it should be easy

outer oasis
#

Don't delete your work

#

Just make an issue and attach the existing PR

sharp crag
#

Isn't it protocol to have an issue, discuss it first, then make a PR if the issue is go?

outer oasis
#

... Didn't you say the PR already exists?

sharp crag
#

Yah I have the code and I've tested it, I just didn't make an issue for it first

#

The code is in another branch in a fork of mine

static canyon
#

The idea is just so that you don't spend time developing something which we end up deciding we don't want

#

But it's already developed, so there's no harm at this point

sharp crag
#

yeah. It wasn't much work, it was like an extra 30 lines lol. I think i'll just have it sitting in the fork, and if the issue does end up passing through, it should be very easy to make a PR with the existing code

static canyon
#

If the issue is approved, the PR can be reviewed & merged, else the PR can be closed

#

I'd just leave the PR if you haven't already deleted

#

There's no harm in having it

sharp crag
#

Yeah you're right, might as well just leave it

static canyon
#

You can make a comment on the issue that you've got the PR

sharp crag
#

yup just did that

outer oasis
#

What the cat happened to the Workflow for these?

#

ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

sharp crag
#

i honestly don't know.. i ran the pre commits and flake8 and whatnot locally and they all passed

#

i hope i didn't break anything

outer oasis
#

Looks like it just pulled a new version of Poetry or something, and a command option changed somewhere

#

Hmm. Debug mode didn't say much

sharp crag
#

and as for the bookmark context menu..

sharp crag
#

still no button

static canyon
dusky shoreBOT
sharp crag
#

Ah thought it was merged

#

The merged one was the bugged out PR wasn't it?

#

I think so.. my comments are gone