#dev-contrib

1 messages · Page 119 of 1

dusky shoreBOT
vocal wolf
#

there we go

patent pivot
#

velvet sequoia
#

Thank you!

short snow
exotic ember
#

whoops, I added that after you asked

#

then kinda forgot about it

short snow
fallen patrol
#

ah

#

this part i presume

Would need confirmation as I'm not sure if I got it right myself but I don't think the 16 hour limit was meant in this way, but the other way around (as a maximum). With a 16 hour minimum the moderator will always have less than 8 hours for personal non-ping time.

trim cradle
cold island
#

Yeah the 16 hour limit is a maximum

clever wraith
#

for the helpdm command can the dm be deleted once the channel is closed? the command is close to having no benefit

short snow
short snow
#

invoking time:

#

wait, does that mean past?

#

like it the time was in past, so it is getting scheduled immediately PE_PandaThink

short snow
#

Yeah, that was the issue, fixed it and pushed

brazen charm
short snow
#

Ah got it 👍

#

I have mentioned your changes btw

vale ibex
#

Ahh cool, we can free up some emoji slots on emoji server 2 now

#

We're actually at the limit atm

#

Can do it when I'm home

green oriole
#

lol, I guess it is time for server 3

vale ibex
#

Lol Yea

#

Realised deleting emoji was possible in mobile, so I've just done that

#

We've got 4 emoji slots left on there

green oriole
#

We probably have a few that aren't used anymore

vale ibex
#

Yea probably

#

Definitely on the first emoji server

#

There's a bunch of egg emoji

green oriole
#

I think we still have the egg chase cog in sir lance

vale ibex
#

Don't think I was around for that event

green oriole
#

It is very old

#

Maybe two years or so

#

I believe the last 8 or so emojis in the first server can go away

torpid grotto
#

Seems like @stable mountain is triggering typing for quite a while after the docs command was invoked. this might be a discord bug though

#

not sure if this was the right channel to send this to so lmk

vale ibex
#

Do you have example input that causes it?

#

Yea, this is the right channel for discussing it

torpid grotto
#

Just any documentation lookup it seems

#

About every time it was used now

vale ibex
#

So the typing event stays even after the doc is sent?

brazen charm
#

!d str

stable mountainBOT
#
str

class str(object='')``````py

class str(object=b'', encoding='utf-8', errors='strict')```
Return a [string](https://docs.python.org/3/library/stdtypes.html#textseq) version of *object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of `str()` depends on whether *encoding* or *errors* is given, as follows.

If neither *encoding* nor *errors* is given, `str(object)` returns [`object.__str__()`](https://docs.python.org/3/reference/datamodel.html#object.__str__ "object.__str__"), which is the “informal” or nicely printable string representation of *object*. For string objects, this is the string itself. If *object* does not have a [`__str__()`](https://docs.python.org/3/reference/datamodel.html#object.__str__ "object.__str__") method, then [`str()`](https://docs.python.org/3/library/stdtypes.html#str "str") falls back to returning [`repr(object)`](https://docs.python.org/3/library/functions.html#repr "repr").
torpid grotto
#

Yes it hangs for a good few seconds I'd say around 5?

tawdry vapor
#

Isn't it a discord limitation

brazen charm
#

Seems alright to me, but there could be some client side issues

torpid grotto
#

It seems to be happening when more then one people do it at the same time though

tawdry vapor
#

That it has a minimum time it lingers for

torpid grotto
#

I didn't keep a close eye

torpid grotto
vale ibex
#

Yea, the typing events in discord don't have an end event, you send the typing event and then it ends when you send your message

#

Or it times out

brazen charm
#

I guess we could remove the typing as most fetches will be almost instant

torpid grotto
#

Ah yep this is a discord limitation seems like

torpid grotto
#

I don't think you need to trigger typing after every fetch or whatever it is in this bot

#

I haven't read the source code of this bot so I'm unsure

vale ibex
#

There's a context manager in d.py,which you just wrap the command in

#

I pretty certain that's what we're using

torpid grotto
#

Ah sorry, I haven't read through this bot's source code much

#

I see the context managers now

green oriole
#

The typing event either stops after you send a message or a 5s timeout

#

But the context manager isn't really a reliable method and may retrigger a typing just after the message is sent, meaning that will have to wait those 5s

sleek steppe
#

Doesn't it send the message outside the context manager?

green oriole
#

That's even weirder then

fervent sage
# sleek steppe Doesn't it send the message outside the context manager?

it shouldn't matter, what's meant to happen is the client receives the typing event, then wait for message from typing_author in channel then cancel_typing in the client, only if you send the typing and send events close enough together it's possible for delays to cause them to be desynced which makes the typing linger

brazen charm
#

The typing could also be moved to only trigger when a web request is made but the channel would need to go through a few method calls to get there

fallen patrol
#

Uh

vale ibex
fallen patrol
vale ibex
#

fine to me

vale ibex
fallen patrol
#

Pain.

fallen patrol
#

First part

vale ibex
#

lol not sure what's happened there

#

I'm guessing something to do with the square brackets in the post title is breaking the android app

fallen patrol
#

Ah

#

The author used bold in the body

stable mountainBOT
#

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

vale ibex
#

it should be escaped, since it works on the desktop client.

#

I'm guessing it's a bug in the android app

fallen patrol
#

Sigh.

#

I can't get the raw of that message since it's over 2k characters

green oriole
#

Yep, you can blame that one on Discord

fallen patrol
#

Would need it uploaded to paste to see the exact markdown and why there's an issue

green oriole
stable mountainBOT
#

Sorry, an unexpected error occurred. Please let us know!

RuntimeError: Line exceeds maximum page size 1992

fallen patrol
green oriole
#

Thank you bot

fallen patrol
green oriole
#

Well, not like I can do that

placid ermine
#

i think jason posted about this issue a while ago

sleek steppe
#

That's for .pridefact?

#

.pridefact

dusky shoreBOT
#

The year 2021 is not yet supported

vale ibex
#

but ofc, we don't have any 2021 facts in the repo

short snow
#

weeeee cj8 is coming lemon_hyperpleased

#

June 21st

#

wait June 14 for yesterday pithink

#

Monday, June 14 - Form to submit theme suggestions opens

patent pivot
#

good spot

#

I guess it's June 14 in some of the world, but 15 in UTC where we put these calendars

thorny obsidian
#

<_< It's the 14th in the only important TZ

short snow
#

its 15 even in UTC i think, i am 5.30h ahead, and it is 7.43h now

patent pivot
#

yeah, it's 15th in UTC now, so we should amend that

short snow
#

vimeo should be capital right 😛

patent pivot
#

ya it could be

#

feel free to add review comment to caps youtube/vimeo

#

i'll disable auto-merge

short snow
#

welp,you disabled it just on time

patent pivot
#

lul

short snow
#

nice, its gonna be CLI/TUI this time

thorny obsidian
#

Well.... the precommit hook failed me ;_;

patent pivot
#

lol

short snow
#

lint before you push lemonshake

thorny obsidian
#

I did!

#

It passed!

short snow
#

👀 interesting

patent pivot
#

it's because you merged in a suggestion that a trailing space

short snow
#

probably u merged by commit through UI, and it caused error

patent pivot
short snow
#

but i only did change in one word, not aything else

patent pivot
#

yeah, but git has no concept of a word

#

it's a line change, and the suggested line had a trailing space

short snow
#

oo

patent pivot
#

okay we're good to merge

short snow
#

whats github bootcamp? walkthrough it?

patent pivot
#

hahaha now you mention that the github is capitalised incorrectly

vocal prairie
#

It's a git crash course basically

short snow
#

welp, i forgot even github is GitHub

patent pivot
#

Github should be GitHub yeah

short snow
#

lol

patent pivot
#

oh we never changed the date to tuesday either lol

short snow
#

we should add docs link to to each of the frameworks

tawdry vapor
#

You forgot to change this

patent pivot
#

yeah, i noticed that too

short snow
#

and that lol

patent pivot
#

adding it to my patches branch

vocal wolf
#

we do a little bit of trolling

#

@patent pivot I've never seen such a complicated PR

patent pivot
#

lmfao

short snow
vocal wolf
#

this is a bug in english and needs to be solved IMMEDIATELY

short snow
#

lets see if there is something else remaining

short snow
patent pivot
#

could do, probably not in this PR though

vocal wolf
#

why don't we have a label for html in site

patent pivot
#

lol

vocal wolf
#

shouldn't we?

tawdry vapor
#

Doesn't the platform agnostic rule conflict with some frameworks which are not cross platform e.g.ö curses

short snow
#

is it straightforward or straight forward pithink

tawdry vapor
#

The former or straight-forward

short snow
#

@patent pivot another one

tawdry vapor
#

The latter would be used like "look straight forward" which is a different meaning

short snow
#

yeah

patent pivot
#

cc @thorny obsidian

tawdry vapor
patent pivot
#

hmmm

tawdry vapor
#

Never mind, urwid is also a problem

patent pivot
#

we could revert the PR adding events page, make all these necessary corrections there (both those in my PR & those mentioned here) and merge when it's ready for sure, having stuff picked up by scrapers & linked from various bits of the site when unclear probably isn't great

#

linking to docs for each of the frameworks seems smart

short snow
#

linking would be hyperlinking the heading or adding another line below?

patent pivot
#

probably adding a documentation anchor to each

short snow
#

better PE_PandaThumbsUp

patent pivot
#

it is still nice to be able to link to them

#

so

thorny obsidian
thorny obsidian
short snow
#

Did codejam8 page just go down?

patent pivot
#

yep, I rolled it back while we get stuff ready

short snow
#

ah alright, is there a PR open with the changes?

keen valley
#

can we get the template of python discord so that we can make one of clone like it
and then I can run the bot and make changes
Or I should create the new one with specific channels and roles

short snow
onyx acorn
fallen patrol
#

Doing more stuff

#

The escape is not escaping everything

thorny obsidian
#

auto-merge is spooky

patent pivot
#

lol

thorny obsidian
#

is site autodeploy? or is your k8s still blocking?

patent pivot
#

autodeploy

#

it rolls back until a new deployment is created

#

all deployed fine

sleek steppe
#

I think I found a bug

#

does it do this for anyone else?

gritty wind
#

oh boy

#

haha

#

I see it in the repo

sleek steppe
#

I know the problem

#

it's the fact that it has a number in its name

patent pivot
#

cache cleared

#

it works now

sleek steppe
#

oh

sleek steppe
#

still doesn't work though

#

ah I needed to clear too

thorny obsidian
#

It worked locally ;_;

gritty wind
#

Clear your cache

thorny obsidian
#

I swear

gritty wind
#

ah

thorny obsidian
#

I tested it

gritty wind
#

It's working, just caching lol

placid ermine
#

@exotic ember should I close the PR?

#

nvm

torpid grotto
#

Does this happen a lot? Or is this just a rare issue

patent pivot
#

uhh

torpid grotto
#

Visually what happened was, I saw the typing indicator for the bot for a few seconds. Then it just vanished, then a minute later it sent

patent pivot
#

right now we're upgrading our kubernetes cluster

torpid grotto
#

Ah

patent pivot
#

so services are coming and going

torpid grotto
#

Ok that makes sense

vale ibex
#

!ext r help_channels

stable mountainBOT
#

:ok_hand: Extension successfully reloaded: bot.exts.help_channels.

vocal wolf
#

@fervent sage tag has been reviewed.

spring fern
#

!ext r help_channels

patent pivot
#

huh?

wide elm
stable mountainBOT
#

docker-compose.yml line 22

- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql```
vale ibex
#

