After our initial discussion on the matter (see #172) this is the system
that we all seem to have agreed on. As a result, I have implemented a
simple system which effectively implements permissions, while being
extensible and tweakable so bot devs can decide what they want to do for
permissions.
As for default 'permissions', I'm not sure what the best approach would be
here; bot devs are likely to implement their own permissions 'levels' and
use those. I think the most we could do for now is add attributes to
require certain users (by id) and certain roles (by id and possibly by
name?) This would probably be the best option for now as it requires less
work from us, nor do we know the *exact* approach bot devs want to take
with permissions.
This commit adds GET /channels/{id}/pins to the ApiClient, and adds GetPinnedMessagesAsync to IMessageChannel. This method is only implemented on the REST entities, and the WebSocket entities do not include an override to retrieve pinned messages from cache.
Resolves#159.
The previous bug was that SocketSelfUser did not inherit from ISelfUser, so DiscordSocketClient.GetCurrentUserAsync was not returning a SocketSelfUser, despite the underlying type being that. This caused ModifyStatusAsync to throw the NotSupportedException that existed on the REST SelfUser.
Cached Channels keep a local cache of the members of that channel. This commit adds a synchronus method to access the cached user stores.
It also fixes a bug where the GetUser extension would return an IGroupUser by soft-casting to IGroupUser, which would always return null. ISocketUser does not share an inheritance with IGroupUser, so I now return IUser instead.
Previously, if a user autoloaded commands more than once, commands that were already in the command map would be readded.
If the module list already contains a module with the same type as the module being loaded, it will not load the new instance of this module.
For users importing `Discord.WebSocket.Extensions`, there are now non-async extensions for GetUser.
These methods point to the appropriate method on the respective SocketgChannel.
Instead of implicitly soft-casting IGuild to SocketGuild, I added a method to soft-cast IGuild to SocketGuild, and throw an InvalidOp if it came up null for some reason.
GetUsers was changed from an IEnumerable to an IReadOnlyCollection to allow quick ".Count"-ing on the collection.
For users importing `Discord.WebSocket.Extensions`, there are now non-async extensions for Get(Type)Channel(s) and Get(Current)User(s).
These methods point to the appropriate method or member on SocketGuild.
Resolves#153
This is a breaking change!
With the introduction of Vanity URLs and the shortening of Invite URLs, the API appears to have removed the "xkcdpass" field of the Invite.
Since this functionality was removed from the Discord API and thus obsolete, it has been removed from the Invite models.