master
Matthew 2022-03-22 12:34:15 -04:00
parent 2d788946ab
commit 9a92db91bd
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
2 changed files with 7 additions and 0 deletions

View File

@ -72,6 +72,9 @@ export default class Client extends eris.Client {
Sentry.init({
dsn: 'https://323f6626a7104be7859088750b91abe1@sentry.libraryofcode.org/2',
tracesSampleRate: 0.25,
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
],
});
}

View File

@ -1,6 +1,7 @@
/* eslint-disable no-useless-return */
import { Message, TextChannel, NewsChannel } from 'eris';
import * as Sentry from '@sentry/node';
import * as Tracing from '@sentry/tracing';
import { Client, Event } from '../class';
export default class CommandHandler extends Event {
@ -28,6 +29,9 @@ export default class CommandHandler extends Event {
this.client.util.signale.log(`User '${message.author.username}#${message.author.discriminator}' ran command '${resolved.cmd.name}' in '${message.channel.id}'.`);
try {
const transaction = Sentry.startTransaction({ name: 'command-handler' });
Sentry.configureScope((scope) => {
scope.setSpan(transaction);
});
await resolved.cmd.run(message, resolved.args);
transaction.finish();
} catch (err) {