Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhoDit committed Jul 19, 2020
2 parents 7cf7046 + 6965203 commit d9e0e40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/commands/reply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MessageFile } from 'eris';
export default new Command('reply', async (caller, cmd, userDB) => {
if (!cmd.args[0] && cmd.msg.attachments.length === 0) return caller.utils.discord.createMessage(cmd.channel.id, 'You must provide a reply.');
const files: MessageFile[] = [];
if (cmd.msg.attachments.length > 0) for (const file of cmd.msg.attachments) Axios.get<Buffer>(file.url, { responseType: 'arraybuffer' })
if (cmd.msg.attachments.length > 0) for (const file of cmd.msg.attachments) await Axios.get<Buffer>(file.url, { responseType: 'arraybuffer' })
.then((response) => files.push({ file: response.data, name: file.filename }))
.catch(() => false);

Expand Down
2 changes: 1 addition & 1 deletion src/events/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async (caller: Caller, msg: Message): Promise<unknown> => {
if (blacklist?.includes(msg.author.id)) return;

const files: MessageFile[] = [];
if (msg.attachments.length > 0) for (const file of msg.attachments) Axios.get<Buffer>(file.url, { responseType: 'arraybuffer' })
if (msg.attachments.length > 0) for (const file of msg.attachments) await Axios.get<Buffer>(file.url, { responseType: 'arraybuffer' })
.then((response) => files.push({ file: response.data, name: file.filename }))
.catch(() => false);

Expand Down

0 comments on commit d9e0e40

Please sign in to comment.