Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

...
  • 1 commit
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Sep 17, 2012
Zirak some random shit c45c338
2  bookmarklet.js
View
@@ -1 +1 @@
-(function(){var a=document.createElement("script");a.src="https://raw.github.com/Titani/SO-ChatBot/master/master.js",document.head.appendChild(a)})()
+(function(){var a=document.createElement("script");a.src="https://raw.github.com/Zirak/SO-ChatBot/master/master.js",document.head.appendChild(a)})()
19 master.js
View
@@ -48,9 +48,7 @@ var IO = window.IO = {
function fireEvent( evt ) {
var call = evt.fun.apply( evt.thisArg, evt.args.concat(args) );
- if ( call === false ) {
- that.preventDefault = true;
- }
+ that.preventDefault = call === false;
}
},
@@ -5088,8 +5086,8 @@ bot.addCommand({
;
;
-/*global bot:true, IO:true */
(function () {
+
//collection of nudges; msgObj, time left and the message itself
var nudges = [],
interval = bot.adapter.in.interval || 5000;
@@ -5140,7 +5138,7 @@ function addNudge ( delay, msg, msgObj ) {
var nudge = {
msgObj : msgObj,
- message : msg || '*nudge*',
+ message : '*nudge*' + ( msg || '' ),
register: Date.now(),
time : inMS
};
@@ -5159,7 +5157,7 @@ bot.addCommand({
description : 'Register a nudge after an interval. ' +
'`/nudge intervalInMinutes message`, or the listener, ' +
- '`nudge|remind|poke me? in? intervalInMinutes message'
+ '`nudge|remind|poke me? in? intervalInMinutes message`'
});
bot.listen(/(?:nudge|remind|poke)\s(?:me\s)?(?:in\s)?(\d+m?)\s?(.*)$/,
@@ -5899,6 +5897,15 @@ bot.addCommand({
;
;
+IO.register( 'input', function ( msgObj ) {
+ var content = msgObj.content.toUpperCase().match( /\w+/ )[ 0 ];
+
+ if ( content === 'STOP' ) {
+ bot.adapter.out.add( 'HAMMERTIME!', msgObj.room_id );
+ }
+});
+
+;
(function () {
var list = JSON.parse( localStorage.getItem('bot_todo') || '{}' ),
4 source/bot.js
View
@@ -48,9 +48,7 @@ var IO = window.IO = {
function fireEvent( evt ) {
var call = evt.fun.apply( evt.thisArg, evt.args.concat(args) );
- if ( call === false ) {
- that.preventDefault = true;
- }
+ that.preventDefault = call === false;
}
},
7 source/plugins/STOP.js
View
@@ -0,0 +1,7 @@
+IO.register( 'input', function ( msgObj ) {
+ var content = msgObj.content.toUpperCase().match( /\w+/ )[ 0 ];
+
+ if ( content === 'STOP' ) {
+ bot.adapter.out.add( 'HAMMERTIME!', msgObj.room_id );
+ }
+});
6 source/plugins/nudge.js
View
@@ -1,5 +1,5 @@
-/*global bot:true, IO:true */
(function () {
+
//collection of nudges; msgObj, time left and the message itself
var nudges = [],
interval = bot.adapter.in.interval || 5000;
@@ -50,7 +50,7 @@ function addNudge ( delay, msg, msgObj ) {
var nudge = {
msgObj : msgObj,
- message : msg || '*nudge*',
+ message : '*nudge*' + ( msg || '' ),
register: Date.now(),
time : inMS
};
@@ -69,7 +69,7 @@ bot.addCommand({
description : 'Register a nudge after an interval. ' +
'`/nudge intervalInMinutes message`, or the listener, ' +
- '`nudge|remind|poke me? in? intervalInMinutes message'
+ '`nudge|remind|poke me? in? intervalInMinutes message`'
});
bot.listen(/(?:nudge|remind|poke)\s(?:me\s)?(?:in\s)?(\d+m?)\s?(.*)$/,

No commit comments for this range

Something went wrong with that request. Please try again.