#topgg-open-source

1 messages · Page 5 of 1

worthy cypress
#

are we actually losing anything in terms of processing, or memory, etc.?

dense barn
#

yea

high depot
#

Xetera will fix that ig

worthy cypress
#

how so Veld

tiny shard
dense barn
#

Performance doesn't really matter

plain storm
#

always optimize for the developer before optimizing for the program

dusky shale
dense barn
#

It's not like a webhook needs to be ran 100/s

jade cobalt
dense barn
#

imagine overengineering a webhook

worthy cypress
#

yeah, so i don't see the prevalent need of ternary operations

high depot
dense barn
#

btw

jade cobalt
worthy cypress
#

the character thing was a joke, scrolling left to right isn't too difficult imo

tiny shard
#

i mean it cant hurt to add some simple ratelimit handling to make sure you dont miss something entirely

high depot
#

I don't think crowdin will spam it out

tiny shard
#

if 6 people submit a string at the same time you'll lose one

high depot
#

no?

tiny shard
#

yes

dense barn
#
const StringsAdded = "string.added";

...

let stringsAdded = 0;
if(eventsStructured[StringsAdded]) {
  stringsAdded = eventsStructured[StringsAdded].length;
}
tiny shard
#

discord ratelimits

dense barn
#

This is what I would do

#

or probably use Number

#

because JS handles str <> num

#

then again

high depot
#

fiiine I'll add them tmrw if Xetera will not do it before I do

dense barn
#

I have too little context on the actual reason why we JSON.stringify it

tiny shard
#

yeah you can just put numbers in string templates lol

dusky shale
#

Doesn't that property already return a number

dense barn
#

oh wait

#

.length

worthy cypress
#

it's not like we can re-use it if need be

dusky shale
#

.length

#

is a number

high depot
#

o wait yeah .length returns a number

#

I need a coffee KEK

jade cobalt
#

wait a minute did you just stringify a number?

high depot
tiny shard
#

brup

high depot
#

O wait

#

I did

dusky shale
#

You literally JSON.stringify(<number>)

#

Man you need some sleep

high depot
ashen dragon
high depot
#

mind me fixing it?

#

or you already on it?

jade cobalt
#

berry is doing a pr so....

dusky shale
#

Berry speedrunning

wintry marten
#

I'm doing it dw

#

I'll push change in a sec

jade cobalt
#

@tiny shard

wintry marten
#

also trying to fix top.gg code on the side ahh

tiny shard
#

dw

#

ill do it and pr

high depot
tiny shard
#

pain

#

?

dusky shale
tiny shard
#

sob

high depot
wintry marten
#

oh I didn't know you were already working on it lol

tiny shard
#

eez what it eez

jade cobalt
#

lmao they both closed their own prs

high depot
jade cobalt
#

yea ik

#

who is going to be the "manager" of this channel? Xet or Veld? (who is going to review most of the prs)

ashen dragon
#

3 diffrent fixes pogey

dense barn
#

I'll take it

wintry marten
#

some typescript issues also needs fixing, would be a good idea to set up github workflows for building the project

high depot
#

Xet it seems liek something is broken

wintry marten
#

yeah

high depot
#

I used test update event

jade cobalt
#

might want to just append lines to a base content string so you don't deal with 0 lines added.

wary stratus
#

Can't remember, but do webhooks support context being added too? Or possibly issues being created?

#

oh fuck wrong channel

#

or wait

#

is this for the crowdin webhook too hmmm

wintry marten
#

ye we did it with cloudflare workers PeepoHmm did we not tell you im sorry

worthy cypress
wary stratus
#

Gave up after 5 minutes anyways, don't like js sadcry

wintry marten
#

same

jade cobalt
#

on that pr?

worthy cypress
#

join me with the php lib hope

dusky shale
#

You spent 3 hours on that?

high depot
tiny shard
#

WEFDLKJK

wintry marten
#

probably 90% spent reading docs

high depot
jade cobalt
#

docs for what?

wintry marten
#

learning new technologies gang

wary stratus
high depot
high depot
# high depot

@wintry marten string.updated isnt being counted properly idk why

wary stratus
#

Though referring to these webhooks, probably useful to include when context is being added and/or when a new issue gets created/resolved

wary stratus
#

if crowdin supports that, can't remember

high depot
#

Its ok with delete and add

wintry marten
#

I'm busy with top.gg stuff I'll take a look later

high depot
#

o wait

warm marsh
#

time to make a pr to add an extra space between a = in a function call kwarg

icy kayak
#

urgent PR

#

missing semicolon on line 34

jade cobalt
#

public JS and TS top.gg repos should all have eslint and prettier for standardization and readability tbh

jade cobalt
#

smol

icy kayak
high depot
icy kayak
#

aaah

#

ig that's fine if it's a standard

#

i don't follow the rules 😎

wintry marten
#

alright I fixed the build errors

icy kayak
#

double quotes, tabs, and semis

wintry marten
#

funny meme caused by esnext

#

yeah we have topgg-eslint but I haven't pushed it to npm yet ugh

high depot
#

funni

warm marsh
#

urgent pr change all " to '

icy kayak
#

yes

worthy cypress
#

dang that was funny lemme schedule in a laugh for you

warm marsh
#

thank you

jade cobalt
warm marsh
#

i feel happy that you got joy

worthy cypress
#

i don't

warm marsh
#

KaguyaPensive i hope you get the happy one day then

high depot
#

love ya

wintry marten
#

maybe the pluralization needs to be fixerino'd 👼

high depot
jade cobalt
#

(s)

high depot
jade cobalt
#

unless you really care that much

wintry marten
#

we still need the project name to be fetched from query params btw

#

but other than that I think this one's ready to go pogger

icy kayak
#

cryaboutit

dusky shale
#

"tabWidth": 2
"singleQuote": true
Cry about it

wintry marten
high depot
#

lemme push

wintry marten
#

