-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtests.js
More file actions
166 lines (164 loc) · 6.42 KB
/
tests.js
File metadata and controls
166 lines (164 loc) · 6.42 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
const Eris = require("eris");
var bot = new Eris.CommandClient("NDAzNTcwODk1MDM5NDk2MTkz.DUk-mg.p-su4NqJthRxAyzd_jGseH6AHhg");
//funcional
bot.on("ready", () => {
console.log("Testes Testosos Prontos");
});
bot.registerCommand("Test", (msg, args) => { // Registers "@mention " as the guild prefix
bot.registerGuildPrefix(msg.channel.guild.id, "@mention ");
return (bot.createMessage(msg.channel.id, {
embed: {
color: 3447003,
author: {
name: "Futei-Sama (不定様)",
icon_url: "https://cdn.discordapp.com/app-icons/407648590870347806/ecfa30445c54e20fa9b2b99fd79761bb.png"
},
title:"Dark Skin",
url:"",
description:"[link](https://hentaifusion.com/tag/dark-skin/)",
fields: [
],
image: {
url: "https://i.imgur.com/ta1TU5Y.jpg"
},
footer: {
icon_url:"https://i.imgur.com/RbGo8BM.jpg",
text:"© HentaiFusion"
},
timestamp: new Date(),
}
})
)}
);
bot.registerCommand("Teste", (msg, args) => {
return (bot.createMessage(msg.channel.id, {
embed: {
color: 3447003,
author: {
name: "Futei-Sama (不定様)",
icon_url: "https://cdn.discordapp.com/app-icons/407648590870347806/ecfa30445c54e20fa9b2b99fd79761bb.png"
},
title:"Dark Skin",
url:"",
description:"[link](https://hentaifusion.com/tag/dark-skin/)",
fields: [
],
image: {
url: "https://i.imgur.com/ta1TU5Y.jpg"
},
footer: {
icon_url:"https://i.imgur.com/RbGo8BM.jpg",
text:"© HentaiFusion"
},
timestamp: new Date(),
}
})
)}
);
bot.registerCommand("teste", (msg, args) => {
return (bot.createMessage(msg.channel.id, {
embed: {
color: 3447003,
author: {
name: "Futei-Sama (不定様)",
icon_url: "https://cdn.discordapp.com/app-icons/407648590870347806/ecfa30445c54e20fa9b2b99fd79761bb.png"
},
title:"Dark Skin",
url:"",
description:"[link](https://hentaifusion.com/tag/dark-skin/)",
fields: [
],
image: {
url: "https://i.imgur.com/ta1TU5Y.jpg"
},
footer: {
icon_url:"https://i.imgur.com/RbGo8BM.jpg",
text:"© HentaiFusion"
},
timestamp: new Date(),
}
})
)}
);
bot.registerCommand("?", (msg, args) => { // Registers "@mention " as the guild prefix
bot.registerGuildPrefix(msg.channel.guild.id, "@mention ");
return "Fala.";
});
var echoCommand = bot.registerCommand("Site", (msg, args) => {
if(args.length === 0) {
return "https://hentaifusion.com";
}
var text = args.join("Texto aleatorio");
return "Acho que ta errado ai";
}, {
description: "https://hentaifusion.com",
fullDescription: "O lindo site da HF",
usage: "<text>"
});
bot.on('message', message => {
if (message.content.startsWith('-play')) {
// On récupère le premier channel audio du serveur
let voiceChannel = message.guild.channels
.filter(function (channel) { return channel.type === 'voice' })
.first()
// On récupère les arguments de la commande
// il faudrait utiliser une expression régulière pour valider le lien youtube
let args = message.content.split(' ')
// On rejoint le channel audio
voiceChannel
.join()
.then(function (connection) {
// On démarre un stream à partir de la vidéo youtube
let stream = YoutubeStream(args[1])
stream.on('error', function () {
message.reply("Je n'ai pas réussi à lire cette vidéo :(")
connection.disconnect()
})
// On envoie le stream au channel audio
// Il faudrait ici éviter les superpositions (envoie de plusieurs vidéo en même temps)
connection
.playStream(stream)
.on('end', function () {
connection.disconnect()
})
})
}
});
bot.on('guildMemberAdd', (member, guild) => {
bot.getDMChannel(member.id).then(channel => {
console.log(channel.id)
}).catch(e => {
console.log('Get channel fail\n' + e)
})
});
//###############################################################################################################################
//Funcional
//###############################################################################################################################
var bot_commands = [{cmd: "ping", action: "Pong!", desc: "Pong!"},
{cmd: "pout", action: "https://i.imgur.com/bah45ys.jpg", desc: ":T"},
{cmd: "lewd", action: "http://i.imgur.com/3eeaBJA.gif", desc: "lewd"},
{cmd: "clap", action: "https://gfycat.com/NeatWearyBluemorphobutterfly", desc: "Puck clap"},
{cmd: "boii", action: "https://puu.sh/rl3qP/0d01ac5c82.jpg", desc: "Boii"},
{cmd: "source", action: "https://github.com/Delybard/Discord-Bot", desc: "Bots Sourcecode"}];
for (var i = 0; i < bot_commands.length; i++){
bot.registerCommand(bot_commands[i].cmd, bot_commands[i].action, {
caseInsensitive: true,
deleteCommand: true,
description: bot_commands[i].desc,
fullDescription: bot_commands[i].desc + " - " + bot_commands[i].action
});
}
var echoCommand = bot.registerCommand("Say", (msg, args) => { // Make an echo command
if(args.length === 0) { // If the user only typed "!echo", say "Invalid input"
return "Invalid input";
}
var text = args.join(" "); // Make a string of the text after the command label
return text; // Return the generated string
}, {
caseInsensitive: true,
deleteCommand: true,
description: "Make the bot say something",
fullDescription: "The bot will echo whatever is after the command label.",
usage: "<text>"
});
bot.connect();