[violet] wrote:There are a few challenges, which you've highlighted. A concern for me is also that we don't currently offer a way for you to subscribe to events -- you can't just ask to be pinged whenever there's a new message on an RMB you're tracking. Instead, you'd need to keep polling the RMB to see if there's anything new. You'll no doubt want your bot to be responsive, so I wonder whether you're going to wind up polling a large number of regions every second or two, 99% of which is pulling the same messages over and over, just to listen for new messages. We might be able to offer a listener-based API to solve this, though.
I came here to say this.
Please add an event-driven API for notices (and happenings?). In the case of an RMB bot, 30 seconds in between each notice check would probably be the maximum for a high-quality, modern bot, at least without boring the user, and in any case you'd still be "running hot". If you just didn't care about efficiency and wanted it to be responsive within the second, you could poll the site at 100 times per second. But if you wanted to add features that interact with NS' site (e.g. a nations not endorsing command for GPers, or an NSEconomy stats command for RPers), you'd run into an issue where you're balancing features and responsiveness. While this is mainly an efficiency problem, larger bots might run into quality-of-life problems.
The same could be said for happenings, which are frustrating to poll, especially if you need to get new happenings in as fast as possible (e.g. manual recruitment "accelerators" like 10KI's, Trotterdam's issues analysis). And in any case, NS already seems to have a start to a push API with automatically-updating telegrams, happenings, and notices (and NS++).
All in all, I really like this idea. I might whip up a rough draft of some general-purpose bot commands later today. And perhaps August can port NSVerify's database to NS (i.e. see a nation's discord account and other nations, if applicable).