string formatting with templates

This commit is contained in:
Nathaniel Mason 2022-03-26 18:20:32 +00:00
parent 4d51f2b5a7
commit 7bfbe0a021
19 changed files with 28 additions and 28 deletions

View file

@ -32,7 +32,7 @@ module.exports = {
} else { } else {
await message.channel.send({embed: { await message.channel.send({embed: {
"title": ":8ball: Anitrox 8 Ball", "title": ":8ball: Anitrox 8 Ball",
"description": "Your question: **" + question + "**", "description": `Your question: **${question}**`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -7,7 +7,7 @@ module.exports = {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author; const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
await message.channel.send({embed: { await message.channel.send({embed: {
"title": ":frame_photo: " + user.username + "'s Beautiful Avatar!", "title": `:frame_photo: ${user.username}'s Beautiful Avatar!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -10,7 +10,7 @@ module.exports = {
} else { } else {
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "<a:SylvBonk:801185845847130113> Bonk", "title": "<a:SylvBonk:801185845847130113> Bonk",
"description": "<@" + taggedUser + ">" + " You have been bonked by <@" + message.author + ">!", "description": `${taggedUser} You have been bonked by ${message.author}!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -8,7 +8,7 @@ module.exports = {
} else { } else {
await message.channel.send({embed: { await message.channel.send({embed: {
"title": ":cheese: Cheesed", "title": ":cheese: Cheesed",
"description": "<@" + taggedUser + ">" + " You got cheesed by " + "<@" + message.author + ">!", "description": `${taggedUser} You have been cheesed by ${message.author}!`,
"color": 16312092, "color": 16312092,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -20,7 +20,7 @@ module.exports = {
} else { } else {
await message.channel.send({embed: { await message.channel.send({embed: {
"title": ":heart: Cuddle", "title": ":heart: Cuddle",
"description": "<@" + taggedUser + ">" + " You have been cuddled by " + "<@" + message.author + ">!", "description": `${taggedUser} You have been cuddled by ${message.author}!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -11,7 +11,7 @@ module.exports = {
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": footerTxt + " | No mother it's just the northern lights" "text": `${footerTxt} | No mother it's just the northern lights`
}, },
"fields": [ "fields": [
{ {

View file

@ -19,7 +19,7 @@ module.exports = {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "<a:ABlobCatHuggle:801232248035999784> Hug", "title": "<a:ABlobCatHuggle:801232248035999784> Hug",
"description": "<@" + taggedUser + ">" + " You have been hugged by " + "<@" + message.author + ">!", "description": `${taggedUser} You have been hugged by ${message.author}!`,
"color": 8311585, "color": 8311585,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -58,7 +58,7 @@ module.exports = {
}, },
{ {
"name": "<:memory:793536677737136178> Bot Memory Usage", "name": "<:memory:793536677737136178> Bot Memory Usage",
"value": (Math.round(process.memoryUsage().heapUsed / 1024 / 1024 * 100) / 100) + " MiB", "value": `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MiB`,
"inline": true "inline": true
}, },
{ {
@ -68,7 +68,7 @@ module.exports = {
}, },
{ {
"name": "Bot ID", "name": "Bot ID",
"value": "``" + client.user.id + "``", "value": `\`${client.user.id}\``,
"inline": true "inline": true
}, },
{ {
@ -81,12 +81,12 @@ module.exports = {
}, },
{ {
"name": "<:cpu:793672442056802354> CPU Type", "name": "<:cpu:793672442056802354> CPU Type",
"value": process.arch + ", " + cpu.model() "value": `${process.arch}, ${cpu.model()}`
}, },
{ {
"name": "<:hostos:793866961675223090> OS Type", "name": "<:hostos:793866961675223090> OS Type",
"value": process.platform + " / " + os.version() "value": `${process.platform} / ${os.version()}`
}, },
{ {
"name": "<:node:793537507018145813> Node.JS Version", "name": "<:node:793537507018145813> Node.JS Version",
@ -94,7 +94,7 @@ module.exports = {
}, },
{ {
"name": "<:hostinfo:793529505263517747> Bot Ping", "name": "<:hostinfo:793529505263517747> Bot Ping",
"value": Math.round(client.ws.ping) + " ms", "value": `${Math.round(client.ws.ping)} ms`,
"inline": true "inline": true
}, },
{ {

View file

@ -19,7 +19,7 @@ module.exports = {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embed: {
"title": ":heart: Kiss", "title": ":heart: Kiss",
"description": "<@" + taggedUser + ">" + ", You have been kissed by <@" + message.author + ">!", "description": `${taggedUser} You have been kissed by ${message.author}!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -29,7 +29,7 @@ module.exports = {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embed: {
"title": ":heart: <:lesbian:803831629428686849> Kiss", "title": ":heart: <:lesbian:803831629428686849> Kiss",
"description": "<@" + taggedUser + ">" + " You have been kissed by <@" + message.author + ">! <:lesbian:803831629428686849>", "description": `${taggedUser} You have been kissed by ${message.author}!`,
"color": 8311585, "color": 8311585,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -18,7 +18,7 @@ module.exports = {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "<a:LeafeonLick:806396195089154058> Lick", "title": "<a:LeafeonLick:806396195089154058> Lick",
"description": "<@" + taggedUser + "> You have been licked by <@" + message.author + ">!", "description": `${taggedUser} You have been licked by ${message.author}!`,
"color": 8311585, "color": 8311585,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -18,7 +18,7 @@ module.exports = {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "<:BlobNomBlob:801241117919805510> Nom", "title": "<:BlobNomBlob:801241117919805510> Nom",
"description": "<@" + taggedUser + "> You have been nommed by <@" + message.author + ">!", "description": `${taggedUser} You have been nommed by ${message.author}!`,
"color": 8311585, "color": 8311585,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -17,7 +17,7 @@ module.exports = {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "<:pats:801238281286713355> Pat", "title": "<:pats:801238281286713355> Pat",
"description": "<@" + taggedUser + "> You have been patted by <@" + message.author + ">!", "description": `${taggedUser} You have been patted by ${message.author}!`,
"color": 8311585, "color": 8311585,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -9,7 +9,7 @@ module.exports = {
await message.channel.send({embed:{ await message.channel.send({embed:{
"title": ":ping_pong: Ping", "title": ":ping_pong: Ping",
"description": "**Pong!** We pinged **" + pingLocation + "** and got " + client.ws.ping + " ms.", "description": `**Pong!** We pinged **${pingLocation}** and got ${client.ws.ping} ms.`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -17,7 +17,7 @@ module.exports = {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "👉 Poke!", "title": "👉 Poke!",
"description": "<@" + taggedUser + "> You have been poked by <@" + message.author + ">!", "description": `${taggedUser} You have been poked by ${message.author}!`,
"color": 8311585, "color": 8311585,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -10,7 +10,7 @@ module.exports = {
} else { } else {
await message.channel.send({embed: { await message.channel.send({embed: {
"title": ":anger: Slap", "title": ":anger: Slap",
"description": "<@" + taggedUser + "> You have been slapped by <@" + message.author + ">!", "description": `${taggedUser} You have been slapped by ${message.author}!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -18,7 +18,7 @@ module.exports = {
const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)]; const gif = gifchoices[Math.floor(Math.random() * gifchoices.length)];
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "<:BlobSnuggleCat:806759753450782731> Snuggle", "title": "<:BlobSnuggleCat:806759753450782731> Snuggle",
"description": "<@" + taggedUser + ">" + " You have been snuggled by " + "<@" + message.author + ">!", "description": `${taggedUser} You have been snuggled by ${message.author}!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),

View file

@ -5,7 +5,7 @@ module.exports = {
async execute(client, message, args, footerTxt) { async execute(client, message, args, footerTxt) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "Everything you've ever wanted to know about " + user.username + "!", "title": `Everything you've ever wanted to know about ${user.username}!`,
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
@ -41,7 +41,7 @@ module.exports = {
}, },
{ {
"name": "User ID", "name": "User ID",
"value": "``" + user.id + "``" "value": `\`${user.id}\``
}, },
{ {
"name": "User Joined Discord", "name": "User Joined Discord",

View file

@ -30,16 +30,16 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: {
] ]
}}) }})
client.on("error", (e) => console.log("[ERROR]" + error(e))); client.on("error", (e) => console.log(`[ERROR] ${error(e)}`));
client.on("warn", (e) => ("[WARN]" + warn(e))); client.on("warn", (e) => (`[WARN] ${warn(e)}`));
client.once('ready', () => { client.once('ready', () => {
console.clear() console.clear()
console.log(' ___ _ __ '); console.log(' ___ _ __ ');
console.log(' / | ____ (_) /__________ _ __'); console.log(' / | ____ (_) /__________ _ __');
console.log(' / /| | / __ \/ / __/ ___/ __ \| |/_/'); console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/');
console.log(' / ___ |/ / / / / /_/ / / /_/ /> < '); console.log(' / ___ |/ / / / / /_/ / / /_/ /> < ');
console.log('/_/ |_/_/ /_/_/\__/_/ \____/_/|_| ') console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ');
console.log(release + ", " + build) console.log(`${release}, ${build}`);
console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!"); console.log("All Systems Go. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!");
}); });