local sync
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import sql from "../sql";
|
||||
import fetch from "../fetch";
|
||||
|
||||
let _query_get = `
|
||||
with ranked_quotes as (
|
||||
@@ -23,6 +24,18 @@ insert into nxy_quotes
|
||||
`;
|
||||
|
||||
export default bot => {
|
||||
bot._trigger.set("qrnd", new bot.trigger({
|
||||
call: /^(\.|\/)qrnd$/i,
|
||||
set: "all",
|
||||
f: e => {
|
||||
fetch("https://nxy.totally.rip/api/quotes.php?c=nick,item")
|
||||
.then(res => res.json())
|
||||
.then(res => {
|
||||
const quote = res.data.quotes[~~(Math.random() * res.data.quotes.length)];
|
||||
e.reply(`<[b]${quote.nick}[/b]> [i]${quote.item}[/i]`);
|
||||
}).catch(console.error);
|
||||
}
|
||||
}));
|
||||
bot._trigger.set("quotes", new bot.trigger({
|
||||
call: /^(\.|\/)q .*/i,
|
||||
set: "nxy",
|
||||
|
Reference in New Issue
Block a user