From 60e63695578eb9fa3723654e09e3f91b81bbcdbb Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Thu, 9 Feb 2023 12:51:59 +1100 Subject: [PATCH] Add webhook for something else in mind. --- src/client.ts | 5 ++++- src/commands/dev.ts | 7 +++---- src/typings/interfaces.d.ts | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client.ts b/src/client.ts index de93ee5..212cae3 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,4 +1,4 @@ -import Discord, { Client, GatewayIntentBits, Partials } from 'discord.js'; +import Discord, { Client, WebhookClient, GatewayIntentBits, Partials } from 'discord.js'; import fs from 'node:fs'; import timeNames from './timeNames'; import { Punishment, formatTimeOpt, Tokens, Config } from './typings/interfaces'; @@ -187,3 +187,6 @@ export default class TClient extends Client { } } } + +export class WClient extends WebhookClient {tokens: Tokens; constructor(){super({url: tokens.webhook_url})}} +// hi tae, ik you went to look for secret hello msgs in here too. \ No newline at end of file diff --git a/src/commands/dev.ts b/src/commands/dev.ts index 460386f..4a6c107 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -1,9 +1,9 @@ import Discord,{SlashCommandBuilder} from 'discord.js'; -import { Octokit } from '@octokit/rest'; +import {Octokit} from '@octokit/rest'; import {exec} from 'node:child_process'; -import { readFileSync } from 'node:fs'; +import {readFileSync} from 'node:fs'; import * as util from 'node:util'; -import TClient from 'src/client'; +import TClient from '../client'; import path from 'node:path'; const removeUsername = (text: string)=>{ let matchesLeft = true; @@ -117,7 +117,6 @@ export default { `Name: **${currentActivities[0].name}**`, `URL: \`${currentActivities[0].url}\`` ].join('\n')) - break } }, data: new SlashCommandBuilder() diff --git a/src/typings/interfaces.d.ts b/src/typings/interfaces.d.ts index 69ea66f..640a800 100644 --- a/src/typings/interfaces.d.ts +++ b/src/typings/interfaces.d.ts @@ -123,6 +123,7 @@ export interface Tokens { token_beta: string token_toast: string token_tae: string + webhook_url: string } export interface Config { embedColor: ColorResolvable,