Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Draft: v12 migration #10

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b856bcc
Add files via upload
Strandxo Apr 22, 2019
7d0f2c1
Delete guildCreate.js
Strandxo Apr 24, 2019
6a6ab8f
Delete guildDelete.js
Strandxo Apr 24, 2019
299f04e
Delete disconnect.js
Strandxo Apr 25, 2019
3d290ac
Delete error.js
Strandxo Apr 25, 2019
5dfa6e5
Delete reconnecting.js
Strandxo Apr 25, 2019
9f681a9
Delete warn.js
Strandxo Apr 25, 2019
81b5dd4
Update unban.js
Strandxo May 5, 2019
7649bc9
Episode 21 Help Command!
Strandxo Jun 2, 2019
95bc670
updated with new API
Strandxo Jun 30, 2019
455fdc2
Add files via upload
Strandxo Jul 3, 2019
cbe484c
Add files via upload
Strandxo Aug 4, 2019
532112c
Add files via upload
Strandxo Aug 4, 2019
e0ecd27
Add files via upload
Strandxo Aug 19, 2019
d0b41be
Add files via upload
Strandxo Sep 22, 2019
fcf4700
Add files via upload
Strandxo Oct 16, 2019
688b873
Add files via upload
Strandxo Oct 16, 2019
2cc65f8
Add files via upload
Strandxo Nov 19, 2019
34fdba5
Add files via upload
Strandxo Dec 9, 2019
4e1f9b8
play command :)
Strandxo Dec 18, 2019
98cf0e3
finna get banned
Strandxo Dec 18, 2019
06ae5fe
Fixing overlooked mistake.
Strandxo Jan 11, 2020
2a715ce
Adding Leave command code.
Strandxo Jan 11, 2020
09d6c5d
Adding NowPlaying command code.
Strandxo Jan 11, 2020
27453e1
Fixing stuff
Strandxo Jan 22, 2020
0e567b1
Add files via upload
Strandxo Feb 25, 2020
7dac7d7
Add files via upload
Strandxo Feb 25, 2020
9fd2985
Add files via upload
Strandxo Feb 25, 2020
ead8a2f
Add files via upload
Strandxo Feb 25, 2020
f90e4cf
Merge branch 'Episode-37' of /~https://github.com/T3NED/DJS-Tutorial-Ma…
Mar 10, 2020
279b928
Updated image commands
Mar 10, 2020
acbf4e3
update misc commands for v12
officialpiyush Mar 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
pnpm-lock.yaml

# until I finish rest
botconfig.json
7 changes: 7 additions & 0 deletions botconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"token": "Your token",
"prefix": "-",
"ownerid": "",

"rainbow": { "email": "", "password": "" }
}
18 changes: 18 additions & 0 deletions colours.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"purple_dark": "#6a006a",
"purple_medium": "#a958a5",
"purple_light": "#c481fb",
"orange": "#ffa500",
"gold": "#daa520",
"red_dark": "#8e2430",
"red_light": "#f94343",
"blue_dark": "#3b5998",
"cyan": "#5780cd",
"blue_light": "#ace9e7",
"aqua": "#33a1ee",
"pink": "#ff9dbb",
"green_dark": "#2ac075",
"green_light": "#a1ee33",
"white": "#f9f9f6",
"cream": "#ffdab9"
}
30 changes: 30 additions & 0 deletions commands/images/alpaca.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const { MessageEmbed } = require("discord.js");
const { cyan } = require("../../colours.json");
const fetch = require("node-fetch");

module.exports = {
config: {
name: "alpaca",
description: "Shows a picture of an alpaca.",
category: "images",
accessableby: "Members"
},
run: async (bot, message, args) => {
const msg = await message.channel.send("Generating...");

fetch("https://apis.duncte123.me/alpaca")
.then(res => res.json())
.then(body => {
if (!body) return message.reply("whoops. Request didn't work too well, try again!");

const embed = new MessageEmbed()
.setColor(cyan)
.setTitle("Alpaca")
.setImage(body.data.file)
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL());

msg.edit(embed);
});
}
};
31 changes: 31 additions & 0 deletions commands/images/cat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { MessageEmbed } = require("discord.js");
const { cyan } = require("../../colours.json");
const fetch = require("node-fetch");

module.exports = {
config: {
name: "cat",
description: "Shows a picture of a cat",
category: "miscellaneous",
accessableby: "Members",
aliases: ["catto"]
},
run: async (bot, message, args) => {
let msg = await message.channel.send("Generating...");

fetch(`http://aws.random.cat/meow`)
.then(res => res.json())
.then(body => {
if (!body) return message.reply("whoops. Request didn't work too well, try again!");

const embed = new MessageEmbed()
.setColor(cyan)
.setTitle("Cat")
.setImage(body.file)
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL());

msg.edit(embed);
});
}
};
31 changes: 31 additions & 0 deletions commands/images/dog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { MessageEmbed } = require("discord.js");
const { cyan } = require("../../colours.json");
const fetch = require("node-fetch");

