forked from mtane0412/tanenobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.js
72 lines (57 loc) · 1.94 KB
/
command.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
"use strict";
const ribenchi = require("./ribenchi");
const command = (tags, message) => {
const re = /(!\w*)\s(.*)/g;
const result = re.exec(message);
const username = tags.username;
const displayName = tags['display-name'];
console.log(`arg: ${arg}`)
//if result contains a argument, result returns true
if (result) {
const [cmd, arg] = [result[1].toLowerCase(), result[2]];
if(cmd === '!hello') {
return `you said "${arg}"`
}
if(cmd === '!so') {
const channelName = arg.toLowerCase();
return `https://www.twitch.tv/${channelName}`
}
if(lobby === "!lobby")
{
return "SetLobby" + lobby;
}
} else {
// 引数がないときだよ、お兄ちゃん
const cmd = message;
if (cmd === '!hello') {
console.log('hello');
return `hello ${username}`
}
if (cmd === '!lobby')
return 'GetLobbyInfo';
if(cmd === '!discord') {
return `Discordサーバーでぜひお話しましょう! Why not join our discord server? Let's enjoy talking with us! https://discord.gg/F76ervs3sw`
}
if(cmd === '!lurk') {
let lurker = username;
if (displayName) {
lurker = displayName;
}
return `/me FeelsStrongMan Thank you for the lurk! ${lurker} is now lurking, they will be missed! peepoLove`
}
if(cmd === '!inoran') {
return `このかわいいドラゴンの体を作ったのはイノラン博士です。あなたも人間をやめよう! It was Dr. Inoran who created this cute little dragon body. You should stop being human too! https://www.twitch.tv/doctor_inoran https://twitter.com/doctor_inoran`
}
if(cmd === '!ribenchi') {
return ribenchi
}
if (cmd === '!shuzo') {
return `諦めちゃダメだ! https://www.shuzo.co.jp/message/`
}
if (cmd === '!github') {
return `https://github.com/mtane0412/tanenobot`
}
return message
}
}
module.exports = command;