now that we fixed the basic issues let's pr any new changes

high depot
#

okie

#

ill pr it then

high depot
#

and now we're done

true portal
jade cobalt
true portal
#

oh I thought that was for top.gg lul

#

I am dumb

wintry marten
#

When you're reviewing code or discussing contributions please be kind. Piling up on someone because of their code or belittling them is not acceptable. We want to create an environment where everyone feels comfortable contributing without the fear of feeling of being made fun of. If you have constructive comments to make it's up to you to make sure that does not come off as hostile, we're all learning here.

high depot
#

Will be happy to something like that again, cool experience

true portal
#

Why not move the github updates to this channel for the sdks?

unreal lagoon
wintry marten
jade cobalt
#

wut?

unreal lagoon
#

😆

true portal
neat cobalt
jade cobalt
#

OSS Contributor

#

is that really a good idea?

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

burnt sinew
#

why is this channel made?

odd heron
#

oh new channel

#

458th msg

plain storm
#

It feels like a subset of library developer.

dusky shale
#

luca

sly jay
#

New Channel Cool

true portal
kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

true portal
#

lib dev*

kindred maple
#

One message removed from a suspended account.

true portal
#

NO

#

but some tried

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

plain storm
#

is the translator role just a thank you card

high depot
#

I have advice for role hunters

#

If you want a role => earn it

#

Simple, isn’t it?

wary stratus
vast cliff
plain storm
#

and just like that he influenced the lives of over 100,000 people

worthy cypress
ornate kite
wanton tapir
#

I think

kindred maple
ornate kite
#

sad

dusky shale
#

no copy pastas yet

left eagle
#

ey

wraith flint
gaunt sand
dusky shale
#

👀

wintry marten
#

how do you write a comment in the exact same second as me on a pr that was created 4 hours ago

#

I'm starting to think berry is outside my window or something

tiny shard
#

yeah idfk

#

i posted my comment and look up and you're there

jade cobalt
#

which repo?

#

ah I see

dusky shale
#

the number of channels is increasing exponentially

worthy cypress
#

How is it exponential

dusky shale
#

idk

soft sorrel
river trail
#

But it's abnormally quite

dusky shale
#

GIME TOPUMGEGEE OPENSUS DEV ROLE

#

toppu jj role hunter

deft merlin
#

Please keep this channel on topic ^^

dusky shale
silent cedar
#

you can mention voice channels??

dusky shale
plain storm
#

You can now

deft merlin
#

Again please keep this channel on topic

placid crow
#

@ashen quartz

#

whoops

dusky shale
#

Applause, you know how to mention a voice channel Clap

pulsar coral
#

How

bronze cave
#

<#channelid> @pulsar coral
Just like a text channel

pulsar coral
#

I can't in mobile but i know now

#

here!!

surreal socket
stark quiver
wraith pelican
#

How to make a message which is sent when someone votes? Discord.js

worldly orchid
#

@wraith pelican

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

wintry marten
#

would be cool if we could give people access to this channel once they open a pr or issue but that's not really possible

surreal socket
#

Well technically

jade cobalt
#

you could make it something someone could request. For example someone could go to top.gg/open-source or something and it would give them the role to see this channel. Then they don't need to really make a change if they want to know whats going on but it removes the people who don't realize what the channel is actually for

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

wintry marten
#

give me webhooks magical enough to find out people's discord ids from their github actions and I'll code it

soft sorrel
jade cobalt
#

I would just say use oauth

wintry marten
#

I'll think about some other way to make it work later

honest ingot
#

How do you get <@&844267965742186619>?

hollow jacinth
honest ingot
#

I already did

surreal socket
#

It means you contributed to top.gg OSS in one way or another

honest ingot
#

Does opening issues count? Cuz I have a few currently open

hollow jacinth
#

such as a pull request

#

that adds a new feature

#

lol

surreal socket
high depot
surreal socket
#

Sort of, yeah. The guideline really helps with what is considered a valid contribution

hollow jacinth
#

something like adding a comma doesn't count

dusky shale
#

Bumping versions smirk

hollow jacinth
#

has to be actual something useful

surreal socket
hollow jacinth
#

like adding a feature or fixing the code examples in the top.gg docs for example

surreal socket
#

Hey technically speaking

#

Where's your role nori

hollow jacinth
#

What if the Version bumps are security patches

#

that fix major vulnerabilitys

#

lol

dusky shale
#

IDK, I don't really care either, I genuinely contributed because I wanted to

hollow jacinth
#

I don't see much I could contribute to honestly

#

although I do have an idea but idk if it would be useful at all

surreal socket
#

It's still recognition so @wintry marten could you give norizon the contributor role?

high depot
wintry marten
#

if you have an idea pls open an issue first

honest ingot
jade cobalt
#

likely not

surreal socket
#

Well, it's just issue reports and not code contributions

jade cobalt
#

since you aren't really contributing anything

surreal socket
#

I doubt that counts as contributing, yeah

jade cobalt
#

@fair goblet all of the issues about a bug on the resign should get a redesign tag or something so users can search for an already-existing issue documenting the bug they found, which would reduce the duplicates

fair goblet
#

pretty sure there is

jade cobalt
#

ah I see the beta label

fair goblet
#

oh i guess it wasnt applied to most of the issues

jade cobalt
#

yeah only 8 or something

worthy cypress
wintry marten
#

alright, I'll do that. I don't mind counting valid bug reports as OSS contributions either

worthy cypress
#

can u also merge #39 too plz blobpain

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

kindred maple
tiny shard
#

so over kill honestly

#

i think it’s fine how it is

kindred maple
#

One message removed from a suspended account.

worthy cypress
#

this is good enough imo

#

we just don't need random white names getting OT in here or shitposting

kindred maple
#

One message removed from a suspended account.

tiny shard
#

it creates an open discussion for users who might want to contribute but if you lock it now they can’t and those are the people who need the most guidance via discussion

