Initial commit
This commit is contained in:
17
patchnote-publisher.js
Normal file
17
patchnote-publisher.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { data } from "./wwwroot/core/appData.js";
|
||||
import path from "path";
|
||||
import {readFileSync} from "fs";
|
||||
import {Logger} from "./wwwroot/core/logging/logger.js";
|
||||
|
||||
try{
|
||||
const filePath = "./patchnote.md";
|
||||
const fullPath = path.resolve(filePath);
|
||||
const patchNoteContent = readFileSync(fullPath, 'utf8');
|
||||
|
||||
await data.client.login(process.env.DISCORD_TOKEN);
|
||||
await data.sender.send(data.updateChannelID, patchNoteContent);
|
||||
await data.client.destroy();
|
||||
|
||||
} catch (err){
|
||||
await Logger.log("An error occurred while publishing patch note", err);
|
||||
}
|
||||
Reference in New Issue
Block a user