Page 1 of 1

IRC bot to report changes in Mantis, now available!

Posted: 13 Mar 2006, 21:47
by Darkness
I wanted to have an IRC bot that was able to report changes in mantis for some time.
So I decided to stop looking for it and write my own.
Not only did I succeed, I also make it available to everyone 8)

This requires a few changes to mantis, I used 1.0.0rc5 to start with.

First, I had to define a new custom function in custom_function_api.php
Second, I hooked this function to the history_log_event_special and history_log_event_direct functions so it would be called, everytime something is added to the history table.
Third, I wrote a custom override for this function that writes data to a file in the main mantis folder everytime there is an update.
Last, I made the IRC bot that uses the data in this file to report changes in the IRC channel of your choice. It's written in C# and easy to modify or add functionality.
The bot can be run from a remote server.
What does it report? Basicly the things that are in the history of an issue (at the bottom of the page) It will also give the bug number and the summary.
Example output:
26: Darkness Note Added: 0000081 - (this is the summary)
35: Darkness Status - feedback => resolved (changes to mantis to support IRC bot)
I based my bot on the code from David Cumps

Patched Mantis files and patch itself: here
IRC bot + source: here

The *_api.php files go into the core directory, the custom_function_inc.php goes in the main directory.
Note:
It creates and writes to a file _hist_updates.txt in the main directory. You might have to create this file manually and give write permissions to it.
Other note:
There is a problem with mantis that is not easy to fix right away. This concerns private changes. These changes will be recorded in the history of an issue.
Since there is not private field in the database table or another way to determine if data in the history of an issue is private, it will report these changes as well.

Enjoy! :D

Peter

(edit: added example output)

Posted: 14 Mar 2006, 01:07
by Darkness
poll interval of the bot is 5 seconds. you might want to up that to 30 seconds or something like that since the delay from waiting for the remote server seems to exceed 5 seconds now and then resulting in stuff not being reported.

Posted: 06 Apr 2006, 15:44
by Darkness
I updated the patched files for mantis (not the patch itself)
custom_function_inc.php now uses lang_push('english'); and lang_pop(); to make sure all reports are in english. Otherwise it used the language of the reporter.

Posted: 12 Apr 2006, 05:47
by psutinrerk
Hello
I really like your plug-in. It seem very useful
Does it work with the skype? if so how can I install it to work with skype?
Thank you

Posted: 26 May 2006, 12:01
by Darkness
i'm not sure I'm with you here...

How do you want to use this with skype? So the bot calls you on skype to tell you there is an update?

The bot is an easy C# program that can be extended with anything you want like dotMSN or a jabberclient so you can talk to it on msn or jabber.

Re: IRC bot to report changes in Mantis, now available!

Posted: 18 Jun 2011, 19:04
by SugarD-x
It seems this bot is very-much outdated and the download links are now broken. Sorry for the extreme, five-year bump, but does anyone have a link to an updated version? I would love to get one of these set up soon, and they are extremely hard to find. I found SupyBot, but it's buggy as hell and refuses to load it's own Mantis plugin, so I gave up on that. Python is a nightmare for me anyway hahaha...