Skip to content
Snippets Groups Projects
Commit 5cada0c5 authored by deuce's avatar deuce
Browse files

Notice when there's nothing to quote.

parent e4c89eab
No related branches found
No related tags found
No related merge requests found
......@@ -95,11 +95,15 @@ Bot_Commands["QUOTE"].command = function (target, onick, ouh, srv, lbl, cmd) {
return true;
var posts=get_posts_by(cmd.slice(1).join(' '));
var m=null;
while(m==null) {
m=posts.substr(random(posts.length)).match(/[^\.][\.\!\?]\s+(.*?[^.][\.\!\?])[^.]/);
if(posts.search(/[^\.][\.\!\?]\s+(.*?[^.][\.\!\?])[^.]/)==-1)
srv.o(target, "Nothing quotable every posted by "+cmd.slice(1).join(' '));
else {
var m=null;
while(m==null) {
m=posts.substr(random(posts.length)).match(/[^\.][\.\!\?]\s+(.*?[^.][\.\!\?])[^.]/);
}
srv.o(target, cmd.slice(1).join(' ')+': "'+m[1]+'"');
}
srv.o(target, cmd.slice(1).join(' ')+': "'+m[1]+'"');
}
Bot_Commands["DIS"] = new Bot_Command(0, false, false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment