Skip to content

Instantly share code, notes, and snippets.

@Ratismal
Created August 23, 2018 23:37
Show Gist options
  • Save Ratismal/0b3b3393eed817c8c1a25ea2ba14458e to your computer and use it in GitHub Desktop.
Save Ratismal/0b3b3393eed817c8c1a25ea2ba14458e to your computer and use it in GitHub Desktop.
{
"signature": "b7d9a6171b3a3ea8e8ca4104125ad33a7f909f66b4fab7b86fa005b3657a1208",
"payload": {
"cc": {
"lastowo": {
"content": "{func;ns;\r\n {params;0} {params;1}{if;{params;0};!=;1;s}\r\n}\r\n{func;diff;{void;\r\n {set;~r;}\r\n {if;{params};<;60;{set;~r;{func.ns;{params};second}};\r\n {if;{params};<;3600;\r\n {set;~r;{func.ns;{floor;{math;/;{params};60}};minute}};\r\n {if;{params};<;86400;\r\n {set;~r;{func.ns;{floor;{math;/;{params};3600}};hour}};\r\n {set;~r;{func.ns;{floor;{math;/;{params};86400}};day}}\r\n }\r\n }\r\n }\r\n }{get;~r}\r\n}\r\n{switch;{lower;{args;0}};\r\n recent;\r\n{set;~out;[]}\r\n{for;~i;0;<;{length;{get;_lastowos-diff}};\r\n{push;~out;{set;~u;{get;_lastowos-user;{get;~i}}}{space}- {func.diff;{get;_lastowos-diff;{get;~i}}} broken by **{username;{get;~u}}#{userdiscrim;{get;~u}}**}{reverse;{get;~out}}\r\n}**Last {length;{get;_lastowos-diff}} Streaks Broken**\r\n{join;~out;{newline}}{return};\r\n top;\r\n {set;~i;0}\r\n {set;~board;{slice;_owosboard;0;10}}\r\n**Top {length;{get;~board}} Chain-Breakers**\r\n{foreach;~id;~board;\r\n {increment;~i}. **{username;{get;~id}}#{userdiscrim;{get;~id}}** - **{get;_owosbroken{get;~id}}** broken{newline}\r\n}{return}\r\n}\r\n{set;~diff;{math;-;{time;X};{get;_owo}}}\r\n{set;~span;{func.diff;{get;~diff}}}\r\n{if;{get;_owodiff};==;;{set;_owodiff;0}}\r\n{if;{get;~diff};>;{get;_owodiff};\r\n {set;~longest;{get;~span}};\r\n {set;~longest;{func.diff;{get;_owodiff}}}\r\n}\r\n{set;~breaker;{username;{get;_owobreaker}}#{userdiscrim;{get;_owobreaker}}}\r\n{set;~broken;{func.ns;{get;_owosbroken{get;_owobreaker}};streak}}\r\nℹ {randchoose;\r\n This is an owo-free workplace. It has been **{get;~span}** since the last incident.;\r\n It has been **{get;~span}** since the last owo-related incident.;\r\n This guild has gone **{get;~span}** without an owo.;\r\n This workplace has been proudly owo-free for **{get;~span}**.;\r\n There have been **{get;~span}** since the last owo.;\r\n **{get;~span}** since last owo.;\r\n We have worked **{get;~span}** since last owo.;\r\n Time owo-free: **{get;~span}**.\r\n}\r\n\r\n😾 {randchoose;\r\n Last streak broken by: **{get;~breaker}**. They've broken **{get;~broken}**.;\r\n Damnit, **{get;~breaker}**! You've ruined **{get;~broken}**!;\r\n **{get;~broken}** have been broken by **{get;~breaker}**.\r\n}\r\n\r\n🏆 {randchoose;\r\n Longest time owo-free: **{get;~longest}**.;\r\n Our longest streak is **{get;~longest}**.;\r\n The record is **{get;~longest}**.\r\n}"
},
"_owo_process": {
"content": "{void;{if;{userisbot};{return}}\r\n{if;{commandname};==;_owo_process;{return}}\r\n{if;{get;_owochannels};!=;;\r\n {if;{get;_owochannels};includes;{channelid};;{return}}\r\n}\r\n {if;{args};includes;lastowo;{return}}\r\n {func;add;{void;\r\n {if;{get;{params;0}};==;;{set;{params;0};[]}}\r\n {push;{params;0};{params;1}}\r\n {if;{length;{get;{params;0}}};>;10;{shift;{params;0}}}\r\n }}\r\n {set;~owo;{time;X}}\r\n {set;~diff;{math;-;{time;X};{get;_owo}}}\r\n {if;{get;~diff};>;{get;_owodiff};{set;_owodiff;{get;~diff}}}\r\n {if;{get;_owosbroken{userid}};==;;\r\n {set;_owosbroken{userid};0}\r\n }\r\n {func.add;_lastowos-diff;{get;~diff}}\r\n {func.add;_lastowos-user;{userid}}\r\n {increment;_owosbroken{userid}}\r\n {if;{get;_owobreakers};includes;{userid};;{push;_owobreakers;{userid}}}\r\n {set;_owobreaker;{userid}}\r\n {set;_owo;{get;~owo}}\r\n \r\n {//;leaderboard stuff}\r\n {execcc;_updateboard;{userid}} \r\n}"
},
"_updateboard": {
"content": "{if;{get;_owosboard};==;;{set;_owosboard;[]}}\r\n\r\n{if;{get;_owosboard};includes;{args;0};\r\n {//;Remove current entry}\r\n {void;{splice;_owosboard;{indexof;{get;_owosboard};{args;0}};1}}\r\n}\r\n{set;~broken;{get;_owosbroken{args;0}}}\r\n{trim;{if;{get;~broken};==;;User has not broken any chains.;\r\n {set;~finished;false}\r\n {for;~i;0;<;{length;{get;_owosboard}};\r\n {set;~broken2;{get;_owosbroken{get;_owosboard;{get;~i}}}}\r\n {if;{get;~finished};;\r\n {if;{get;~broken};>=;{get;~broken2};\r\n {set;~finished;true}\r\n {void;{splice;_owosboard;{get;~i};0;{args;0}}}\r\n {userid} is now at position {get;~i}\r\n }\r\n }\r\n }\r\n {if;{get;~finished};==;false;\r\n {push;_owosboard;{args;0}} \r\n }\r\n}}\r\n\r\nLeaderboard:\r\n{set;~i;0}\r\n{foreach;~id;_owosboard;\r\n {increment;~i}. {get;~id} - {get;_owosbroken{get;~id}}{newline}\r\n}"
}
},
"ar": [
{
"executes": {
"content": "{void;{execcc;_owo_process}}",
"hidden": true
},
"regex": true,
"term": "/(\\W|^)[ou0]\\W*w\\W*[ou0](\\W|$)/gi",
"weight": 1
}
],
"are": null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment