Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.29 KB

File metadata and controls

42 lines (32 loc) · 1.29 KB

VkNet.FluentCommands.GroupBot

Extension for VkNet to quickly create bots.

NuGet NuGet

How to use?

Add the package to the project

Package Manager

PM> Install-Package VkNet.FluentCommands.GroupBot

.NET CLI

> dotnet add package VkNet.FluentCommands.GroupBot
using VkNet.FluentCommands.GroupBot;

//...

FluentGroupBotCommands commands = new FluentGroupBotCommands();

commands.ConfigureGroupLongPoll(000000U);

await commands.InitBotAsync("very big group token");

commands.OnText("^ping$", "pong");
commands.OnText("^hello$", new[] {"hi!", "hey!", "good day!"});
commands.OnText("command not found");

commands.OnException((e, token) =>
{
    Console.WriteLine("Wake up, everything is broken");
    Console.WriteLine($"[{DateTime.UtcNow}] {e.Message} {Environment.NewLine} {e.StackTrace}");
    return Task.CompletedTask;
});

await commands.ReceiveMessageAsync();

See the wiki for all features.