Created
March 23, 2017 22:04
-
-
Save SturdyStubs/18531c136a167be50769f47c404ac5a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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