Skip to content
This repository was archived by the owner on Nov 19, 2017. It is now read-only.

Commit ff8068e

Browse files
committed
Update to master again
1 parent 325173f commit ff8068e

File tree

16 files changed

+61
-48
lines changed

16 files changed

+61
-48
lines changed

commands/economy/daily-random.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = class DailyRandomCommand extends Command {
2222
}
2323

2424
async run(msg) {
25-
const guild = await msg.guild.fetchMembers();
25+
const guild = await msg.guild.members.fetch();
2626
const member = guild.members.filter(mem => mem.presence.status === 'online' && !mem.user.bot).random();
2727
const received = await Daily.received(msg.author.id);
2828

commands/economy/leaderboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = class MoneyLeaderboardCommand extends Command {
4949
const paginated = util.paginate(JSON.parse(money), page, Math.floor(PAGINATED_ITEMS));
5050
let ranking = PAGINATED_ITEMS * (paginated.page - 1);
5151

52-
for (const user of paginated.items) await this.client.fetchUser(user.userID); // eslint-disable-line
52+
for (const user of paginated.items) await this.client.users.fetch(user.userID); // eslint-disable-line
5353

5454
return msg.embed({
5555
color: 3447003,

commands/info/user-info.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = class UserInfoCommand extends Command {
3232

3333
async run(msg, args) {
3434
const member = args.member || msg.member;
35-
const user = member.user;
35+
const { user } = member;
3636
const usernames = await username.findAll({ where: { userID: user.id } });
3737
return msg.embed({
3838
color: 3447003,

commands/music/play.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = class PlaySongCommand extends Command {
4242

4343
let voiceChannel;
4444
if (!queue) {
45-
voiceChannel = msg.member.voiceChannel;
45+
voiceChannel = msg.member.voiceChannel; // eslint-disable-line
4646
if (!voiceChannel) {
4747
return msg.reply('you aren\'t in a voice channel, ya dingus.');
4848
}
@@ -108,7 +108,7 @@ module.exports = class PlaySongCommand extends Command {
108108
if (!queue) {
109109
queue = {
110110
textChannel: msg.channel,
111-
voiceChannel: voiceChannel,
111+
voiceChannel,
112112
connection: null,
113113
songs: [],
114114
volume: this.client.provider.get(msg.guild.id, 'defaultVolume', DEFAULT_VOLUME)
@@ -176,7 +176,7 @@ module.exports = class PlaySongCommand extends Command {
176176
if (!queue) {
177177
queue = {
178178
textChannel: msg.channel,
179-
voiceChannel: voiceChannel,
179+
voiceChannel,
180180
connection: null,
181181
songs: [],
182182
volume: this.client.provider.get(msg.guild.id, 'defaultVolume', DEFAULT_VOLUME)

commands/music/skip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = class SkipSongCommand extends Command {
6060
const newVote = {
6161
count: 1,
6262
users: [msg.author.id],
63-
queue: queue,
63+
queue,
6464
guild: msg.guild.id,
6565
start: Date.now(),
6666
timeout: null

commands/social/profile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = class ProfileCommand extends Command {
3939

4040
async run(msg, args) {
4141
const user = args.member || msg.member;
42-
const Image = Canvas.Image;
42+
const { Image } = Canvas;
4343
const profile = await UserProfile.findOne({ where: { userID: user.id } });
4444
const personalMessage = profile ? profile.personalMessage : '';
4545
const money = await Currency.getBalance(user.id);

commands/tags/delete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports = class TagDeleteCommand extends Command {
5757

5858
Tag.destroy({ where: { name, guildID: msg.guild.id } });
5959
if (tag.example) {
60-
const messageToDelete = await msg.guild.channels.get(EXAMPLE_CHANNEL).fetchMessage(tag.exampleID);
60+
const messageToDelete = await msg.guild.channels.get(EXAMPLE_CHANNEL).messages.fetch(tag.exampleID);
6161
messageToDelete.delete();
6262
}
6363

commands/util/clean.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = class CleanCommand extends Command {
5858
!== -1;
5959
} else if (filter === 'user') {
6060
if (member) {
61-
const user = member.user;
61+
const { user } = member;
6262
messageFilter = message => message.author.id === user.id;
6363
} else {
6464
return msg.say(`${msg.author}, you have to mention someone.`);
@@ -76,14 +76,14 @@ module.exports = class CleanCommand extends Command {
7676
}
7777

7878
/* eslint-disable no-unused-vars, handle-callback-err */
79-
const messages = await msg.channel.fetchMessages({ limit: limit }).catch(err => null);
79+
const messages = await msg.channel.messages.fetch({ limit }).catch(err => null);
8080
const messagesToDelete = messages.filter(messageFilter);
8181
msg.channel.bulkDelete(messagesToDelete.array().reverse()).catch(err => null);
8282

8383
return null;
8484
}
8585

86-
const messagesToDelete = await msg.channel.fetchMessages({ limit: limit }).catch(err => null);
86+
const messagesToDelete = await msg.channel.messages.fetch({ limit }).catch(err => null);
8787
msg.channel.bulkDelete(messagesToDelete.array().reverse()).catch(err => null);
8888

8989
return null;

commands/util/cybernuke.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = class LaunchCybernukeCommand extends Command {
3838

3939
async run(msg, { age, join }) {
4040
const statusMsg = await msg.reply('Calculating targeting parameters for cybernuke...');
41-
await msg.guild.fetchMembers();
41+
await msg.guild.members.fetch();
4242

4343
const memberCutoff = Date.now() - (join * 60000);
4444
const ageCutoff = Date.now() - (age * 60000);

commands/util/strawpoll.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ module.exports = class FortuneCommand extends Command {
6767
followAllRedirects: true,
6868
headers: { 'User-Agent': `Commando v${version} (https://github.com/WeebDev/Commando/)` },
6969
body: {
70-
title: title,
71-
options: options,
70+
title,
71+
options,
7272
captcha: true
7373
},
7474
json: true

0 commit comments

Comments
 (0)