afaik /docker-entrypoint-initdb.d/init.sql gets picked up by the postgres container on start and runs it for you

#

so having the init file in that path means the init.sql gets ran on startup

wide elm
#

It runs on startup?

vale ibex
#

It's a volume, rather than in the docker file, as we don't want that to be part of the image that get's pushed to prod

wide elm
#

ah, alright

tough imp
#

you can look at what the script does

#

it inits the metricity db and adds some testing data

#

since metricity isnt managed by django's ORM

#

you need to create the tables manually

#

@patent pivot can prob correct me if I'm wrong

patent pivot
#

yeah, that's it

#

we use two DBs for prod, but postgres docker image only inits 1 by default

dry folio
#

hey, i'm wondering how does one implement a tag? is the md file in resources/tags the only step?

vale ibex
#

yup 😄

dry folio
dry folio
# vale ibex yup 😄

bot#1644 is now on 😄
although this isn't my first time contributing to pydis... it says i need workflow approval

dusky shoreBOT
dry folio
sleek steppe
dry folio
dry folio
vale ibex
#

Yea, those still aren't ideal either, since they don't really tell me what's happened in those commits

brazen charm
#

you can always ammend or rebase while someone is not working with the branch or if they won't affect reviews

vale ibex
#

git rebase -i would be the easiest. You can change the commit names, save the file and close it. Then git push -f

#

at least that's how I usually do it

dry folio
#

@vale ibex are the messages better now?

dry folio
brazen charm
#

git commit --amend is used to add to the last commit, for going further than that you'll need the rebase, git rebase -i works or if you have a GUI utility for git it most likely provides an interface

dry folio
#

wait wat- speedrun

#

yay only one approval needed

#

@vale ibex i added a new commit and it's asking for approval again- why? isn't an approval enough?

vale ibex
#

It'll need to be approved for every change you make

#

until you get a PR merged

dry folio
dry folio
dry folio
gritty wind
#

For a tag, we should probably squash merge anyways

#

There is no reason for 5 commits to get a tag

dry folio
gritty wind
#

It’s still good practice to give them meaningful messages during the process, to aid reviewers, or at least get the experience

trim cradle
#

Is anyone available to review bot#1638?

dusky shoreBOT
green oriole
#

Yus

#

Smh @sleek steppe, not pressing the update branch button lemon_pensive

sleek steppe
#

No point when I can't merge lol

#

