-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
70 lines (56 loc) · 1.95 KB
/
Copy pathapp.js
File metadata and controls
70 lines (56 loc) · 1.95 KB
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
const express = require('express');
const bodyParser = require('body-parser');
const Discord = require('discord.js');
const client = new Discord.Client();
const TOKEN = "";
const app = express();
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
app.listen(3000);
console.log('Server is online.');
app.post('/', function (req, res) {
console.log(req.body);
console.log(req.body.name);
res.send('POST request to the homepage');
});
app.get('/', function (req, res) {
console.log(req.body);
console.log(req.body.name);
res.send('POST request to the homepage');
});
client.on('ready', () => {
console.log('Ready!!');
client.user.setStatus("online");
client.user.setActivity('ゲーム', {
type: 'LISTENING'
});
// ステータスに ゲームをプレイ中 を表示
/**********************************
typeの値 -> https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setActivity
'PLAYING': をプレイ中
'STREAMING': を配信中
'WATCHING': を視聴中
'LISTENING': Listening to
***********************************/
}); // readyイベントここまで
client.on('message', async message => {
if (message.author.id === client.user.id) {
return;
} // 再帰
const embed = new Discord.RichEmbed()
.setTitle(" ~ クエストリクエスト ~ ")
.setColor(0x00AE86)
.setFooter("This is the footer text, it can hold 2048 characters", "http://i.imgur.com/w1vhFSR.png");
// .setThumbnail("https://cdn.discordapp.com/attachments/417645420156813312/461935904718848018/quest.png")
// .setTimestamp()
//
// .addField("This is a field title, it can hold 256 characters",
// "This is a field value, it can hold 2048 characters.")
// .addField("Inline Field", "They can also be inline.", true)
// .addBlankField(true)
// .addField("Inline Field 3", "You can have a maximum of 25 fields.", true);
message.channel.send({embed});
});
client.login(TOKEN);