worthy cypress
#

xet's updated the channel desc already, so presuming people end up reading it they'll know how to get OSS access

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tiny shard
#

oof

kindred maple
#

One message removed from a suspended account.

worthy cypress
#

There are a series of Issues for the top-gg/issues repo that have yet to receive any labels about it being a bug or wontfix. Any clear info on these in particular?

#658-#661
#663-#675
#683
#686
#688-#703
#705

tiny shard
#

idk there's some people who are basically contributors but haven't ever actually contributed to any repo, like @jade cobalt @hollow jacinth @soft sorrel have all been helpful in this channel already but they're not actual contribs

#

oh xet hasnt actually locked it yet

jade cobalt
#

im pretty sure Xetera did an overwite for me so I couldn't be doing it for the role
which is pretty smart

tiny shard
#

or just hasnt locked it yet idk

jade cobalt
#

it was locked before so thats why I thought it was overwritten

tiny shard
#

ah

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

jade cobalt
#

then Xetera is very smart

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

tiny shard
#

stop talking to reaction faith

kindred maple
#

One message removed from a suspended account.

high depot
#

@dense barnsolved your issue with 45 symbols Hehe

dense barn
#

Yea I'm looking at it

#

I'm thinking whether this is a great solution though 🥺

#

The more we add to it, the more the string feels unreadable

high depot
#

lmao

#

I'll try to make it an embed

dense barn
#

one sec

#

I'm doing a suggestion on your review

worthy cypress
#

regex is a programmer's way of sleeping in bed with the devil

#

or is this not regex 👀

high depot
worthy cypress
#

oh no

high depot
dense barn
#

Added my feedback

worthy cypress
#

can't you make it a footer instead?

high depot
dense barn
#

Ah kk

high depot
#

@wintry martenBtw I just realized that we can catch project name from crowdin event itself without getting in from query params

wintry marten
#

oh?

#

that's cool

#

feel free to pr it, I'll add a github workflow later so we can autodeploy the changes

high depot
#

Will add it into this one then

#

Done

worthy cypress
#

@wintry marten are people gonna reaction spam too?

#

Almost every message has a watermelon reaction now

fair goblet
#

i checked yesterday, xet disabled reaction perms for everyone after that

wary stratus
surreal socket
#

Literally re-implementing dict methods just to mimic a dictionary is such a pain

worthy cypress
#

For the python lib?

surreal socket
#

Yeah

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

surreal socket
#

Yeah so does Python

#

The thing here is

worthy cypress
#

So does PHP

surreal socket
#

I need to work with my object's __dict__ attribute

#

And not directly with the object's hash

surreal socket
#

@dusky shale let's talk here

#

And nah, I do this:

    def __init__(self, **kwargs):
        self.__dict__ = parse_dict(kwargs)
dusky shale
#

Why?

#

I think ```py
def init(self, *args, **kwargs):
self.dict = self
super().init(*args, **parse_dict(kwargs))

surreal socket
#

having a superinit clones the data, no?

dusky shale
#

Nope, since its __dict__ is a reference to itself

#

You can test the identity ig

surreal socket
#

...

#

I see KEKW

dusky shale
#

Right

#

Will be there other aliased keys by the way?

surreal socket
#

I don't think so

#

I've gone over the attributes and only colours seems to be an alias I need to handle

dusky shale
#

Ah, so there are only 3 overridden methods, aren't there?

surreal socket
#

Pretty much

#

getitem, setitem, and get

#

All of this to waste

dusky shale
#

exdee, that's what you'd do if you don't inherit the dict

surreal socket
#

It's rather funny how the default JSONEncoder only supports built-in types

dusky shale
#

Default to str smirk

surreal socket
dusky shale
#

Was it the datetime messing it?

surreal socket
#

I mean to be fair

dusky shale
#

I see, nested objects will still be fine ig

surreal socket
#

I don't have datetime object being sent to top.gg so if someone has an issue with it, they can technically Google it iara_xD

dusky shale
#

lol The only thing one would post is the stats which doesn't have the model, isn't it?

surreal socket
#

I added a BotStats... something model

#

Ah, BotStatsData

dusky shale
#

How's the API gonna be? Are users supposed to be able to pass the data on to the parameters directly as well as passing BotStatsData object?

surreal socket
#

Ah no, BotStatsData is for receiving bot stats. Parameters will stay

dusky shale
#

Ahh

surreal socket
#

@dusky shale guess who tests are failing

#
    def test_data_dict_fields(data_dict: types.DataDict):
        for attr in data_dict:
            if "id" in attr.lower():
>               assert isinstance(data_dict[attr], int) or data_dict[attr] is None
E               AssertionError: assert (False or '264811613708746752' is None)
E                +  where False = isinstance('264811613708746752', int)

test_type.py:102: AssertionError
#

Oh hold on what

#

...???

dusky shale
#

exdee

#

Did you figure out something

surreal socket
#
>> from topgg.types import DataDict
... from tests.test_type import d
>>> dd = DataDict(**d)
>>> dd
{'def_avatar': '6debd47ed13483642cf09e832ed0bc1b', 'invite': None, 'website': 'https://top.gg', 'support': 'KYZsaFb', 'github': 'https://github.com/top-gg/Luca', 'longdesc': 'Luca only works in the **Discord Bot List** server.    \nPrepend commands with the prefix `-` or `@Luca#1375`.    \n**Please refrain from using these commands in non testing channels.**\n- `botinfo @bot` Shows bot info, title redirects to site listing.\n- `bots @user`* Shows all bots of that user, includes bots in the queue.\n- `owner / -owners @bot`* Shows all owners of that bot.\n- `prefix @bot`* Shows the prefix of that bot.\n* Mobile friendly version exists. Just add `noembed` to the end of the command.\n', 'shortdesc': 'Luca is a bot for managing and informing members of the server', 'prefix': '- or @Luca#1375', 'lib': None, 'clientid': 264811613708746752, 'avatar': '7edcc4c6fbb0b23762455ca139f0e1c9', 'id': 264811613708746752, 'discriminator': '1375', 'username': 'Luca', 'date': datetime.datetime(2017, 4, 26, 18, 8, 17, 125000), 'server_count': 2, 'guilds': [417723229721853963, 264445053596991498], 'shards': [], 'monthly_points': 19, 'points': 397, 'certified_bot': False, 'owners': [129908908096487424], 'tags': ['Moderation', 'Role Management', 'Logging'], 'donatebotguildid': None}
>>> dd.id
264811613708746752
>>> type(dd.id)
<class 'int'>
#

