Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #291 from BanklessDAO/hotfix/2.5.2
Browse files Browse the repository at this point in the history
Hotfix/2.5.2
  • Loading branch information
Joshua Alexander authored Jan 9, 2022
2 parents 50f9d86 + 962cc6f commit d169800
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 315 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.5.2-RELEASE

1. Address sentry.io issues 2022-01-08
- add type guards to messageCreate sentry method
- handle failed to send poap message edge case
- upgrade discord.js -> 13.5.1
- upgrade slash-create -> 5.0.2

## 2.5.1-RELEASE (2022-01-07)

1. Manually assign DSN, reference bot for gm message, add discord server on event
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "degen-tbd",
"version": "2.5.1",
"version": "2.5.2",
"description": "Administrative and Utilitarian bot for the Bankless Discord Server.",
"main": "app.js",
"private": true,
Expand Down Expand Up @@ -43,15 +43,14 @@
"csv-parse": "^5.0.3",
"csv-stringify": "^6.0.3",
"dayjs": "^1.10.7",
"discord.js": "^13.3.1",
"discord.js-captcha": "^2.2.2",
"discord.js": "^13.5.1",
"dotenv": "^10.0.0",
"form-data": "^4.0.0",
"lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.5.0",
"mongodb": "^3.6.9",
"p-queue": "^6.6.2",
"slash-create": "^4.3.1",
"slash-create": "^5.0.2",
"twitter-api-v2": "^1.6.5",
"uuid": "^8.3.2"
},
Expand Down
5 changes: 4 additions & 1 deletion src/app/service/poap/OptInPOAP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ const OptInPOAP = async (user: User, dmChannel: DMChannel): Promise<void> => {
message.edit({ content: 'No problem!', components: [] });
}
}).catch(error => {
message.edit({ content: 'Timeout reached, please reach out to us with any questions!', components: [] });
message.edit({ content: 'Timeout reached, please reach out to us with any questions!', components: [] }).catch(e => {
Log.warn(e);
return;
});
Log.debug(error?.message);
});

Expand Down
5 changes: 3 additions & 2 deletions src/app/service/poap/start/StartChannelFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import {
GuildMember,
StageChannel,
VoiceChannel,
GuildChannel, TextChannel,
GuildChannel,
TextChannel,
Collection,
} from 'discord.js';
import {
Collection as CollectionMongo,
} from 'mongodb';
import { Collection } from '@discordjs/collection';
import { MessageEmbedOptions as MessageEmbedOptionsSlash } from 'slash-create/lib/structures/message';
import ValidationError from '../../../errors/ValidationError';
const StartChannelFlow = async (
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/Log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const LogUtils = {
},
});
} catch (e) {
Log.error(message);
Log.warn(message);
}
},
};
Expand Down
10 changes: 9 additions & 1 deletion src/app/utils/POAPUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,15 @@ const POAPUtils = {
results.failedToSend++;
});
if (!message) {
throw new Error('failed to send message');
Log.warn('failed to send message');
failedPOAPsList.push({
discordUserId: participant.discordUserId,
discordUserTag: participant.discordUserTag,
poapLink: poapLink,
});
results.failedToSend++;
i++;
continue;
}
message.awaitMessageComponent({
filter: args => (args.customId == buttonIds.POAP_REPORT_SPAM && args.user.id == participant.discordUserId),
Expand Down
40 changes: 28 additions & 12 deletions src/app/utils/SentryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,26 @@ export function command(target: SlashCommand, propertyKey: string, descriptor: P

scope.setSpan(transaction);

const userId = (ctx.member?.id) ? ctx.member?.id : '';
const userName = (ctx.member?.user?.username) ? ctx.member?.user?.username : '';
const discriminator = (ctx.member?.user?.discriminator) ? ctx.member?.user?.discriminator : '';
const nickName = (ctx.member?.nick) ? ctx.member?.nick : '';

scope.setUser({
id: ctx.member?.id,
username: ctx.member?.user.username,
discriminator: ctx.member?.user.discriminator,
nickname: ctx.member?.nick,
id: userId,
username: userName,
discriminator: discriminator,
nickname: nickName,
});

const guildId = (ctx.guildID) ? ctx.guildID : '';
const channelId = (ctx.channelID) ? ctx.channelID : '';
const commandName = (ctx.commandName) ? ctx.commandName : '';

scope.setTags({
guild: ctx.guildID,
channelId: ctx.channelID,
commandName: ctx.commandName,
guild: guildId,
channelId: channelId,
commandName: commandName,
});

try {
Expand Down Expand Up @@ -68,15 +77,22 @@ export function message_event(target: DiscordEvent, propertyKey: string, descrip

scope.setSpan(transaction);

const authorId = (message.author?.id?.toString()) ? message.author?.id?.toString() : '';
const authorUserName = (message.author?.username) ? message.author?.username : '';
const discriminator = (message.author?.discriminator) ? message.author?.discriminator : '';

scope.setUser({
id: message.author.id.toString(),
username: message.author.username,
discriminator: message.author.discriminator,
id: authorId,
username: authorUserName,
discriminator: discriminator,
});

const guildId = (message.guild?.id?.toString()) ? message.guild?.id?.toString() : '';
const channelId = message.channel?.id?.toString() ? message.channel?.id?.toString() : '';

scope.setTags({
guild: message.guild?.id.toString(),
channelId: message.channel.id.toString(),
guild: guildId,
channelId: channelId,
event: 'messageCreate',
});

Expand Down
Loading

0 comments on commit d169800

Please sign in to comment.