module-development

textPage 8 of 43
50 messages on this page
Thursday, July 17, 2025
Avatar for 5c75f2ead9539cedf84becdac7befc72fa3bc877c1541fb168d92420c32b6730
User 5c75f2
is there a module already made that does what csmms custom notification feature for discord?
Wednesday, July 16, 2025
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
heh ok ty
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
pog search by gamesererid?
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
This call with that filter :P
image.png

image.png

PNG โ€ข 52.8 KB

Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Ok, what's the preferred way to get players on a specific game server now?
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
That does a direct call to your gameserver -> very slow and no way to do any filtering or sorting or whatever
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Oh yeah that doesn't look right :O But you actually don't want to use that API route, it should be deprecated
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Uhhh, shouldn't this promise yield an array?
image.png

image.png

PNG โ€ข 27.8 KB

Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Hahaha well thank you for pointing it out ๐Ÿ˜„
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
It's actually been available for months but never documented, just a shadowy unsupported feature ๐Ÿฅท
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
If you run into stuff you want to extend but isn't available yet, let me know! I can add to this system :)
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
I'm stoked this is available now, it's incredible how often I need both player and pog hahaha
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
pogs for days!
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Ok then ๐Ÿ˜„
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Nothing nested possible there ;)
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Oh ya I probably should have specified I'm talking about /players/search ๐Ÿ™‚
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Because you start from ShopOrders, which has a relation to listing, which relates to items (many-to-many table) and finally to items iteself
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
listing.items.item will still return an object
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Yep! I screenshotted the real-life example from that docs page
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
No content
image.png

image.png

PNG โ€ข 3.3 KB

Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Ah, nice of you to worry about that but no need. The bandwidth is in-cluster local network so it doesn't really matter much :p It's heckin fast
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Errr I don't know what you mean by that. The web API docs you linked earlier show using hierarchal extensions. I think you call them "nested" on that docs page.
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Ok all good, nbd just wondering if that's an option for conserving bandwidth since I'll probably end up doing these extensions A LOT now that they're availablel hehe
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
If it's not listed in here, you probably wont get it working :P
image.png

image.png

PNG โ€ข 113.2 KB

Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
The nested stuff is only if it's actually supported by the underlying models
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Don't think that'll work, no
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Or it it object properties only?
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
How detailed can I be with hierarchel extensions? Can I do like
extend: ['playerOnGameServers.gameServerId']
to get back only gameServerId for pogs?
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Yeah I know, that's why I realllllyyy want name on pog hahaha ๐Ÿ™‚ Buttt now that you can extend player queries, that helps because I can get pog from player.
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
It's just all abstracted away from you so you don't really notice it unless you pay attention or look under the hood
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Oh btw, just to be sure, the module code you write is actually calling the web API under the hood
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
It's there if people want to use it though :p Takaro itself is for sure the biggest consumer of the API ๐Ÿคทโ€โ™‚๏ธ
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Yeah I mean given that modules are the first class citizen to Takaro, IMO types documentation is more important. You can figure out web API stuff with that, and the type docs are invaluable for writing modules.
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Tree made a web page showing stats using Takaro API a while ago but idk if that's still online
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Hahah, by "any" what I actually mean is "pretty much anyone" lol
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
I know R20 made a Discord bot to automate some of his admin-y tasks (but that's mainly because Takaro doesnt have good enough Discord support yet, couldve been a module otherwise)
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
many is a big word :P
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
I mean directly, rather than via modules
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Yeah I don't expect param definitions in OpenAPI for writing scripts. The TypeDoc source is much much more useful for writing modules.
Are many people actually using the web API?
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Lots of stuff ๐Ÿคฃ
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
I use this to generate a openapi spec from the code
And then I use openapi-generator to go from spec -> api client code
Rapidoc makes the interactive api docs page
And, typedoc to make the detailed code-gen docs
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
ope I see it on the doc page, TypeDoc
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Well possible is good ๐Ÿ™‚ Maybe someday!
What's the name of the doc generator?
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
It's totally possible though because the API docs has a 'description' field next to the properties. Just gotta untangle how to actually pass it from here all the way to the autogenerated docs ๐Ÿ˜„
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Oh well, it all works without it and the group here being here to support it helps a lot
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Yeh :( I haven't found a way to add comments to properties inside a request body
Avatar for a12f6e80e9d89b5470e3311f9d8388d6d4bc834b3825be85bf1f6a4e71dd314f
User a12f6e
Ya, the auto gen documentation is super handy. The only thing that would help with that is doc comments to explain things, but understanding comes with experience haha
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Good catch haha
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
image.png

image.png

PNG โ€ข 91.1 KB

Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69