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.
27 lines
726 B
C#
27 lines
726 B
C#
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");
|
|
}
|
|
} |