Literally ran this in Python Console

dusky shale
#

So, the attribute was int but not the item?

surreal socket
#

Oh did I not copy that

#
>>> type(dd['id'])
<class 'int'>
dusky shale
#

lmao

surreal socket
#

My test is failing because my ID attr is str for... whatever reason

dusky shale
#

What attribute was that?

surreal socket
#

oh oops

dusky shale
#

donatbotguildid mmulu

surreal socket
#

I didn't unpack my dict

dusky shale
#

It's Optional[int]

surreal socket
#

Yeah it's None if Top.gg returns ''

dusky shale
#

Ah, so that wasn't the issue?

#

mfw didn't see this

surreal socket
#

Ya, nah. I rely on kwargs for parse_dict and I forgot to unpack it

#

did DataDict(d) instead of DataDict(**d)

dusky shale
#

Ah, since you only parse the kwargs but not if the dict was passed as positional argument

#

Maybe you also want to parse the args? But w/e it's not meant to be instantiated by users anyway

surreal socket
#

I'm thinking about removing *args altogether since I don't use it anyway

dusky shale
#

Ah true

surreal socket
#

Weee, tests pass

dusky shale
high depot
#

Xet I'll note it as TODO in my TODO list

#

Will do

surreal socket
#

What do you guys think about having a slash prepended to the endpoints in top.gg docs?
For example:

wintry marten
#

I added a wrangler workflow to automatically update the bot with the new version

#

don't change crowdin-discord to yourname again otherwise it'll break the build

wintry marten
high depot
#

I noticed that it crashed

#

Decided not to ping you since I thought you already got a notif

high depot
wintry marten
#

I don't have permission to block on the organization level

#

@dense barn

high depot
#

@dense barn

#

Wake up

wary stratus
#

Just yeet their commands for now

#

Comments

wintry marten
#

pretty sure github bans for this behavior but we'll see

#

literally 0 value user account

high depot
#

I’ll save a ss for veld

#

I have a fucking shitton of GitHub notifications on my email now KEK

surreal socket
#

What happened lol

high depot
#

I’m banned from server he sent KEK

surreal socket
#

You have to be kidding

#

LMFAO

worthy cypress
#

I will be pushing an update for the PHP library soon for webhooks to work, however for now they will be webserver in terms of implementation.

high depot
#

I locked convo

wintry marten
#

dude what do you want me to do

surreal socket
high depot
wintry marten
#

I just moved to webhook temporarily until his github account gets banned

#

I'll move it back

#

gonna go back to my project now

dense barn
#

What happened

surreal socket
#

Someone spammed in 2 repos and got banned from this server

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

surreal socket
#

Xetera wanted you to ban the guy from the org

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

surreal socket
#

Nah

#

Some bot dev

kindred maple
#

One message removed from a suspended account.

high depot
#

I’ll dm u veld

dense barn
#

oh ok

worthy cypress
high depot
#

reported this guy tho

tiny shard
#

plus i’m sure half of the issues you brought up were already known and were gonna be / have been fixed already

surreal socket
#

Poor GitHub webhook still hidden

high depot
wary stratus
#

nah not broken

high depot
#

Let xet have his weekend

wary stratus
#

let's just say intentionally broken

high depot
surreal socket
#

What weekend? /s

tiny shard
#

maybe make it only viewable to open source contribs cuz i use it to see stuff tbh

surreal socket
#

@dense barn what do you think? 👀

surreal socket
#

Be sure to follow consistent formatting, kids

surreal socket
#

@dusky shale Does :meth:WebhookManager.run is now awaitable make sense KEKW

dusky shale
#

It's always been awaitable 🔫

surreal socket
#

Since the method can be used without await

dusky shale
#

What about "can optionally be awaited"? Lmao, I suck at wording tbh

surreal socket
#

O sounds good

#

... more or less KEKW

dusky shale
#

@surreal socket shiv xd

surreal socket
#

Eh I'll probably add additional ratelimiter for specific routes and update that

#

v1.1.1 changelog: update examples

dusky shale
#

LMAO, it's on me tbh, forgot to delete it blobweary

surreal socket
#

Nah it's okay

#

I kinda forgot about that example trying to figure out all the DataDict crap

dusky shale
surreal socket
#

@wintry marten Can you update the docs URL for the Python SDK repo to topggpy.rtfd.io?

wintry marten
#

I'll take a look tomorrow, vacation for top.gg today

surreal socket
#

No problem

worthy cypress
#

PR up for documenting error handling

high depot
#

Got a message about guy who was spamming on GitHub

worthy cypress
#

I mean it's a one-and-done kind of deal; very old related information that I don't think we have to bring up anymore

surreal socket
#

Webhook for Python SDK when

dusky shale
#

@surreal socket wdyt of making topggpy PEP 561 compliant?

surreal socket
#

You mean adding stubs?

dusky shale
#

Um, not really. Just make it so that mypy can detect the lib types

#

Inline annotations is fine imo, since we're working with python 3.6+

dusky shale
surreal socket
#

Sounds good to me

dusky shale
#

Oh yeah, another thing, is this intended to be 500?

surreal socket
#

Yeah, I'm not sure if the search endpoint is fixed yet but when I wrote that, it allowed max 500 results at a time

dusky shale
#

