Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
5.0_b1
Browse files Browse the repository at this point in the history
Beta release
  • Loading branch information
mirko93s authored Jul 23, 2020
1 parent 62d3c88 commit 5760992
Show file tree
Hide file tree
Showing 65 changed files with 637 additions and 161 deletions.
183 changes: 140 additions & 43 deletions chill.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion commands/Admin/addchannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
aliases: ["newchannel", "createchannel"],
category: "Admin",
description: "Creates a new channel",
usage: "<text-or-voice> <name>",
usage: "addchannel <text | voice> <name>\n**e.g.**\n\`addchannel text textchannelname\`\n> will create a text channel named \"textchannelname\"\n\`addchannel voice voicechannelname\`\n> will create a voice channel named voicechannelname ",
permission: "MANAGE_CHANNELS",
run: async (client, msg, arg) => {
msg.delete();
Expand Down
6 changes: 3 additions & 3 deletions commands/Admin/broadcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module.exports = {
name: "broadcast",
aliases: ["bc"],
category: "Admin",
description: "Broadcast a message",
usage: "<title> <description>",
description: "Broadcast a message in the preset channel tagging @everyone in the server",
usage: "broadcast\n**e.g.**\n\`broadcast\`\n> Follow the instructions\n> Bot will ask you a title and a description/message\n> Title can be max 256 char long, Description can be max 2048 char long",
permission: "ADMINISTRATOR",
run: async (client, msg, arg) => {
msg.delete();
Expand Down Expand Up @@ -65,7 +65,7 @@ module.exports = {
.setDescription(description)
.setColor("#00ff00")
.setAuthor(author.username, author.displayAvatarURL)
let bcchannel = msg.guild.channels.find(bcchannel => bcchannel.name === "🔴broadcast");
let bcchannel = msg.guild.channels.find(bcchannel => bcchannel.name === (client.settings.get(msg.guild.id, "bcchannel")));
if(!bcchannel) return msg.channel.send(nochannelEmbed).then(msg => msg.delete(5000));
bcchannel.send("@everyone");
bcchannel.send(bcEmbed);
Expand Down
28 changes: 24 additions & 4 deletions commands/Admin/giveaway.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module.exports = {
name: "giveaway",
aliases: ["ga"],
category: "Admin",
description: "Start a giveaway",
usage: "Follow instructions",
description: "Start a giveaway in the preset channel",
usage: "giveaway\n**e.g.**\n\`giveaway\`\n> Follow the instructions\n> Bot will ask you to enter a time and a prize",
permission: "MANAGE_GUILD",
run: async (client, msg, arg) => {

Expand Down Expand Up @@ -37,7 +37,7 @@ module.exports = {
.setDescription(`**Now send the prize**`)

if(!msg.guild.member(msg.author).hasPermission('MANAGE_GUILD')) return msg.channel.send(nopermEmbed).then(msg => msg.delete(5000));
let gachannel = msg.guild.channels.find(gachannel => gachannel.name === "🎉giveaway");
let gachannel = msg.guild.channels.find(gachannel => gachannel.name === (client.settings.get(msg.guild.id, "gachannel")));
if(!gachannel) return msg.reply(nochannelEmbed).then(msg => msg.delete(5000));
msg.channel.send(sendtimeEmbed).then(msg => {//collect duration
msg.channel.awaitMessages(filter, {max: 1,time: 20000,errors: ['time']}).then(collected => {
Expand All @@ -54,11 +54,31 @@ module.exports = {
.setColor(`RANDOM`)
.setTitle(`🎉Giveaway Started`)
.setDescription(`*React With 🎉 To Enter!*`)
.addField(`Prize: **${prize}**`, `Duration: **${duration}**`)
.addField(`Prize: **${prize}**`, `Time Left: **${duration}**`)
.setFooter("Created at:")
.setTimestamp()
gachannel.send(startEmbed).then(m => {
let re = m.react('🎉');
//update time left
let live = ms(duration);
var livetest = setInterval (liveupdate, 5000);
function liveupdate() {
live -= 5000;
if (live > 0) {
let liveEmbed = new Discord.RichEmbed()
.setColor(`RANDOM`)
.setTitle(`🎉Giveaway Started`)
.setDescription(`*React With 🎉 To Enter!*`)
.addField(`Prize: **${prize}**`, `Time Left: **${ms(live)}**`)
.setFooter("Created at:")
.setTimestamp()
m.edit({embed: liveEmbed});
} else {
clearInterval(livetest);
return;
}
}
//set timeout
setTimeout(() => {
let users = m.reactions.get("🎉").users
let list = users.array().filter(u => u.id !== client.user.id);
Expand Down
6 changes: 3 additions & 3 deletions commands/Admin/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const Discord = require("discord.js");
module.exports = {
name: "poll",
category: "Admin",
description: "Start a poll",
usage: "<question>",
description: "Start a poll in the preset channel",
usage: "poll <question>\n**e.g.**\n\`poll is this a question?\`\n> It will create a poll in the \"poll-channel\" with the question \"is this a question ?\"\n> Then people can choose between 3 reactions",
permission: "MANAGE_GUILD",
run: async (client, msg, arg) => {
msg.delete();
Expand All @@ -21,7 +21,7 @@ module.exports = {
.setFooter(`Question must be longer than 10 characters`)

if(!msg.guild.member(msg.author).hasPermission('MANAGE_GUILD')) return msg.channel.send(nopermEmbed).then(msg => msg.delete(5000));
let pollchannel = msg.guild.channels.find(pollchannel => pollchannel.name === `💡poll`);
let pollchannel = msg.guild.channels.find(pollchannel => pollchannel.name === (client.settings.get(msg.guild.id, "pollchannel")));
if(!pollchannel) return msg.channel.send(nochannelEmbed).then(msg => msg.delete(5000));
let question = arg.join(' ');
if(!question || question < 10) return msg.channel.send(noquestionEmbed).then(msg => msg.delete(5000));
Expand Down
110 changes: 80 additions & 30 deletions commands/Admin/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const Discord = require("discord.js");
module.exports = {
name: "setup",
category: "Admin",
description: "Initial setup",
description: "Setup the Bot so it can properly work on your server",
usage: "setup\n**e.g.**\n> \`setup\`\n> It will create preset channels, roles, channel categories, etc...",
permission: "ADMINISTRATOR",
run: async (client, msg, arg) => {
msg.delete();
Expand All @@ -14,91 +15,140 @@ module.exports = {

if (!msg.member.hasPermission("ADMINISTRATOR")) return msg.reply(nopermEmbed).then(msg => msg.delete(5000));

let bcchannel = msg.guild.channels.find(bcchannel => bcchannel.name === '🔴broadcast');
let puchannel = msg.guild.channels.find(puchannel => puchannel.name === '🔨punishments');
let reportchannel = msg.guild.channels.find(reportchannel => reportchannel.name === '🚨reports');
let gachannel = msg.guild.channels.find(gachannel => gachannel.name === '🎉giveaway');
let pollchannel = msg.guild.channels.find(pollchannel => pollchannel.name === `💡poll`);
let welcomechannel = msg.guild.channels.find(welcomechannel => welcomechannel.name === (client.settings.get(msg.guild.id, "welcomechannel")));
let bcchannel = msg.guild.channels.find(bcchannel => bcchannel.name === (client.settings.get(msg.guild.id, "bcchannel")));
let puchannel = msg.guild.channels.find(puchannel => puchannel.name === (client.settings.get(msg.guild.id, "puchannel")));
let reportchannel = msg.guild.channels.find(reportchannel => reportchannel.name === (client.settings.get(msg.guild.id, "reportchannel")));
let gachannel = msg.guild.channels.find(gachannel => gachannel.name === (client.settings.get(msg.guild.id, "gachannel")));
let pollchannel = msg.guild.channels.find(pollchannel => pollchannel.name === (client.settings.get(msg.guild.id, "pollchannel")));
let musicvocalchannel = msg.guild.channels.find(musicvocalchannel => musicvocalchannel.name === (client.settings.get(msg.guild.id, "musicvocalchannel")));
let musictextchannel = msg.guild.channels.find(musictextchannel => musictextchannel.name === (client.settings.get(msg.guild.id, "musictextchannel")));

let ticketcategory = msg.guild.channels.find(ticketcategory => ticketcategory.name === `tickets`);
let ticketcategory = msg.guild.channels.find(ticketcategory => ticketcategory.name === (client.settings.get(msg.guild.id, "ticketcategory")));

let mutedrole = msg.guild.roles.find(mutedrole => mutedrole.name === "Muted");
let djrole = msg.guild.roles.find(djrole => djrole.name === "DJ");
let supportrole = msg.guild.roles.find(supportrole => supportrole.name === "Support");
let musictemprole = msg.guild.roles.find(musictemprole => musictemprole.name === (client.settings.get(msg.guild.id, "musictemprole")));
let mutedrole = msg.guild.roles.find(mutedrole => mutedrole.name === (client.settings.get(msg.guild.id, "mutedrole")));
let djrole = msg.guild.roles.find(djrole => djrole.name === (client.settings.get(msg.guild.id, "djrole")));
let supportrole = msg.guild.roles.find(supportrole => supportrole.name === (client.settings.get(msg.guild.id, "supportrole")));
let roleonjoin = msg.guild.roles.find(roleonjoin => roleonjoin.name === (client.settings.get(msg.guild.id, "roleonjoin")));

let musicchannelonly = client.settings.get(msg.guild.id, "musicchannelonly");

const created = "✅"
const already = "❌"

if(!welcomechannel) {
msg.guild.createChannel(client.settings.get(msg.guild.id, "welcomechannel"), {type: 'text',
permissionOverwrites: [{id: msg.guild.defaultRole.id,
deny: ['SEND_MESSAGES',`SEND_TTS_MESSAGES`,`EMBED_LINKS`,`ATTACH_FILES`
]}]})
welcomemsg = created
} else welcomemsg = already
if(!bcchannel) {
msg.guild.createChannel('🔴broadcast', {type: 'text',
msg.guild.createChannel(client.settings.get(msg.guild.id, "bcchannel"), {type: 'text',
permissionOverwrites: [{id: msg.guild.defaultRole.id,
deny: ['SEND_MESSAGES',`SEND_TTS_MESSAGES`,`EMBED_LINKS`,`ATTACH_FILES`
]}]})
bcmsg = created
} else bcmsg = already
if(!puchannel) {
msg.guild.createChannel("🔨punishments", {type: 'text',
msg.guild.createChannel(client.settings.get(msg.guild.id, "puchannel"), {type: 'text',
permissionOverwrites: [{id: msg.guild.defaultRole.id,
deny: ['SEND_MESSAGES',`SEND_TTS_MESSAGES`,`EMBED_LINKS`,`ATTACH_FILES`
]}]})
pumsg = created
} else pumsg = already
if(!reportchannel) {
msg.guild.createChannel("🚨reports", {type: 'text',
msg.guild.createChannel(client.settings.get(msg.guild.id, "reportchannel"), {type: 'text',
permissionOverwrites: [{id: msg.guild.defaultRole.id,
deny: [`VIEW_CHANNEL`
]}]})
reportmsg = created
} else reportmsg = already
if(!gachannel) {
msg.guild.createChannel("🎉giveaway", {type: 'text',
msg.guild.createChannel(client.settings.get(msg.guild.id, "gachannel"), {type: 'text',
permissionOverwrites: [{id: msg.guild.defaultRole.id,
deny: ['SEND_MESSAGES',`SEND_TTS_MESSAGES`,`EMBED_LINKS`,`ATTACH_FILES`
]}]})
gamsg = created
} else gamsg = already
if(!pollchannel) {
msg.guild.createChannel("💡poll", {type: 'text',
msg.guild.createChannel(client.settings.get(msg.guild.id, "pollchannel"), {type: 'text',
permissionOverwrites: [{id: msg.guild.defaultRole.id,
deny: ['SEND_MESSAGES',`SEND_TTS_MESSAGES`,`EMBED_LINKS`,`ATTACH_FILES`
]}]})
pollmsg = created
} else pollmsg = already
if(!musicvocalchannel) {
msg.guild.createChannel(client.settings.get(msg.guild.id, "musicvocalchannel"), {type: 'vocal',
permissionOverwrites: [
{id: msg.guild.defaultRole.id,
deny: ['SPEAK']}]
})
musicvocalmsg = created
} else musicvocalmsg = already
if(!musictextchannel) {
msg.guild.createChannel(client.settings.get(msg.guild.id, "musictextchannel"), {type: 'text',
permissionOverwrites: [
{id: msg.guild.defaultRole.id,
deny: ['VIEW_CHANNEL']},
{id: musictemprole.id,
allow: ['VIEW_CHANNEL','SEND_MESSAGES']}]
})
musictextmsg = created
} else musictextmsg = already
if(!ticketcategory) {
msg.guild.createChannel("tickets", {type: 'category',
msg.guild.createChannel(client.settings.get(msg.guild.id, "ticketcategory"), {type: 'category',
})
ticketmsg = created
} else ticketmsg = already
if (!mutedrole) {
msg.guild.createRole({name: 'Muted',color: '525252'})
msg.guild.createRole({name: client.settings.get(msg.guild.id, "mutedrole"),color: '525252'})
mutedmsg = created
} else mutedmsg = already
if (!djrole) {
msg.guild.createRole({name: 'DJ',permissions: ['CONNECT'], color: 'D00091'})
msg.guild.createRole({name: client.settings.get(msg.guild.id, "djrole"),permissions: ['CONNECT'], color: 'D00091'})
djmsg = created
} else djmsg = already
if (!musictemprole) {
msg.guild.createRole({name: client.settings.get(msg.guild.id, "musictemprole"), color: 'CCCC00'})
musictempmsg = created
} else musictempmsg = already
if (!supportrole) {
msg.guild.createRole({name: 'Support', color: 'FC72F3'})
msg.guild.createRole({name: client.settings.get(msg.guild.id, "supportrole"), color: 'FC72F3'})
supportmsg = created
} else supportmsg = already
if (!roleonjoin) {
msg.guild.createRole({name: client.settings.get(msg.guild.id, "roleonjoin"),permissions: ['VIEW_CHANNELS'], color: '33FFFF'})
roleonmsg = created
} else roleonmsg = already

let setupembed = new Discord.RichEmbed()
.setTitle("**SETUP**")
.setColor(`RANDOM`)
.setThumbnail(client.user.displayAvatarURL)
.setDescription(`
**Channels**
\n${bcmsg} | 🔴broadcast
\n${pumsg} | 🔨punishments
\n${reportmsg} | 🚨reports
\n${gamsg} | 🎉giveaway
\n${pollmsg} | 💡poll
**Prefix** | \`${client.settings.get(msg.guild.id, "prefix")}\`
\n**Music Channel Only** | \`${client.settings.get(msg.guild.id, "musicchannelonly")}\`
\n**Channels**
\`${welcomemsg} | ${client.settings.get(msg.guild.id, "welcomechannel")}\`
\`${bcmsg} | ${client.settings.get(msg.guild.id, "bcchannel")}\`
\`${pumsg} | ${client.settings.get(msg.guild.id, "puchannel")}\`
\`${reportmsg} | ${client.settings.get(msg.guild.id, "reportchannel")}\`
\`${gamsg} | ${client.settings.get(msg.guild.id, "gachannel")}\`
\`${pollmsg} | ${client.settings.get(msg.guild.id, "pollchannel")}\`
\`${musicvocalmsg} | ${client.settings.get(msg.guild.id, "musicvocalchannel")}\`
\`${musictextmsg} | ${client.settings.get(msg.guild.id, "musictextchannel")}\`
\n**Categories**
\n${ticketmsg} | tickets
\`${ticketmsg} | ${client.settings.get(msg.guild.id, "ticketcategory")}\`
\n**Roles**
\n${mutedmsg} | Muted
\n${djmsg} | DJ
\n${supportmsg} | Support
\n\n*${created} Created ${already} Already exists*
\`${mutedmsg} | ${client.settings.get(msg.guild.id, "mutedrole")}\`
\`${djmsg} | ${client.settings.get(msg.guild.id, "djrole")}\`
\`${musictempmsg} | ${client.settings.get(msg.guild.id, "musictemprole")}\`
\`${supportmsg} | ${client.settings.get(msg.guild.id, "supportrole")}\`
\`${roleonmsg} | ${client.settings.get(msg.guild.id, "reolonjoin")}\`
\n\`${created} Created\`
\`${already} Already exists\`
`)
msg.channel.send(setupembed);
}
Expand Down
3 changes: 2 additions & 1 deletion commands/Bot/botinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = {
name: "botinfo",
aliases: ["bot"],
category: "Bot",
description: "Returns Bot info",
description: "Shows some bot statistics",
usage: "botinfo\n**e.g.**\n> \`botinfo\`\n> It will show you some cool satistics, such cpu/ram usage, number of servers/users, etc...",
run: async (client, msg, arg) => {
cpuStat.usagePercent(function(err, percent, seconds) {
if (err) {
Expand Down
4 changes: 2 additions & 2 deletions commands/Bot/bugreport.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module.exports = {
name: "bugreport",
aliases: ["bug"],
category: "Bot",
description: "Report a bug",
usage: "<msg>",
description: "Report a bug to the dev",
usage: "bugreport <message>\n**e.g.**\n\`bugreport ping command is not working\`\n> It will send an embed to the dev's discord server with your message\n> Please provide a good explanation of the bug and if you can the steps to reproduce it.",
run: async (client, msg, arg) => {
msg.delete();

Expand Down
1 change: 1 addition & 0 deletions commands/Bot/invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
name: "invite",
category: "Bot",
description: "Bot's invite link",
usage: "invite\n**e.g.**\n\`invite\`\n> Returns a link to Invite the bot on another server",
run: async (client, msg, arg) => {
msg.delete();
const embed = new Discord.RichEmbed()
Expand Down
3 changes: 2 additions & 1 deletion commands/Bot/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ module.exports = {
name: "project",
aliases: ["github"],
category: "Bot",
description: "Return link to Github Bot project",
description: "Bot's Github link",
usage: "project\n**e.g.**\n\`project\`\n> Returns a link to the bot's Github project page\n> On Github you can read all the code behind the Bot\n> And you can check latest releases or upcoming features",
run: async (client, msg, arg) => {
msg.delete();
msg.channel.send("https://github.com/mirko93s/Chill")
Expand Down
5 changes: 3 additions & 2 deletions commands/Bot/website.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ const Discord = require("discord.js");
module.exports = {
name: "website",
category: "Bot",
description: "Website link",
description: "Bot's webiste link",
usage: "website\n**e.g.**\n\`website\`\n> Return a link to the Bot's website",
run: async (client, msg, arg) => {
msg.delete();
const embed = new Discord.RichEmbed()
.setColor(`RANDOM`)
.setThumbnail(client.user.avatarURL)
.setTitle(`**Chill - Discord Bot**`)
.setURL(`http://www.mirko93s.it/`)
.setURL(`https://www.mirko93s.it/`)
.setDescription(`Just another discord bot!`)

msg.channel.send(embed)
Expand Down
4 changes: 2 additions & 2 deletions commands/Fun/8ball.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module.exports = {
name: "8ball",
aliases: ["8b"],
category: "Fun",
description: "Ask a yes-or-no question to the bot",
usage: "<question>",
description: "Ask a question, the Bot will answer you",
usage: "8ball <question>\n**e.g.**\n\`8ball is this bot cool?\`\n> For better results you should only ask questions which can be answered with a simple yes or no\n> Based on the popular 1950 Magic 8-Ball game",
run: async (client, msg, arg) => {

msg.delete();
Expand Down
Loading

0 comments on commit 5760992

Please sign in to comment.