Upload files to "/"
This commit is contained in:
parent
d27a858df3
commit
85419ab630
2 changed files with 128 additions and 0 deletions
29
log.js
Normal file
29
log.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
import fs from "fs";
|
||||
|
||||
export default function (file, message, from, msg) {
|
||||
try {
|
||||
fs.appendFileSync(
|
||||
`../pepperbot/logs/${file}`,
|
||||
`AT: ${Date()}
|
||||
SCRIPT: ${from}
|
||||
IN: <#${message.channel.id}>
|
||||
MESSAGE CONTENT: ${message.content}
|
||||
ADDITIONAL INFORMATION: ${msg}
|
||||
\n`
|
||||
);
|
||||
} catch (err) {
|
||||
try {
|
||||
fs.appendFileSync(
|
||||
`../pepperbot/logs/${file}`,
|
||||
`AT: ${Date()}
|
||||
SCRIPT: ${from}
|
||||
ADDITIONAL INFORMATION: ${msg}
|
||||
\n`
|
||||
);
|
||||
} catch (err) {console.log(err)}
|
||||
}
|
||||
}
|
||||
|
||||
// TEMPLATE:
|
||||
// import { default as log } from "../util/log.js"
|
||||
// log('failed.log', message, import.meta.url, `additional content`)
|
Loading…
Add table
Add a link
Reference in a new issue