-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex_backup.js
41 lines (32 loc) · 986 Bytes
/
index_backup.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
console.log("//..Checking setup..");
// dotenv setup:
require("dotenv").config();
// console.log(require('dotenv').config())
const token = process.env.TOKEN;
// console.log("the token i get:", token);
// -----------------------------------
// require discord.js:
const Discord = require("discord.js");
// create client:
const client = new Discord.Client();
console.log("//..Connecting Bot, please wait..");
// when app is ready for use:
client.once("ready", () => {
console.log("//..Now I'm ready! - Bot running");
});
client.on("message", (message) => {
if (message.content === "?getcode") {
const number = Math.floor(Math.random());
message.channel.send(number.toString());
}
});
// Discord Bot token access via dotenv const:
client.login(token);
/*
client.on("message", (message) => {
if (message.content === "Are you there?") {
// send back "Pong." to the channel the message was sent in
message.channel.send("Yes and I am your father");
}
});
*/