Relatively recently, Pylon was introduced; it’s a serverless platform with its own SDK for developing Discord bots. At first, I really didn’t pay it any attention due to the amount of terrible services like it that I’d seen, but that was definitely a mistake. It’s primarily run by Discord staff and ex-staff, so it’s obviously trusted, and its speed yet ease-of-use genuinely shocked me.
So… how does it work?
You’ll be somewhat familiar with the SDK if you’ve used other JS API wrappers for Discord, but it’s unique in some ways; scripts are per-guild and it seems to be relatively more low-level (as of now, at least). You’ll be able to use your own bot account and have multiple guilds in the future with BYOB — bring your own bot. It’ll cost around $2.99 per month; the standard tier, however, will always be free!
You’ll end up needing a DB at some point in time, so Pylon provides a KV store with a default limit of 256 keys free-of-charge. It has a super easy API that you can work with.
To deploy your scripts, you can either use the really neat online editor or send a
POST request to Pylon’s API. Pylon handles all of this for you; you can expect deployments to take around 2 seconds. This also means that downtime is uncommon enough that it’s almost implausible.
Pylon really isn’t limited a lot. For each event, you’re limited to 50ms CPU time (which is quite a lot), 20s total time, and 25 fetch requests. In the case that you exceed the maximum CPU time, you can request a CPU burst; this temporarily loosens the restrictions.
Pylon actually has an easy online editor built on top of monaco. Scripts are automatically deployed when you save them and there’s tooling to help you, like TypeScript IntelliSense.
While I think Pylon’s great, it’s not the best in all cases. Sometimes you just, well, don’t want to use TS, or want to have full control over how your bot is being hosted. I’d say the only real issues I have with it include the following:
- no support for WebAssembly yet;
- limits that can affect larger bots (note that these are able to be loosened); and
- fees to use your own bot user.
Pretty much all of these are understandable, though.
So to answer the question — yes. While it’s perfect if you’re making a bot for a single community, it’ll also be able to be used in multiple once BYOB is released. It’s amazing how much you get for… free. What I’ve covered doesn’t even include all built-in features; there’s a bunch of new stuff constantly being implemented, including cron tasks, etc.