routing/src/discordParser.ts

46 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-05-23 16:07:33 +02:00
import { Channel, Client } from 'discord.js';
import { isBooleanObject } from 'util/types';
import { ImplementableApi } from './implementableApi';
namespace DiscordParser {
export type Config = ImplementableApi.Config & {
token: string;
};
}
class DiscordParser extends ImplementableApi {
readonly token: string;
readonly channelid: string;
client: Client;
constructor(readonly config: DiscordParser.Config) {
super(config);
this.token = config.token;
// this.settingEvents();
this.client = new Client();
this.instantiateClient();
}
private instantiateClient() {
this.client.login(this.token);
}
public receivedMessage(message: ImplementableApi.Message) {
switch (message.type) {
case 'newEntriesNotify':
default:
break;
}
}
private sendMsg(message: string) {
// this.client.channels.resolveID();
}
private settingEvents(): void {
throw 'empty';
}
}
export { DiscordParser };