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

Commit

Permalink
add claim button
Browse files Browse the repository at this point in the history
  • Loading branch information
SlinkyPotato committed Jan 7, 2022
1 parent ba57a51 commit debc572
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/events/Ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class implements DiscordEvent {

async execute(client: Client): Promise<any> {
try {
Log.info('Starting up degen-tbd');
Log.info(`Starting up ${constants.APP_NAME}`);

if (client.user) {
Log.debug(`setting status: ${process.env.DISCORD_BOT_ACTIVITY}`);
Expand All @@ -30,7 +30,7 @@ export default class implements DiscordEvent {
await POAPService.runAutoEndSetup(client, constants.PLATFORM_TYPE_TWITTER).catch(Log.error);
await POAPService.clearExpiredPOAPs();

Log.info('degen-tbd is ready!');
Log.info(`${constants.APP_NAME} is ready!`);
} catch (e) {
LogUtils.logError('Error processing event ready', e);
}
Expand All @@ -46,7 +46,7 @@ const updateActiveDiscordServers = async (client: Client, db: Db) => {
},
});
for await (const guild of guilds.values()) {
Log.info(`DEGEN active for: ${guild.id}, ${guild.name}`);
Log.info(`${constants.APP_NAME} active for: ${guild.id}, ${guild.name}`);
await discordServerCollection.updateOne({
serverId: guild.id.toString(),
}, {
Expand Down
4 changes: 4 additions & 0 deletions src/app/utils/POAPUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ const POAPUtils = {
content: `Thank you for participating in the ${event} from ${guildName}! Here is your POAP: ${poapLink}`,
components: [
new MessageActionRow().addComponents(
new MessageButton()
.setLabel('Claim')
.setURL(`${poapLink}`)
.setStyle('LINK'),
new MessageButton()
.setCustomId(buttonIds.POAP_REPORT_SPAM)
.setLabel('Report')
Expand Down
1 change: 1 addition & 0 deletions src/app/utils/ServiceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ const ServiceUtils = {
isDMEnabledForUser: async (member: GuildMember): Promise<boolean> => {
const db: Db = await MongoDbUtils.connect(constants.DB_NAME_DEGEN);
const dbUsers: MongoCollection<DiscordUserCollection> = await db.collection(constants.DB_COLLECTION_DISCORD_USERS);
await member.fetch();
const result: DiscordUserCollection | null = await dbUsers.findOne({
userId: member.id.toString(),
});
Expand Down

0 comments on commit debc572

Please sign in to comment.