Commit d0b83ebd by Иван Кубота

more rules

parent 18e5c27e
...@@ -48,8 +48,12 @@ User.prototype = { ...@@ -48,8 +48,12 @@ User.prototype = {
}; };
const chat = captures[this.chat.id] || (captures[this.chat.id] = {}); const chat = captures[this.chat.id] || (captures[this.chat.id] = {});
(chat[this.id] || (chat[this.id] = [])).push(capture); (chat[this.id] || (chat[this.id] = [])).push(capture);
let stopped = false;
return { return {
stop: function() { stop: function() {
if(stopped)
return;
stopped = true;
chat[capture.user].splice(chat[capture.user].indexOf(capture), 1); chat[capture.user].splice(chat[capture.user].indexOf(capture), 1);
if(chat[capture.user].length === 0){ if(chat[capture.user].length === 0){
delete chat[ capture.user ]; delete chat[ capture.user ];
......
...@@ -20,6 +20,8 @@ module.exports = { ...@@ -20,6 +20,8 @@ module.exports = {
"ban2": "{{$count}} {{plural:$count,рыба,рыбы,рыб}}", "ban2": "{{$count}} {{plural:$count,рыба,рыбы,рыб}}",
"ku": "Говори «ку»", "ku": "Говори «ку»",
"permission": "Не можно", "permission": "Не можно",
"newLocale": "Теперь напиши боту лично. У тебя есть на это 15 минут, поторопись.",
"linkToUI": "Секретная ссылка! {{$link}}",
"_plural": "plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)" "_plural": "plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)"
}; };
\ No newline at end of file
...@@ -82,9 +82,6 @@ module.exports = [ ...@@ -82,9 +82,6 @@ module.exports = [
//var chatlanPlanet = isPazak; //var chatlanPlanet = isPazak;
var countTo = (match.to|0)||3; var countTo = (match.to|0)||3;
message.from.send(L('pidor', {count: countTo, condition: isPazak, ...usr})); message.from.send(L('pidor', {count: countTo, condition: isPazak, ...usr}));
/*message.from.user.full_name + ', ты — ' + ( isPazak ? 'пацак' : 'чатланин' ) + ', а это — ' + ( chatlanPlanet ? 'чатланская' : 'пацаковская' ) + ' планета.\n\n' +
'Считай до 5'
);*/
var last = 1; var last = 1;
var mistakes = 0; var mistakes = 0;
var debil = 0; var debil = 0;
...@@ -142,13 +139,25 @@ module.exports = [ ...@@ -142,13 +139,25 @@ module.exports = [
}), }),
Answer('/newPattern',function(message) { Answer('/newPattern',function(message) {
message.user message.reply(L('newLocale'));
const originalChat = message.user.chat.id;
message.user.chat.id = message.user.id;
var capture = message.user.capture( [
Answer('{{$any}}', function(msg, match) {
capture.stop();
msg.send(L('linkToUI', {link: 'http://lal.ru'}))
})
]);
setTimeout(()=>capture.stop(), 5*60*1000);
/*
.send('Which pattern?', Choose([ .send('Which pattern?', Choose([
{ text: 'Read only'}, { text: 'Read only'},
{ text: 'Text only'}, { text: 'Text only'},
{ text: 'Timeout kick'}, { text: 'Timeout kick'},
], function(result) { ], function(result) {
message.user.send('Selected: '+result.text); message.user.send('Selected: '+result.text);
})); }));*/
}) })
]; ];
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment