Skip to content

gep13/nubot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NuBot

A robotic butler for your organization.

Getting started

Create a new Console Application and install the NuBot package.

Install-Package NuBot

In your Main function, run NuBot,

public static void Main(string[] args)
{
    var gitterToken = "<YOUR GITTER AUTHENTICATION TOKEN>";

    new RobotFactory()
        .AddPart<DoIt>()
        .AddPart<Echo>()
        .AddPart<ShipIt>()
        .UseAdapter(new GitterAdapter(gitterToken))
        .RunAsync(CancellationToken.None)
        .GetAwaiter()
        .GetResult();
}

Writing Robot Parts

It is up to the robot owner to add Robot Parts to the NuBot, making the robot do things just right.

Here is a simple RobotPart which echoes any message sent to the robot,

public sealed class Echo : RobotPart
{
    public override void Attach(IRobot robot)
    {
        robot.Listen("echo (?<Message>.*)", async ctx =>
        {
            await ctx.SendAsync("{0}", ctx.Parameters["Message"]);
        });
    }
}

About

A robotic butler.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.3%
  • PowerShell 0.7%