!server can now also use numbers from the invite of servers with
a vanity URL.
API calls for the invite and the REST guild endpoint are now memoized.
Since Guild.fetchAllMembers() now returns a promise, tweaked
refreshMembersIfNeeded() to not make unnecessary API calls if called
multiple times in rapid succession.
Offline member count is now derived from guild member count and
calculated online member count. The numbers might still not match the
real member counts, but at least they add up to the total member
count.
Eris 0.11.2 also made Guild.fetchAllMembers() return a promise, which
means !server will now properly wait for all members to load.
Since the command uses extra server resources for resizing the image,
I want to limit its use a bit. Might look into a per-channel or
per-guild cooldown in the future rather than per-user, but this will
work for now.
Including the dom lib doesn't make much sense since we're not in a
browser environment. While this solution isn't perfect either, I
think it's more fitting.
Since voice mutes cannot be re-applied unless the member is in voice,
we can't re-apply the voice mute automatically on join and would have
to do it later when they first join voice, which could get messy if
they were not supposed to be voice muted anymore after all (if they
e.g. don't use voice for a long time).
Separate role adding/removing to two separate commands for clearer
help pages and to remove the conflict with the self-assignable roles
plugin.
Require the assignable_roles option to always be an array (even if an
empty one).
Allow role assignments to self.
Log role additions/removals via these commands with the right
moderator name (instead of relying on the auto-log from the event).
Development npm scripts now also listen for debuggers:
- Port 9229 for the bot
- Port 9239 for the api
Via Knub 28, PluginErrors are no longer used in development, which
helps with call stacks in debuggers (see Knub changelog).
Unhandled promise rejections are now treated as exceptions via nodejs
flag --unhandled-rejections=strict, which allows catching them with
a debugger.
The internal "error-tolerant" error handler is now only used in
production; in development, all unhandled errors cause the bot to
crash and are easily catchable by debuggers.