Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Sep 17, 2012
@Zirak some random shit
c45c338
View
2  bookmarklet.js
@@ -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)})()
View
19 master.js
@@ -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') || '{}' ),
View
4 source/bot.js
@@ -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;
}
},
View
7 source/plugins/STOP.js
@@ -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 );
+ }
+});
View
6 source/plugins/nudge.js
@@ -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.