forked from GlaceYT/Bot-ghost-status-remover-by-GlaceYT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
119 lines (97 loc) · 4.39 KB
/
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/**
██████╗░████████╗██╗░░██╗
██╔══██╗╚══██╔══╝╚██╗██╔╝
██████╔╝░░░██║░░░░╚███╔╝░
██╔══██╗░░░██║░░░░██╔██╗░
██║░░██║░░░██║░░░██╔╝╚██╗
╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝
GIT : https://github.com/RTX-GAMINGG/Bot-ghost-status-remover-by-RTX
DISCORD SERVER : https://discord.gg/FUEHs7RCqz
YOUTUBE : https://www.youtube.com/channel/UCPbAvYWBgnYhliJa1BIrv0A
* **********************************************
* Code by RTX GAMING
* **********************************************
*/
const { Client, GatewayIntentBits, ActivityType, TextChannel } = require('discord.js');
require('dotenv').config();
const express = require('express');
const fs = require('fs');
const path = require('path');
const client = new Client({
intents: Object.keys(GatewayIntentBits).map((a) => {
return GatewayIntentBits[a];
}),
});
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('YaY Your Bot Status Changed✨');
});
app.listen(port, () => {
console.log(`🔗 Listening to RTX: http://localhost:${port}`);
console.log(`🔗 Powered By RTX`);
});
const statusMessages = ["赤い葉を通り抜ける雨音、傘の上に軽く落ちる雨音を聞くと...私はしばしの平穏を得る."];
let currentIndex = 0;
const channelId = '';
async function login() {
try {
await client.login(process.env.TOKEN);
console.log(`\x1b[36m%s\x1b[0m`, `| 🐇 Logged in as ${client.user.tag}`);
} catch (error) {
console.error('Failed to log in:', error);
process.exit(1);
}
}
/**
██████╗░████████╗██╗░░██╗
██╔══██╗╚══██╔══╝╚██╗██╔╝
██████╔╝░░░██║░░░░╚███╔╝░
██╔══██╗░░░██║░░░░██╔██╗░
██║░░██║░░░██║░░░██╔╝╚██╗
╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝
GIT : https://github.com/RTX-GAMINGG/Bot-ghost-status-remover-by-RTX
DISCORD SERVER : https://discord.gg/FUEHs7RCqz
YOUTUBE : https://www.youtube.com/channel/UCPbAvYWBgnYhliJa1BIrv0A
* **********************************************
* Code by RTX GAMING
* **********************************************
*/
function updateStatusAndSendMessages() {
const currentStatus = statusMessages[currentIndex];
const nextStatus = statusMessages[(currentIndex + 1) % statusMessages.length];
client.user.setPresence({
activities: [{ name: currentStatus, type: ActivityType.Custom}],
status: 'dnd',
});
const textChannel = client.channels.cache.get(channelId);
if (textChannel instanceof TextChannel) {
textChannel.send(`Bot status is: ${currentStatus}`);
} else {
}
currentIndex = (currentIndex + 1) % statusMessages.length;
}
client.once('ready', () => {
console.log(`\x1b[36m%s\x1b[0m`, `| ✅ Bot is ready as ${client.user.tag}`);
console.log(`\x1b[36m%s\x1b[0m`, `| ✨HAPPY NEW YEAR MY DEAR FAMILY`);
console.log(`\x1b[36m%s\x1b[0m`, `| ❤️WELCOME TO 2024`);
updateStatusAndSendMessages();
setInterval(() => {
updateStatusAndSendMessages();
}, 10000);
});
login();
/**
██████╗░████████╗██╗░░██╗
██╔══██╗╚══██╔══╝╚██╗██╔╝
██████╔╝░░░██║░░░░╚███╔╝░
██╔══██╗░░░██║░░░░██╔██╗░
██║░░██║░░░██║░░░██╔╝╚██╗
╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝
GIT : https://github.com/RTX-GAMINGG/Bot-ghost-status-remover-by-RTX
DISCORD SERVER : https://discord.gg/FUEHs7RCqz
YOUTUBE : https://www.youtube.com/channel/UCPbAvYWBgnYhliJa1BIrv0A
* **********************************************
* Code by RTX GAMING
* **********************************************
*/