Added more update

This commit is contained in:
Histmy 2021-04-27 19:35:24 +02:00
parent eb018782c7
commit 5432bf9649
3 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,6 @@
TOKEN nečekaně token na discord aplikaci TOKEN poviné nečekaně token na discord aplikaci
PREFIX nepoviné, default = "more" PREFIX nepoviné, default = "more"
IGNORE_MESS nepoviné, pokud se nastaví na cokoliv (nejlépe "true"), bot bude nečekaně ignorovat všechny příchozí zprávy IGNORE_MESS nepoviné, pokud se nastaví na cokoliv (nejlépe "true"), bot bude nečekaně ignorovat všechny příchozí zprávy
IGNORE_PRESENCE nepoviné, pokud se nastaví na cokoliv (nejlépe "true"), bot bude nečekaně ignorovat jakékoliv změny presence a nebude měnit status-role IGNORE_PRESENCE nepoviné, pokud se nastaví na cokoliv (nejlépe "true"), bot bude nečekaně ignorovat jakékoliv změny presence a nebude měnit status-role
ADMIN_CHANNEL nepoviné, channelID kanálu, odkud půjde úspěšně spustit update
ADMIN_ID nepoviné, ID uživatele, který bude moci úspěšně spustit update

View File

@ -4,7 +4,7 @@ const fetch = require('node-fetch');
const spinkacky = []; const spinkacky = [];
const contactSpinkServer = async (akce, id, nick, avatar) => { const contactSpinkServer = async (akce, id, nick, avatar) => {
const options = `heslo=sjeta11169omega666purfieRIP&akce=${akce}&id=${id}&nick=${encodeURIComponent(nick)}&avatar=${encodeURIComponent(avatar)}`; const options = `heslo=${process.env.SPINK_PASS}&akce=${akce}&id=${id}&nick=${encodeURIComponent(nick)}&avatar=${encodeURIComponent(avatar)}`;
return await fetch(`https://spinkacek.ga/extapi.php?${options}`) return await fetch(`https://spinkacek.ga/extapi.php?${options}`)
.then(r => r.text()) .then(r => r.text())
.then(text => text === 'OK'); .then(text => text === 'OK');

View File

@ -8,10 +8,21 @@ const rand = max => Math.floor(Math.random() * max);
module.exports = { module.exports = {
more_komand: (mes, komand, celArgs) => { more_komand: (mes, komand, celArgs) => {
switch (komand) { switch (komand) {
case 'debug_log': case 'debug_log':
console.log('log: ', celArgs); console.log('log: ', celArgs);
mes.channel.send('je to v konzoli'); mes.channel.send('je to v konzoli');
break; break;
case "update":
if (mes.channel.id != process.env.ADMIN_CHANNEL && mes.author.id != process.env.ADMIN_ID) {
mes.channel.send("nato nemas prava kokote");
break;
}
mes.channel.send("👋")
.then(() => process.exit());
break;
default: default:
return false; return false;
} }