TorqueScript Bot

As a programming language nerd with an obsession for the Torque Game Engine (maybe a subject for future posts?) and more specifically the crude kind of scripting languages, I found it frustrating that the only way to test out a bit of TorqueScript code was to launch a compatible game and then to evaluate the code into that game...
So with the help of a neat website by "Lukas J" I hooked up a Discord bot to it that can receive commands and relays the code to that website and returns the evaluation result.
Natually from the nature of that website, it is limited to the Torque3D flavor of TS (using the TS Neo VM) for now, but later it could be expanded to support the TGE flavor deployed in an actual docker container on my server instead of relying on a third party website, that's something to think about (and a proper opportunity to figure out docker haha).

The bot supports both commands and messages (for servers where slash commands are unauthorized) along with minimal support for Markdown code blocks, all of the following messages shall work:
/eval ts-code-here
$eval ts-code-here
$eval `ts-code-here`
$eval ```ts-code-here```

It's not really a complex project by any means and mostly relies on discord.js, some async calls and fetch. But it was a neat way for me to familiarize myself once again with the process of making a Discord "Application".

Here's the invite link for the bot.
I hope this was of any use to even a single person on this planet lol.
viwrap - 2024-06-06 08:24:18
copyright © 2024, viwrap. custom blog software