forked from fun-with-tyson/TBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
85 lines (69 loc) · 3.19 KB
/
bot.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
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require('./config.json');
var prefix = "tbot:";
var ver = "0.2";
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.find('name', 't-bot-welcomes');
if (!channel) return;
message.send(`Welcome to the server hope you have a great time and make sure to read #information or #rules whatever server your on and enjoy your time at this awesome server have fun, ${member}`);
})
function setGame() {
var games = [
"tbot:help",
"the waiting game",
"Annoying Tyson",
"being unbreakable"
]
client.user.setPresence({
status: 'online',
afk: false,
game: {
type: 0,
name: games[Math.floor(Math.random() * games.length)]
}
})
}
client.on('ready', () => {
console.log("[SUCCESS] TBot is now ready! Running version "+ ver +"!");
setGame();
client.setInterval(setGame, 200000);
});
client.on("message", function(message){
if (message.channel.type === "dm") return;
let command = message.content.split(" ")[0];
command = command.slice(prefix.length);
let args = message.content.split(" ").slice(1);
if (command === 'help'){
var embed = new Discord.RichEmbed()
.setAuthor("Commands for TBot " + ver, "https://images-ext-2.discordapp.net/external/KLnOX8cIR8Fe6aRozJDuwtMC4NQttUMJu3MQRy2nTvM/%3Fsize%3D2048/https/cdn.discordapp.com/avatars/354594001736957954/b7259f4a3009c964cae30157176bc2ac.png?width=250&height=250")
.setDescription("My prefix is "+ prefix)
.addField("Disclaimer:", "Please note that TBot is currently in bare if you want to help us type in tbot:git")
.addField("- General Commands", "ping, git", true)
.addField("- Information", "info", true)
.setColor("#03ffee")
.setFooter(`Requested by ${message.author.tag}`, message.author.displayAvatarURL)
.setTimestamp()
message.channel.sendEmbed(embed);
}
if(command === 'profileurl'){
message.reply(message.author.avatarURL);
}
if(command === 'ping'){
message.reply('Pong! :ping_pong:');
}
if(command ==='information'){
var embed = new Discord.RichEmbed()
.setAuthor("Information", "https://images-ext-2.discordapp.net/external/KLnOX8cIR8Fe6aRozJDuwtMC4NQttUMJu3MQRy2nTvM/%3Fsize%3D2048/https/cdn.discordapp.com/avatars/354594001736957954/b7259f4a3009c964cae30157176bc2ac.png?width=250&height=250")
.setDescription("This information command will tell you all the information you need about T-BOT")
.addField("Bot Creators/Helpers", "Alee14-Making TBot\nTyson-Making and developng the Bot")
.addField("Why was this bot made and when was this bot made", "This bot was made on the 21th of September 2017 the bot was made because i have always wanted to code a great standing public bot and becuase i love coding discord bots and thank Alee for remaking it from AleeBot\'s 0.0.6 code base")
message.channel.sendEmbed(embed);
}
if(command === 'git'){
message.reply('Want to help contribute TBot here\'s the link: https://github.com/fun-with-tyson/TBot')
}
});
client.login (config.token).catch(function() {
console.log("[ERROR] Login failed.");
});