Skip to content

Instantly share code, notes, and snippets.

@SturdyStubs
Created March 23, 2017 22:04
Show Gist options
  • Save SturdyStubs/18531c136a167be50769f47c404ac5a5 to your computer and use it in GitHub Desktop.
Save SturdyStubs/18531c136a167be50769f47c404ac5a5 to your computer and use it in GitHub Desktop.
using Discord;
using Discord.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DiscordBotStunthound
{
class MyBot
{
DiscordClient discord;
public MyBot()
{
discord = new DiscordClient(x =>
(
x.Loglevel = LogSeverity.info
x.Loghandler = Log;
});
discord.UsingCommands(x =>
{
x.PrefixChar = '!';
x.AllowMentionPrefix = true;
});
var commands = Discord.GetService<CommndService>();
commands.CreateCommand("hello"
.Do(Async (e) =>
{
await e.Channel.SendMessage("Hi!");
});
discord.ExecuteAndWait(async() =>
{
await discord.connect("Mjg2Njc1NTY2NjIxNjIyMjc2.C7Ib1g.npfUXtsrYCZqkNJohjmoeCzpsxE")
});
}
private void Log(object sender, LogMessageEventArgs e)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment