From c0c6ccc1371204a6c4f5af0ed37789bcf4c7503d Mon Sep 17 00:00:00 2001 From: Bram Borggreve Date: Sat, 16 Dec 2023 16:47:05 +0000 Subject: [PATCH] feat: add verify command with link to the Web UI --- .../discord/data-access/src/lib/commands/index.ts | 2 ++ .../src/lib/commands/verify.command.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 libs/api/discord/data-access/src/lib/commands/verify.command.ts diff --git a/libs/api/discord/data-access/src/lib/commands/index.ts b/libs/api/discord/data-access/src/lib/commands/index.ts index 6a21f30..d22aac1 100644 --- a/libs/api/discord/data-access/src/lib/commands/index.ts +++ b/libs/api/discord/data-access/src/lib/commands/index.ts @@ -5,6 +5,7 @@ import { FindDiscordIdentityCommand } from './find-discord.command' import { FindSolanaIdentityCommand } from './find-solana.command' import { PingCommand } from './ping.command' import { SyncCommand } from './sync.command' +import { VerifyCommand } from './verify.command' import { WhoamiCommand } from './whoami.command' export const commands = [ @@ -15,5 +16,6 @@ export const commands = [ FindDiscordIdentityCommand, PingCommand, SyncCommand, + VerifyCommand, WhoamiCommand, ] diff --git a/libs/api/discord/data-access/src/lib/commands/verify.command.ts b/libs/api/discord/data-access/src/lib/commands/verify.command.ts new file mode 100644 index 0000000..7d4e0b2 --- /dev/null +++ b/libs/api/discord/data-access/src/lib/commands/verify.command.ts @@ -0,0 +1,15 @@ +import { Injectable } from '@nestjs/common' +import { ApiCoreService } from '@pubkey-link/api/core/data-access' +import { Context, SlashCommand, SlashCommandContext } from 'necord' + +@Injectable() +export class VerifyCommand { + constructor(private readonly core: ApiCoreService) {} + + @SlashCommand({ name: 'verify', description: 'Verify Discord and Solana identities' }) + async verify(@Context() [interaction]: SlashCommandContext) { + await interaction.reply(`Visit ${this.core.config.webUrl} to verify your Discord account and link Solana wallets.`) + + return + } +}