From a1ab06dcfccef90192b90910aecdddbc505eca00 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 26 Oct 2021 22:20:52 -0400 Subject: sentry stuff --- src/lib/common/Sentry.ts | 12 ++ src/lib/extensions/discord-akairo/BushClient.ts | 12 +- src/lib/extensions/global.d.ts | 1 + src/lib/utils/BushConstants.ts | 142 ++++++++++++------------ src/lib/utils/Config.ts | 1 + 5 files changed, 96 insertions(+), 72 deletions(-) create mode 100644 src/lib/common/Sentry.ts (limited to 'src/lib') diff --git a/src/lib/common/Sentry.ts b/src/lib/common/Sentry.ts new file mode 100644 index 0000000..2040536 --- /dev/null +++ b/src/lib/common/Sentry.ts @@ -0,0 +1,12 @@ +import * as SentryNode from '@sentry/node'; +import config from './../../config/options'; + +export class Sentry { + public constructor() { + SentryNode.init({ + dsn: config.credentials.sentryDsn, + environment: config.environment, + tracesSampleRate: 1.0 + }); + } +} diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 32f43be..4954d8e 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -1,4 +1,5 @@ -import { AkairoClient, ContextMenuCommandHandler } from 'discord-akairo'; +import * as Sentry from '@sentry/node'; +import { AkairoClient, ContextMenuCommandHandler, version as akairoVersion } from 'discord-akairo'; import { Awaitable, Collection, @@ -13,6 +14,7 @@ import { ReplyMessageOptions, Snowflake, Structures, + version as discordJsVersion, WebhookEditMessageOptions } from 'discord.js'; //@ts-ignore: no typings @@ -152,6 +154,7 @@ export class BushClient extends AkairoClient( event: K, @@ -322,6 +325,13 @@ export class BushClient extends AkairoClient>.`, false); + // loads all the handlers const loaders = { commands: this.commandHandler, diff --git a/src/lib/extensions/global.d.ts b/src/lib/extensions/global.d.ts index e10db0a..5274fd2 100644 --- a/src/lib/extensions/global.d.ts +++ b/src/lib/extensions/global.d.ts @@ -4,4 +4,5 @@ import { BushClientUtil } from './discord-akairo/BushClientUtil'; declare global { var client: BushClient; var util: BushClientUtil; + var __rootdir__: string; } diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index 64208a1..a4b3108 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -1,76 +1,5 @@ import { Constants, ConstantsColors } from 'discord.js'; -interface bushColors { - default: '#1FD8F1'; - error: '#EF4947'; - warn: '#FEBA12'; - success: '#3BB681'; - info: '#3B78FF'; - red: '#ff0000'; - blue: '#0055ff'; - aqua: '#00bbff'; - purple: '#8400ff'; - blurple: '#5440cd'; - newBlurple: '#5865f2'; - pink: '#ff00e6'; - green: '#00ff1e'; - darkGreen: '#008f11'; - gold: '#b59400'; - yellow: '#ffff00'; - white: '#ffffff'; - gray: '#a6a6a6'; - lightGray: '#cfcfcf'; - darkGray: '#7a7a7a'; - black: '#000000'; - orange: '#E86100'; - discord: ConstantsColors; -} - -export type PronounCode = - | 'unspecified' - | 'hh' - | 'hi' - | 'hs' - | 'ht' - | 'ih' - | 'ii' - | 'is' - | 'it' - | 'shh' - | 'sh' - | 'si' - | 'st' - | 'th' - | 'ti' - | 'ts' - | 'tt' - | 'any' - | 'other' - | 'ask' - | 'avoid'; -export type Pronoun = - | 'Unspecified' - | 'He/Him' - | 'He/It' - | 'He/She' - | 'He/They' - | 'It/Him' - | 'It/Its' - | 'It/She' - | 'It/They' - | 'She/He' - | 'She/Her' - | 'She/It' - | 'She/They' - | 'They/He' - | 'They/It' - | 'They/She' - | 'They/Them' - | 'Any pronouns' - | 'Other pronouns' - | 'Ask me my pronouns' - | 'Avoid pronouns, use my name'; - const rawCapeUrl = 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/'; export class BushConstants { public static emojis = { @@ -564,3 +493,74 @@ export class BushConstants { { name: 'No Support', id: '790247359824396319' } ]; } + +interface bushColors { + default: '#1FD8F1'; + error: '#EF4947'; + warn: '#FEBA12'; + success: '#3BB681'; + info: '#3B78FF'; + red: '#ff0000'; + blue: '#0055ff'; + aqua: '#00bbff'; + purple: '#8400ff'; + blurple: '#5440cd'; + newBlurple: '#5865f2'; + pink: '#ff00e6'; + green: '#00ff1e'; + darkGreen: '#008f11'; + gold: '#b59400'; + yellow: '#ffff00'; + white: '#ffffff'; + gray: '#a6a6a6'; + lightGray: '#cfcfcf'; + darkGray: '#7a7a7a'; + black: '#000000'; + orange: '#E86100'; + discord: ConstantsColors; +} + +export type PronounCode = + | 'unspecified' + | 'hh' + | 'hi' + | 'hs' + | 'ht' + | 'ih' + | 'ii' + | 'is' + | 'it' + | 'shh' + | 'sh' + | 'si' + | 'st' + | 'th' + | 'ti' + | 'ts' + | 'tt' + | 'any' + | 'other' + | 'ask' + | 'avoid'; +export type Pronoun = + | 'Unspecified' + | 'He/Him' + | 'He/It' + | 'He/She' + | 'He/They' + | 'It/Him' + | 'It/Its' + | 'It/She' + | 'It/They' + | 'She/He' + | 'She/Her' + | 'She/It' + | 'She/They' + | 'They/He' + | 'They/It' + | 'They/She' + | 'They/Them' + | 'Any pronouns' + | 'Other pronouns' + | 'Ask me my pronouns' + | 'Avoid pronouns, use my name'; diff --git a/src/lib/utils/Config.ts b/src/lib/utils/Config.ts index 393dd44..81e3a85 100644 --- a/src/lib/utils/Config.ts +++ b/src/lib/utils/Config.ts @@ -61,6 +61,7 @@ interface Credentials { wolframAlphaAppId: string; imgurClientId: string; imgurClientSecret: string; + sentryDsn: string; } type Environment = 'production' | 'beta' | 'development'; -- cgit