From 5dd5a73dfc16d03ed56b2519270de733423c68b3 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 13 Sep 2019 19:06:19 +0200 Subject: [PATCH] use os.tmp() to get tmp dir instead of /tmp/ --- commands/utility/seetag.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/utility/seetag.js b/commands/utility/seetag.js index cacfbf4d..76c5765d 100644 --- a/commands/utility/seetag.js +++ b/commands/utility/seetag.js @@ -1,6 +1,7 @@ const { Command } = require('discord-akairo'); const Tag = require('../../models').Tag; const fs = require('fs'); +const os = require('os'); const { MessageEmbed } = require('discord.js'); @@ -60,9 +61,9 @@ class seetagCommand extends Command { tagList.forEach(tag => { tagArray.push(tag.dataValues); }); - fs.writeFile('/tmp/tagslist.txt',JSON.stringify(tagArray, null, 2), function(err) { + fs.writeFile(`${os.tmpdir()}/tagslist.txt`,JSON.stringify(tagArray, null, 2), function(err) { if (err) return console.error(err); - return message.channel.send('Here are your tags', {files: ['/tmp/tagslist.txt']}); + return message.channel.send('Here are your tags', {files: [`${os.tmpdir()}/tagslist.txt`]}); }); } else { let tagList = await Tag.findAll({attributes: ['trigger'], where: {serverID: message.guild.id}});