I see

#

And is there a case where the response returns without json content type?

surreal socket
#

Yeah. Say, CF errors

dusky shale
#

Cuz 😅

surreal socket
#

uhhhh

#

Wait, don't I raise ServerError with response codes >= 500?

dusky shale
#

Yep, you do

surreal socket
#

Refusing to claim to be smart was a rather good idea, it seems

#

Yeah that annotation should be changed

#

There's no endpoint that returns an invalid JSON

dusky shale
#

So, would you rather check the type at runtime or just lie to the type checker by casting it? The former might/might not add an overhead while the latter should be just as fast

surreal socket
#

The latter sounds more appropriate in this case imo

surreal socket
#

@dusky shale stares at the failing tests

dusky shale
#

LMAO

#

Fixed it LUL

surreal socket
#

yee haw

#

Now we're talking

dusky shale
#

Tried to use AsyncMock from the mocker fixture as mypy screamed at me doing mock.AsyncMock for whatever reason. Turned out, it's not compatible with 3.6 mmulu Let's just # type: ignore them

surreal socket
#

🤣

surreal socket
#

Well, I think my dumb way of implementing ratelimiters into the request method should work

#
        async with (global_ratelimiter, bot_endpoint_ratelimiter
        if route.startswith("/bots") else global_ratelimiter):

because we can Shrug

dusky shale
#

Multiple global ratelimiters? Wouldn't it cause issues as the lock is waiting for itself? Not sure mmulu

surreal socket
#

It works

dusky shale
#

Oh well, if it works it works kek

surreal socket
#

Oh God, you're right

#

... or not. I should probably test with a period that isn't equal to a second

dusky shale
surreal socket
#

Nah, it was ratelimiting at half the max_calls

#
    ratelimiter = (global_ratelimiter, bot_endpoint_ratelimiter) if route.startswith("/bots") else global_ratelimiter
    for _ in range(200):
        async with ratelimiter:
            print(_)

:)

dusky shale
#

exdee, yeah that's basically the same as else (global_ratelimiter, nullcontext()) with less import

surreal socket
#

Yeah, I didn't want to do it with nullcontext

tiny shard
#

@wintry marten im gettin a bit of an issue with the topgg-autoposter that im not sure how to deal with in typescript, i did a stupid thing and made the AutoPoster and all of it's properties export via an index.js because i wanted normal js users just to be able to do const AutoPoster = require('topgg-autoposter'), but now im stuck in a pickle because i want to fix this by making it export via const { AutoPoster } = require('topgg-autoposter'), but i don't want it to be a breaking change, so i tried something like this

module.exports = AutoPoster

