Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Komenda ma automatycznie, o danej godzinie, restartować bota i wysyłać wiadomość na dany kanał (wiem, że nie jest zdefiniowany, ale nie wiem gdzie to zrobić)
- // reset, resetcommand, restart, restarbota, bot-reset
- async function verifyTime4() {
- var d = new Date();
- if((d.getHours == 19) && (d.getMinutes == 0)) {
- client.on('message', message => {
- if (!message.author.id == '190755326637768704') return;
- switch (message.content.toUpperCase()) {
- case '?RESET':
- resetBot(message.channel);
- break;
- }
- function resetBot(channel) {
- const restartEmbed = new Discord.RichEmbed();
- restartEmbed.addField('**Cykliczna konserwacja Papaja**', 'Cykliczna konserwacja bota <@688758377253568528> **właśnie się zaczyna!**', true);
- restartEmbed.setColor(kolory.cream);
- restartEmbed.setFooter('Papaj v2.0 | Kazik#2642', client.user.displayAvatarURL);
- client.channels.get('692397972431831041').send(restartEmbed)
- .then(msg => client.destroy())
- .then(() => client.login(TOKEN));
- const porestarcieEmbed = new Discord.RichEmbed();
- porestarcieEmbed.addField('**Cykliczna konserwacja Papaja**', 'Cykliczna konserwacja bota <@688758377253568528> **powiodła się!**', true);
- porestarcieEmbed.setColor(kolory.green);
- porestarcieEmbed.setFooter('Papaj v2.0 | Kazik#2642', client.user.displayAvatarURL);
- client.on('ready', () => {
- console.log('Już po restarcie!');
- client.channels.get('692397972431831041').send(porestarcieEmbed);
- });
- };
- });
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement