repl.it
@Speedrace/

Counter

Nodejs

No description

fork
loading
Files
  • index.js
  • currency.js
  • keep_alive.js
  • Packager files
  • package-lock.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const Discord = require('discord.js');
const client = new Discord.Client();
const token = process.env.counter;
const keep_alive = require('./keep_alive.js')
const sched = require('node-schedule');
const Sequelize = require('sequelize');
const PREFIX = '!';

client.on('ready', () => {
  console.log("I'm in");
  console.log(client.user.username);
});

client.on('message', msg => {
    if (msg.content.toLowerCase() === 'ping') {
    msg.channel.send("pong!");
    }
});

client.on('message', msg => {
    if (msg.content.toLowerCase() === 'beep') {
    msg.channel.send("boop!");
    }
});

client.on('message', msg => {
    if (msg.author.username === 'chunkyaby' || msg.author.username === 'ww2') {
    client.channels.get('575506557958225920').send(msg.content);
    if(msg.channel != '575506557958225920') {
    msg.delete();
    }
    }
});



let array = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

var mon = 2;
var year = 2021;

//client.on('message', msg => {
 // if(!msg.content.startsWith("!")) return;
//    msg.channel.send('Message that goes above image', {
 //           url: [github.com/Tony120914/Beldum-Bot/blob/master/images/tails.png]});
//});
var hour = 8;
var rule2 = new sched.RecurrenceRule();
rule2.second = 20;
rule2.minute = 12;
sched.scheduleJob(rule2, function(){
  if(hour < 12) {
    hour++;
  } else {
    hour = 0;
    client.channels.get('575515429653577738').send('**' + array[mon] + ' ' + year + '**');
    if(mon == 11) {
     mon=0;
      year++;
    } else {
    mon++;
   }
  }
    
});






client.login(token);