1234567891011121314151617181920212223242526272829 |
- import { Client, ClientUser, Util } from "discord.js";
- import { XenforoClient } from "./xenforo";
- export const FORUMS_DOMAIN = "https://custommaid3d2.com";
- export class BotClient {
- public bot = new Client();
- public forum = new XenforoClient(`${FORUMS_DOMAIN}/api`, process.env.FORUM_API_KEY ?? "");
- get botUser(): ClientUser {
- if (!this.bot.user)
- throw new Error("No bot user detected!");
- return this.bot.user;
- }
- get usernameMention(): string {
- return `<@${this.botUser.id}>`;
- }
- get nameMention(): string {
- return `<@!${this.botUser.id}>`;
- }
- get cleanMention(): string {
- return Util.removeMentions(`@${client.botUser.username}`);
- }
- }
- export const client = new BotClient();
|