Make these command work in dm

This commit is contained in:
loicbersier 2020-03-22 21:54:19 +01:00
parent f282b415c9
commit 378be5da88
19 changed files with 24 additions and 24 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -30,7 +30,7 @@ class aboutCommand extends Command {
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())
.setTitle('About me')
.setDescription(description)

View file

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

View file

@ -16,7 +16,7 @@ class donateCommand extends Command {
async exec(message) {
const Embed = this.client.util.embed()
.setColor(message.member.displayHexColor)
.setColor(message.member ? message.member.displayHexColor : 'NAVY')
.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``');

View file

@ -52,14 +52,14 @@ class DownloadCommand extends Command {
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)
.setDescription(args.caption)
.setFooter(`You can get the original video by clicking on the "downloaded by ${message.author.username}" message!`);
let compressEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor)
.setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('This one will need compression!')
.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!');

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -32,7 +32,7 @@ class wallpaperCommand extends Command {
})
.then(res => {
const wallpaperEmbed = this.client.util.embed()
.setColor(message.member.displayHexColor)
.setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle('Bing wallpaper of the day')
.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})`)

View file

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