client.ts 682 B

12345678910111213141516171819202122232425
  1. import { Client, ClientUser } from "discord.js";
  2. import { XenforoClient } from "./xenforo";
  3. export const FORUMS_DOMAIN = "https://custommaid3d2.com";
  4. export class BotClient {
  5. public bot = new Client();
  6. public forum = new XenforoClient(`${FORUMS_DOMAIN}/api`, process.env.FORUM_API_KEY ?? "");
  7. get botUser(): ClientUser {
  8. if (!this.bot.user)
  9. throw new Error("No bot user detected!");
  10. return this.bot.user;
  11. }
  12. get usernameMention(): string {
  13. return `<@${this.botUser.id}>`;
  14. }
  15. get nameMention(): string {
  16. return `<@!${this.botUser.id}>`;
  17. }
  18. }
  19. export const client = new BotClient();