#dev-contrib

1 messages · Page 171 of 1

brisk brook
#

Could it be well, timezones 😅. I live in Sweden with UTC+01:00 right now I believe

#

I mentioned the theoretical fix in the review though, we should aim to have all datetimes be aware now with how discord.py disnake treats them.

vale ibex
#

was this PR created before we migrated to d.py 2.0?

brisk brook
#

I don't have a lot of time, I was gonna test the botcore PR and then shut off my computer for the day, would you like me to try to reproduce it tomorrow?

vale ibex
#

I have no concept of how long ago that was

#

since merging in main might have fixed it

#

(if the naive time was from discord py)

brisk brook
#

The migration was merged October 17 and the PR created December 10, so that can't be it 🤔

vale ibex
#

Pr desc also has

Since discord.py moved to timezone aware datetimes, the discord timestamp converter failed, therefore giving no confirmation message, this has now been fixed.

#

so it's likely unrelated

brisk brook
# exotic ember yes please

Okay I have requested a review from myself, I will take a look at it tomorrow on my Notifications page and let you know!

#

Hey @vale ibex for the bot-core PR, can you remove the tag and (when it's merged) apply it on the merge commit like what was done for v2.1.0?

#

If not, what should be the status-quo moving forward?

vale ibex
#

lol yea, I've made a note to myself not to push tags until they're in main

#

I'm just going to move the tag to the tip of main when this is merged

brisk brook
#

Sounds good!

vale ibex
#

I had assumed how tags worked, which was wrong

last patio
#

good evening

thorny spade
#

i am here

#

to begging

#

for a review

#

to python-discord/sir-lancebot#1041

dusky shoreBOT
wind ruin
#

just wondering - are the review rules public or only staff can see them?

wind ruin
#

nvm

vocal prairie
patent pivot
#

one sec

#

and then click the python-discord/site: main in top left to get to the rules section

#

though sometimes that's a hook to another repo, like our .github repository

trim cradle
#

@wild prism I saw the issue, I'll respond Soon ™️

#

but if it's within the next 7 hours, it means I'm not doing work.

vale ibex
#

This is great news

#

the update to github's PR files changed tab has fixed the memory leak issue i was having

wild prism
brisk brook
# exotic ember yes please

I apologize for all pings, but in case you have the test server muted, I pinged you in bot-commands. It's not something urgent, but I realize that you may miss it if it's completely muted.

exotic ember
#

no worries, ping me all you want

#

I have the test server always muted

#

@brisk brook do you have master merged?

brisk brook
exotic ember
#

@short snow deleted the branch iirc

brisk brook
#

Oooooooh yeah because I am missing two PRs which both seem to be theirs. By the looks of it the whole fork was removed.

#

Gonna open an issue on the GitHub Desktop repository, but how can you continue working on the PR if the branch it is on is removed @exotic ember?

exotic ember
brisk brook
#

Ah, right. Odd that the PR is still up though

brisk brook
exotic ember
brisk brook
exotic ember
#

yeah thats what i have, then i merged master locally

brisk brook
exotic ember
#

yep, ill ping you when I do

trim cradle
#

@wild prism I tried to approve

#

but I can't find approve button

#

help

wild prism
#

uh ehm

trim cradle
#

I did it 😄

#

anyway nice work lemon_hyperpleased

wild prism
#

ty for the good editing

trim cradle
exotic ember
short snow
exotic ember
#

no problem

cold island
#

Do we care? @vale ibex

vale ibex
#

I mentioned in the PR desc that I didn't scope those

cold island
#

@vale ibex have you tried playing with the help command buttons? it seems to stutter, work, but then complain it failed

vale ibex
#

I have not

#

let me look at possible breaking changes in views

cold island
#

@vale ibex approved

vale ibex
#

nice

#

just going to squash and rebase onto main

#

luckily nothing got merged into main that conflicted

#

went through each commit too, and they didn't add things that would break

tawdry vapor
#

For some reason my test bot is really unresponsive. Any ideas why?

#
2022-03-05 15:49:03 | bot.pagination | TRACE | Got reaction: ➡
2022-03-05 15:49:13 | bot.pagination | DEBUG | Got next page reaction - changing to page 2/6

The first time I clicked the reaction it didn't even log that it received it

vale ibex
#

hmmm

tawdry vapor
#

And see how it took 10 seconds for it to respond

vale ibex
#

what does ping say about your connection?

tawdry vapor
#

Command processing time
321.743 ms
Python Discord website status
Healthy
Discord API latency
77.635 ms

vale ibex
#

that seems reasonable

tawdry vapor
#

It took a while for it to respond with the ping embed even

#

I think it's something wrong with HTTP requests.

#

Cause it also hangs when attempting to connect to our API

#

2022-03-05 15:52:49 | bot | INFO | Attempting site connection: 1/3
2022-03-05 15:53:12 | bot.exts.info.pep | TRACE | Started refreshing PEP URLs.

#

Or maybe DNS?

gritty wind
#

You mean patching in our own handlers and stuff to patch the library’s http handler was a bad idea? :DDDDDD

tawdry vapor
#

It's not only requests to Discord

gritty wind
#

Based on the api comment, it seems to be the entire http handler. Since I imagine this isn’t a problem for most disnake users my guess is that it’s the custom http stuff which is what I was referring to

vale ibex
#

I don't experience this issue though, which is odd

#

Are you on a branch with the disnake changes Mark?

tawdry vapor
#

No

#

I'm not sure what you're talking about patching the HTTP handler. The api client has its own session

#

Are we patching aiohttp somewhere?

gritty wind
#

Not patching aiohttp, but rather patching the client from the discord library with our own connectors and resolvers

tawdry vapor
#

Hmm I think the site connection is misleading

#

There's no log for a successful connection.

#

And the next log is from a cog that was waiting for the bot to be ready

#

So the delay is more than likely just the time taken to log into discord

#

I know what you're talking about with the connector now. The API client does use the same connector though.

vale ibex
#

is the delay all the time or just near start up?

tawdry vapor
#

Always

vale ibex
#

since the user syncer could be causing slow downs

tawdry vapor
#

Any command I run

#

it's just slow

vale ibex
#

huh, odd

gritty wind
#

Where is this? I’d like to test it

tawdry vapor
#

My bot on the test server

vale ibex
gritty wind
#

I mean what Pr/branch 😅

#

I jumped in about half way through the conversation

tawdry vapor
gritty wind
#

Oh gotcha

tawdry vapor
#

I'm going to try to make logging more verbose for libraries to see if there is any insight on network requests

#

I am quite suspect of it being a DNS issue

cold island
#

!echo .

stable mountainBOT
#

.

cold island
#

it didn't explode!

vale ibex
#

huzzah

#

!int e discord.version

stable mountainBOT
#
In [4]: discord.__version__
Out[4]: 2.4.0```
cold island
#

discord? not disnake?

vale ibex
#

I kept the discord var in the int e globals

#

it just points to disnake

cold island
#

ah

tawdry vapor
#

It seems to pretty consistently get delayed by 10 seconds which is weird

2022-03-05 16:12:53 | bot.exts.moderation.infraction._scheduler | TRACE | Awaiting the infraction #4 application action coroutine.
2022-03-05 16:13:03 | discord.gateway | DEBUG | For Shard ID None: WebSocket Event: {'t': 'GUILD_MEMBER_UPDATE', 's': 10
fallen patrol
tawdry vapor
#

Yes

#

I did update my branch to disnake a few minutes ago and it's still the same problem

fallen patrol
#

what's the ref so i can check it out locally?

tawdry vapor
#

Haven't pushed yet but it's bot#1680

dusky shoreBOT
tawdry vapor
#

It doesn't matter. I could be on main and it'd be the same problem

#

It's just something weird with my system; I dunno. Like I said, I suspect DNS cause I've seen what it looks like to have DNS server down. Requests take a long time but eventually load.

#

Might try disabling aiodns or all the custom connector stuff in general

balmy sluice
#

bad time to port

sleek steppe
#

Funny how dpy comes back the day we switch to disnake 😄

austere hornet
#

Yeah

cold island
#

We still get the latest Discord features, and leave behind an alpha release, so it's not without merit

#

And since it was mostly changing the namespace it wasn't too difficult

fallen patrol
#

We are not stopping development anytime soon, either

thorny spade
#

the magic thing has happened

#

so will you migrate to dpy again troll

vocal wolf
#

Is it just me or are the disnake docs kind of laggy?

fallen patrol
#

I thought we fixed that

austere hornet
#

Seems fine to me

fallen patrol
#

Since every token is on the same page, they will be slightly laggy... but we did remove some of the code that was causing a lot of lag

fallen patrol
vocal wolf
#

latest

fallen patrol
#

they seem fine once they've loaded

#

which page are you on, specifically?

vocal wolf
#

the lag seems to have just

#

disappeared

#

I was on ApplicationCommandInteraction

fallen patrol
#

ah, maybe the laggy css was cached

vocal wolf
#

perhaps

gaunt cypress
#

Why don't we use gist?

thorny obsidian
gaunt cypress
#

Pasting stuff?

cold island
#

You're welcome to if you want

#

Not sure what you mean

sleek steppe
#

!paste

stable mountainBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

gaunt cypress
thorny obsidian
# gaunt cypress Ik we have but "why not use gists"

which account will the gist live under? We can't create gists for orgs. Gists are meant to be somewhat permanent and I'd feel uncomfortable with uploading arbitrary user pastes onto github associated with a user account

gaunt cypress
#

Ahh I see thanks

green oriole
#

The timing on that is just gold

placid ermine
#

it really is

digital plank
#

what are the future plans btw

crude gyro
#

we're gonna need some time to discuss that before we can comment on it, there's a discussion now among the core devs.

austere hornet
#

👍

brazen rover
#

Wouldn't it be nice if there was a subscribe feature for the discord bot?
When you ask a question in the help chanels it often takes a while for someone to see your question and answer something.
The bot already tells you via PMs that you opened a help channel.
I think it would be nice if you could tell the bot that you want to get notified via PM once the first person answered something in the help channel?
That way you could do something different while waiting for an answer, like working on code (which we of course love)

austere hornet
placid ermine
#

helpdm is for the helper, not the helpee

austere hornet
#

Ohhh

#

Hmm, then that might actually be nice to add

brazen rover
#

!helpdm help

stable mountainBOT
#
Bad argument

help is not a recognised boolean option

#
Command Help

!helpdm <state_bool>
*Allows user to toggle "Helping" dms.

If this is set to on the user will receive a dm for the channel they are participating in.

If this is set to off the user will not receive a dm for channel that they are participating in.*

gritty wind
#

Having no clue what this feature is, wouldn't this imply it'll work for both

#

!src helpdm

stable mountainBOT
#
Command: helpdm

Allows user to toggle "Helping" dms.

Source Code
gritty wind
#

Nope, explicit ignore

#

Not sure why though

clever wraith
#

will the newest 2.0 be updated for pydis bot?

#

i can actually implement my modal without a fork now :H

vocal prairie
#

We recently migrated to disnake.

#

The decision on discord.py is yet to be determined, that's a core dev discussion.

clever wraith
#

??? why disnake

sleek steppe
#

Pretty much we migrated to disnake an hour before danny announced the continuation of dpy, and we were preparing for a switch to disnake for a while anyways

dry folio
#

it's been so long since i've done anything remotely related to bot development 😔

#

i have no idea what's going on with the discord api wrappers currently, but now that d.py continues development, maybe it'll be good to switch back

clever wraith
#

In our opinion, all trust for d.py is long gone

mint nebula
#

they betrayed us lemon_angrysad

patent pivot
#

we'll be discussing it internally with core devs, no updates immediately

fervent sage
#

fyi for everyone reading who doesn't know, we (maintainers of disnake) have no intent of stopping development in any way, the lib isn't gonna just disappear because dpy is back, so that shouldnt be a worry :P

crude gyro
#

I thought you maintained nextcord

#

I'm so confused

#

@fervent sage are you involved in both of the forks?

fervent sage
#

I'm a NC and disnake maintainer because I'm weird lol

#

Though I mostly handle infrastructure for disnake like websites and domains and stuff rather than doing a ton of coding

cold island
#

@vale ibex what is the website where you write a json and it shows you the resulting embed?

wind ruin
cold island
vale ibex
#

that's the one 😄

brisk brook
cursive relic
#

Can I find the list of existing topics from somewhere of .topic command

cursive relic
#

Thx 😄

surreal veldt
#

Good evening if I want to make a pull request, are these steps mandatory?

gritty wind
#

These are the requirements for running the project locally

#

For most code changes, you'll want to test your code before you PR

#

(In general, not just to our projects)

#

If you're doing content changes, it's up to you

#

Personally I want to make sure things look how I expect, but at the end of the day it's not necessary

#

There'll also be a deploy preview showing what the site will look like with your changes

surreal veldt
gritty wind
#

The requirements are just for running the project on your local machine. The preview will be built automatically provided you don't have errors that prevent it from running

fallen patrol
#

sigh.

gritty wind
#

It's been greaaaat

#

Dev-log is loving it

#

Err error-log

fallen patrol
#

I would like to also add that acking has been disabled

#

this affects clients, not bots

#

oh acking is back up thankfully

fallen patrol
trim cradle
#

I don't think we've ever measured how long it takes for a given message to iterate through every regex in the blacklist, or has that since been done?

gritty wind
#

A single message? Not very long

#

I could int e it

trim cradle
#

if you feel so inclined 😛

#

though if you want to int e to print out the list of patterns, I could experiment and report back

gritty wind
#

0.0004418427124619484s on a single message on all filters (not just regex)

#

Check your DMs

austere hornet
#

What happened to the status of @humble leaf? I remember it was "The-Not-Quite-So-Bot-as-Sir-Lancebot" or something like that at one point, did it get removed?

patent pivot
sleek steppe
#

they're talking about @humble leaf's discord status, which is missing for some reason

patent pivot
#

ahhhh

#

hmmmm

#

M-x deploy restart sir-robin

radiant merlinBOT
#

:white_check_mark: Restarted deployment sir-robin in namespace default.

patent pivot
#

there we go

#

it was probably knocked around a bit as a result of the discord outage earlier

fallen patrol
#

^ that just happens sometimes

fallen patrol
#

to explain it a bit futher, status tend to sometimes be removed when the api is deployed. It would also explain why @viscid badge doesn't have a status either

austere hornet
clever wraith
#

Heya, is there any guide on how to setup the database or how to bypass the check saying connection doesn't work? (I won't need the database for my changes.)

molten perch
clever wraith
#

Yep

molten perch
clever wraith
#

Already did so, the issue is that for some reason docker doesn't start? Says the daemon is not running.

#

Which isn't as I get an error when starting the service.

molten perch
#

Do you use Docker Desktop?

clever wraith
#

No, but I probably will try to get on Windows and see how it goes there 😅

molten perch
clever wraith
#

Yeah could've tried that

cursive relic
#

Is there possibility to do !resources <tag> or something similar? If not, would it be possible

dim pelican
#

To look up the tags we have?

cursive relic
#

Eh I don't think that would work, the site wasn't exactly what I thought it to be

rapid swallow
dim pelican
#

Oh to search the resources directly you mean

rapid swallow
cursive relic
#

Oh there was issue for it, didn't know it

#

Thx for info 😄

rapid swallow
#

i could be wrong though

rapid swallow
rapid swallow
rapid swallow
cursive relic
#

Yep, that's exactly what I thought about lemon_sweat

#

Thank you!

surreal veldt
#

could someone give me a brief break down of how a normal message would be put into a markdown file?

thorny obsidian
#

What do you mean by normal message?

surreal veldt
thorny obsidian
brisk brook
fallen patrol
#

wow, @slow bone now has a banned name

#

Usernames cannot contain the following substrings: '@', '#', ':', '```', 'discord'

rapid swallow
#

is channel creation counted in 2 edits/10 minutes ratelimit for editing channels?

#

seems like it

rapid swallow
gritty wind
#

@rapid swallow rate limits on all requests are sent in a X-… header

#

If you’re wondering if they’re documented anywhere

#

Haha imagine discord doing something useful like that

rapid swallow
tawdry vapor
#

Why do you need it?

#

I believe d.py already delays requests to respect the headers.

#

I don't think it's accessible unless you use the http client to request endpoints yourself

rapid swallow
#

?help tag

slow boneBOT
#
`?tag [tag]`

Append a tag at the beginning of the channel name.

Using the command without any argument will reset it.

rapid swallow
#

i thought it'd be neat if the command could show some kinda useful message

gritty wind
#

It doesn’t fail it gets postponed

rapid swallow
#

oh

gritty wind
#

You’d need to entirely bypass the lib to get that feature

rapid swallow
gritty wind
#

Aka access the http client directly and send out the request manually

rapid swallow
#

how about switching out discord.py in favor of hikari?

#

I don't see any problems which can arise from that

gritty wind
#

A dirty fix for this is to just

gritty wind
#

Send a message confirming receipt and saying it might take up to 10 mins to reflect

rapid swallow
#

that's how i solve all of my problems

tawdry vapor
#

What problems?

rapid swallow
#

the ones which go away when you ignore them

thorny spade
#

hi there

#

can anyone assign me @MaskDuck on github, since id like to work on this

fallen patrol
#

it makes the channel and then sets the topic even though creating the channel can have the topic set when makingit (╯°□°)╯︵ ┻━┻

#

and channel creation actually has an extremely high ratelimit, of 500 requests in every 600 seconds

#

anyways

stable mountainBOT
#

discord/http.py lines 135 to 143

bucket = route.bucket
method = route.method
url = route.url

lock = self._locks.get(bucket)
if lock is None:
    lock = asyncio.Lock()
    if bucket is not None:
        self._locks[bucket] = lock```
stable mountainBOT
#

discord/http.py lines 591 to 592

def edit_channel(self, channel_id, *, reason=None, **options):
    r = Route('PATCH', '/channels/{channel_id}', channel_id=channel_id)```
fallen patrol
#
# make a route instance for modifying channels
route = discord.http.Route('PATCH', '/channels/{channel_id}', channel_id=channel.id)
# see if a lock exists for that 
lock = self.bot.http._locks.get(route.bucket)

# if this returns True, then you can't make a request
# if this is False, then you are able to make a request
return lock and lock.locked()
patent pivot
fallen patrol
#

is it hacky af? yes.
is modmail already hacky af? also yes.

fallen patrol
patent pivot
#

Does anyone want to migrate moderator ping config to site?

#

From redis, to align with new persistence policies

thorny spade
#

maybe let mods do this

patent pivot
#

we're not storing data that needs proper persistence in redis anymore

thorny spade
#

yes?

patent pivot
#

it doesn't require any info from the moderators, the mods set their config through bot commands, it's just that right now that data gets stored in redis, not on site

#

so anyone can do the migration

thorny spade
#

so we need to move ping config from bot to site?

patent pivot
#

no, the storage needs to be moved from redis to site

thorny spade
#

hm

#

i am not really experienced on redis and site

#

so maybe not me

patent pivot
#

yeah just offering it up to anyone

thorny spade
#

is that this issue

patent pivot
#

uhh it's related

#

same system

gritty wind
#

Zig said we might not necessarily want to move this

#

We’re fine with losing it

patent pivot
#

ahh alright, that may ring a bell, I’d still rather move it and don’t mind doing that myself - I’d rather just put in the work than just accept it’s not persistent, when realistically it probably should be

cold island
surreal veldt
#

So I want to contribute to the python site. I forked it and cloned it to a local folder on my computer. Now I was told to create a new branch. Anyone mind explaining to me how to do this?

dim pelican
#

git branch -b <your branch name> will create a new git branch on your forked repo

#

Then when you make a pull request, you can use that new branch for the new features, and keep the main branch un touched, so you can pull updates from the origin main

surreal veldt
#

And, what do I replace branch name with? Is it the folder name? Also I'm using VS code terminal

dim pelican
#

A good branch name should be short, and try to describe what change you are making

surreal veldt
#

Are there any in-depth videos? I tend to understand a lot easier from them

dim pelican
#

Also just to back track a little bit, are you working off an issue on the repo? Or is this part of the pinned message migration project?

surreal veldt
#

The pinned message migration project

dim pelican
#

Ah. Maybe git branch -b pin_migrate_raven?

surreal veldt
#

Oh so I can put any name, however, how does it know where to create the new branch in?

dim pelican
#

It depends on what git repo you are currently in

#

It sounds like you are in your locally cloned fork of the repo

surreal veldt
#

So I just open the site folder I cloned from the website in VS code and run the commands right?

dim pelican
#

After you checkout the new branch you created, since you want the original branch to not have the changes

#

git status should show some info regarding what branch you have checked out

#
➜ git status
On branch main
Your branch is up to date with 'origin/main'.
surreal veldt
#

got it thanks. Also I'm watching a video; it says git branch -c, which one is correct?

dim pelican
#

I believe -b creates and checks out a new branch, -c checks out a branch that is already present? Let me double check

#

I think I got my wires crossed and meant to say git checkout -b new_branch

surreal veldt
#

And once I add the file in the new branch, I do git add filename right?

dim pelican
#

Yup!

#

And before you commit, make sure you have the pre-commit hooks installed

#

iirc: pre-commit install

surreal veldt
#

Where do I do run that command?

dim pelican
#

On the command line / terminal

#

(brb)

surreal veldt
#

Wrong screenshot whoops

dim pelican
#

No worries 👍

#

So after the pre-commit hooks are installed, and you have added the file, you can do git commit and make a descriptive, short commit message

surreal veldt
#

What do you think of this? I have it as preview in VS Code

dim pelican
#

When you make your PR there will be a more in-depth review, but my quick one is:

  • most customizable could be more customizable
    -...you can follow this: For... looks like it could be worded differently?
    -In the first ctx.send: This is the help page...
surreal veldt
#

Wow I just noticed I made many typos lol

dim pelican
#

Haha, thats why code reviews exist!

surreal veldt
#

Is there anything now to change? Going to be going in a bit more detail later on but more or less it'd be like that

#

Also going to be referencing Stella (the author of the walkthrough)

dim pelican
#

So far it looks good to me, there will likely be some more improvements suggested during the PR review process

placid ermine
#

the indentation inside the codeblock's if-else looks a bit wonky

sleek steppe
dim pelican
#

I think it is just the MD preview in VS Code, they haven't created the PR yet

hoary haven
#

@surreal veldt please use links like this:
[text here](https://url.com)

#

and that section might benefit from using a bulleted list, and changing the wording to be in the pattern of:

  • get command object from ...
  • get command name

^ something like that

#

who is Stella? do they need to be referenced by name on this guide?

surreal veldt
#

I believe they are referenced in a tag, so I thought we can do it on the site too?

#

!customhelp

stable mountainBOT
#

Custom help commands in discord.py

To learn more about how to create custom help commands in discord.py by subclassing the help command, please see this tutorial by Stella#2000

surreal veldt
hoary haven
#

oh cool

hoary haven
surreal veldt
#

Yeah that's true, I'm at this now.

hoary haven
#

nice nice

#

thanks so much for working on this @surreal veldt @clever wraith
much appreciated

clever wraith
surreal veldt
#

Alright so I believe I'm nearly done however I wanted to ask here, I was planning to put something like this additionally.
Can i have feedback please?

You can also set custom values to display

#subclass HelpCommand
...
brief = command.brief
name, aliases, description = brief
#where brief is a list, as shown below```
```py
@bot.command(brief = [name here, aliases here, description here```
#

That's what I currently have implemented for my help command ^

brisk brook
surreal veldt
#

But I wanted to know whether it's worth adding or not

brisk brook
#

I am a bit confused at what this suggests, you can already grab the name and list of aliases by other means

#

command.brief is already a thing that has a set purpose

surreal veldt
#

For example maybe a example (command usage example) value

brisk brook
surreal veldt
#

i can show an example

brisk brook
#

What happens to command that don't have briefs?

surreal veldt
#

Example command:

@bot.command(brief=['Example', 'Just an example command', '!example @member'])
async def example(ctx, member : disnake.Member):
  pass

Help command:

@bot.command()
async def helP(ctx, command_name):
  command = bot.get_command(command_name)
  brief = command.brief
  name, description, example_usage = brief
  print(name, description, example_usage)

Output from help command (provided !help example is done) : Example, Just an example commamd, !example @member

surreal veldt
brisk brook
surreal veldt
#

okay yeah so the method is not efficient is what you're saying?

brisk brook
#

Yeah my point is that it isn't an official way to use brief. It's a bit of a hack you can put in your code on your own risk but I don't think we should put it in a guide

surreal veldt
#

Got it. Also, I'm now at this and can't really think of more to add. Any suggestions?

hoary haven
#

is the walkthrough by stella a pre-requisite reading before the rest of your content can be understood?

placid ermine
surreal veldt
#

Visual studio code showed it was aligned iirc will check

placid ermine
surreal veldt
#

Oh that

surreal veldt
surreal veldt
# surreal veldt Yeah I'd say so

Oh sorry i misread, yes it can be helpful but I also think its better they go through that first before looking for the custom implementation

hoary haven
#

okay, if so then maybe a mention of that would be helpful.

A basic walkthrough by Stella#2000 on subclassing the HelpCommand will provide some foundational knowledge required before attempting a more customizable help command.

^ something like that

i have questions that i'll defer to others on:

  • should we ask Stella#2000 for permission before putting their username on our website?
  • as for your message on replit vs heroku, i'm not sure, will defer to others.
surreal veldt
#

I can ask Stella yeah

green oriole
#

neither repl.it nor heroku are suitable for hosting a discord bot

#

they won't even let you run code 24/7 without hackery

#

even so, they suffer from critical flaws such as shared IPs

surreal veldt
surreal veldt
#

Anything else I'm missing or can add now?

cursive relic
#

Is there yet any plans for using slash commands?

molten perch
#

Not until the permission rework.

surreal veldt
#

How do I do the pre-commit install command? I'm in the directory with the branch and I did git add but when I do pre-commit install it says pre-commi : The term 'pre-commit' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

molten perch
#

Because, it is installed in your poetry environment.
You can either run poetry run task precommit or enter the poetry environment with poetry shell and then run pre-commit install.
(the first one is easier 😉 )

#

(you also gotta run poetry install before doing so, to create the poetry env)

surreal veldt
molten perch
#

Yes, I presumed you had poetry installed.
I advise you to follow this guide: https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/site/
(But you can install poetry by following the docs here: https://python-poetry.org/docs/#installation)

surreal veldt
#

So I have to install poetry?

molten perch
#

Well, I would advise you to install it.

surreal veldt
#

but I think I'm lost but you already said I have it installed

#

oh nevermind, I just read that wrong

#

pip install poetry is a different command that this? Or would it achieve the same thing

molten perch
#

You can install it via pip, but it is not recommended. (See the docs)
Be aware that it will also install Poetry’s dependencies which might cause conflicts with other packages.

surreal veldt
#

ah well previously i already did pip install poetry

molten perch
#

On your current workstation?

native yoke
#

@surreal veldt lmk when you're done with ur markdown file. My pin has something that fits will with yours so I was thinking we could just make it into one file

native yoke
#

have u Pr'd it and has it been accepted?

#

or actually. maybe I could contribute directly to ur fork

#

if thats alright

surreal veldt
#

No not PRd yet request that from @trail pilot actually

trail pilot
#

Yep, I'll be taking it over

native yoke
#

:o

trail pilot
#

I'll try to get the PR in by today (or at least make it)

native yoke
#

ok sounds good

surreal veldt
cursive relic
surreal veldt
dense bison
#

tem alguem do brasil ???

wild prism
stable mountainBOT
#

4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.

dense bison
#

I want to tak some doubts

wild prism
native yoke
cursive relic
#

Why is there no posts in #reddit recently , is it on purpose?

patent pivot
#

no - the reddit relay seems to be broken right now

#

but there aren't any logs indicating why - if someone wants to document the process with log calls then that might fix it

cursive relic
#

Which bot handles the reddit posts?

patent pivot
cursive relic
#

.src Reddit

dusky shoreBOT
#
Cog: Reddit

Track subreddit posts and show detailed statistics about them.

Source Code
cursive relic
#

Ah, thx

patent pivot
#

yea

surreal veldt
#

By the way @trail pilot was the PR made?

trail pilot
#

Not yet, I've been a bit busy with school

thorny obsidian
#

There should be an associated issue that's approved by core devs before you make a pull request

#

It makes sure the idea is solid and something we want without wasted effort on a PR. The issue doesn't need to be too involved, but you're also welcome to ask here (although we do prefer GH)

gritty wind
#

I don’t think multiple queries will fit, we already trim many entries. You could paginate like we do with the help command for instance, but I’m not sure if the benefit gained over just calling the command multiple times is there

fallen patrol
fallen patrol
gritty wind
#

You may need to put the license in the files were you’ve used the code as well, but it’s pretty vague. Some people will tell you to add your own license to the top of all your files as well, so i don’t think there’s an agreed upon standard. Technically speaking you also need to get your users to agree to this license when agreeing to your terms and conditions, but most discord bots don’t exactly have terms and conditions

fallen patrol
#

but most discord bots don’t exactly have terms and conditions
I'm about to make one mmlol

#

sadly

vocal wolf
#

@sleek steppe lmao that was fast

sleek steppe
#

lol I forgot I didn't approve yet and saw the github notification

trim cradle
#

If a message contains a py codeblock, it would be nice if @stable mountain gave you a reaction that evaluates the code if you click on that reaction.

austere hornet
trim cradle
austere hornet
surreal veldt
#

Isn't that what it does currently?

trim cradle
placid ermine
#

i think the new context menu thingies would be more suitable than a reaction

#

@fallen patrol's bot, on another server

fallen patrol
placid ermine
#

!otn a backwards compatible bots

stable mountainBOT
#

:ok_hand: Added backwards-compatible-bots to the names list.

fallen patrol
#

so that's basically monty in a nutshell

#

anyways

#

okay I'm adding that to it

trim cradle
#

how do we start having that

placid ermine
#

dunno if dpy 2.0 has it

gritty wind
#

We’re not going to have it just yet, discord’s implementation is kind of shit

#

They’re rewriting it and we’ll look at it again once they make it better

placid ermine
#

O

gritty wind
#

Discord discord

placid ermine
#

o ok

fallen patrol
#

I have absolutely no permissions on monty: all app commands are runnable by all users

#

even though yes, disnake supports checks for slash commands, the interface by discord is bad, and v2 permissions will be out soon probably anyhow

gritty wind
#

It's interface is bad probs because discord's api is bad

fallen patrol
#

edited :3

#

the discord interface is shit for permissions

#

v2 perms will be better\™️

gritty wind
#

Designed by a toddler I'd say

fallen patrol
#

imagine giving them that much credit

narrow valve
#

Good afternoon everyone. I am new to docker and kubernetes, Could anyone suggest me few resources for beginner level?

fallen patrol
surreal veldt
gritty wind
#

A bit of both

#

The permissions are 100% a nightmare

surreal veldt
#

What exactly is a bad about the UI?

gritty wind
#

The system itself gets really messy when you have more than 5 commands

#

Like you can’t find anything

surreal veldt
#

Ah I'm yet to see 5 application commands

gritty wind
#

I think since the system’s been announced we’ve had well over 5 suggested

#

Lol

signal forge
#

Howdy everyone. I'm getting the following error when trying to run the bot locally on my test server created with the template provided in the directions. Docker is up and running and working without issue.

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/disnake/http.py", line 467, in static_login
data: user.User = await self.request(Route("GET", "/users/@me"))
File "/usr/local/lib/python3.9/site-packages/disnake/http.py", line 420, in request
raise HTTPException(response, data)
disnake.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

he above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
xec(code, run_globals)
File "/bot/bot/__main__.py", line 13, in <module>
bot.instance.run(constants.Bot.token)
File "/usr/local/lib/python3.9/site-packages/disnake/client.py", line 856, in run
eturn future.result()
File "/usr/local/lib/python3.9/site-packages/disnake/client.py", line 835, in runner
await self.start(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/disnake/client.py", line 798, in start
await self.login(token)
File "/bot/bot/bot.py", line 259, in login
await super().login(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/disnake/client.py", line 658, in login
data = await self.http.static_login(token.strip())
File "/usr/local/lib/python3.9/site-packages/disnake/http.py", line 471, in static_login
raise LoginFailure("Improper token has been passed.") from exc
disnake.errors.LoginFailure: Improper token has been passed.
gritty wind
#

What do you have in your bot's .env

#

The error indicates the bot token is invalid

signal forge
#

^Randomness to avoid sharing my token 🙂

sleek steppe
#

Are you sure you passed the correct token?

signal forge
#

I can regenerate it again, but yup it was generated via the Discord Developer panel in the browser.

gritty wind
#

The tokens are usually a little longer than that

#

Mine is 59 characters for instance

#

Unless you've changed it

signal forge
#

Mines 59 as well

gritty wind
#

Hm, it should work then

#

Uhh, could you screenshot the dashboard?

signal forge
#

With my token displayed?

#

I don't think that's safe.

gritty wind
#

Hidden, just where you're getting it

#

There are other tokens on the dashboard, but none of them are that length, so it's probably not that

signal forge
gritty wind
#

Alright, all that looks correct

#

My next step would be checking that the correct variable is being loaded

#

You could print it right before it's passed on line

signal forge
#

oh great idea... so on like 258

gritty wind
#

Yeah that seems right

signal forge
#

How would I print it though

#

what variable

#

BOT_TOKEN/

#

How do I print out the BOT_TOKEN if it's pulled from .env

gritty wind
#

It's loaded as constants.Bot.token

#

or you could try to get it from args

signal forge
#

It's not what is provided in .env

#

Do I need to resave .env after changing the token?

#

PyCharm autosaves everything thought

gritty wind
#

It should autosave

#

Where's the env file in relation to the rest of the project?

#

You could screenshot the folder viewer for this

gritty wind
#

The arrow's a nice touch :D

#

But yeah that's in the correct position

#

Is the env loading thing actually installed? Try importing it by running poetry run python -c "import dotenv"

signal forge
#

zsh: command not found: poetry

gritty wind
#

Oh, how are you installing and running the code

signal forge
#

I just started Docker

gritty wind
#

Ahh, okay. It should be loaded by docker then

signal forge
#

am not installing and running the code anywhere else

gritty wind
#

Dockerfile or just docker?

#

docker compose or just docker*

#

brain fart

signal forge
#

Assuming you have Docker installed and running, enter the cloned repo in the command line and type docker-compose up

#

that's what i did

gritty wind
#

In that case it's docker compose, so it should've just worked

#

Hm

wild prism
#

you didnt regenerate the token, did you?

signal forge
#

I did

#

I regenereated it then replaced the token in the .env file

#

oh

#

it's printing my public key

#

i'm going to search the files of the project with my public key as the search term

#

i might have provided it somewhere i shouldn't have

hoary haven
#

hhm, did you change anything around after cloning the repo?

signal forge
#

I think I provided my public key in the .env file when it should have been my bot token.

#

I had to regenerate my bot token

#

replace the public key with it in .env

#

but it's still picking up my public key even though it's been removed from the .env file

gritty wind
#

You may need to recreate the container to get the .env file to reflect

signal forge
#

oh darn

gritty wind
#

it should be quicker than the first time though

signal forge
#

so delete the container in docker

#

then recreate it?

gritty wind
#

docker-compose down should delete it, then docker-compose up --build should rebuild it

signal forge
#

Currently building

#

fingers crossed

#

variable has been updated

#

Bot is live!

#

How freaking cool.

#

There is so much to this bot that I find fascinating.

#

I'm still new to programming, but am looking forward to reviewing the source code and perhaps helping out on issues for beginners.

hoary haven
#

getting the bot up & running is a first major step, congrats BlushFluent

signal forge
#

🙂 It's so damn cool.... such an interesting bot

wild prism
#

if you want something a little easier, Lancebot is more geared to beginners
but you're welcome to do @stable mountain as well, and setting it up is half the battle already

signal forge
#

Having to rebuild the Docker container for changed to implement is a pain. Is there an easier way to quicken the time it takes for changes made to be reflected in the server without having ot restart Docker?

gritty wind
#

Anything under the bot directory that is

#

What are you working on?

sleek steppe
#

you can use the !ext command instead of restarting the docker container as well

signal forge
#

I'm just working on this issue for fun as a learning experience

#

so I created a new resources.py file in bot -> exts -> info

#

Working on creating this new bot command.

gritty wind
#

As long as you have a discord cog, you can do !ext reload <cog_name> to get it to load your changes

#

Or simply !ext reload * to reload everything

#

Or you can stop and restart the bot (without rebuilding the docker container), that'll work too

signal forge
#

@gritty wind where would I run the !xt command?

#

!ext

gritty wind
#

Anywhere on your server (just make sure you have the admin role configured and set up)

#

!ext reload infractions

stable mountainBOT
#

:ok_hand: Extension successfully reloaded: bot.exts.moderation.infraction.infractions.

gritty wind
#

This is what you should expect to see

signal forge
#

@gritty wind Awesome

#

I didn't have the admin role

#

How long have you been involved with the Python projects on GitHub?>

#

You seem to have a good understanding of the Bot codebase 🙂

gritty wind
#

Uhhh I made my first contribution when I first became a helper, so... maybe a year and a half?

austere hornet
#

Re: site#694
I think the embed color in the #roles channel in the server should also be changed for the Project Leads role. I also think the forms team and events team should have separate embeds because the roles don't have the same color so it doesn't look very good imo

dusky shoreBOT
signal forge
vocal prairie
signal forge
fallen patrol
#

@patent pivot could y'all please include a reason of why you're switching back to dpy aside from it was unarchived

#

I'm getting asked why

patent pivot
#

existing projects and infrastructure are in discord.py, so path of least work for us is keeping things that way. also I think going forward it will continue to be the most prominent Python library which aides us in terms of bringing on new Core Developers and new Contributors.

#

nothing against the forks.

fallen patrol
#

from what you've said in places, but w/e

patent pivot
#

It's more us praising boring technology!

#

We've got stuff that works - our existing infrastructure is built around discord.py and so right now it makes sense for us to stick with that.

fallen patrol
#

dpy could be archived at any time again, and I would not be surprised if that happens

#

if you're fine with boring technology that gets archived and unarchived at any time, then use dpy

gritty wind
#

Discord.oh guarantees as much stability as other forks 🤷‍♂️

#

Because just as forks have said they’ll maintain the lib for now, so has d.py

patent pivot
last patio
#

i think even if discord.py would fall out of maintenance again the v10 support will probably last a while

patent pivot
#

yea, +1

patent pivot
#

it talks about postgres, and uses the word "great success", so you know it's a good article

patent pivot
# fervent sage a loss of motivation to who?

Having seen similar things in other spaces, not all Python, once the main repository is restored the forks will dwindle in activity. I'm not saying that will happen, but there's a chance it does, just like there is a chance that Discord.py archives again. Especially considering Discord.py is the second most used Discord library even 6 months after deprecation with no signs of slowing.

fallen patrol
#

especially prominent users who people listen to

patent pivot
fallen patrol
#

Why do you believe there's another point where you'll need to make a decision?

#

You just said that the forks will dwindle in activity

#

(which I don't believe will occur)

last patio
#

and using the standard track is probably the best choice for that

patent pivot
patent pivot
fervent sage
#

I think the entire future of discord.py is unstable given that Danny already ragequit once

fallen patrol
fervent sage
#

Given what he says hasn't changed at the start of the gist it's clear he's coming back out of vengence/anger the forks are succeeding

twilit juniper
#

… seems a bit too quick to change back to dpy. Some of these forks have proven that they have good code quality and can get new features implemented in half the time dpy could. As some have already said it seems that he’s coming back for the wrong reasons and will just rage quit again. I also think by using dpy we kind of promote using it and while it’s a good library the community is rather toxic and isn’t very helpful when it comes to helping new people which completely goes against what python discord is.

wind ruin
#

it seemed more like "no further immediate changes" than "adequate the code to discord.py v2 new standards"? or at least I hope so

crude gyro
#

our bots are absolutely crucial to the running of this community, so like @patent pivot said, we're generally gonna pick the most boring software we can find for the job. With d.py back, that's going to be d.py. If a fork overtakes it in popularity or utility, we'd probably reconsider.

#

we would never have switched to disnake in the first place if it had been viable to continue using d.py for another six months.

#

we didn't switch because we were making some sort of endorsement or statement, we switched because we felt it was the path of least resistance, and the most boring option available to us, and because we're adverse to excitement in our core service platform.

fervent sage
#

Excitement like... The library deciding on 0 days notice to discontinue?

#

This makes no sense to me

crude gyro
#

yes, that was very exciting, and I wasn't happy about it. I'm also not ready to write d.py off forever just because it archived once, just like I'm not ready to write off the forks just because the upstream is back.

#

I wish the whole thing was less of a circus.

#

this wasn't a trivial decision to arrive at, but I still stand behind it.

fallen patrol
#

From the way everyone was talking, I had figured y'all had written off the forks (also how the announcement was written)

#

If it was more clear that you weren't writing off the forks and they're still very much on the table, that would be easier for us

crude gyro
#

they're not on the table for our immediate future, but I personally am still excited to see where the forks go.

brisk brook
#

Hmm, my viewpoint on this is honestly just a neutral acceptance.

I don't like discord.py: I've moved on from it and don't want anything to do with its culture (both in terms of the helping and maintainership) so I'll not use it for any personal projects. I would've probably voted for just going through with the decision made (because it was made).

The thing is, with slightly different timing all bots would still be on discord.py and everything would be continuing as normal. The decision to move to a fork was one that was forced - it simply had to be made. If discord.py had been unarchived before the final decision, and announcement (say, 4 months ago) we'd not be here discussing anything because all bots would just remain on that. I understand that all bots are going back to discord.py because that is what would've happened if discord.py was unarchived before a fork was chosen.

It is what it is.

cold island
#

Not 4 months, had it been announced earlier that day we wouldn't merge the PR. Seriously. I'm not trying to belittle the work and effort done in the forks, but it wouldn't make sense for us to switch in the first place when everything we had was using dpy and that it was then getting all of the new features and the up to date API version.

brisk brook
#

Oops yes sorry. 4 months ago is 2 months after discord.py was archived. I meant 4 months into its archival.

cold island
#

Given that we hadn't completed the switch yet on all our projects, we decided to stop the switch.

brisk brook
#

That's roughly when the fork discussions started picking up more seriously if my sense of time is correctly.

signal forge
#

I'm adding a Cog to the Bot and have a function that scrapes data from a website then adds that information to a list. Do I use scheduling.py to have this Cog run every X hours to ensure the scraped data is kept up to date?

brisk brook
#

Which issue is this?

You'll want to use discord.ext.tasks to run it every X hours. Hold on

#

There are examples here ^

signal forge
#

Thanks!

vocal wolf
thorny obsidian
signal forge
vocal wolf
#

Very nice. Thanks!

signal forge
#

🙂

vocal wolf
#

@obsidian patio Twemoji merged

obsidian patio
#

.twemoji 🥓

dusky shoreBOT
trim cradle
#

If we have !resources as a proper command (not just a tag) with dynamic behavior based on what comes after, where should that command live?

#

Asking for @signal forge

dim pelican
#

I'd vote for exts/utilities

tawdry vapor
#

exts/info

clever wraith
#

just a small note.
we have this statement in #roles

@Voice Verified
This role allows people to speak in our voice channels.
To get this role send the command !voice-verify in #voice-verification. Please note that there are requirements to getting this role. They are listed in the channel where you run the command.

however #voice-verification does not exist(or is removed for historic reasons), this should be changed to #bot-commands perhaps.

patent pivot
clever wraith
#

alright makes sense.

patent pivot
#

it's only relevant when pending verif, once you've done that it doesn't matter anymore :)

clever wraith
#

ah i see. alright great! thanks for clairification joe!

signal forge
cursive relic
#

should there be open issue relating to that #reddit sometimes doesn't post

austere hornet
cursive relic
#

there's option to add logging to see what could be wrong (or what goes wrong), because there's not any logging yet

#

eh. nvm I didn't read your message properly. Sorry

austere hornet
#

👍

#

All good

trim cradle
#

@signal forge

Also, I added a method to scrape the Topics from https://www.pythondiscord.com/resources/. I plan to use this information for validation
I think this is overkill. if a URL for the resources page has an invalid ?topic= argument, it just doesn't do any topic filtering.

vale ibex
signal forge
#

Plus I'm kind of excited and want to leverage this first contribution as much as possible as a learning experience 🙂

trim cradle
signal forge
trim cradle
#

It sounds like you're interested to take on something more substantial as well. I'm sure we can find another task that will push you a bit further than this one does.

signal forge
crude gyro
#

thanks for the contribution lemon_cowboy

signal forge
#

No problem, Lemon! Is it ok if I'm assigned to the issue?

crude gyro
#

yeah, link it?

#

assigned.

signal forge
#

Thanks so much, @crude gyro

crude gyro
#

thanks yourself

green oriole
#

I randomly found that in my picture gallery and I have to say this is the most important announcement ever put out

#

oh wait this is staff-announcements

#

that's considerably less fun

#

also yes this is from august

fallen patrol
#

as dpy wasn't well designed for typings with the different types of interactions

vale ibex
#

Ahhh right, couldn't find anything in the changelog so assumed it was removed

signal forge
#

Howdy, everyone. Forgive the beginner question, but I am working on an issue for the bot. I forked and cloned the project and am pushing my branch to my local repository on GitHub. Should I also push my new branch to the actual GitHub repository, or do I just do that when I am complete with my work locally? I think it would make sense to push my branch to the actual repository so other people can merge it into their forks to test it out, right?

I'm super new to Git, so thanks for bearing with me 🙂

summer garden
eternal hull
#

What's the best way to check if an issue regarding a certain problem already exists so I don't end up making a duplicate one?

austere hornet
# eternal hull What's the best way to check if an issue regarding a certain problem already exi...

Well, simple: if you want open an issue for a game you want to write for @dusky shore , for example, go to https://git.pydis.com/sir-lancebot/issues and search for that game and if nothing comes up, then you're free to open an issue. If something does come up, you can feel free to comment on that issue. Same goes for all of the other repos.

GitHub

A Discord bot started as a community project for Hacktoberfest 2018, later evolved to an introductory project for aspiring new developers starting out with open source development. - Issues · pytho...

#

Hope this helps!

eternal hull
#

Also, what do I do after I submit an issue?

#

It's something for @stable mountain

austere hornet
eternal hull
#

Ah ok

hoary haven
#

other users will pitch in and give ideas for or against, possibly discuss other options. eventually a core dev will decide on a direction for implementation, or close the issue if we decide it's not something we want at the moment

eternal hull
#

Will I get like a message if it gets approved?
Or would I just have to keep checking in?

hoary haven
#

you'll get a ping and probably some notifications from github :)

austere hornet
#

You can also check #dev-log to see if someone commented on your issue

eternal hull
#

Noted

#

That's cool

#

oh that's really cool

austere hornet
#

Yeah 😁

hoary haven
#

yeah, even if your issue isn't approved, lurk these channels and you can learn a lot by observing

eternal hull
#

I will

#

thanks again

hoary haven
#

would they be any way for us to add git docs to !docs?

patent pivot
#

we could add manpages of popular commands but it's not quite as intuitive and the UX won't be great

placid ermine
#

i think its out of scope

fallen patrol
thorny spade
#

can anyone approve

#

thanks

cold island
#

Personally not in favor, commented in the issue

patent pivot
fallen patrol
#

@cold island relative timestamps do work on mobile lol, what OS are you on?

#

there is specific locations where they don't work

fervent sage
#

subject deez nuts

patent pivot
#

yeah look under alt names lol

fervent sage
#

ye ik

#

but the deez nuts joke was more important

patent pivot
#

banks shoots, banks scores

cold island
fallen patrol
#

this is my bots uptime command

#

on android

#

both an exact and relative timestamp, visible on android

cold island
#

🤷‍♂️

#

I'll try updating the app later

#

Nope there don't seem to be avaliable updates

patent pivot
rapid swallow
#

maybe we can have both

fallen patrol
#

but yes

patent pivot
#

yeah, it's not on stable

#

and most android users are on stable

fallen patrol
#

probably will have to wait another few months and then some for it then

surreal veldt
#

Has the pin article been pull requested? CC: @trail pilot

last patio
surreal veldt
last patio
#

ah I see

surreal veldt
#

okay yeah I just checked and doesn't seem so

trail pilot
surreal veldt
#

not to get it done faster, just for personal knowledge gain

trail pilot
surreal veldt
#

thank you!

trail pilot
#

Np!

signal forge
surreal veldt
#

But it's regarding a project for putting some pins in #discord-bots to the python site

wild prism
signal forge
#

Ah... I see 🙂 Thanks @wild prism

surreal veldt
#

Anyone, if they have some time, mind walking me through the steps of installing pre-commit hooks

brisk brook
dim pelican
#

I think pre-commit install should also work:

:Desktop\python\sir-lancebot  main [$?2✓] 🐍

➜ pre-commit install
pre-commit installed at .git\hooks\pre-commit
surreal veldt
# brisk brook It should just be `poetry run task precommit`!

I know I asked this before, but I didn't have time to follow up.
Anyways, it raises


  Command C:\Users\tenuk\AppData\Local\pypoetry\Cache\virtualenvs\site-C_3__m3n-py3.9\Scripts\python.exe -W ignore - errored with the following return code 1, and output:

  The system cannot find the path specified.
  input was : import sys```
#

I need to put it to PATH right?

brisk brook
surreal veldt
#

poetry

brisk brook
#

I am gonna be honest, personally I don't use the pre-commit hooks. If you haven't yet made any changes I think you could start with that and take a look at pre-commit once you have made the changes you want and are looking to commit it.

brisk brook
# surreal veldt poetry

Wouldn't that have a different error like Couldn't find specified program or path 'poetry'....?

surreal veldt
#

yeah i have no idea

#

i'm kind of clueless in these type of things

surreal veldt
#

it's when i run poetry run task precommit

dim pelican
#

Got it, and what is your current working directory when you run it?

surreal veldt
#

what do you mean?

dim pelican
#

From the command line, you should be in a directory (what is the path to the left of your cursor?)

#

For example, I am currently on my Desktop, in the python directory:
(I use a modified shell, but the concept is the same)

surreal veldt
#

Is it this? Command C:\Users\tenuk\AppData\Local\pypoetry\Cache\virtualenvs\site-C_3__m3n-py3.9\Scripts\python.exe -W ignore - errored with the following return code 1, and output:

dim pelican
#

If I navigate to where I have cloned Sir-Lancebot, it would show like this:

dim pelican
surreal veldt
#

okay yeah nevermind it's this

#

C:\Users\tenuk\site

dim pelican
#

👍

#

And what did you run from there?

surreal veldt
surreal veldt
dim pelican
#

Try poetry run task pre-commit

#

Or pre-commit install

surreal veldt
#

it's the same error

#
PS C:\Users\tenuk\site> poetry run task pre-commit

  EnvCommandError

  Command C:\Users\tenuk\AppData\Local\pypoetry\Cache\virtualenvs\site-C_3__m3n-py3.9\Scripts\python.exe -W ignore - errored with the following return code 1, and output:

  The system cannot find the path specified.
  input was : import sys

  if hasattr(sys, "real_prefix"):
      print(sys.real_prefix)
  elif hasattr(sys, "base_prefix"):
      print(sys.base_prefix)
  else:
      print(sys.prefix)


  at ~\.poetry\lib\poetry\utils\env.py:1195 in _run
      1191│                 output = subprocess.check_output(
      1192│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1193│                 )
      1194│         except CalledProcessError as e:
    → 1195│             raise EnvCommandError(e, input=input_)
      1196│
      1197│         return decode(output)
      1198│
      1199│     def execute(self, bin, *args, **kwargs):```
#

i assume there's something wrong with how I installed poetry maybe?

dim pelican
#

And you have done poetry shell?

surreal veldt
#

that raises the same error

#

but when I do just poetry it gives a list of commands

dim pelican
#

Weird....

surreal veldt
#

how do I uninstall poetry so I can try again?

#

maybe my files got messed up

vale ibex
#

open up C:\Users\tenuk\AppData\Local\pypoetry\Cache\virtualenvs\

#

and delete the folder site-C_3__m3n-py3.9

#

Done that?

#

@surreal veldt ?

surreal veldt
vale ibex
#

it's a hidden folder

#

just paste that entire path into the address bar of windows explorer

vale ibex
#

yea

#

and press enter

surreal veldt
#

sorry I meant to send both at once

vale ibex
#

oh, that's likely the problem

vale ibex
surreal veldt
#

so do you know what to do?

vale ibex
#

What about just C:\Users\tenuk\AppData\Local\pypoetry\Cache

vale ibex
#

hmm interesting

#

what is poetry version

#

Actually, it'll need to be poetry --version

surreal veldt
surreal veldt
vale ibex
#

That's the same version I have, no idea what's happened to your files

#

could you run python -c "import os,sys;print(os.path.dirname(sys.executable))"

#

that'll output the path to your base python install

#

does it end in 39?

surreal veldt
vale ibex
#

ah

#

you have python installed from windows store

#

I'm not saying that's causing this issue, but it's definitely not helping

#

and you will run into issues in future

#

make sure to select add Python to PATH when going through the installer

surreal veldt
vale ibex
#

Ah, then your PATH likely isn't in the correct order

#

Since the windows store version is what's being used when you run python

surreal veldt
vale ibex
#

to confirm that you have the other version installed, you can go to C:\Users\Chris\AppData\Local\Programs\Python\

#

and see if a Python39 folder is there

#

that's the default path for it

surreal veldt
#

oh wait

#

have to replace Chris

vale ibex
#

oh lol yea

surreal veldt
vale ibex
#

32bit version isn't great

#

I'd suggest installing 64 bit version and make sure to select add it to your path

surreal veldt
#

uninstall?

vale ibex
#

you can uninstall 32 bit if you want

#

Python39-32 means it's Python 3.9 (32-bit) you have isntalled

surreal veldt
#

should i delete 310 also?

vale ibex
#

3.10 is worth keeping

surreal veldt
#

i was using 3.9

vale ibex
#

Just deleting the folder doesn't uninstall it.

#

if you want to remove it, do it via control panel

surreal veldt
#

so i should remove 32bit version from path and add 64 right

#

oh also I don't know if this helps but I have this in PATH

vale ibex
#

that's fine

#

that's what allows you to use poetry in powershell

#

If you install 64bit from python.org, it will add to path for you

#

so long as you tick the box

surreal veldt
#

what do I do to put this over windows store?

vale ibex
#

if you restart all instances of powershell and run python -c "import os,sys;print(os.path.dirname(sys.executable))" what shows up?

#

if it's still windows store, then you'll need to raise the new install above that in your PATH var

surreal veldt
#

before I ran it in VS code terminal but now in powershell and it says PS C:\Users\tenuk> python -c "import os,sys;print(os.path.dirname(sys.executable))" C:\Users\tenuk\Desktop\python PS C:\Users\tenuk>

vale ibex
#

ok that works

#

you installed python on your desktop?

surreal veldt
#

yeah just installed the 64bit on laptop

vale ibex
#

I mean C:\Users\tenuk\Desktop\python means it's in your desktop folder

#

shouldn't cause issues, just odd

#

anyway, if you open C:\Users\tenuk\Desktop\python is there a python.exe in there?

surreal veldt
vale ibex
#

cool

surreal veldt
#

pythonw.exe is there

vale ibex
#

python.exe is too

#

if you goto your site folder now in powershell

#

run poetry env use C:\Users\tenuk\Desktop\python\python.exe

surreal veldt
#

how do I go to my site folder in powershell?

vale ibex
surreal veldt
#

oh okay i that wrong

surreal veldt
vale ibex
#

alright, you're likely going to have to reinstall poetry now, since I have no idea where it's storing that env that it's trying to use

#

when you reinstall, it should correctly use your python version

surreal veldt
#

do i use pip uninstall?

vale ibex
#

did you install it with pip?

surreal veldt
#

i think so yeah

#

'twas a while back

vale ibex
#

Ah, that's highly not recommended

surreal veldt
#

yeah...i heard that

#

but is it fine to uninstall with pip?

vale ibex
#

I am assuming you installed it with pip on the windows store version

#

so you'll need to uninstall it with that version too

#

the other option is to see if it appears in control panel

surreal veldt
trail pilot
dusky shoreBOT
signal forge
#

Nice thanks!

surreal veldt
#

how do I go back to the old version now that I installed the 64 bit?

vale ibex
#

No, in the control panel when you're trying to add or remove programs

surreal veldt
#

oh in control panel > uninstall a program, I don't see it

vale ibex
#

alright

#

if you run (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content > install-poetry.py that will download the install script

surreal veldt
#

install?

#

oh okay

vale ibex
#

you can then run python install-poetry.py --uninstall

#

and that might work for the pip installed one

surreal veldt
#

do i need to go back to the before py version?