1
0
Fork 0

Make these command work in dm

akairo
loicbersier 5 years ago
parent f282b415c9
commit 378be5da88

@ -71,7 +71,7 @@ class FourchanCommand extends Command {
} }
const FourchanEmbed = this.client.util.embed() const FourchanEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(turndown.turndown(title)) .setTitle(turndown.turndown(title))
.setDescription(turndown.turndown(description)) .setDescription(turndown.turndown(description))
.setImage(`https://i.4cdn.org/${args.board}/${response.threads[i].posts[0].tim}${response.threads[i].posts[0].ext}`) .setImage(`https://i.4cdn.org/${args.board}/${response.threads[i].posts[0].tim}${response.threads[i].posts[0].ext}`)

@ -47,7 +47,7 @@ class RedditCommand extends Command {
if (response.data.children[i].data.over_18 == true && !message.channel.nsfw) if (response.data.children[i].data.over_18 == true && !message.channel.nsfw)
return message.channel.send('No nsfw'); return message.channel.send('No nsfw');
const redditEmbed = this.client.util.embed() const redditEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(response.data.children[i].data.title) .setTitle(response.data.children[i].data.title)
.setDescription(response.data.children[i].data.selftext) .setDescription(response.data.children[i].data.selftext)
.setURL('https://reddit.com' + response.data.children[i].data.permalink) .setURL('https://reddit.com' + response.data.children[i].data.permalink)

@ -20,7 +20,7 @@ class AdviceCommand extends Command {
return response.json(); return response.json();
}).then((response) => { }).then((response) => {
const adviceEmbed = this.client.util.embed() const adviceEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(response.slip.slip_id) .setTitle(response.slip.slip_id)
.setDescription(response.slip.advice); .setDescription(response.slip.advice);

@ -36,7 +36,7 @@ class guessCommand extends Command {
const leaderboard = await guessLeaderboard.findAll({order: ['try']}); const leaderboard = await guessLeaderboard.findAll({order: ['try']});
let top = []; let top = [];
let leaderboardEmbed = this.client.util.embed() let leaderboardEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Guess leaderboard'); .setTitle('Guess leaderboard');
for (let i = 0; i < leaderboard.length; i++) { for (let i = 0; i < leaderboard.length; i++) {
this.client.users.fetch(leaderboard[i].get('memberID')) this.client.users.fetch(leaderboard[i].get('memberID'))

@ -30,7 +30,7 @@ class aboutCommand extends Command {
const aboutEmbed = this.client.util.embed() const aboutEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setAuthor(this.client.user.username, this.client.user.avatarURL()) .setAuthor(this.client.user.username, this.client.user.avatarURL())
.setTitle('About me') .setTitle('About me')
.setDescription(description) .setDescription(description)

@ -22,7 +22,7 @@ class AvatarCommand extends Command {
async exec(message, args) { async exec(message, args) {
const avatarEmbed = this.client.util.embed() const avatarEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Avatar'); .setTitle('Avatar');

@ -16,7 +16,7 @@ class donateCommand extends Command {
async exec(message) { async exec(message) {
const Embed = this.client.util.embed() const Embed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Donation link') .setTitle('Donation link')
.setDescription('If you decide to donate, please use the feedback command to let the owner know about it so he can put you in the about and donator command\n[Paypal](https://www.paypal.me/supositware)\n[Patreon](https://www.patreon.com/bePatron?u=15330358)\n[Brave referal program](https://brave.com/hah459)\nTip me with Brave BAT token on [my website](https://namejeff.xyz/)\nYou can also donate ETH to ``0xe188F9062A74cc29e23D0602F4Fe335B1F5D8409``'); .setDescription('If you decide to donate, please use the feedback command to let the owner know about it so he can put you in the about and donator command\n[Paypal](https://www.paypal.me/supositware)\n[Patreon](https://www.patreon.com/bePatron?u=15330358)\n[Brave referal program](https://brave.com/hah459)\nTip me with Brave BAT token on [my website](https://namejeff.xyz/)\nYou can also donate ETH to ``0xe188F9062A74cc29e23D0602F4Fe335B1F5D8409``');

@ -52,14 +52,14 @@ class DownloadCommand extends Command {
const Embed = this.client.util.embed() const Embed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setAuthor(`Downloaded by ${message.author.username}`, message.author.displayAvatarURL(), link) .setAuthor(`Downloaded by ${message.author.username}`, message.author.displayAvatarURL(), link)
.setDescription(args.caption) .setDescription(args.caption)
.setFooter(`You can get the original video by clicking on the "downloaded by ${message.author.username}" message!`); .setFooter(`You can get the original video by clicking on the "downloaded by ${message.author.username}" message!`);
let compressEmbed = this.client.util.embed() let compressEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('This one will need compression!') .setTitle('This one will need compression!')
.setDescription('Starting compression now!') .setDescription('Starting compression now!')
.setFooter('Want it to go faster? Donate to the dev with the donate command, so i can get a better server and do it faster!'); .setFooter('Want it to go faster? Donate to the dev with the donate command, so i can get a better server and do it faster!');

@ -38,7 +38,7 @@ class HelpCommand extends Command {
}, command.description); }, command.description);
const embed = this.client.util.embed() const embed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(`\`${this.client.commandHandler.prefix[0]}${command.aliases[0]} ${description.usage}\``) .setTitle(`\`${this.client.commandHandler.prefix[0]}${command.aliases[0]} ${description.usage}\``)
.addField('Description', description.content) .addField('Description', description.content)
.setFooter(`All the available prefix: ${this.client.commandHandler.prefix.join(' | ')}`); .setFooter(`All the available prefix: ${this.client.commandHandler.prefix.join(' | ')}`);
@ -72,7 +72,7 @@ class HelpCommand extends Command {
async execCommandList(message) { async execCommandList(message) {
const embed = this.client.util.embed() const embed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.addField('Command List', .addField('Command List',
[ [
'This is a list of commands.', 'This is a list of commands.',

@ -32,7 +32,7 @@ class screenshotCommand extends Command {
async exec(message, args) { async exec(message, args) {
if (args.url.includes('config.json')) return message.channel.send('I don\'t think so'); if (args.url.includes('config.json')) return message.channel.send('I don\'t think so');
let Embed = this.client.util.embed() let Embed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(args.url); .setTitle(args.url);
let loadingmsg = await message.channel.send('Taking a screenshot <a:loadingmin:527579785212329984>'); let loadingmsg = await message.channel.send('Taking a screenshot <a:loadingmin:527579785212329984>');

@ -31,7 +31,7 @@ class seebannedwordCommand extends Command {
if (list == undefined) return message.channel.send('No word are banned yet.'); if (list == undefined) return message.channel.send('No word are banned yet.');
const Embed = this.client.util.embed() const Embed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('List of banned words') .setTitle('List of banned words')
.setDescription(list); .setDescription(list);

@ -37,7 +37,7 @@ class seetagCommand extends Command {
this.client.users.fetch(tagList.dataValues.ownerID) this.client.users.fetch(tagList.dataValues.ownerID)
.then(user => { .then(user => {
const TagEmbed = this.client.util.embed() const TagEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(message.guild.name) .setTitle(message.guild.name)
.addField('Trigger:', tagList['dataValues']['trigger']) .addField('Trigger:', tagList['dataValues']['trigger'])
.addField('Response:', tagList['dataValues']['response']) .addField('Response:', tagList['dataValues']['response'])
@ -53,7 +53,7 @@ class seetagCommand extends Command {
}) })
.catch(() => { .catch(() => {
const TagEmbed = this.client.util.embed() const TagEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(message.guild.name) .setTitle(message.guild.name)
.addField('Trigger:', tagList['dataValues']['trigger']) .addField('Trigger:', tagList['dataValues']['trigger'])
.addField('Response:', tagList['dataValues']['response']) .addField('Response:', tagList['dataValues']['response'])
@ -82,7 +82,7 @@ class seetagCommand extends Command {
let tagList = await Tag.findAll({attributes: ['trigger'], where: {serverID: message.guild.id}}); let tagList = await Tag.findAll({attributes: ['trigger'], where: {serverID: message.guild.id}});
const tagString = tagList.map(t => t.trigger).join(', ') || 'No tags set.'; const tagString = tagList.map(t => t.trigger).join(', ') || 'No tags set.';
const TagEmbed = this.client.util.embed() const TagEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('List of tags') .setTitle('List of tags')
.setDescription(tagString) .setDescription(tagString)
.setFooter('Use this command with the name of the tag to see more info about it!'); .setFooter('Use this command with the name of the tag to see more info about it!');

@ -18,7 +18,7 @@ class ServerCommand extends Command {
async exec(message) { async exec(message) {
let botCount = message.guild.members.cache.filter(member => member.user.bot).size; let botCount = message.guild.members.cache.filter(member => member.user.bot).size;
const addEmbed = this.client.util.embed() const addEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(message.guild.name) .setTitle(message.guild.name)
.setThumbnail(message.guild.iconURL()) .setThumbnail(message.guild.iconURL())
.addField('Number of users', message.guild.memberCount - botCount, true) .addField('Number of users', message.guild.memberCount - botCount, true)

@ -23,7 +23,7 @@ class serverIconCommand extends Command {
async exec(message, args) { async exec(message, args) {
const serverEmbed = this.client.util.embed() const serverEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Server icon'); .setTitle('Server icon');

@ -52,7 +52,7 @@ class StatsCommand extends Command {
} }
const statsEmbed = this.client.util.embed() const statsEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Bot stats') .setTitle('Bot stats')
.setAuthor('Haha yes') .setAuthor('Haha yes')
.addField('Servers', this.client.guilds.cache.size, true) .addField('Servers', this.client.guilds.cache.size, true)

@ -61,7 +61,7 @@ class translateCommand extends Command {
// If it didn't find anything in the dictionary simply send the translation // If it didn't find anything in the dictionary simply send the translation
if (response.def.length == 0) { if (response.def.length == 0) {
const translationEmbed = this.client.util.embed() const translationEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Asked for the following translation:') .setTitle('Asked for the following translation:')
.setURL('https://tech.yandex.com/dictionary/') .setURL('https://tech.yandex.com/dictionary/')
.setAuthor(message.author.username) .setAuthor(message.author.username)
@ -85,7 +85,7 @@ class translateCommand extends Command {
} }
const translationEmbed = this.client.util.embed() const translationEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Asked for the following translation:') .setTitle('Asked for the following translation:')
.setURL('https://tech.yandex.com/dictionary/') .setURL('https://tech.yandex.com/dictionary/')
.setAuthor(message.author.username) .setAuthor(message.author.username)

@ -17,7 +17,7 @@ class UpdootCommand extends Command {
async exec(message) { async exec(message) {
const upDoot = this.client.util.embed() const upDoot = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Vote for my bot') .setTitle('Vote for my bot')
.setAuthor(message.author.username) .setAuthor(message.author.username)
.setDescription('You can vote for my bot if you think the bot is awesome!') .setDescription('You can vote for my bot if you think the bot is awesome!')

@ -32,7 +32,7 @@ class wallpaperCommand extends Command {
}) })
.then(res => { .then(res => {
const wallpaperEmbed = this.client.util.embed() const wallpaperEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Bing wallpaper of the day') .setTitle('Bing wallpaper of the day')
.addField('Copyright', `[${res.copyright}](${res.copyright_link})`) .addField('Copyright', `[${res.copyright}](${res.copyright_link})`)
.setDescription(`[1366](https://bing.biturl.top/?resolution=1366&format=image&mkt=${mkt}) | [1920](https://bing.biturl.top/?resolution=1920&format=image&mkt=${mkt})`) .setDescription(`[1366](https://bing.biturl.top/?resolution=1366&format=image&mkt=${mkt}) | [1920](https://bing.biturl.top/?resolution=1920&format=image&mkt=${mkt})`)

@ -30,7 +30,7 @@ class commandStartedListener extends Listener {
console.log('Gold triggered!'); console.log('Gold triggered!');
this.client.user.setActivity('people buy haha yes gold™', { type: 'WATCHING' }); this.client.user.setActivity('people buy haha yes gold™', { type: 'WATCHING' });
let Embed = this.client.util.embed() let Embed = this.client.util.embed()
.setColor(message.member.displayHexColor) .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Haha yes **gold**') .setTitle('Haha yes **gold**')
.setDescription('To further utilize this command, please visit https://namejeff.xyz/gold') .setDescription('To further utilize this command, please visit https://namejeff.xyz/gold')
.attachFiles(['./asset/img/gold.png']) .attachFiles(['./asset/img/gold.png'])

Loading…
Cancel
Save