Initial commit
This commit is contained in:
52
wwwroot/core/appData.js
Normal file
52
wwwroot/core/appData.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import 'dotenv/config';
|
||||
import {Client, GatewayIntentBits} from "discord.js";
|
||||
import {MessageSender} from "./base/MessageSender.js";
|
||||
import {InstagramTokenManager} from "./instagram/instagramTokenManager.js";
|
||||
import {TikTokTokenManager} from "./tiktok/tiktokTokenManager.js";
|
||||
import JsonManager from "./utils/jsonManager.js";
|
||||
import {InstagramPoller} from "./instagram/instagramPoller.js";
|
||||
import {UsersToken} from "./usersToken.js";
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.MessageContent,
|
||||
GatewayIntentBits.GuildMembers,
|
||||
]
|
||||
});
|
||||
|
||||
const sender = new MessageSender(client);
|
||||
|
||||
const instagramID = process.env.INSTAGRAM_CLIENT_ID;
|
||||
const instagramSecret = process.env.INSTAGRAM_CLIENT_SECRET;
|
||||
|
||||
const updateChannelID = process.env.BOT_UPDATE_CHANNEL_ID;
|
||||
const socialChannelID = process.env.SOCIAL_CHANNEL_ID
|
||||
|
||||
const filePath = ".instagram_client_tokens.json";
|
||||
|
||||
const usersToken = new UsersToken(filePath)
|
||||
|
||||
const instagramTokenManager = new InstagramTokenManager(
|
||||
{clientID : instagramID, clientSecret : instagramSecret, usersToken : usersToken}
|
||||
);
|
||||
|
||||
const instagramPoller = new InstagramPoller(process.env.INSTAGRAM_POST_LIST, process.env.INSTAGRAM_POST_DETAILS, instagramTokenManager);
|
||||
|
||||
export const data = {
|
||||
client,
|
||||
sender,
|
||||
instagramPoller,
|
||||
updateChannelID,
|
||||
socialChannelID,
|
||||
instagramTokenManager,
|
||||
//tiktokTokenManager
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
const tiktokTokenManager = new TikTokTokenManager(
|
||||
{filepath : ".tiktok_client_tokens.json", clientKey : "", clientSecret : ""}
|
||||
);
|
||||
*/
|
||||
Reference in New Issue
Block a user