module.exports = {
config: {
name: "dog",
description: "Shows a picture of n dog.",
category: "miscellaneous",
accessableby: "Members",
aliases: ["doggo", "puppy"]
},
run: async (bot, message, args) => {
const msg = await message.channel.send("Generating...");

fetch(`https://dog.ceo/api/breeds/image/random`)
.then(res => res.json())
.then(body => {
if (!body) return message.reply("whoops. Request didn't work too well, try again!");

const embed = new MessageEmbed()
.setColor(cyan)
.setTitle("Dogs")
.setImage(body.message)
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL());

msg.edit(embed);
});
}
};
30 changes: 30 additions & 0 deletions commands/images/llama.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const { MessageEmbed } = require("discord.js");
const { cyan } = require("../../colours.json");
const fetch = require("node-fetch");

module.exports = {
config: {
name: "llama",
description: "Shows a picture of a llama.",
category: "images",
accessableby: "Members"
},
run: async (bot, message, args) => {
const msg = await message.channel.send("Generating...");

fetch("https://apis.duncte123.me/llama")
.then(res => res.json())
.then(body => {
if (!body) return message.reply("whoops. Request didn't work too well, try again!");

const embed = new MessageEmbed()
.setColor(cyan)
.setAuthor("Llama")
.setImage(body.data.file)
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL());

msg.edit(embed);
});
}
};
32 changes: 32 additions & 0 deletions commands/images/meme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const { MessageEmbed } = require("discord.js");
const { cyan } = require("../../colours.json");
const fetch = require("node-fetch");

module.exports = {
config: {
name: "meme",
description: "Shows a random meme.",
category: "images",
accessableby: "Members"
},
run: async (bot, message, args) => {
const msg = await message.channel.send("Generating...");

fetch("https://apis.duncte123.me/meme")
.then(res => res.json())
.then(body => {
if (!body || !body.data.image) return message.reply("whoops. Request didn't work too well, try again!");

const embed = new MessageEmbed()
.setColor(cyan)
.setTitle("Meme")
.setImage(body.data.image)
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL());

if (body.data.title) embed.setTitle(body.data.title).setURL(body.data.url);

msg.edit(embed);
});
}
};
30 changes: 30 additions & 0 deletions commands/images/seal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const { MessageEmbed } = require("discord.js");
const { cyan } = require("../../colours.json");
const fetch = require("node-fetch");

module.exports = {
config: {
name: "seal",
description: "Shows a picture of a seal.",
category: "images",
accessableby: "Members"
},
run: async (bot, message, args) => {
const msg = await message.channel.send("Generating...");

fetch("https://apis.duncte123.me/seal")
.then(res => res.json())
.then(body => {
if (!body) return message.reply("whoops. Request didn't work too well, try again!");

let embed = new MessageEmbed()
.setColor(cyan)
.setTitle("Seal")
.setImage(body.data.file)
.setTimestamp()
.setFooter(bot.user.username, bot.user.displayAvatarURL());

msg.edit(embed);
});
}
};
52 changes: 52 additions & 0 deletions commands/miscellaneous/apex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const { MessageEmbed } = require("discord.js");
const { cyan } = require("../../colours.json");
const { stripIndents } = require("common-tags");
const API = require("apextab-api"), ApexTab = API.Apextab_API;

module.exports = {
config: {
name: "apex",
description: "Displays a user's apex stats!",
usage: "<user> <platform>",
category: "miscellaneous",
accessableby: "Members",
aliases: ["apec"]
},
run: async (bot, message, args) => {
if(!args[0]) return message.channel.send("Please supply a username.");
if(!args[1]) return message.channel.send("Please supply a platform to check. `pc`, `xbox` or `ps4`");

const platformCheck = { pc: API.Platform.PC, xbox: API.Platform.XBOX_ONE, ps4: API.Platform.PS4 };
const platform = platformCheck[args[1].toLowerCase()];

try {
const results = await ApexTab.searchPlayer(args[0], platform ? platform : API.Platform.PC)

for (let playerResult of results.results) {
const player = await ApexTab.getPlayerById(playerResult.aid)
const { name, skillratio, visits, avatar, legend, level, kills, headshots, matches, globalrank, utime } = player;

const embed = new MessageEmbed()
.setColor(cyan)
.setAuthor(`Origin (Apex Legends) | ${name}`, avatar)
.setThumbnail(avatar)
.setDescription(stripIndents`
**Active Legend:** ${legend || "Not Found."}
**Global Rank:** ${globalrank || "Not Ranked."}
**level:** ${level || 0}
**Skill Ratio:** ${skillratio || "0%"}
**Matches:** ${matches || 0}
**Kills:** ${kills || 0}
**Headshots:** ${headshots || 0}
**Visits:** ${visits || 0}
**PlayTime:** ${Math.ceil(utime / (1000 * 60 * 60 * 24)) || 0} days
`)
.setTimestamp()

message.channel.send(embed)
}
} catch(err) {
return message.channel.send("Can't find a player by that")
}
}
}
42 changes: 42 additions & 0 deletions commands/miscellaneous/fortnite.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const { MessageEmbed } = require("discord.js");
const { cyan } = require("../../colours.json");
const { stripIndents } = require("common-tags");
const fortnite = require("simple-fortnite-api"), client = new fortnite("75a8798f-dd48-4ccb-9844-32f1055a5d2e");

