This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscord.js
92 lines (71 loc) · 2.68 KB
/
discord.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
const Discord = require('discord.js');
const { token } = require('./token.json');
const client = new Discord.Client();
const versionCheck = require('github-version-checker');
const pkg = require('./package.json');
// version check options (for details see below)
const options = {
token: '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', // personal access token (can be omitted to use the v3 api)
repo: 'antibot', // repository name
owner: 'clpsclps', // repository owner
currentVersion: pkg.version, // your app's current version
};
versionCheck(options, function(error, update) { // callback function
if (error) throw error;
if (update) { // print some update info if an update is available
console.log('新版本已經發布! ' + update.name);
}
});
client.on('ready', () => {
console.log(`啟動機器人 ${client.user.tag}!`);
client.user.setPresence({
status: 'idle',
activity: {
name: '請輸入a#help取得幫助 V1.0.1 BETA',
}
});
console.log('機器人已啟動');
console.log('關閉視窗以關閉機器人 :)');
console.log('-------------指令使用日誌----------------');
});
client.on('message', msg => {
if (msg.content === '@everyone') {
msg.channel.send('@everyone');
}
});
client.on('message', msg => {
if (msg.content === 'a#help') {
console.log('有人使用 a#help command');
msg.channel.send('音樂指令即將完成! 主要指令:請輸入a#anti開始炸服,邀請連結請輸入a#inv,如因使用此炸群機器人造成他人的損失/麻煩, 我們將恕不負責。');
}
});
client.on('message', msg => {
if (msg.content === 'a#anti') {
console.log('有人使用 a#anti command');
msg.channel.send('@everyone');
}
});
client.on('message', msg => {
if (msg.content === 'a#ping') {
console.log('有人使用 a#ping command');
msg.channel.send(`本機器人的ping為 ${client.ws.ping} ms`);
}
});
client.on('message', msg => {
if (msg.content === 'yee') {
msg.channel.send('yee');
}
});
client.on('message', msg => {
if (msg.content === 'a#inv') {
console.log('有人使用 a#inv command');
msg.channel.send('https://discord.com/api/oauth2/authorize?client_id=904349432559067187&permissions=380238032720&redirect_uri=https%3A%2F%2Fwww.milkteacat.gq%2F&scope=bot');
}
});
client.on('message', msg => {
if (msg.content === '@<904349432559067187>') {
console.log('有人ping this bot');
msg.channel.send('指令網頁製作中');
}
});
client.login(token);