Documentation updates:

global: Modified the unicode in |stub| to be compatible with sphinx. Still appears as a wrench in the browser.

events: added information for events, and a list of events, as well as their arg paramater. Still marked as 'WIP', as I feel my documentation was a bit lacking

permissions: added information for channel\server permissions, dual channel permissions, and roles. need to update with bits at some point.
This commit is contained in:
Christopher F
2015-11-20 18:06:49 -05:00
parent 864fb53ab6
commit 3bc91838e9
5 changed files with 201 additions and 4 deletions

27
docs/samples/events.cs Normal file
View File

@@ -0,0 +1,27 @@
class Program
{
private static DiscordBotClient _client;
static void Main(string[] args)
{
var client = new DiscordClient();
// Handle Events using Lambdas
client.MessageCreated += (s, e) =>
{
if (!e.Message.IsAuthor)
await client.SendMessage(e.Message.ChannelId, "foo");
}
// Handle Events using Event Handlers
EventHandler<MessageEventArgs> handler = new EventHandler<MessageEventArgs>(HandleMessageCreated);
client.MessageCreated += handler;
}
// NOTE: When using this method, 'client' must be accessible from outside the Main function.
static void HandleMessageCreated(object sender, EventArgs e)
{
if (!e.Message.IsAuthor)
await client.SendMessage(e.Message.ChannelId, "foo");
}
}