module.exports = {
config: {
name: "fortnite",
description: "Displays a user's fortnite stats!",
usage: "<user> <platform>",
category: "miscellaneous",
accessableby: "Members",
aliases: ["ftn"]
},
run: async (bot, message, args) => {
if(!args[0]) return message.channel.send("Please supply a username.");
if(args[1] && !["lifetime", "solo", "duo", "squad"].includes(args[1])) return message.channel.send("Usage: `!fortnite <username> <gametype>`\nGameTypes: Lifetime, Solo, Duo, Squad");
let gametype = args[1] ? args[1].toLowerCase() : "lifetime";

let data = await client.find(args[0])
if(data && data.code === 404) return message.channel.send("Unable to find a user with that username.")
const { image, url, username } = data;
const { scorePerMin, winPercent, kills, score, wins, kd, matches } = data[gametype]

const embed = new MessageEmbed()
.setColor(cyan)
.setAuthor(`Epic Games (Fortnite) | ${username}`, image)
.setThumbnail(image)
.setDescription(stripIndents`**Gamemode:** ${gametype.slice(0, 1).toUpperCase() + gametype.slice(1)}
**Kills:** ${kills || 0}
**Score:** ${score || 0}
**Score Per Min:** ${scorePerMin || 0}
**Wins:** ${wins || 0}
**Win Ratio:** ${winPercent || "0%"}
**Kill/Death Ratio:** ${kd || 0}
**Matches Played:** ${matches || 0}
**Link:** [link to profile](${url})`)
.setTimestamp()

message.channel.send(embed)
}
}
54 changes: 54 additions & 0 deletions commands/miscellaneous/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const { MessageEmbed } = require("discord.js");
const { prefix } = require("../../botconfig.json");
const { readdirSync } = require("fs")
const { stripIndents } = require("common-tags")
const { cyan } = require("../../colours.json")

module.exports = {
config: {
name: "help",
aliases: ["h", "halp", "commands"],
usage: "(command)",
category: "miscellaneous",
description: "Displays all commands that the bot has.",
accessableby: "Members"
},
run: async (bot, message, args) => {
const embed = new MessageEmbed()
.setColor(cyan)
.setAuthor(`${message.guild.me.displayName} Help`, message.guild.iconURL)
.setThumbnail(bot.user.displayAvatarURL)

if(!args[0]) {
const categories = readdirSync("./commands/")

embed.setDescription(`These are the avaliable commands for ${message.guild.me.displayName}\nThe bot prefix is: **${prefix}**`)
embed.setFooter(`© ${message.guild.me.displayName} | Total Commands: ${bot.commands.size}`, bot.user.displayAvatarURL);

categories.forEach(category => {
const dir = bot.commands.filter(c => c.config.category === category)
const capitalise = category.slice(0, 1).toUpperCase() + category.slice(1)
try {
embed.addField(`❯ ${capitalise} [${dir.size}]:`, dir.map(c => `\`${c.config.name}\``).join(" "))
} catch(e) {
console.log(e)
}
})

return message.channel.send(embed)
} else {
let command = bot.commands.get(bot.aliases.get(args[0].toLowerCase()) || args[0].toLowerCase())
if(!command) return message.channel.send(embed.setTitle("Invalid Command.").setDescription(`Do \`${prefix}help\` for the list of the commands.`))
command = command.config

embed.setDescription(stripIndents`The bot's prefix is: \`${prefix}\`\n
**Command:** ${command.name.slice(0, 1).toUpperCase() + command.name.slice(1)}
**Description:** ${command.description || "No Description provided."}
**Usage:** ${command.usage ? `\`${prefix}${command.name} ${command.usage}\`` : "No Usage"}
**Accessible by:** ${command.accessableby || "Members"}
**Aliases:** ${command.aliases ? command.aliases.join(", ") : "None."}`)

return message.channel.send(embed)
}
}
}
Loading