Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

patHyatt/XmppBot-for-HipChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XmppBot-for-HipChat

NOTICE

Hipchat was acquired and is no longer available.

The repository has been archived and is still available mainly, because it's my hottest repo. Thanks to everyone who used and built on this.

What is it

A simple XMPP bot written in C# which is easily extended to run your own custom extensions.

To use:

Copy/Paste the App.config.template file and rename to App.config. Inside the newly named App.config file, fill in key entries with appropriate values from your XMPP page in hipchat.

To add an extension:

Implement the IXmppBotPlugin interface and decorate the class with [Export(typeof(IXmppBotPlugin))]. Implement the interfaces methods (Evaluate and Name). Uberfy your HipChat.

Example:

using System;
using System.ComponentModel.Composition;
using System.Linq;

using XmppBot.Common;

namespace XmppBot.Extensions
{
    [Export(typeof(IXmppBotPlugin))]
    public class SmackEm : IXmppBotPlugin
    {
        public string Evaluate(ParsedLine line)
        {
            if (!line.IsCommand)
                return "";

            switch (line.Command.ToLower())
            {
                case "smack":
                    return String.Format("{0} smacks {1} around with a trout.", line.User, line.Args.FirstOrDefault() ?? "Your mom");

                default: return null;
            }
        }

        public string Name
        {
            get { return "Smack Em!"; }
        }
    }
}

Installation

You can run the bot as a console application, or you can install it as a Windows Service by running:

XmppBot.Service.exe install

For more info about installing as a service, see the TopShelf documentation.

Issues

If you have an issue or identify a bug, please file an issue or create a pull request.

Contributors

License

MIT

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages