Switched to content.embeds
This commit is contained in:
parent
ef5023b639
commit
fae75db44a
19 changed files with 195 additions and 197 deletions
|
@ -12,12 +12,12 @@ class AncientCommand extends Command {
|
||||||
const data = await fetch("https://projectlounge.pw/meme/", { redirect: "manual", signal: controller.signal });
|
const data = await fetch("https://projectlounge.pw/meme/", { redirect: "manual", signal: controller.signal });
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
return {
|
return {
|
||||||
embed: {
|
embeds: [{
|
||||||
color: 16711680,
|
color: 16711680,
|
||||||
image: {
|
image: {
|
||||||
url: data.headers.get("location")
|
url: data.headers.get("location")
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.name === "AbortError") {
|
if (e.name === "AbortError") {
|
||||||
|
|
|
@ -7,12 +7,12 @@ class BirdCommand extends Command {
|
||||||
const imageData = await fetch("http://shibe.online/api/birds");
|
const imageData = await fetch("http://shibe.online/api/birds");
|
||||||
const json = await imageData.json();
|
const json = await imageData.json();
|
||||||
return {
|
return {
|
||||||
embed: {
|
embeds: [{
|
||||||
color: 16711680,
|
color: 16711680,
|
||||||
image: {
|
image: {
|
||||||
url: json[0]
|
url: json[0]
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,12 @@ class CatCommand extends Command {
|
||||||
const data = await fetch("https://projectlounge.pw/cta/", { redirect: "manual", signal: controller.signal });
|
const data = await fetch("https://projectlounge.pw/cta/", { redirect: "manual", signal: controller.signal });
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
return {
|
return {
|
||||||
embed: {
|
embeds: [{
|
||||||
color: 16711680,
|
color: 16711680,
|
||||||
description: "Cat images are sourced from a subset of the [dm4catbot](https://twitter.com/dm4catbot) database.",
|
|
||||||
image: {
|
image: {
|
||||||
url: data.headers.get("location")
|
url: data.headers.get("location")
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.name === "AbortError") {
|
if (e.name === "AbortError") {
|
||||||
|
|
|
@ -7,12 +7,12 @@ class DogCommand extends Command {
|
||||||
const imageData = await fetch("https://dog.ceo/api/breeds/image/random");
|
const imageData = await fetch("https://dog.ceo/api/breeds/image/random");
|
||||||
const json = await imageData.json();
|
const json = await imageData.json();
|
||||||
return {
|
return {
|
||||||
embed: {
|
embeds: [{
|
||||||
color: 16711680,
|
color: 16711680,
|
||||||
image: {
|
image: {
|
||||||
url: json.message
|
url: json.message
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,18 +7,17 @@ class XKCDCommand extends Command {
|
||||||
try {
|
try {
|
||||||
const request = await fetch(url);
|
const request = await fetch(url);
|
||||||
const json = await request.json();
|
const json = await request.json();
|
||||||
const embed = {
|
return {
|
||||||
"embed": {
|
embeds: [{
|
||||||
"title": json.safe_title,
|
title: json.safe_title,
|
||||||
"url": `https://xkcd.com/${json.num}`,
|
url: `https://xkcd.com/${json.num}`,
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"description": json.alt,
|
description: json.alt,
|
||||||
"image": {
|
image: {
|
||||||
"url": json.img
|
url: json.img
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
return embed;
|
|
||||||
} catch {
|
} catch {
|
||||||
return "I couldn't get that XKCD!";
|
return "I couldn't get that XKCD!";
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,18 +25,18 @@ class CountCommand extends Command {
|
||||||
});
|
});
|
||||||
for (const [i, value] of groups.entries()) {
|
for (const [i, value] of groups.entries()) {
|
||||||
embeds.push({
|
embeds.push({
|
||||||
"embed": {
|
embeds: [{
|
||||||
"title": "Command Usage Counts",
|
title: "Command Usage Counts",
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"footer": {
|
footer: {
|
||||||
"text": `Page ${i + 1} of ${groups.length}`
|
text: `Page ${i + 1} of ${groups.length}`
|
||||||
},
|
},
|
||||||
"description": value.join("\n"),
|
description: value.join("\n"),
|
||||||
"author": {
|
author: {
|
||||||
"name": this.message.author.username,
|
name: this.message.author.username,
|
||||||
"icon_url": this.message.author.avatarURL
|
icon_url: this.message.author.avatarURL
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return paginator(this.client, this.message, embeds);
|
return paginator(this.client, this.message, embeds);
|
||||||
|
|
|
@ -16,35 +16,35 @@ class HelpCommand extends Command {
|
||||||
const info = collections.info.get(command);
|
const info = collections.info.get(command);
|
||||||
const counts = await database.getCounts();
|
const counts = await database.getCounts();
|
||||||
const embed = {
|
const embed = {
|
||||||
"embed": {
|
embeds: [{
|
||||||
"author": {
|
author: {
|
||||||
"name": "esmBot Help",
|
name: "esmBot Help",
|
||||||
"icon_url": this.client.user.avatarURL
|
icon_url: this.client.user.avatarURL
|
||||||
},
|
},
|
||||||
"title": `${this.message.channel.guild ? prefix : ""}${command}`,
|
title: `${this.message.channel.guild ? prefix : ""}${command}`,
|
||||||
"url": "https://projectlounge.pw/esmBot/help.html",
|
url: "https://projectlounge.pw/esmBot/help.html",
|
||||||
"description": command === "tags" ? "The main tags command. Check the help page for more info: https://projectlounge.pw/esmBot/help.html" : info.description,
|
description: command === "tags" ? "The main tags command. Check the help page for more info: https://projectlounge.pw/esmBot/help.html" : info.description,
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"fields": [{
|
fields: [{
|
||||||
"name": "Aliases",
|
name: "Aliases",
|
||||||
"value": info.aliases.length !== 0 ? info.aliases.join(", ") : "None"
|
value: info.aliases.length !== 0 ? info.aliases.join(", ") : "None"
|
||||||
}, {
|
}, {
|
||||||
"name": "Times Used",
|
name: "Times Used",
|
||||||
"value": counts[command],
|
value: counts[command],
|
||||||
"inline": true
|
inline: true
|
||||||
}, {
|
}, {
|
||||||
"name": "Parameters",
|
name: "Parameters",
|
||||||
"value": command === "tags" ? "[name]" : (info.params ? (info.params.length !== 0 ? info.params.join(" ") : "None") : "None"),
|
value: command === "tags" ? "[name]" : (info.params ? (info.params.length !== 0 ? info.params.join(" ") : "None") : "None"),
|
||||||
"inline": true
|
inline: true
|
||||||
}]
|
}]
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
if (info.flags.length !== 0) {
|
if (info.flags.length !== 0) {
|
||||||
const flagInfo = [];
|
const flagInfo = [];
|
||||||
for (const flag of info.flags) {
|
for (const flag of info.flags) {
|
||||||
flagInfo.push(`\`--${flag.name}${flag.type ? `=[${flag.type}]` : ""}\` - ${flag.description}`);
|
flagInfo.push(`\`--${flag.name}${flag.type ? `=[${flag.type}]` : ""}\` - ${flag.description}`);
|
||||||
}
|
}
|
||||||
embed.embed.fields.push({
|
embed.embeds[0].fields.push({
|
||||||
"name": "Flags",
|
"name": "Flags",
|
||||||
"value": flagInfo.join("\n")
|
"value": flagInfo.join("\n")
|
||||||
});
|
});
|
||||||
|
@ -74,25 +74,25 @@ class HelpCommand extends Command {
|
||||||
const embeds = [];
|
const embeds = [];
|
||||||
for (const [i, value] of pages.entries()) {
|
for (const [i, value] of pages.entries()) {
|
||||||
embeds.push({
|
embeds.push({
|
||||||
"embed": {
|
embeds: [{
|
||||||
"author": {
|
author: {
|
||||||
"name": "esmBot Help",
|
name: "esmBot Help",
|
||||||
"icon_url": this.client.user.avatarURL
|
icon_url: this.client.user.avatarURL
|
||||||
},
|
},
|
||||||
"title": value.title,
|
title: value.title,
|
||||||
"description": value.page.join("\n"),
|
description: value.page.join("\n"),
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"footer": {
|
footer: {
|
||||||
"text": `Page ${i + 1} of ${pages.length}`
|
text: `Page ${i + 1} of ${pages.length}`
|
||||||
},
|
},
|
||||||
"fields": [{
|
fields: [{
|
||||||
"name": "Prefix",
|
name: "Prefix",
|
||||||
"value": this.message.channel.guild ? prefix : "N/A"
|
value: this.message.channel.guild ? prefix : "N/A"
|
||||||
}, {
|
}, {
|
||||||
"name": "Tip",
|
name: "Tip",
|
||||||
"value": random(tips)
|
value: random(tips)
|
||||||
}]
|
}]
|
||||||
}
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return paginator(this.client, this.message, embeds);
|
return paginator(this.client, this.message, embeds);
|
||||||
|
|
|
@ -16,21 +16,21 @@ class ImageSearchCommand extends Command {
|
||||||
const images = rawImages.results.filter((val) => !val.img_src.startsWith("data:"));
|
const images = rawImages.results.filter((val) => !val.img_src.startsWith("data:"));
|
||||||
for (const [i, value] of images.entries()) {
|
for (const [i, value] of images.entries()) {
|
||||||
embeds.push({
|
embeds.push({
|
||||||
"embed": {
|
embeds: [{
|
||||||
"title": "Search Results",
|
title: "Search Results",
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"footer": {
|
footer: {
|
||||||
"text": `Page ${i + 1} of ${images.length}`
|
text: `Page ${i + 1} of ${images.length}`
|
||||||
},
|
},
|
||||||
"description": value.title,
|
description: value.title,
|
||||||
"image": {
|
image: {
|
||||||
"url": encodeURI(value.img_src)
|
url: encodeURI(value.img_src)
|
||||||
},
|
},
|
||||||
"author": {
|
author: {
|
||||||
"name": this.message.author.username,
|
name: this.message.author.username,
|
||||||
"icon_url": this.message.author.avatarURL
|
icon_url: this.message.author.avatarURL
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return paginator(this.client, this.message, embeds);
|
return paginator(this.client, this.message, embeds);
|
||||||
|
|
|
@ -5,7 +5,7 @@ class ImageStatsCommand extends Command {
|
||||||
await this.client.sendChannelTyping(this.message.channel.id);
|
await this.client.sendChannelTyping(this.message.channel.id);
|
||||||
const servers = await this.ipc.command("image", { type: "stats" }, true);
|
const servers = await this.ipc.command("image", { type: "stats" }, true);
|
||||||
const embed = {
|
const embed = {
|
||||||
embed: {
|
embeds: [{
|
||||||
"author": {
|
"author": {
|
||||||
"name": "esmBot Image Statistics",
|
"name": "esmBot Image Statistics",
|
||||||
"icon_url": this.client.user.avatarURL
|
"icon_url": this.client.user.avatarURL
|
||||||
|
@ -13,10 +13,10 @@ class ImageStatsCommand extends Command {
|
||||||
"color": 16711680,
|
"color": 16711680,
|
||||||
"description": `The bot is currently connected to ${servers.length} image server(s).`,
|
"description": `The bot is currently connected to ${servers.length} image server(s).`,
|
||||||
"fields": []
|
"fields": []
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
for (let i = 0; i < servers.length; i++) {
|
for (let i = 0; i < servers.length; i++) {
|
||||||
embed.embed.fields.push({
|
embed.embeds[0].fields.push({
|
||||||
name: `Server ${i + 1}`,
|
name: `Server ${i + 1}`,
|
||||||
value: `Running Jobs: ${servers[i].runningJobs}\nQueued: ${servers[i].queued}\nMax Jobs: ${servers[i].max}`
|
value: `Running Jobs: ${servers[i].runningJobs}\nQueued: ${servers[i].queued}\nMax Jobs: ${servers[i].max}`
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,39 +10,39 @@ class InfoCommand extends Command {
|
||||||
const owner = await this.ipc.fetchUser(process.env.OWNER.split(",")[0]);
|
const owner = await this.ipc.fetchUser(process.env.OWNER.split(",")[0]);
|
||||||
const stats = await this.ipc.getStats();
|
const stats = await this.ipc.getStats();
|
||||||
return {
|
return {
|
||||||
"embed": {
|
embeds: [{
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"author": {
|
author: {
|
||||||
"name": "esmBot Info/Credits",
|
name: "esmBot Info/Credits",
|
||||||
"icon_url": this.client.user.avatarURL
|
icon_url: this.client.user.avatarURL
|
||||||
},
|
},
|
||||||
"description": `This instance is managed by **${owner.username}#${owner.discriminator}**.`,
|
description: `This instance is managed by **${owner.username}#${owner.discriminator}**.`,
|
||||||
"fields": [{
|
fields: [{
|
||||||
"name": "ℹ️ Version:",
|
name: "ℹ️ Version:",
|
||||||
"value": `v${version}${process.env.NODE_ENV === "development" ? `-dev (${(await exec("git rev-parse HEAD")).stdout.substring(0, 7)})` : ""}`
|
value: `v${version}${process.env.NODE_ENV === "development" ? `-dev (${(await exec("git rev-parse HEAD")).stdout.substring(0, 7)})` : ""}`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "📝 Credits:",
|
name: "📝 Credits:",
|
||||||
"value": "Bot by **[Essem](https://essem.space)** and **[various contributors](https://github.com/esmBot/esmBot/graphs/contributors)**\nIcon by **[MintBurrow](https://twitter.com/MintBurrow)**"
|
value: "Bot by **[Essem](https://essem.space)** and **[various contributors](https://github.com/esmBot/esmBot/graphs/contributors)**\nIcon by **[MintBurrow](https://twitter.com/MintBurrow)**"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "💬 Total Servers:",
|
name: "💬 Total Servers:",
|
||||||
"value": stats && stats.guilds ? stats.guilds : `${this.client.guilds.size} (for this cluster only)`
|
value: stats && stats.guilds ? stats.guilds : `${this.client.guilds.size} (for this cluster only)`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "✅ Official Server:",
|
name: "✅ Official Server:",
|
||||||
"value": "[Click here!](https://projectlounge.pw/support)"
|
value: "[Click here!](https://projectlounge.pw/support)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "💻 Source Code:",
|
name: "💻 Source Code:",
|
||||||
"value": "[Click here!](https://github.com/esmBot/esmBot)"
|
value: "[Click here!](https://github.com/esmBot/esmBot)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "🐦 Twitter:",
|
name: "🐦 Twitter:",
|
||||||
"value": "[Click here!](https://twitter.com/esmBot_)"
|
value: "[Click here!](https://twitter.com/esmBot_)"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,43 +5,43 @@ class ServerInfoCommand extends Command {
|
||||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||||
const owner = await this.message.channel.guild.members.get(this.message.channel.guild.ownerID);
|
const owner = await this.message.channel.guild.members.get(this.message.channel.guild.ownerID);
|
||||||
return {
|
return {
|
||||||
"embed": {
|
embeds: [{
|
||||||
"title": this.message.channel.guild.name,
|
title: this.message.channel.guild.name,
|
||||||
"thumbnail": {
|
thumbnail: {
|
||||||
"url": this.message.channel.guild.iconURL
|
url: this.message.channel.guild.iconURL
|
||||||
},
|
},
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"fields": [
|
fields: [
|
||||||
{
|
{
|
||||||
"name": "🔢 **ID:**",
|
name: "🔢 **ID:**",
|
||||||
"value": this.message.channel.guild.id
|
value: this.message.channel.guild.id
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "👤 **Owner:**",
|
name: "👤 **Owner:**",
|
||||||
"value": owner ? `${owner.user.username}#${owner.user.discriminator}` : this.message.channel.guild.ownerID
|
value: owner ? `${owner.user.username}#${owner.user.discriminator}` : this.message.channel.guild.ownerID
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "🗺 **Region:**",
|
name: "🗺 **Region:**",
|
||||||
"value": this.message.channel.guild.region
|
value: this.message.channel.guild.region
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "🗓 **Created on:**",
|
name: "🗓 **Created on:**",
|
||||||
"value": `<t:${Math.floor(this.message.channel.guild.createdAt / 1000)}:F>`
|
value: `<t:${Math.floor(this.message.channel.guild.createdAt / 1000)}:F>`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "👥 **Users:**",
|
name: "👥 **Users:**",
|
||||||
"value": this.message.channel.guild.memberCount
|
value: this.message.channel.guild.memberCount
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "💬 **Channels:**",
|
name: "💬 **Channels:**",
|
||||||
"value": this.message.channel.guild.channels.size
|
value: this.message.channel.guild.channels.size
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "😃 **Emojis:**",
|
name: "😃 **Emojis:**",
|
||||||
"value": this.message.channel.guild.emojis.length
|
value: this.message.channel.guild.emojis.length
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class StatsCommand extends Command {
|
||||||
const owner = await this.ipc.fetchUser(process.env.OWNER.split(",")[0]);
|
const owner = await this.ipc.fetchUser(process.env.OWNER.split(",")[0]);
|
||||||
const stats = await this.ipc.getStats();
|
const stats = await this.ipc.getStats();
|
||||||
return {
|
return {
|
||||||
embed: {
|
embeds: [{
|
||||||
"author": {
|
"author": {
|
||||||
"name": "esmBot Statistics",
|
"name": "esmBot Statistics",
|
||||||
"icon_url": this.client.user.avatarURL
|
"icon_url": this.client.user.avatarURL
|
||||||
|
@ -74,7 +74,7 @@ class StatsCommand extends Command {
|
||||||
"inline": true
|
"inline": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,13 @@ class StickerCommand extends Command {
|
||||||
return `https://cdn.discordapp.com/stickers/${result.id}.png`;
|
return `https://cdn.discordapp.com/stickers/${result.id}.png`;
|
||||||
} else if (result.format_type === 2) { // APNG
|
} else if (result.format_type === 2) { // APNG
|
||||||
return {
|
return {
|
||||||
embed: {
|
embeds: [{
|
||||||
color: 16711680,
|
color: 16711680,
|
||||||
description: `[This sticker is an APNG; however, since Discord doesn't allow displaying APNGs outside of stickers, you'll have to save it or open it in your browser to view it.](https://cdn.discordapp.com/stickers/${result.id}.png)`,
|
description: `[This sticker is an APNG; however, since Discord doesn't allow displaying APNGs outside of stickers, you'll have to save it or open it in your browser to view it.](https://cdn.discordapp.com/stickers/${result.id}.png)`,
|
||||||
image: {
|
image: {
|
||||||
url: `https://cdn.discordapp.com/stickers/${result.id}.png`
|
url: `https://cdn.discordapp.com/stickers/${result.id}.png`
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
} else if (result.format_type === 3) { // Lottie
|
} else if (result.format_type === 3) { // Lottie
|
||||||
return `I can't display this sticker because it uses the Lottie animation format; however, I can give you the raw JSON link to it: https://cdn.discordapp.com/stickers/${result.id}.json`;
|
return `I can't display this sticker because it uses the Lottie animation format; however, I can give you the raw JSON link to it: https://cdn.discordapp.com/stickers/${result.id}.json`;
|
||||||
|
|
|
@ -17,35 +17,35 @@ class UserInfoCommand extends Command {
|
||||||
}
|
}
|
||||||
const member = this.message.channel.guild ? this.message.channel.guild.members.get(user.id) : undefined;
|
const member = this.message.channel.guild ? this.message.channel.guild.members.get(user.id) : undefined;
|
||||||
return {
|
return {
|
||||||
"embed": {
|
embeds: [{
|
||||||
"title": `${user.username}#${user.discriminator}`,
|
title: `${user.username}#${user.discriminator}`,
|
||||||
"thumbnail": {
|
thumbnail: {
|
||||||
"url": user.avatarURL
|
url: user.avatarURL
|
||||||
},
|
},
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"fields": [
|
fields: [
|
||||||
{
|
{
|
||||||
"name": "🔢 **ID:**",
|
name: "🔢 **ID:**",
|
||||||
"value": user.id
|
value: user.id
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "📛 **Nickname:**",
|
name: "📛 **Nickname:**",
|
||||||
"value": member ? (member.nick ? member.nick : "None") : "N/A"
|
value: member ? (member.nick ? member.nick : "None") : "N/A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "🤖 **Bot:**",
|
name: "🤖 **Bot:**",
|
||||||
"value": user.bot ? "Yes" : "No"
|
value: user.bot ? "Yes" : "No"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "🗓️ **Joined Discord on:**",
|
name: "🗓️ **Joined Discord on:**",
|
||||||
"value": `<t:${Math.floor(user.createdAt / 1000)}:F>`
|
value: `<t:${Math.floor(user.createdAt / 1000)}:F>`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "💬 **Joined this server on:**",
|
name: "💬 **Joined this server on:**",
|
||||||
"value": member ? `<t:${Math.floor(member.joinedAt / 1000)}:F>` : "N/A"
|
value: member ? `<t:${Math.floor(member.joinedAt / 1000)}:F>` : "N/A"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,29 +12,29 @@ class NowPlayingCommand extends MusicCommand {
|
||||||
const track = await Rest.decode(player.node, player.track);
|
const track = await Rest.decode(player.node, player.track);
|
||||||
const parts = Math.floor((player.state.position / track.length) * 10);
|
const parts = Math.floor((player.state.position / track.length) * 10);
|
||||||
return {
|
return {
|
||||||
"embed": {
|
embeds: [{
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"author": {
|
author: {
|
||||||
"name": "Now Playing",
|
name: "Now Playing",
|
||||||
"icon_url": this.client.user.avatarURL
|
icon_url: this.client.user.avatarURL
|
||||||
},
|
},
|
||||||
"fields": [{
|
fields: [{
|
||||||
"name": "ℹ️ Title:",
|
name: "ℹ️ Title:",
|
||||||
"value": track.title ? track.title : "Unknown"
|
value: track.title ? track.title : "Unknown"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "🎤 Artist:",
|
name: "🎤 Artist:",
|
||||||
"value": track.author ? track.author : "Unknown"
|
value: track.author ? track.author : "Unknown"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "💬 Channel:",
|
name: "💬 Channel:",
|
||||||
"value": this.message.channel.guild.channels.get(this.message.member.voiceState.channelID).name
|
value: this.message.channel.guild.channels.get(this.message.member.voiceState.channelID).name
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": `${"▬".repeat(parts)}🔘${"▬".repeat(10 - parts)}`,
|
name: `${"▬".repeat(parts)}🔘${"▬".repeat(10 - parts)}`,
|
||||||
"value": `${format(player.state.position)}/${track.isStream ? "∞" : format(track.length)}`
|
value: `${format(player.state.position)}/${track.isStream ? "∞" : format(track.length)}`
|
||||||
}]
|
}]
|
||||||
}
|
}]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,26 +28,26 @@ class QueueCommand extends MusicCommand {
|
||||||
if (groups.length === 0) groups.push("del");
|
if (groups.length === 0) groups.push("del");
|
||||||
for (const [i, value] of groups.entries()) {
|
for (const [i, value] of groups.entries()) {
|
||||||
embeds.push({
|
embeds.push({
|
||||||
"embed": {
|
embeds: [{
|
||||||
"author": {
|
author: {
|
||||||
"name": "Queue",
|
name: "Queue",
|
||||||
"icon_url": this.client.user.avatarURL
|
icon_url: this.client.user.avatarURL
|
||||||
},
|
},
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"footer": {
|
footer: {
|
||||||
"text": `Page ${i + 1} of ${groups.length}`
|
text: `Page ${i + 1} of ${groups.length}`
|
||||||
},
|
},
|
||||||
"fields": [{
|
fields: [{
|
||||||
"name": "🎶 Now Playing",
|
name: "🎶 Now Playing",
|
||||||
"value": `${firstTrack.info.author !== "" ? firstTrack.info.author : "(blank)"} - **${firstTrack.info.title !== "" ? firstTrack.info.title : "(blank)"}** (${firstTrack.info.isStream ? "∞" : format(firstTrack.info.length)})`
|
value: `${firstTrack.info.author !== "" ? firstTrack.info.author : "(blank)"} - **${firstTrack.info.title !== "" ? firstTrack.info.title : "(blank)"}** (${firstTrack.info.isStream ? "∞" : format(firstTrack.info.length)})`
|
||||||
}, {
|
}, {
|
||||||
"name": "🔁 Looping?",
|
name: "🔁 Looping?",
|
||||||
"value": player.loop ? "Yes" : "No"
|
value: player.loop ? "Yes" : "No"
|
||||||
}, {
|
}, {
|
||||||
"name": "🗒️ Queue",
|
name: "🗒️ Queue",
|
||||||
"value": value !== "del" ? value.join("\n") : "There's nothing in the queue!"
|
value: value !== "del" ? value.join("\n") : "There's nothing in the queue!"
|
||||||
}]
|
}]
|
||||||
}
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (embeds.length === 0) return "There's nothing in the queue!";
|
if (embeds.length === 0) return "There's nothing in the queue!";
|
||||||
|
|
|
@ -52,18 +52,18 @@ class TagsCommand extends Command {
|
||||||
});
|
});
|
||||||
for (const [i, value] of groups.entries()) {
|
for (const [i, value] of groups.entries()) {
|
||||||
embeds.push({
|
embeds.push({
|
||||||
"embed": {
|
embeds: [{
|
||||||
"title": "Tag List",
|
title: "Tag List",
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"footer": {
|
footer: {
|
||||||
"text": `Page ${i + 1} of ${groups.length}`
|
text: `Page ${i + 1} of ${groups.length}`
|
||||||
},
|
},
|
||||||
"description": value.join("\n"),
|
description: value.join("\n"),
|
||||||
"author": {
|
author: {
|
||||||
"name": this.message.author.username,
|
name: this.message.author.username,
|
||||||
"icon_url": this.message.author.avatarURL
|
icon_url: this.message.author.avatarURL
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (embeds.length === 0) return "I couldn't find any tags!";
|
if (embeds.length === 0) return "I couldn't find any tags!";
|
||||||
|
|
|
@ -130,7 +130,7 @@ export default async (client, cluster, worker, ipc, message) => {
|
||||||
await promises.writeFile(`${process.env.TEMPDIR}/${filename}`, result.file);
|
await promises.writeFile(`${process.env.TEMPDIR}/${filename}`, result.file);
|
||||||
const imageURL = `${process.env.TMP_DOMAIN == "" ? "https://tmp.projectlounge.pw" : process.env.TMP_DOMAIN}/${filename}`;
|
const imageURL = `${process.env.TMP_DOMAIN == "" ? "https://tmp.projectlounge.pw" : process.env.TMP_DOMAIN}/${filename}`;
|
||||||
await client.createMessage(message.channel.id, Object.assign({
|
await client.createMessage(message.channel.id, Object.assign({
|
||||||
embed: {
|
embeds: [{
|
||||||
color: 16711680,
|
color: 16711680,
|
||||||
title: "Here's your image!",
|
title: "Here's your image!",
|
||||||
url: imageURL,
|
url: imageURL,
|
||||||
|
@ -140,7 +140,7 @@ export default async (client, cluster, worker, ipc, message) => {
|
||||||
footer: {
|
footer: {
|
||||||
text: "The result image was more than 8MB in size, so it was uploaded to an external site instead."
|
text: "The result image was more than 8MB in size, so it was uploaded to an external site instead."
|
||||||
},
|
},
|
||||||
}
|
}]
|
||||||
}, reference));
|
}, reference));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -102,29 +102,29 @@ export async function nextSong(client, message, connection, track, info, music,
|
||||||
playingMessage = players.get(voiceChannel.guild.id).playMessage;
|
playingMessage = players.get(voiceChannel.guild.id).playMessage;
|
||||||
} else {
|
} else {
|
||||||
playingMessage = await client.createMessage(message.channel.id, !music ? "🔊 Playing sound..." : {
|
playingMessage = await client.createMessage(message.channel.id, !music ? "🔊 Playing sound..." : {
|
||||||
"embed": {
|
embeds: [{
|
||||||
"color": 16711680,
|
color: 16711680,
|
||||||
"author": {
|
author: {
|
||||||
"name": "Now Playing",
|
name: "Now Playing",
|
||||||
"icon_url": client.user.avatarURL
|
icon_url: client.user.avatarURL
|
||||||
},
|
},
|
||||||
"fields": [{
|
fields: [{
|
||||||
"name": "ℹ️ Title:",
|
name: "ℹ️ Title:",
|
||||||
"value": info.title !== "" ? info.title : "(blank)"
|
value: info.title !== "" ? info.title : "(blank)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "🎤 Artist:",
|
name: "🎤 Artist:",
|
||||||
"value": info.author !== "" ? info.author : "(blank)"
|
value: info.author !== "" ? info.author : "(blank)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "💬 Channel:",
|
name: "💬 Channel:",
|
||||||
"value": voiceChannel.name
|
value: voiceChannel.name
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": `${"▬".repeat(parts)}🔘${"▬".repeat(10 - parts)}`,
|
name: `${"▬".repeat(parts)}🔘${"▬".repeat(10 - parts)}`,
|
||||||
"value": `0:00/${info.isStream ? "∞" : format(info.length)}`
|
value: `0:00/${info.isStream ? "∞" : format(info.length)}`
|
||||||
}]
|
}]
|
||||||
}
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
connection.removeAllListeners("error");
|
connection.removeAllListeners("error");
|
||||||
|
|
Loading…
Reference in a new issue