You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shiftkey edited this page Jan 10, 2012
·
4 revisions
Want to start writing your own extensions to JibbR?
Three steps:
Create a new project under the Extensions folder - name it whatever you want
Create a class which implements one of the extension points - the ICommandSprocket or IAnnounce interface are currently supported
TODO: ICommandSprocket sample
[Export(typeof(IAnnounce))]
public class EchoAnnouncement : IAnnounce
{
public TimeSpan Interval
{
get { return TimeSpan.FromMinutes(5); }
}
public void Execute(Bot bot)
{
// TODO: something smarter
foreach (var room in bot.Rooms)
{
bot.Say("Hello world!", room);
}
}
}
Note how we have the Export attribute at the top of the class? We're using MEF to wire up components at runtime. You don't need to modify the console runner code to add your extension.
Add the project to the Jabbot.ConsoleBotHost/get-packages.cmd script to copy the project assemblies after building the solution: