aboutsummaryrefslogtreecommitdiff
path: root/commands/mod/log.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands/mod/log.js')
-rw-r--r--commands/mod/log.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/commands/mod/log.js b/commands/mod/log.js
new file mode 100644
index 0000000..170f48e
--- /dev/null
+++ b/commands/mod/log.js
@@ -0,0 +1,27 @@
+const Discord = require("discord.js")
+const settings = require("../../src/settings")
+const fs = require('fs')
+const {upload_limit} = require("../../src/util")
+const path = require('path')
+let config_loc = __filename+".json"
+let config = JSON.parse(fs.readFileSync(config_loc))
+module.exports = {
+ name: "log",
+ command: ["log"],
+ mod_only:true,
+ config:config,
+ config_loc:config_loc,
+ main(client,Discord,message,args) {
+ this.exec(message)
+ },
+ s_main(client,Discord,interaction){
+ this.exec(interaction)
+ },
+ exec(message){
+ let filename = path.join(__dirname+"../../../log")
+ let stats = fs.statSync(filename)
+ if(stats.size / (1024*1024) > upload_limit(message.guild))
+ return message.reply("file too large:( file is "+stats.size / (1024*1024)+"mb")
+ message.reply({files:[filename]})
+ }
+}; \ No newline at end of file