export { DJSPoster } from './structs/DJSPoster'
export { ErisPoster } from './structs/ErisPoster'
export { DJSSharderPoster } from './structs/DJSSharderPoster'
export { RosePoster } from './structs/RosePoster'```
Which WOULD work, but typescript exports the bottom part as defineProperty to `exports` rather than `module.exports` which makes it not work :/
As you know export default makes it define the `default` property which is super duper annoying now but e, i'm just trying to remove the js part, and also trying to make it actually pass along typings because typings would not work when im exporting it via an index.js file.
surreal socket
#

Why not let it be a breaking change?

tiny shard
#

because i don't want to bump for a stupid export change

dusky shale
#

Long life to this channel

high depot
#

This channel isnt locked

#

pog

surreal socket
#

We are superior

dusky shale
#

Well it's locked for people without the role

high depot
wintry marten
surreal socket
#

Well since all chat channels are locked, I'm gonna ask here

#

Does anyone know if the @everyone role has the same ID as the guild itself for new servers?

wary stratus
#

yes it does

#

afaik

surreal socket
#

ty

wary stratus
#

doesn't actually ping it

#

but it does

surreal socket
#

Got it

#

thanks

true portal
#

Why not put notis in here and just remove comments from the webhook responses?

tiny shard
#

no point

royal breach
tiny shard
#

yes

#

2.0.0

royal breach
#

neat

#

done

tiny shard
#

thanks

royal breach
#

smiles np

#

yea if xet is not online feel free to ping me for docs stuff

tiny shard
#

sounds good SCyes

dense barn
#

What's the reason of that change tho

worthy cypress
#

Docs change faster than my github issues pogey

dense barn
#

sadge sorry I haven't been working on top.gg in the last few days

#

Focusing on auctions atm

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tiny shard
#

and there's no real way to export as everything in typescript

#

it'd be export default but it sets default rather than the base of the export pensiveFast

kindred maple
#

One message removed from a suspended account.

high depot
#

imagine

surreal socket
#

_ _

jade cobalt
tiny shard
#

shush

#

not anymore

jade cobalt
#

hmm

surreal socket
#

@wintry marten Any news on the slashes PR? 😛

wintry marten
#

oh I thought I responded to that

surreal socket
#

I did some changes regarding the review

kindred maple
#

One message removed from a suspended account.

worthy cypress
#

@dense barn sorry to ask, but what's the Top.gg code stack you guys employ again?

#

As well, are there plans in API/1.1 to support endpoints to DSL?

tiny shard
worthy cypress
#

Thank you Berry

tiny shard
worthy cypress
#

pepega

tiny shard
#

@wintry marten so do you think you can do the docs strategy this week?

tiny shard
#

me when semicolons and double quotes in top-gg eslint config sadge

dusky shale
#

The semi-colons are fine, but y double quotes tho

#

Smh my head

wintry marten
#

does it really matter

#

I don't use semicolons myself but it's like such a meaningless thing

tiny shard
#

like ill work with them i dont really care thaat much they're just stinky to look at for me atleast

wintry marten
#

the only thing I don't like about semicolons is when I want to refactor f(x); into f(a(x)); I add the opening parentheses f(a(x); and after I press shift-A to go to the end of the line to add closing parentheses it turns into f(a(x);) so I have to delete the semicolon which is very annoying

worthy cypress
#

I mean personally it's just a configuration, as long as some standard is being kept then imo no reason to worry

#

also

#

@wintry marten

surreal socket
#

We need a fucking bot that generates these memes, like "I am once again asking for you to merge PR #x in top-gg/docs"

wintry marten
#

this is honestly a pretty bad system I mean I don't know any of these libraries how am I supposed to approve them or why do they even belong in the docs in the first place

worthy cypress
#

maintenance

#

keeping it open-sourced™️

tiny shard
#

that would make autodocs much better as well

wintry marten
#

yes

tiny shard
#

@fair goblet could you give @sacred belfry the oss contributor role

wary stratus
#

where did they contribute?

tiny shard
wary stratus
#

done

tiny shard
#

thank

sacred belfry
#

thank

tiny shard
#

bonk @sacred belfry

sacred belfry
#

i am now contributor

kindred maple
#

One message removed from a suspended account.

sacred belfry
#

where new color?

kindred maple
#

One message removed from a suspended account.

sacred belfry
#

frick

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

dusky shale
#

Should have a color and be above bot dev

jade cobalt
#

It really shouldn’t. Top.gg isn’t trying to make people want to make contributions, they just want to be open to it. If the role was hoisted then people would be doing it only for the role

surreal socket
#

This

wintry marten
#

sadly we can't have nice things in topgg because people ruin it for everyone else

fair goblet
high depot
#

how to become more weeb than @fair goblet atTeam

jade cobalt
#

its literally impossible

worthy cypress
#

not every role is supposed to be collected Rinsip

surreal socket
#

Rules Only

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

fair goblet
#

eh disagree

#

helps managing stuff like this channel etc

worthy cypress
#

i agree

#

helps also with keeping stuff serious

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wintry marten
#

sigh looks like I might have to fork nextjs soon lol

tiny shard
#

next moment

#

seems stink

high depot
#

next is bruh

#

use nuxt

dense barn
#

I don't wanna work in vue in scale

tiny shard
#

true

high depot
dense barn
dusky shale
surreal socket
#

@wintry marten docs PR #48 merge plz

wintry marten
#

ok this is a really stupid system this is the last library related pr I'm merging

surreal socket
#

LMFAO

tiny shard
#

auto build for docs when

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tiny shard
#

thats stinky

kindred maple
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

tiny shard
#

its all pr based and thats how it is and always should be with out-of-company contributors

kindred maple
#

One message removed from a suspended account.

high depot
#

Y’all just need a NDA

#

Veld make NDA and give library devs to sign it

#

||add a line that they should pay you $1000 monthly||

tiny shard
#

what does an nda have to do with it

high depot
#

Non-disclosure agreement

#

Mark in it info you can’t disclose and responsibility for prohibited actions (like filling docs with hentai), etc

#

That’s how NDA works

wintry marten
#

why would you need to write to the topgg docs? Does discord.js put examples in discord's dev documentation?

#

I think yall just need to have the docs set up in your own Readme or a separate markdown file instead

worthy cypress
#

NDA would be a disastrous idea

worthy cypress
#

people won't remember "okay JS is topgg.rtfd.io and python is ..., etc."

#

big fancy words to come out of me, but probably easier to remember the top.gg url than each individual one

wintry marten
#

but wrappers are not topgg documentation. If you need to find js docs for python you Google that

#

like 3 people in total are going to use more than one api client

#

why do I need to make my life harder for 3 people

worthy cypress
#

i don't think that's necessarily it

#

it's just a good idea imo to have a place to organize all of them under 1 source that can easily be remembered and referred to

#

that's the gist of my thoughts at least

wintry marten
#

I'll add links so people can discover api clients but I'm not gonna be adding documentation for it under the topgg docs anymore. This is for the top.gg api so I just don't see why any library developer should be trying to keep a 3rd party docs up to date or have write access.

If we get new clients I'm happy to add them to the docs so people can go to one place to discover what they need

worthy cypress
#

understood, i'll begin moving all of my lib documentation off of the docs page and refer to it on the website as a link to my own docs page

#

should be a happy compromise that way

wintry marten
#

sounds great. I'm not gonna be doing that this weekend but probably sometime next week

worthy cypress
#

no rush 👍

tiny shard
#

@wintry marten well the conversation initially sparked from me asking veld about domains for the node-sdk typedoc change, he said to use docs.top.gg, so i asked him then you about an auto-build strategy that could centralize the library docs for auto-generated documentation, because obviously we shouldn't just be copy and pasting an entire typedoc into a single md file in a pr. we can stepback that and i can go get something like topgg.js.org for the node-sdk

wintry marten
#

@dense barn this is not a sustainable way to do documentation and I don't think it's worth my time to work on a generic autobuild solution for documentation either

tiny shard
#

he never said thats what we should do i just thought that would be the only feasible way to get auto-generated docs onto the docs.top.gg page

#

shrug

wintry marten
#

if you have websites for library docs it could be ok to lease something like js.docs.top.gg I suppose but getting pinged about accepting random PRs for libraries of languages I've never used before is pretty ridiculous

#

if someone has the time to work on that, maybe but I'm not gonna be doing it

#

if you have a solution that works on github actions and works generically for every language then feel free to make something like that

tiny shard
#

it'd be neat but feels like centralized docs in the first place brings like no foreseen advantages tbh

wintry marten
#

yes

#

clicking on a link that brings you to a different repo vs clicking a link that opens a different page on the same domain to show docs that could possibly be stale. One is about 10 minutes worth of work the other is like 10 hours

tiny shard
#

i think editing the docs.top.gg library mds is fine how it is right now

#

but it shouldnt be like filled with documentation, just common examples

worthy cypress
#

i mean i have no issues with migrating my docs honestly

#

it supersedes the write access issue we have

#

and takes off the workload of them having to check our PRs all the time for changes to doc

wintry marten
#

maybe fine for you writing the docs, but not me who has to read them and accept changes

tiny shard
#

well they shouldnt be so constant either

#

tis the life of a code reviewer KEK

worthy cypress
#

idk the workload xet has outside of our docs writing

#

but i'm sure it's not out of pure laziness

#

otherwise it would not be such a prevalent complaint

tiny shard
#

shruggy

worthy cypress
#

plus honestly not our judgement call.

tiny shard
#

fair

worthy cypress
#

i'm here just so that there is a wrapper for their API

#

and nothing more

#

so whatever changes they make, i'm only for adapting to them

#

there's not much else to be asked out of that tbh

wintry marten
#

there's just no reason for these docs to be in the api documentation for the exact same reason why discord doesn't have d.py in their documentation

tiny shard
#

well d.py isnt discord official

#

these sdks are

worthy cypress
#

i mean xet has a point

tiny shard
#

alot of companies do the sdks on their docs all the time

worthy cypress
#

the docs should be solely about their API

#

we're only offering the means of substitution and pre-written code for use

#

i can't really argue against that stance because there's no fallacy to it

tiny shard
#

if we were random developers just making wrappers of your api i'd agree

#

but all of these sdks are atleast approved by employees or whatnot, and some maintained by them

worthy cypress
#

i mean honestly, we are random developers

#

this is voluntary work as well

tiny shard
#

of course but it's still an official sdk

#

not just some random wrapper like d.py and djs

#

no discord developer is approving prs on d.js repo

worthy cypress
#

if i was being paid, i think i'd likely have some arguing point

#

i don't think our work is official SDK

#

i think it's open-sourced, volunteered wrapeprs

tiny shard
#

really even the sdks are owned by top.gg

#

we're just contributors

worthy cypress
#

after all we got our own channel archived in favor for an open source channel

#

which is more like private source now

tiny shard
#

its on the top-gg repo i mean like we have #topgg-api too its safe to say its official

worthy cypress
#

feel like its a moot point

#

ig declaring it an official top.gg library makes it sdk

tiny shard
wintry marten
#

I'm not against the idea of having docs in one place but I can't be spending time accepting prs of things I literally do not know like golang into the documentation

worthy cypress
#

then trust us with the PRs and accept merging since we're the ones maintaining our own wrappers

tiny shard
#

i mean they shouldn't be happening so often

worthy cypress
#

easy solution

tiny shard
#

the main job with you approving prs at this point is like spelling mistakes and stuff lmao

worthy cypress
#

im not sure who is making sporadic PRs for doc changes either

tiny shard
#

because you just have to trust the maintainer

worthy cypress
#

I guess I did, but I think I had a 3 week window between mine

#

or well

#

you could just let us directly commit

#

but blobpain

#

also inb4 berry kills me

#

is there a need for our lib dev role anymore? maybe it makes us stand out in #topgg-api sure but feels cosmetic now

tiny shard
#

like js docs were edited 2 weeks ago, and 2 months before that

#

both were just for updates to the examples

#

i think that's how it should be

worthy cypress
#

mm idk xet wasn't arguing about how consistently updated the docs are

#

xet was simply arguing their ignorance about what languages the API was being wrapped for

#

it's not an entirely invalid thing to stand on, but at the same time, at some point, i feel that you've gotta trust the lib devs

tiny shard
#

could also just iframe the repos README ez

#

wouldnt be a bad idea just to like do that and display the readme or something tbh

worthy cypress
#

tbqh i don't like the idea of migrating our docs to our own sites

#

because what if those sites go down?

#

there go your docs.

tiny shard
#

what

#

use github pages or something

surreal socket
#

I use rtfd.io which is never down basically

dense barn
#

I don't see a problem. Just have an introduction on the API on our actual docs page

#

If that's too much manual work, then I am quitting with all the manual work I do every week for top.gg sip

wintry marten
#

I'm just not interested in maintaining this and keeping up with changes to libraries on top of everything else

dense barn
#

The library maintainers can PR it

wintry marten
#

I still have to go through the prs and check them

dense barn
#

Anyone from the team*

#

We're a team of 5

wintry marten
#

nobody else does open source

#

me and you

dense barn
#

Feel free to reach out if you don't have time for it

wintry marten
#

I don't

#

it's just extra work that can be avoided

dense barn
#

It's a 5 minute PR review

wintry marten
#

not worth the extra effort when we can just link to the docs of the library and never have to keep up with it

dense barn
#

That's fine with me too

#

As long as it goes to an onboarding page on that docs page

wintry marten
#

sure we can have a libraries index in the docs for useful clients

tiny shard
wintry marten
#

yeah that's what I want

#

link to the repo and the readme is the page people read

tiny shard
#

or maybe some custom thing like DOCS.md on each of the sdks

wintry marten
#

if you can set up the build for it with gatsby it's possible

tiny shard
#

i’ll take a look

kindred maple
#

One message removed from a suspended account.

wintry marten
#

tomorrow

kindred maple
#

One message removed from a suspended account.

tiny shard
#

@wintry marten for docs autobuild what should i do for this?

#

should i just keep it my info

wintry marten
#

what do you need this for

tiny shard
#

or do we have a top-gg bot?

#

docs building

wintry marten
#

we do have topgg bot

tiny shard
#

.github/workflows/docs.yml

name: Build Docs
on:
  push:
    branches:
      - 'master'

jobs:
  Docgen:
    name: Docgen
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Project
        uses: actions/checkout@v2
      - name: Use Node.js 14
        uses: actions/setup-node@v2
        with:
          node-version: 14
      - name: Restore CI Cache
        uses: actions/cache@v2.1.4
        with:
          path: node_modules
          key: ${{ runner.os }}-14-${{ hashFiles('**/package-lock.json') }}
      - name: Install Dependencies
        run: npm i --also=dev
      - name: Build documentation
        run: npm run docs
      - name: Publish Docs
        run: |
          REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
          echo -e "\n# Checkout the repo in the target branch"
          TARGET_BRANCH="docs"
          git clone $REPO out -b $TARGET_BRANCH
          echo -e "\n# Move the generated docs to the newly-checked-out repo, to be committed and pushed"
          rsync -vaI README.md out/
          rsync -vaI docs/ out/
          echo -e "\n# Commit and push"
          cd out
          git add --all .
          git config user.name "${GITHUB_ACTOR}"
          git config user.email "${GITHUB_EMAIL}"
          git commit -m "docs: api docs build for ${GITHUB_SHA}" || true
          git push origin $TARGET_BRANCH
        env:
          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
          GITHUB_ACTOR: jpbberry
          GITHUB_EMAIL: jb@jt3ch.net```
