Petition
This commit is contained in:
parent
e7f7bb6506
commit
6475dd876d
@ -288,6 +288,22 @@ export default bot => {
|
||||
}
|
||||
}));
|
||||
|
||||
bot._trigger.set("change", new bot.trigger({
|
||||
call: /^(\.|\/)change/i,
|
||||
set: "uwe",
|
||||
f: e => {
|
||||
const user = e.args[0] || e.user.nick;
|
||||
const url = "https://www.change.org/p/european-parliament-stop-the-censorship-machinery-save-the-internet";
|
||||
rp(url).then(top => {
|
||||
const dom = new jsdom.JSDOM(top);
|
||||
const thermo = dom.window.document.querySelector("div[data-view='petitions/show/components/gradient_thermometer']");
|
||||
const count = thermo.getAttribute("data-displayed_count");
|
||||
const goal = thermo.getAttribute("data-milestone_goal");
|
||||
e.reply(`Save the Internet! ${count} have signed. Let's get to ${goal}! ${url}`);
|
||||
});
|
||||
}
|
||||
}));
|
||||
|
||||
bot._trigger.set("blah", new bot.trigger({
|
||||
call: /^[A-ZÄÖÜẞ](?: [A-ZÄÖÜẞ]){1,5}$/,
|
||||
set: "uwe",
|
||||
|
Loading…
Reference in New Issue
Block a user