Skip to content

hartez/XmppBot-for-HipChat

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 34 commits behind patHyatt:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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 functionality: 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!"; }
        }
    }
}

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

XMPP_bot.exe install

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

About

HipChat XMPP Bot in C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%