wintry marten
tiny shard
#

got all this stuff

tiny shard
wintry marten
#

I don't know

#

there's a git push action tho why are you doing this by hand

tiny shard
#

i need to generate the docs to a diff folder so i thought might as well

wintry marten
#

idk I'll look at this tomorrow

tiny shard
#

alr

tiny shard
#

@wintry marten i looked into the build error im getting and apparently the eslint report thing you got goin only works for contributors who have full write perms, so it doesnt work for anyone without them and fails on build

dense barn
#

top-gg-bot is such a good bot

tiny shard
kindred maple
surreal socket
#

@tiny shard did you

tiny shard
#

yeah i did and i’m still trying to learn the full thing before i try implementing it

kindred maple
#

One message removed from a suspended account.

surreal socket
#

Ah ok

tiny shard
#

also considering maybe waiting for v1 before implementing them because there’s no major changes happening rn

#

and v1 will have those

wintry marten
#

v1 graphql maybe hmmGe

tiny shard
kindred maple
#

One message removed from a suspended account.

wintry marten
#

probably not but it's on the table

kindred maple
#

One message removed from a suspended account.

tiny shard
wintry marten
#

idk I'm working on something else atm

tiny shard
#

prolly the best way to do it is to define an org secret with like BOT_TOKEN BOT_USERNAME BOT_EMAIL, and then can just use those

#

alr lmk

wintry marten
#

im not sure idk about topgg bot maybe ask veld about it

tiny shard
#

@dense barn

high depot
#

That time when I don't want to be Veld

dense barn
#

whats up

tiny shard
#

can you add org secrets for the credentials of top-gg-bot?

dense barn
#

no public access to top-gg-bot

#

it has access to our private repos

tiny shard
#

not public

#

i mean for workflows

dense barn
#

well it still is public access

tiny shard
#

github actions stuff

dense barn
#

yes

tiny shard
#

i mean everything uses it would need approval from trusted people

high depot
#

they couldnt be accessed out of workflows yknow

dense barn
#

It's a security concern for now

#

What do you need the bot for?

tiny shard
#

pushing docs for github pages to a docs branch

tiny shard
#

need to replace

        env:
          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
          GITHUB_ACTOR: jpbberry
          GITHUB_EMAIL: jb@jt3ch.net```
high depot
#

pff don't use secrets

#

just put it in public

#

/j

tiny shard
dense barn
#

isn't it

#

GITHUB_TOKEN

#

instead of GH_TOKEN

tiny shard
#

its a secret

#

so its defined in the repo

#

and then i generate a token and add that to repo secrets

#

but i dont really want to use my own github token for the pushes unless ig i have to, i also dont think i even can cuz i dont have full write perms

#

its already kinda weird that it uses my npm token to publish but

worthy cypress
#

Thonk interesting

tiny shard
#

@dense barn

dense barn
#

?

tiny shard
dense barn
#

oh i haven't had time to look into this yet

dense barn
#

hey

#

for vote webhooks

#

is the "type" property right now either "bot" or "guild"?

#

cc @worthy cypress @kindred maple @surreal socket @tiny shard

#

I saw for test webhooks we handle it as "test" type

#

but that seems kind of intuitive

tiny shard
#

“upvote”

dense barn
#

Oh i see

tiny shard
#

yeah it’s like extremely useless but

dense barn
#

How would you know whether the type is a guild or bot though

tiny shard
#

it’s there lol

#

check if vote.bot or vote.guild

dense barn
#

OK

#

understood

#

I wanna do some layout adjustments

#

as we move into our new backend for things

tiny shard
#

yeah for sure

dense barn
#

so what I propose is

type WebhookPayload {
  guild?: string; // @deprecated - use entity.id instead
  bot?: string;   // @deprecated - use entity.id instead
  type: "vote" | ...,
  entity: BasicEntity {
    id: string;
    name: string;
    avatarUrl?: string;
    url: string; // e.g. https://top.gg/bot/miki
  }
  user: string;
}
#

I don't want to break it, but i want to expose a bit more data for the entity

#

However as you can see we no longer would send "test" in type

#

instead we have a header

#

X-TOPGG-TENANCY: "live" | "test"

#

so any payload would be the exact same for webhooks

#

e.g. a test vote would show as a vote

tiny shard
#

right right, hm

dense barn
#

Just to not break the API though

#

"test" will still be the type in v0

kindred maple
dense barn
#

but the header will be added in advance

#

ok

#

no pressure

tiny shard
#

is there a way to version the webhooks?

#

so we dont have to care abt breaking stuff

dense barn
#

we can add a version header

tiny shard
#

cant you do something with headers

#

yeah

dense barn
#

X-TOPGG-API: v0

#

but I'll have to think more about the design of that

tiny shard
#

ye just default to v0 and then libs can implement v1 and just pass the header

#

i thought for the webhook payloads you were gonna do something like...

dense barn
#

this is still for v0

#

to expose a little more data

#

most likely for v1 it'll look more like this

tiny shard
#
interface WebhookPayload {
  event: string // example bot::vote
  
}```
#

oh got it

#

ok

dense barn
#
{
   type: "VOTE"
   body: {}
}
tiny shard
#

is v1 that far off lol