コード例 #1
0
ファイル: Program.cs プロジェクト: skovsende/TriviaBot.Net
		static void Main()
		{
			using (var bot = new Bot())
			{
				bot.AddPlugin(new TriviaPlugin());

				bot.Connect("irc.quakenet.org", "GinnTrivia", "GinnTrivia", "GinnTrivia");
				Console.WriteLine("Connected...");

				bot.Join("#ginnunga");
				bot.Message +=
					(channel, sender, text) => Console.WriteLine(string.Format("{0}/{1}: {2}", channel.Name, sender, text));

				Console.ReadKey();
			}
		}
コード例 #2
0
        public async Task MainAsync()
        {
            Bot bot = new Bot();

            bot.AddProvider(
                new DiscordBotProvider(
                    new DiscordProviderConfigurations()
            {
                Token      = "",
                ShardCount = 1
            }));

            bot.AddPlugin(
                new CommandsPlugin(bot, new CommandProcessorConfiguration()
            {
                AutoSearchForCommands = true,
                DefaultPrefix         = "!"
            }));

            await bot.StartAsync();

            await Task.Delay(-1);
        }