oh wait auto merge was on

#

I thought it updates it automatically

green oriole
#

lol

#

Also Stel was so ready for the changelog

#

That's one perm I really miss haha

sleek steppe
green oriole
#

lol

#

I'm going to ping you every time I need something to be posted there haha

trim cradle
#

@green oriole @sleek steppe thanks!

trim cradle
dry folio
#

is any core dev available to review sir-lancebot#756? last approval then it can be merged, this pr had been waiting for almost a month. thanks so much in advance!

sharp zephyr
#

thought it'd be cool to have token detection added to the !paste command . So if someone pastes a token , and clicks save .. before it is saved it reads the whole text looking for the word "token" ... and then checks with the user before confirming save . what do you guys think?

#

!paste

stable mountainBOT
#

Pasting large amounts of code

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

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

short snow
#

Issue: bot#1385 can be closed, since it is much clear right now

dusky shoreBOT
sharp zephyr
fervent sage
#

wouldn't it be better to use our existing token detection & somewhat validation (also, the pastebin isnt part of the bot)

sharp zephyr
#

so i see it could also search for a series of numbers/letters that look like a token , and verify that its not .

#

also there was an update on that issue on github

#

basically heard that the pastebin service is one that is not easy to add onto . As its a hosted application from another company

#

was just thinking of any ideas that could support users in not accidently posting their token . I nearly did . (i turned on logging for something else .. and it inadvertently turned on logging of my token in the log)

#

i just scroll through the log prior to posting . I see others will not

sharp zephyr
sharp zephyr
#

very cool

#

hmmm

#

well ... if theres a way to put a message on the "backburner" before being posted.... a bot could grab every pastebin and search the html text for anything that looks like a token .. in the same way.

#

and if it doesnt pass, deny the message post . And if it passes, paste the link

fervent sage
#

not possible

sharp zephyr
#

the backburner idea is not possible?

fervent sage
#

no, discord doesnt let you do that

sharp zephyr
#

i see ...

#

the link could be passed to the bot , instead of being directly posted into the channel , and then the bot posts the link when it passes

#

using a private message to the bot option .. using the / commands

fervent sage
#

thats just becoming harder and harder to actually use though

#

its not worth it for the minimal benefit it'll provide

sharp zephyr
#

idk , i see there could be a lot done with that . The bot could even create a new pastebin that doesnt include the tokens , and instantly post that instead.

#

and users could use it and know that their code is safe .. could be optional

#

and preferred

fervent sage
sharp zephyr
#

mhm , yes . i see tht

#

i see there could be another way to post bulk code with it being checked like the token_remover does

#

maybe passing it to a bot instead of using pastebin

fervent sage
#

again its just removing ease of use for little added value

#

we've considered various ways of adding token removal and in the end it boils down to just not being worth it for the few occasions it actually helps

sharp zephyr
#

understanding that it has already been looked into

gritty wind
#

We won’t be adding features to the pastebin if it can be helped

#

We’ve shot this idea down many times before. There is some gain, but not worth the hassle of maintaining our own fork of hastebin

#

The hastebin also doesn’t have as much a risk of scraping as on server messages, because accessing it involves more steps and resources than scraping the server

gritty wind
green oriole
#

I wonder if we could proxy the requests to the pastebin

#

Yeah, we can totally do that (CC @patent pivot)

#

Put a proxy that analyse POST requests, and if a token is found put a placeholder instead

patent pivot
#

Also worth checking the error responses, we might be able to forge one of those to display it to clients

green oriole
#

Hmm

#

I guess I could try to reach the characters limit

#

Seems like it answers with 400 and a json message body

#

cool

#

Could I make that a traefik middleware?

short snow
patent pivot
green oriole
#

right

fallen patrol
# fervent sage no, discord doesnt let you do that

it would be nice if it did, but it would have to be a permission thing. Ig like manage messages.….
discord has the api to make this possible, but i wonder if it could handle that many requests.…
what if bots could set up regexes within discord to be deleted so discord blocks them because they match a regex and then it lets the bot know with the interactions api or smth?
hm.…
I'm rambling at this point lmao, respond in #ot2-never-nester’s-nightmare

patent pivot
#

@green oriole do you wanna open an issue on workers to add token filters

green oriole
#

sure

#

!remind 14h hope you did it, you lazy bastard

stable mountainBOT
#
Yeah okay.

Your reminder will arrive in 13 hours, 59 minutes and 59 seconds!

patent pivot
#

lolol

stable mountainBOT
#

@green oriole

It has arrived!

