104 lines
5.7 KiB
JavaScript
104 lines
5.7 KiB
JavaScript
|
const fs = require('fs');
|
||
|
|
||
|
const Markup = require('telegraf/markup');
|
||
|
const Extra = require('telegraf/extra');
|
||
|
|
||
|
//=== TOOL FUNCTIONS
|
||
|
|
||
|
const food = [{s:"l'Intranet"},{s:"un serveur", p: "des serveurs"},{s:"la ventillation"},{s:"la benne",p: "les bennes"},{s:"un serpent",p:"des serpents"},{s:"du piment d'esperlette"},{s:"une saucisse",p:"des saucisses"},{s:"une olive",p:"des olives"},{s:"un pain",p:"des pains"},{s:"une baguette",p:"des baguettes"},{s:"un croissant",p:"des croissants"},{s:"un steak",p:"des steaks"},{s:"de la blanquette de veau"},{s:"un oeuf",p:"des oeufs"},{s:"du fromage",p:"des tonnes de fromage"},{s:"dionys"},{s:"evoli"},{s:"ma fierté"},{s:"un rack anim"},{s:"la présidence"},{s:"une pomme",p:"des pommes"},{s:"une banane",p:"des bananes"},{s:"une mandarine",p:"des mandarines"},{s:"une clementine",p:"des clementines"},{s:"EPFELLE"},{s:"un cheval",p:"des chevals"},{s:"un poney",p:"des poneys"},{s:"une licorne",p:"des licornes"},{s:"un frigal",p:"des frigeaux"},{s:"une capote",p:"des capotes"},{s:"du lubrifiant"},{s:"du ketchup"},{s:"une Nitendo WeSwitch XS Max Pro"},{s:"un pokemon"},{s:"une pasteque",p:"des pasteques"},{s:"une corde",p:"des cordes"},{s:"un poisson",p:"des poissons"},{s:"de la laitue"},{s:"de la salade"},{s:"une tomate",p:"des tomates"},{s:"un raisain",p:"des raisins"},{s:"un cornichon",p:"des cornichons"},{s:"un aspirateur"},{s:"un slip a gestre"},{s:"un cancer",p:"des cancers"},{s:"du caviar"},{s:"une langouste",p:"des langoustes"},{s:"une datte",p:"des dattes"},{s:"un citron",p:"des citrons"},{s:"de la moisissure"},{s:"un yaourt",p:"des yaourts"},{s:"la poubelle",p:"les poubelles"},{s:"un avocat",p:"des avocats"},{s:"du gouacamol"},{s:"un hotdog",p:"des hotdogs"},{s:"un tuperware",p:"des tuperware"},{s:"une glace",p:"des glaces"},{s:"un burger",p:"des burgers"},{s:"un tacos",p:"des tacos"},{s:"un nugget",p:"des nuggets"},{s:"une pizza",p:"des pizzas"},{s:"ce bot"},{s:"un monster",p:"des monsters"},{s:"un redbull",p:"des redbulls"},{s:"du café"},{s:"un maté"},{s:"un verre", p:"des verres"},{s:"du cenovis"},{s:"du hummus"},{s:"la vaisselle salle"}];
|
||
|
const foodlen = food.length;
|
||
|
|
||
|
const effect = [{s:"est remplis de vers",p:"sont remplis de vers"},{s:"se désintègre",p:"se désintègrent"},{s:"putréfie",p:"putréfient"},{s:"se désagrège",p:"se désagrègent"},{s:"se gâte",p:"se gâtent"},{s:"se frelate",p:"se frelatent"},{s:"se dissous",p:"se dissouent"},{s:"pourris",p:"pourrissent"},{s:"est remplis de larves", p:"sont remplis de larves"}, {s:"entre en putréfaction", p:"entrent en putréfaction"}, {s:"devient bleu",p:"deviennent bleu"},{s:"se décompose",p:"se décomposent"},{s:"est périmé",p:"sont périmés"}, {s:"traine",p:"trainnent"}];
|
||
|
|
||
|
const complaint = ["*insérez remarque*","étonament pas encore a la poubelle","bientot le temps de le jetter","bientot temps de s'en occuper","un bon debut pour une culture de champignons","sympa, on dirait un nis de moucherons", "répugnant","immonde","dégoutant","d'une puanteur extrême","inhumain","limite un crime contre l'humanité","pire que du gaz sarin","pire que le cancer de Bryan","contraire aux normes de sécurité","un lieu de reproduction pour des nouveaux virus","pas DSPS proof","pas tolérable","inacceptable"];
|
||
|
|
||
|
const place = ["dans le frigo","dans une caisse","dans le panier a pain", "dans le congelateur", "dans la poubelle", "sur la table", "dans le couloir", "dans l'imprimante", "dans ma botte","au DIT", "a l'AGEP", "en SDC"];
|
||
|
|
||
|
function get_food(){
|
||
|
return food[Math.floor(Math.random() * foodlen)];
|
||
|
}
|
||
|
|
||
|
function get_effect(){
|
||
|
return effect[Math.floor(Math.random() * effect.length)];
|
||
|
}
|
||
|
|
||
|
function get_complaint(){
|
||
|
return complaint[Math.floor(Math.random() * complaint.length)];
|
||
|
}
|
||
|
|
||
|
function get_place(){
|
||
|
return place[Math.floor(Math.random() * place.length)];
|
||
|
}
|
||
|
|
||
|
function get_sp(){
|
||
|
return (Math.floor(Math.random() * 2)==0);
|
||
|
}
|
||
|
|
||
|
function build_complaint(){
|
||
|
var i = Math.floor(Math.random()*5);
|
||
|
|
||
|
var foodstr = get_food();
|
||
|
var effectstr = get_effect();
|
||
|
var placestr = get_place();
|
||
|
var complaintstr = get_complaint();
|
||
|
var sp = foodstr.p? get_sp():0;
|
||
|
|
||
|
if(sp){
|
||
|
foodstr = foodstr.p
|
||
|
effectstr = effectstr.p
|
||
|
}else{
|
||
|
foodstr = foodstr.s
|
||
|
effectstr = effectstr.s
|
||
|
}
|
||
|
|
||
|
if(i == 0){
|
||
|
return "WTF ! Il y a "+foodstr+" qui "+effectstr+" "+placestr+"... C'est "+complaintstr+" !";
|
||
|
}else if(i == 1){
|
||
|
return "Non mais faut faire quelque chose... Avoir "+foodstr+" qui "+effectstr+" "+placestr+" depuis "+Math.ceil(Math.random()*10000)+" ans ... "+"C'est "+complaintstr+" ! Merci.";
|
||
|
}else if(i == 2){
|
||
|
return "Sérieux faut faire quelque chose. C'est "+complaintstr+"! J'en ai mare de voir "+foodstr+" qui "+effectstr+" "+placestr+"...";
|
||
|
}else if(i == 3){
|
||
|
return "Je tiens à vous informer qu'il y a "+foodstr+" qui "+effectstr+" "+placestr+"... Je trouves que c'est "+complaintstr+" !";
|
||
|
}else if(i == 4){
|
||
|
return "Cher comité, je tiens a vous informer qu'il y a "+foodstr+" qui "+effectstr+" "+placestr+"... Trouvant cela "+complaintstr+", je vous prierais d'en prendre soin. Cordialement votre Evoli.";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//=== MAIN MODULE CONFIG
|
||
|
|
||
|
module.exports = function(){
|
||
|
return {
|
||
|
name : "Frigal",
|
||
|
version : 0.1,
|
||
|
requirements : {
|
||
|
gps: false,
|
||
|
},
|
||
|
text : [
|
||
|
{
|
||
|
trigger : ["/frigal","/frigo","/bar"],
|
||
|
requirements : (bot,event,message)=>{
|
||
|
return new Promise((resolve, reject)=>{
|
||
|
return resolve({error:false});
|
||
|
});
|
||
|
},
|
||
|
action : (bot,event,message)=>{
|
||
|
return event.reply(build_complaint(), {"parse_mode":"Markdown"});
|
||
|
}
|
||
|
},
|
||
|
],
|
||
|
reply : [],
|
||
|
regex : [],
|
||
|
media : [],
|
||
|
callback : [],
|
||
|
inline : [],
|
||
|
new_member : (bot,event)=>{
|
||
|
//return event.replyWithMarkdown("Welcome !");
|
||
|
},
|
||
|
weburl : [],
|
||
|
cron : [],
|
||
|
cron_register : function(cron_f,bot,c){
|
||
|
new cron_f(c.cstr, new c.action(bot), c.params[0], c.params[1], c.timezone);
|
||
|
},
|
||
|
}
|
||
|
|
||
|
}
|