-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add timestamp and author to command footers embeds
- Loading branch information
Derek
committed
Apr 3, 2021
1 parent
5e2bf46
commit e5942ce
Showing
37 changed files
with
876 additions
and
783 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,64 @@ | ||
const Discord = require("discord.js"); | ||
const colors = require("../lib/colors.json"); | ||
exports.run = async (client, message, args) => { | ||
try { | ||
const prefix = | ||
message.guild === null | ||
? ";;" | ||
: client.getSettings(message.guild.id).prefix; | ||
const results = ["Yes.", "No.", "Maybe."]; | ||
const result = results[Math.floor(Math.random() * results.length)]; | ||
const input = args.join(" "); | ||
try { | ||
const prefix = | ||
message.guild === null ? | ||
";;" : | ||
client.getSettings(message.guild.id).prefix; | ||
|
||
if (!input) { | ||
const embed = new Discord.MessageEmbed() | ||
.setColor(colors.red) | ||
.setTitle("Invalid Syntax") | ||
.setDescription( | ||
`\`${prefix}8ball [message]\`\n\nIf question contains "who" or "whose", a random member from the guild will be chosen.` | ||
); | ||
const language = client.getSettings(message.guild.id).language | ||
console.log(language) | ||
const lang = require("../lib/languages/" + language + ".json"); | ||
console.log(lang.EightBallYes) | ||
const results = [lang.EightBallYes, lang.EightBallNo, lang.EightBallMaybe]; | ||
const result = results[Math.floor(Math.random() * results.length)]; | ||
const input = args.join(" "); | ||
|
||
message.channel.send(embed); | ||
} else { | ||
if (message.content.includes("who") || message.content.includes("Who")) { | ||
if (message.channel.type === "dm") { | ||
const member = ["You.", "Me."]; | ||
const result = member[Math.floor(Math.random() * member.length)]; | ||
message.channel.send(`${result}`); | ||
if (!input) { | ||
let command = client.commands.get("8ball") | ||
const embed = new Discord.MessageEmbed() | ||
.setColor(colors.red) | ||
.setTitle("Invalid Syntax") | ||
.setDescription(`\`${prefix}${command.help.usage}\`\n\n${command.help.description}`) | ||
.setFooter(`Responding to ${message.author.tag}`, message.author.avatarURL()) | ||
.setTimestamp() | ||
|
||
message.channel.send(embed); | ||
} else { | ||
if (message.content.includes("who") || message.content.includes("Who")) { | ||
if (message.channel.type === "dm") { | ||
const member = ["You.", "Me."]; | ||
const result = member[Math.floor(Math.random() * member.length)]; | ||
message.channel.send(`${result}`); | ||
} | ||
var member = message.guild.members.cache.random(); | ||
const embed = new Discord.MessageEmbed() | ||
.setColor(colors.default) | ||
.setThumbnail(member.avatarURL) | ||
.addField(member.displayName, `<@${member.id}>`) | ||
.setFooter(`Responding to ${message.author.tag}`, message.author.avatarURL()) | ||
.setTimestamp() | ||
message.channel.send(embed); | ||
} else { | ||
message.channel.send(result); | ||
} | ||
} | ||
var member = message.guild.members.cache.random(); | ||
const embed = new Discord.MessageEmbed() | ||
.setColor(colors.default) | ||
.setThumbnail(member.avatarURL) | ||
.addField(member.displayName, `<@${member.id}>`) | ||
.setTimestamp() | ||
message.channel.send(embed); | ||
} else { | ||
message.channel.send(result); | ||
} | ||
} catch (err) { | ||
message.channel.send(client.errors.genericError + err.stack).catch(); | ||
} | ||
} catch (err) { | ||
message.channel.send(client.errors.genericError + err.stack).catch(); | ||
} | ||
} | ||
|
||
exports.conf = { | ||
enabled: true, | ||
aliases: [], | ||
guildOnly: false, | ||
permLevel: "User", | ||
enabled: true, | ||
aliases: [], | ||
guildOnly: false, | ||
permLevel: "User", | ||
}; | ||
|
||
exports.help = { | ||
name: "8ball", | ||
category: "Utility", | ||
description: "Ask the mighty 8ball a question.", | ||
usage: "8ball <question>", | ||
}; | ||
name: "8ball", | ||
category: "Utility", | ||
description: "Ask the mighty 8ball a question. If question contains 'who' or 'whose', a random member from the guild will be chosen.", | ||
usage: "8ball <question>", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.