Here's your reminder: hope you did it, you lazy bastard.
[Jump back to when you created the reminder](#dev-contrib message)

green oriole
#

I am officially a lazy bastard

dry folio
stable mountainBOT
#
Missing required argument

expiration

#
Reminders for Objectivitix#9891

No active reminders could be found.

dry folio
#

wat, i set an 8-year reminder...

fallen patrol
#

WOOO

#

inline timestamps

#

<t:1618953630:d>

#

seems worth adding to @stable mountain for when stuff infractions end

#

it will show it in the user's local time

#

oh wait nvm it doesn't work on mobile (android) yet

thorny obsidian
#

Mhm, that's most likely the plan once it's on stable

fallen patrol
#

oh u already knew of this?

#

smh

short snow
#

oh that's wonderful, but I don't think it is gonna get stable anytime soon lol, see files

fallen patrol
#

<t:1624047476:t>
<t:1624047476:T>
<t:1624047476:d>
<t:1624047476:D>
<t:1624047476:f>
<t:1624047476:F>
<t:1624047476:R>

patent pivot
#

it'll hit stable soon

#

it's been on canary since this morning

fallen patrol
patent pivot
#

android has it

fallen patrol
#

uh no

#

are you in android alpha?

patent pivot
fallen patrol
patent pivot
#

i don't know i don't use android lol

#

friends screenshot

fallen patrol
#

idk what to tell you

#

i don't have it lol

#

but i am up to date on beta

patent pivot
#

yeah, it's probably alpha

#

but we won't look at implementing it at all until docs are merged and it hits stable on all 4 platforms

fallen patrol
#

4?

patent pivot
#

desktop, web, ios, android

fallen patrol
#

o

#

web and desktop are identical lol

patent pivot
#

in parts

#

gateway for desktop and web is completely different

#

desktop uses erlang term format (ETF), web uses JSON

fallen patrol
patent pivot
#

because browsers can't handle ETF very well

fallen patrol
patent pivot
#

the TL;DR is that web & desktop operate differently

vale ibex
#

Anyone seen this on bot before? ```
postgres_1 | 2021-06-18 19:03:41.124 UTC [69] ERROR: integer out of range
postgres_1 | 2021-06-18 19:03:41.124 UTC [69] STATEMENT: INSERT INTO "api_role" ("id", "name", "colour", "permissions", "position") VALUES (476190141161930753, '@everyone', 0, 4397059136, 0)
web_1 | Internal Server Error: /bot/roles
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute
web_1 | return self.cursor.execute(sql, params)
web_1 | psycopg2.errors.NumericValueOutOfRange: integer out of range

#

loading this on the site directly, it seems the permissions column in only an integer, not a bigint

#

hmmm, wonder why this is pushing a larger number than normal

#

ah ok I got it

#

d.py 1.7 added 3 new permissions

#

so we will need to bump site max val to allow for that, before bumping bot to 1.7+

#

Soooo, bumping d.py up to 1.7 for @stable mountain will require changing a column type on site from int to bigint

#

would that just work with a migration?

fervent sage
#

lol so the breaking change is breaking due to integer handling kek

fervent sage
#

actually, exactly that

#

might take a sec though, it has to rewrite all of the rows in the table because the size changes from 4 bytes to 8

vale ibex
#

was mostly asking if there's other things to consider

#

site#534 bot#1648

fervent sage
#

shouldnt be, should be pretty smooth as long as the table isnt like millions of rows

vale ibex
#

only other thing I saw was the new linesep arg in the Paginator class

fervent sage
#

if it is massive no issues, just the table would be locked until the alter finished

#

but thats a pretty smol table iirc

vale ibex
#

yea, it's the roles table too, so it's not huge

green oriole
green oriole
#

Thank you wookie and Chris

vale ibex
#

you now owe me 1 groote

fallen patrol
#

Not sure that's the best solution

#

I feel like it should check a user's flags and have the 4.2k limit for nitro users and 3k for non nitro users

remote wigeon
#

you cant do that

#

a discord bot cant see nitro flags

green oriole
#

We are not going to implement any nitro gate either way

#

Every user should be equal no matter what

#

and for what is worth I'm really not happy with the 4k chars change

fervent sage
#

im confused why we increased the limit of a spam filter because it was possible to send more? surely no matter how much discord raises the limit, what qualifies as spam remains the same?

green oriole
#

Well, I we don't think we should be muting someone for sending a full length message

#

At least not automatically

fallen patrol
fallen patrol
patent pivot
#

they definitely cannot

fallen patrol
#

Huh?

#

OK brb

patent pivot
#

you can see if a user boosts or has an animated avatar

green oriole
patent pivot
#

you cannot see if they have a nitro subscription

fallen patrol
#

I thought you could lol

patent pivot
#

nope

green oriole
#

Two full length for a non nitro is the same as one full length for a nitro user

#

I don't see why we would punish the former but not the latter

#

Again, nitro is a Discord thing, we are not discord

#

We don't care if the user has nitro or not

fallen patrol
#

Ah yep

#

Can't get the nitro flags

#

Can get every other flag

patent pivot
#

yep

remote wigeon
#

i dont think they'll ever add that

#

just think the amount of data that would mean for bots like dyno or mee6

patent pivot
#

yeah, it's closed

remote wigeon
#

data discord definitely doesnt want in competitioners hands

fallen patrol
#

Yeah and there's already two ways for bots to figure out if one has nitro

#

Three, I guess

#

Which all require user input

cold island
#

Is there a way to check if a user accepts DM's without sending them one?

brazen charm
#

Don't think you can do that

sleek steppe
#

Well it's still making an API call, but you can send them a blank message and see if you get a 403 vs a 400 :P

cold island
#

Hah, I'd rather not spam people with blank messages

fervent sage
#

thats the thing

#

the blank message will 400 if its not a 403

#

and never be delivered either way

cold island
#

o

#

🤔

fervent sage
#

im curious though which takes precedence

#

if I were designing the api (as i have done lol) then I'd do that sort of message validation pre-database query to see whether I could send it

#

so in my api a blank message would always 400, even if it couldnt be sent to a user

#

unsure if thats how discord handles it though

#

huh, discord validates that a message can be sent before it validates content length, very interesting

sleek steppe
vocal wolf
#

@timid sentinel that's one small pr

timid sentinel
#

lol. small pr's are my speciality

vocal wolf
#

and this is more of a bug than an enhancement I think

fervent sage
#

I love small PRs

sleek steppe
#

Hmm on mobile it says I can enable auto merge but when checks pass it doesn't merge 😔

fervent sage
#

wait you can enable auto merge on bot repo prs...

sleek steppe
#

Nah I think it's a github mobile bug

fervent sage
#

it looks like it went through

sleek steppe
#

I disabled because it didn't merge

vocal wolf
fervent sage
#

already on it

vocal wolf
#

mmmm good

fervent sage
#

lol

green oriole
#

I am speed

#

Much faster that both of you combinated

fervent sage
#

I dont have bot issues piped into my brain tho pensivewobble

clever wraith
fair spoke
#

.

stable mountainBOT
#

:incoming_envelope: :ok_hand: applied mute to @fair spoke until 2021-06-19 20:38 (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

fallen patrol
#

add some of the tui stuff to @snekbox

brazen charm
#

how would you be able to use it

patent pivot
#

yeah snekbox isn't suited for that sort of stuff

fallen patrol
#

!d rich.traceback.install

stable mountainBOT
#
rich.traceback.install(*, console: Optional[rich.console.Console] = None, ...) → Callable[[Type[BaseException], BaseException, Optional[types.TracebackType]], Any]```
Install a rich traceback handler.

Once installed, any tracebacks will be printed with syntax highlighting and rich formatting.
green oriole
#

I don't think we should be adding rich knowing that only a couple of functions will work corectly

#

It may not even work because it is lacking a big part of the tty interface

vale ibex
#

Could we get bot#1653 reviewed pls

green oriole
#

no

short snow
#

@brazen charm Could you give bot#1634 another review? :D

dusky shoreBOT
brazen charm
short snow
#

I don't get any errors now

brazen charm
#

I can still see them, do you have anything in the redis cache for it to reschedule?
From the ones I checked, there's an unawaited coro for the mod var, it's trying to unpack int keys from the dict instead of using items directly and is passing a string to fromtimestamp

short snow
#

That would have been the issue probably, i probably would have forgotten to disable fake redis when I shifted to docker for testing sadpats

#

i will have a look

molten perch
#

Hey, I'm kind of new to this open-source world, however I think I spotted an issue(in Sir-Lancebot) that I might be able to fix, and haven't been assigned to anyone.
If I'd like take it, my only job is to leave a comment? 😄
(Sorry, I haven't done such things before)

exotic ember
molten perch
#

okay, thank you!

vale ibex
molten perch
#

Okay! However that issue doesn't seem to be a hard one.

vale ibex
#

Yea, should be a good introduction to the code in general

brazen charm
#

Any other opinions on bot#1641 ? Also waiting for an approval/consensus on bot#1545

dusky shoreBOT
vocal prairie
#

I like the idea of 1641

vale ibex
#

1545 had a core dev ping 2 days ago, so you should get a consensus soon

vocal prairie
#

I think 1545 might break too many things, but I haven't gone through the codebase much

vale ibex
#

It'll be a decently sized change to the users, but it opens up a lot of command name space

brazen charm
green oriole
#

We created a poll to decide how we should interact with the namespaces

vale ibex
#

Yea, it was manual

clever wraith
#

Hey

#

I found a bug that might be a security issue

brazen charm
#

modmail or an email to admins would probably be the best if it's an actual vulnerability

clever wraith
#

Normally how ir looks when I launch my python script

brazen charm
#

ah

clever wraith
#

One typo

brazen charm
#

this channel is for python discord projects

clever wraith
#

And it seems to load parts of random images on my desktop bar.
Hovering with mouse makes it go grey then change permanently into another random image, until I hover over it again and it changes

clever wraith
brazen charm
clever wraith
#

Oh I see, that is tkinter for python, to make graphical stuff

#

Well, I am off to sleep, found it when I did finishing touches before bed. I'll do more bug testing tomorrow and try to find more info. On top of contacting the right place

brazen charm
dry folio
#

@sharp timber your changes have been all implemented :D

#

btw, absolutely genius lmao

short snow
#

oh is api open for contributions?

sharp timber
# dry folio <@!246512746986864641> your changes have been all implemented \:D

Alright, giving them a look over. FYI (literally fyi, just so you don't do more work) you don't need to merge master in very often when working on a part as isolated as this. Github can just merge it back up so long as there's no conflicts (which, given its a new file and nothing is changing around it, is cool)

sharp timber
gritty wind
#

Github (discord probably) sets that on it's own, not sure we can pull it for ya

#

It's mostly just an inverted the github logo tho

patent pivot
#

hmmm we probably shouldn't use <a>'s here for this navbar item

#

using a <span> seems to mimic behaviour

gritty wind
#

If you wan the CDN link, that's easy enough

vocal wolf
patent pivot
dry folio
#

@sharp timber changes implemented

dry folio
#

thanks a lot bast!! also, why is it not merged? everything's approved

gritty wind
#

It’s linting

dry folio
gritty wind
#

I triggered it now

dry folio
dry folio
#

!dunder-methods

#

Aww, still not updated?

short snow
#

let it build and deploy

dry folio
#

Hm, i guess it takes a while

vocal wolf
#

!dunder-methods

stable mountainBOT
#

Dunder methods

Double-underscore methods, or "dunder" methods, are special methods defined in a class that are invoked implicitly. Like the name suggests, they are prefixed and suffixed with dunders. You've probably already seen some, such as the __init__ dunder method, also known as the "constructor" of a class, which is implicitly invoked when you instantiate an instance of a class.

When you create a new class, there will be default dunder methods inherited from the object class. However, we can override them by redefining these methods within the new class. For example, the default __init__ method from object doesn't take any arguments, so we almost always override that to fit our needs.

Other common dunder methods to override are __str__ and __repr__. __repr__ is the developer-friendly string representation of an object - usually the syntax to recreate it - and is implicitly called on arguments passed into the repr function. __str__ is the user-friendly string representation of an object, and is called by the str function. Note here that, if not overriden, the default __str__ invokes __repr__ as a fallback.

class Foo:
    def __init__(self, value):  # constructor
        self.value = value
    def __str__(self):
        return f"This is a Foo object, with a value of {self.value}!"  # string representation
    def __repr__(self):
        return f"Foo({self.value!r})"  # way to recreate this object


bar = Foo(5)

# print also implicitly calls __str__
print(bar)  # Output: This is a Foo object, with a value of 5!

# dev-friendly representation
print(repr(bar))  # Output: Foo(5)

Another example: did you know that when you use the <left operand> + <right operand> syntax, you're implicitly calling <left operand>.__add__(<right operand>)? The same applies to other operators, and you can look at the operator built-in module documentation for more information!

dry folio
#

Let's go!

short snow
#

that is a big one 👀

placid ermine
#

you're implicitly calling <left operand>.__add__(<right operand>)
type(<left operand>).__add__(<left operand>, <right operand>) 👀

green oriole
#

I mean it is almost the exact same thing

sharp timber
#

!e ```py
class A:
def add(self, other):
raise Exception("Fail")

a = A()
def add2(self, other):
return A()
a.add = add2

print(a + a, a)

stable mountainBOT
#

@sharp timber :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 |   File "<string>", line 3, in __add__
004 | Exception: Fail
sharp timber
#

huh

#

TIL

green oriole
#

I am not sure what could be causing this

exotic ember
#

@green oriole what operating system are you on?

green oriole
#

Linux Manjaro

exotic ember
#

run grep cgroup /proc/filesystems and see if there is a cgroup2 line

#

at least, I think that's how I fixed it

green oriole
#

I have v1 and v2

exotic ember
#

yeah, you're probably using v2 since it supports it

#

check the link for switching it to v1 and try running it again

green oriole
#

hmm, will do later on

#

I probably won't need it before a long time

sharp timber
#

It's testing the test itself's coverage

green oriole
#

Yep

#

and because a branch in the test hasn't ran it isn't happy

short snow
#

@exotic ember @sleek steppe could you give sir-lancebot#745 and sir-lancebot#618 another review

dusky shoreBOT
sharp timber
#

I'm not all familiar with the tool so I'm not really sure I want to touch it

green oriole
#

Couldn't you just do without the try/except?

sharp timber
#

Yeah, although that turns any failure fo the test into an exception rather than a failure

green oriole
#

Well, is that a problem?

#

It is still a failed test

sharp timber
#

Eh. It feels wrong to not test it and return results and instead error out

#

I can change it to that though

#

We do have a coveragerc file it just doesn't have the test locations in it for some reason

green oriole
#

we can do that then

sharp timber
#

Should I make that part a separate PR?

#

I can do it now over the next, say, 30 minutes

green oriole
#

you can do that in one PR if you wish

sharp timber
#

Sorry, #539 already filed >.>

green oriole
#

no problem haha

#

now let's poke some people

#

Good morning @cold island, do you have a second?

cold island
#

hey

brazen charm
#

Having coverage on tests can be useful, I'd just ignore that one branch

green oriole
cold island
#

I approved the first one, not available to look into the second

dry folio
#

everyone in the cat dev is ascending

#

so happy

placid ermine
#

thank

short snow
#

For some reasons reaction adding is reallly slow

#

on @stable mountain , did !tags

green oriole
#

is it getting rate limited

#

!int socket

stable mountainBOT
#
WebSocket statistics

Receiving 1.53 events per second.

TYPING_START

28,006

MESSAGE_CREATE

19,278

GUILD_MEMBER_UPDATE

11,112

MESSAGE_UPDATE

2,527

CHANNEL_CREATE

1,264

CHANNEL_UPDATE

1,022

MESSAGE_REACTION_ADD

965

CHANNEL_PINS_UPDATE

462

MESSAGE_DELETE

453

GUILD_MEMBER_ADD

400

VOICE_STATE_UPDATE

259

GUILD_MEMBERS_CHUNK

225

MESSAGE_REACTION_REMOVE

203

GUILD_MEMBER_REMOVE

201

MESSAGE_REACTION_REMOVE_EMOJI

171

GUILD_JOIN_REQUEST_DELETE

48

MESSAGE_REACTION_REMOVE_ALL

17

RESUMED

7

GUILD_BAN_ADD

7

GUILD_BAN_REMOVE

4

CHANNEL_DELETE

4

MESSAGE_DELETE_BULK

4

GUILD_CREATE

3

READY

1

GUILD_UPDATE

1

green oriole
#

Wait, that doesn't count outgoing

#

1.53/s is a lot

#

but that's unrelated

#

!help

stable mountainBOT
#
Command Help

Big Brother
!bigbrother
Monitors users by relaying their messages to the Big Brother watch channel.
!bigbrother unwatch <user> <reason>
Stop relaying messages by the given user.
!bigbrother watch <user> <reason>
Relay messages sent by the given user to the #big-brother channel.

Bot
!echo [channel] <text>
Repeat the given message in either a specified channel or the current channel.
!embed [channel] <text>
Send the input within an embed to either a specified channel or the current channel.

BotSource
!source [source_item]
Display information and a GitHub link to the source code of a command, tag, or cog.

Branding
!branding
Control the branding cog.

Clean
!clean
Commands for cleaning messages in channels.

short snow
#

hmm

#

this was fast

green oriole
#

Yeah, it does look rate limited

short snow
#

yeah, thanks

green oriole
#

there was a small break between the second and third emoji

fallen patrol
#

Buttons are the future

green oriole
#

maybe later

sleek steppe
vale ibex
#

@stable mountain hasn't gone up in flames 🎉

#

we're now on d.py 1.7.3

patent pivot
#

poggr s

fringe sphinx
fallen patrol
vale ibex
#

My code is 100% perfect and never breaks

#

until it does

trim cradle
#

There are two pinned questions in #help-peanut 😮 what could cause this?

trim cradle
vale ibex
#

Doesn't sound like something I'd do 🤔

fallen patrol
#

Hm

#

Rather than actually fixing the bug, seems like it would make sense to just make the bot iterate through all pins and remove them when a channel is closed

tawdry vapor
#

It could happen if the cache is cleared.

#

Or if an exception occurs during the process of making the channel dormant, and before unpin gets called.

#

That would likely only happen if Discord is having issues

#

The first case has a log message but it's a debug-level message, so it doesn't show up in production logs.

green oriole
#

Seeing how laggy discord was yesterday, I'm blaming them

hoary vessel
#

I was looking at the Wolfram command as I am using it for myself...

#

I got some error at this point and I literally have to idea how to deal with it.

#
 async with j1.http_session.get(query) as response:
#

It was this. But it is a little modified.

#

There used to be a self.bot there but as I am not using a class so I removed it.

#

There is no http_session in Bot so I don't know how to deal with it

green oriole
#

You can use your own http session here

hoary vessel
#

How do I even do that?

green oriole
#

You need to create an asyncio session

#

erm, aiohttp

balmy sparrow
green oriole
#

anand too fast

balmy sparrow
hoary vessel
#

Erm

#

Anyways, I think I solved it?

placid ermine
#

!d decorators

stable mountainBOT
placid ermine
#

what's up with this embed 👀

green oriole
#

Uhhh

#

Isn't that the EBNF syntax?

#

Okay, yeah

#

It is misdetecting a segment of the syntax as a valid symbol name

brazen charm
green oriole
#

That's stupid

#

Why did they put a symbol there

#

I wonder if we can submit an issue for it

brazen charm
#

I mean, it makes sense to scroll you in there with the fragment, just not for our use without some heavier parsing which may be incorrect in other cases

trail pilot
#

Uh I read the how to contribute to the bot but it confuses me even for the sir lancebot

vocal prairie
#

We can help you out

trail pilot
thorny obsidian
#

Docker makes it very easy to start up, I'd highly recommend using it

vocal prairie
#

The application is set up in docker so you can get it running with 1 or 2 commands.

trail pilot
#

Ohh ok

trail pilot
#

idk what it exactly is htough

vocal prairie
#

Docker helps "containerize" applications. Basically, that means it run it in an isolated environment. It's not as heavy as a VM, since it doesn't use it's own part of an OS or anything like that. It also helps with compatibility across OSs

short snow
#

if you are not using docker container, then you need

dense bear
#

In the cj8-qualifier repo's readme, it says that "If an item cannot be centered evenly, the extra space character should be to the right of the item (see example 3)".

However, after line 90 in local_test_suite.py, there seem to be 2 outputs for each of the test case. This indicates that the extra space character can be put either to the left or to the right of the item.

#

Shouldn't the readme be changed so as to reflect the condition used in the test cases?

cold island
dense bear
#

np :)

clever wraith
#

wouldn't it be handy if we kinda have a command for meaning of mutating arguments since people seem to stumble upon it quite a bit in qualifiers?

thorny obsidian
#

!mutable

stable mountainBOT
#

Mutable Default Arguments

Default arguments in python are evaluated once when the function is
defined, not each time the function is called. This means that if
you have a mutable default argument and mutate it, you will have
mutated that object for all future calls to the function as well.

For example, the following append_one function appends 1 to a list
and returns it. foo is set to an empty list by default.

>>> def append_one(foo=[]):
...     foo.append(1)
...     return foo
...

See what happens when we call it a few times:

>>> append_one()
[1]
>>> append_one()
[1, 1]
>>> append_one()
[1, 1, 1]

Each call appends an additional 1 to our list foo. It does not
receive a new empty list on each call, it is the same list everytime.

To avoid this problem, you have to create a new object every time the
function is called:

>>> def append_one(foo=None):
...     if foo is None:
...         foo = []
...     foo.append(1)
...     return foo
...
>>> append_one()
[1]
>>> append_one()
[1]

Note:

• This behavior can be used intentionally to maintain state between
calls of a function (eg. when writing a caching function).
• This behavior is not unique to mutable objects, all default
arguments are evaulated only once when the function is defined.

thorny obsidian
#

eeeeey

clever wraith
#

oh it is!

#

wow good to know, now we can just use it in there!

vale ibex
#

takes up like 1/3 of my portrait monitor 😬

fervent sage
# stable mountain

we could shorten it by removing a bit of whitespace and using foo = foo or []

sour wolf
#

Theres a typo on the last line, "evaulated"

#

Also wouldnt it be easier on the eyes if the tags were like a brief description of the concept and linked to a full article on the PyDis site mayhap?

thorny obsidian
sour wolf
#

Oh, neat

dry folio
#

hey, is any core dev available to review sir-lancebot#756? it's been sitting there for a month now, and i'd greatly appreciate any review! thanks a lot in advance!

short snow
short snow
remote wigeon
#

repost from #community-meta:
you use sentry for error collection dont you? I'm setting it up rn and cant figure out how to get it to send issues to discord

#

@gritty wind but how do i do that

#

i saw a guide that used a legacy slack integration but i cant find that anymore

gritty wind
#

I was about to link that guide

#

Umm, that is what we use, but I don't have permission to mess with it really

#

It doesn't show up in search like the issue says, but it definitely shows up if you directly visit the link

#

following the guide on my own project, seems it definitely does work

remote wigeon
gritty wind
#

Which step is giving you trouble?

remote wigeon
#

i might have overread the part that i need to directly visit the link lemon_sweat

gritty wind
#

You can technically get to it through the menus, but that's an overly complicated process

#

It's hidden under the "legacy integrations" menu, which only shows up on individual projects not orgs

remote wigeon
#

Tried it there as well lemon_sweat

#

But this is kinda annoying, having to configure it for each project

#

Kinda tempted to make my own integration

gritty wind
#

Shouldn't be too hard, just copy the slack integration, and change it's name to discord :troll:

remote wigeon
#

Internal plugins and integrations are different

#

Tho kinda tempted to make a pr like that

short snow
#

Perfect timing albedo, I just came here to ask that question lol

#

oh, so slack plugin works with discord, nice

gritty wind
#

Discord has native support for slack webhooks, for the most part

short snow
#

Ah alright thanks

remote wigeon
#

su uh the one currently used is a bit more complex

sleek steppe
#

I think sir-lancebot#594 can be closed.

dusky shoreBOT
short snow
#

pythondiscord got tasklists 👀 and yeah that can be closed

sleek steppe
#

actually I don't think it can be closed

#

I think we can just do an asyncio.Lock on the in_executor function

stable mountainBOT
#

bot/exts/evergreen/avatar_modification/avatar_modify.py line 23

_EXECUTOR = ThreadPoolExecutor(10)```
vale ibex
#

I meant that to be 1

#

had it as 10 during dev

sleek steppe
#

yeah I thought I had saw it as one earlier, which is why I thought the issue could be closed

#

I will make a PR that

vale ibex
#

Ah right, yea that's what i had intended to do

#

I was going to look into if there was a way to detect when there were a bunch of commands pending, so that we could deny them until the queue lowered

sleek steppe
#

we could use an asyncio.Queue with a maxsize

vale ibex
#

Yea, that would be a good solution

patent pivot
#

@vale ibex power move

vale ibex
#

lmfao

#

it had to be done

dry folio
trail pilot
#

Do not open a pull request if you aren't assigned to the issue.
So I had an idea for a project idea command in lancebot which gives one idea instead of the kindlings page on the python disc bot but --
am I not allowed to contribute because I need to open a pull request to suggest the idea because i presume this is already an issue that is occupied

#

I"m a bit confused by the wording

vocal prairie
#

You can go ahead and open an issue on the Lancebot repo.

#

You just shouldn't make a PR unless it's confirmed you're allowed to make that change.

trail pilot
vocal prairie
#

The issue is your way of asking if you can make a PR

#

On the issue template, you can choose either "I would like to implement this" or "Anyone can implement this"

#

The fomer is saying "I'd like to implement this, can I do so?" and the latter is saying "This is an idea for anyone to implement

brazen charm
#

@green oriole missing a space after the -U in the dump

#

Probably a good time to bump postgres in bot's compose as well

vale ibex
#

psql doesn't mind missing spaces between single char args like that, so it won't error, but it does look weird

#

I agree we should take this opportunity to upgrade everything to pg13 really.

#

huh I seem to have missed that

gritty wind
#

Hey if anyone's got a Mac, I'd like to get someone to test bot#1626. More testing in general is helpful, but mainly Mac is needed right now

dusky shoreBOT
vocal prairie
#

Hello! This channel is for discussion of Python Discord's projects. If you have a project you'd like to share, you might be better off doing that in a place like r/python.

wild prism
#

!rule 6
Sorry, but we don't allow advertising on the server, @terse vine

stable mountainBOT
#

6. Do not post unapproved advertising.

clever wraith
#

I am Ayman Essalai, I'm a young freelancer and I really appreciate creating stuff. One of my best qualities is my problem-solving skill. I can debug errors fast and this has really helped me during my coding journey ! I love programming, I dream code and I know : HTML, CSS3, basic javascript and python. With my different services, you're guaranteed to be happy.

rapid swallow
#

but please dont spam your message in multiple channels

clever wraith
rapid swallow
#

no worries 👍

trail pilot
#

I forked the sir lancebot repo but the entire thing is just confusing me

#

for one I have to download all the requirements so that'll take a while

#

two where is the file that reads from the yaml files?

vocal prairie
#

It explains everything you need to know to get started

trail pilot
#

raise DockerException(
docker.errors.DockerException: Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.')

I got this error trying to do docker-compose up

brazen charm
#

is docker running?

trail pilot
trail pilot
#
docker: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect

getting this error

molten perch
#

Hey! Can I get assigned to issues that hasn't been approved yet?

sleek steppe
#

Generally you wouldn't get assigned until the issue is approved, if you're unsure whether it's approved or not then you can ask here

molten perch
vale ibex
#

approved

#

Could you comment on the issue so I can assign you? 😄

molten perch
#

Done, thank you! 🙂

vale ibex
#

You're welcome 😄 Feel free to message here if you need a hand with anything 😄

molten perch
#

Sure, thank you! 🙂

gritty wind
trail pilot
#

so I run docker desktop as administrator?

#

problem is i'm accessing this from my ide's terminal

gritty wind
#

I’ve never run into this problem personally, but the top google search results imply it’s a problem starting the docker engine itself. If the engine is started, you should be able to start the bot itself from the terminal fine.

As for starting the engine, you can try the right click method as described above, or alternatively this from the top SO result:
https://stackoverflow.com/a/61062715

#

You don’t need to try this now, just ping me if you’d like more help in the future

trail pilot
gritty wind
#

Ah

#

Interesting

short snow
#

What do you guys think of introducting pytests sugar to the testing setup on bot and site?

short snow
crude edge
#

I installed the sir-lancebot today but evergreen games commands are not working

#

It is showing HTTPException('400 Bad Request (error code: 10014): Unknown Emoji')> i didn't see any emoji requirements and which emoji Ids to add in documentations

gritty wind
#

Can you post the full traceback

#

!paste

stable mountainBOT
#

Pasting large amounts of code

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

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

crude edge
#
06/29/21 18:17:46 - asyncio ERROR: Task exception was never retrieved
future: <Task finished name='Task-65' coro=<Message.add_reaction() done, defined at C:\Users\Raghav\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-AZvk8AtN-py3.9\lib\site-packages\discord\message.py:1192> exception=HTTPException('400 Bad Request (error code: 10014): Unknown Emoji')>
Traceback (most recent call last):
  File "C:\Users\Raghav\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-AZvk8AtN-py3.9\lib\site-packages\discord\message.py", line 1221, in add_reaction
    await self._state.http.add_reaction(self.channel.id, self.id, emoji)
  File "C:\Users\Raghav\AppData\Local\pypoetry\Cache\virtualenvs\sir-lancebot-AZvk8AtN-py3.9\lib\site-packages\discord\http.py", line 254, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji
gritty wind
#

That's probably the trashcan emoji

crude edge
#

or should i paste whole logs after startup

gritty wind
#

It isn't necessary to add that emoji, and it's safe to ignore

#

If you want to add it, you can add it under the TRASHCAN_EMOJI environment variable

#

it's the output of \:emoji_name:

crude edge
gritty wind
#

Without a fuller traceback, I can't help since that command doesn't even use any custom emojis

crude edge
#

full traceback meaning? exception origin from sit-lancebot package ?

gritty wind
#

Honestly anything you can post, since the error above is missing any sort of traceback, it's just an http exception

#

All the code in the battleship command uses default emojis, so I'm not quite sure how you're getting that error

crude edge
#

yeah but it is the only thing showing up in my terminal

gritty wind
#

a reproduction method would also help

crude edge
#

I can share name of environment variables which i am using

#

other than that all is standard procedure

gritty wind
#

Can you share the commands/steps you took

crude edge
#
poetry install
poetry run task start
gritty wind
#

I'm confused, do you get this error when starting the bots, or when using the ships command?

crude edge
#

i am getting these error after running the ships command

#

Bot instance is running and logging the whatever exception is generated

vale ibex
#

Could you add BOT_DEBUG=true to your .env file, and see if more info it output?

green oriole
#

is it not just DEBUG?

gritty wind
#

definitely bot_debug haha

vale ibex
#

for lance it's bot_debug yea

green oriole
#

oh okay

#

but it is debug for Python, right?

vale ibex
#

I think debug mode on bot is inferred on whether site is local

gritty wind
#

doesn't exist

#

what chris said

green oriole
vale ibex
#

DEBUG_MODE = 'local' in os.environ.get("SITE_URL", "local")

#

and then trace is enabled via the cool per cog thing we have

vale ibex
#

You'll need to restart your bot after enabling debug mode fyi

crude edge
#

yeah i did that

#

and .ships is command right?

vale ibex
#

That's a command yea

gritty wind
#

I'm pretty sure it's not the command

#

It seems to be right after the reddit cog loads, so I'm thinking it might be that emoji

#

But that error is invoked before the bot is done loading, and is ready to accept commands

crude edge
#

oh i looked it in source code so thats why i am using thats

gritty wind
#

If it was the ships command, you'd see this before it:

06/29/21 16:05:07 - bot.utils.checks TRACE: Scaleios#8200 may use the battleship command as they are in a whitelisted channel.
06/29/21 16:05:07 - bot.utils.decorators DEBUG: Scaleios#8200 tried to call the 'battleship' command and the command was used in an overridden context.

vale ibex
#

Can you put TRASHCAN_EMOJI=:x: in your .env and see if that fixes it?

crude edge
#

i am not using env

vale ibex
#

you must have a .env file

#

since that's where you put your bot token

crude edge
#

i am using powershell script for initialzing environment

vale ibex
#

not poetry task run start?

crude edge
vale ibex
#

ok, then can you put that above in whatever you're doing then?

crude edge
#

yeah i did that

vale ibex
#

and...?

crude edge
#

it is the ouput i am getting :emoji_name:

#

is it correct?

vale ibex
#

output from what?

crude edge
#

or i need to put its id

crude edge
vale ibex
#

the env var TRASHCAN_EMOJI needs to be set to an emoji.

green oriole
#

if it is a custom emoji you need <:name:id> I believe

vale ibex
#

I recommended you set it to :x:

#

if you want to use a custom emoji, rather than a default one, then you need to do what Ak said

green oriole
crude edge
vale ibex
#

But be aware, your bot needs to be in the server with those emojis, otherwise you will get that 400 error

crude edge
#

is there any emoji which is present in all the server?

vale ibex
#

yes.

#

the default ones

crude edge
#

so i can use there code right?

vale ibex
#

if you open up your emoji bar

#

yea

crude edge
#

👁️

#

i am going with these

vale ibex
#

ok

crude edge
#

what about command .ships was wrong right?

vale ibex
#

There's nothing wrong with the command no

crude edge
#

it is showing command not found

#

after i turned bot_debug on

vale ibex
#

Could you show the logs?

crude edge
vale ibex
#

ah ok,. .ships is a subcommand

#

it's .battleship ships

gritty wind
#

It should work, but try it in the correct bot command channel

#

It doesn't make sense, but I hit that same problem till I tried that so

#

meh

crude edge
#

Well i didn't research properly

crude edge
#

I am not defining .env files but logs are showing Found .env file, loading environment variables from it. Why?

#

does load_env loads empty file when .env is not present?

gritty wind
#

it's a little misleading

vale ibex
#

That is always printed out by us

gritty wind
#

That should say it found the module

vale ibex
#

if the import works

gritty wind
#

joe is just bad at copy pasting

crude edge
crude edge
vale ibex
#

if the module isn't found atm, it doesn't output anything

#

since it's only used in dev

crude edge
#

I think module is automatically installed by poetry

gritty wind
#

It's a dev dependency

vale ibex
gritty wind
#

so it isn't installed in prod

#

(you install prod by doing poetry install --prod)

crude edge
gritty wind
#

Why not?

crude edge
vale ibex
#

We use kubernetes in production

#

All of those env vars are already loaded as secrets in the environment

crude edge
vale ibex
#

Yea, if you look in the Dockerfile, you can see that we build deps with poetry install --no-dev

gritty wind
#

blame yarn

vale ibex
#

lol

vale ibex
crude edge
vale ibex
#

We have documented steps on how to setup a dev environment, using both poetry and Docker

#

if people want to do things themselves, then that's on them, including any issues

#

we can always help with them here though

gritty wind
#

The print is misleading, but that's less of an intentional decision, and more of an oversight

vale ibex
#

Yea, since we assume if python-dotenv is installed, a .env file is going to be there

gritty wind
#

Like chris says, dotenv is an optional helper, even if we do recommend it for most

crude edge
#

Thanks for the help

short snow
#

It is a complicated one lol

molten perch
#

Hey! I have a question. When using Sir Lancebot's "issue" command I experienced a strange behaviour when the first argument (numbers) was not shipped, or was put in the wrong place, the numbers parameter will be an empty array, and because of that it won't fetch any issue and just simply will return a embed with a Github link that points to either sir lancebot's repository or the repository you typed in or in case of wrong order it points to a 404 Github page, but no issues from Github or error message whatsoever, is this an expected behaviour?
Because, it would be cool if it sent an embed with an error message, and invoked the help command.

molten perch
#

While testing, I managed to reproduce, yes. Would you like me to send one into the bot commands?

vale ibex
#

on the issues command, i remember us saying we can just remove it entirely, in favour of the regex listener

cold island
#

Here is fine too

molten perch
#

.issue site 1

vale ibex
#

.issue site 1

dusky shoreBOT
sleek steppe
#

Shouldn't it be

#

.issue 1 site

dusky shoreBOT
molten perch
#

Yes, it should. But the bot doesn't throw any kind of error, or something.

sleek steppe
#

Yeah it takes all the first items that are ints

#

so you fetched 0 issues

molten perch
#

And since that's not an int it will return an empty list, yeah.

cold island
#

I wouldn't mind it throwing the help embed in that case

molten perch
#

Yes, that was my idea. Actually, I might have done it wrong, but I've already implemented a solution for that.

vale ibex
#
if not numbers:
    raise commands.UserInputError("You must enter at least one issue/pr number to fetch.")