From 828fab16b2bbc73a7c3be62f52ca18de09cfdb35 Mon Sep 17 00:00:00 2001 From: Koffe <78866073+ThatKoffe@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:38:38 +0100 Subject: [PATCH 1/5] Open new tab for vote button --- src/routes/bots/[bot_id]/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/bots/[bot_id]/+page.svelte b/src/routes/bots/[bot_id]/+page.svelte index 162e3d1..80785ad 100644 --- a/src/routes/bots/[bot_id]/+page.svelte +++ b/src/routes/bots/[bot_id]/+page.svelte @@ -290,7 +290,7 @@ { - goto(`/bots/${data?.bot?.id}/vote`); + window.open(`/bots/${data?.bot?.id}/vote`, '_blank'); }} color="primary" extended From 91d8b929d47dc898a988aa60b2955345a1fdabee Mon Sep 17 00:00:00 2001 From: Koffe <78866073+ThatKoffe@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:44:06 +0100 Subject: [PATCH 2/5] Redesign botCard --- src/lib/components/cards/botCard.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/cards/botCard.svelte b/src/lib/components/cards/botCard.svelte index 80b3d91..280c9b2 100644 --- a/src/lib/components/cards/botCard.svelte +++ b/src/lib/components/cards/botCard.svelte @@ -67,10 +67,10 @@ } .card-footer { - border: 1px solid rgba(255, 255, 255, 0.1); - padding: 0px 6px; - border-radius: 5px; - background-color: var(--mdc-theme-background); + border-top: 1px solid rgba(255, 255, 255, 0.1); + /* padding: 0px 6px; + border-radius: 5px; */ + /* background-color: var(--mdc-theme-background); */ } .top-data { From fff777298062c78b9cb0789e606c6fb031b549b6 Mon Sep 17 00:00:00 2001 From: Koffe <78866073+ThatKoffe@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:44:10 +0100 Subject: [PATCH 3/5] Update colors.ts --- src/lib/server/colors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/server/colors.ts b/src/lib/server/colors.ts index 55b17f0..b9befa1 100644 --- a/src/lib/server/colors.ts +++ b/src/lib/server/colors.ts @@ -1,5 +1,5 @@ export enum InternalColors { - Green = '#0B8B7C', + Green = '#1abc9c', Purple = '#9B59B6', Red = '#E74C3C', Blurple = '#454FBF', From f040c80ed94ee82b64e95c9f40d554016e063644 Mon Sep 17 00:00:00 2001 From: Koffe <78866073+ThatKoffe@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:44:22 +0100 Subject: [PATCH 4/5] Add log when user votes for bot --- src/routes/api/v1/bots/[bot_id]/vote/+server.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/routes/api/v1/bots/[bot_id]/vote/+server.ts b/src/routes/api/v1/bots/[bot_id]/vote/+server.ts index 709e120..30e573d 100644 --- a/src/routes/api/v1/bots/[bot_id]/vote/+server.ts +++ b/src/routes/api/v1/bots/[bot_id]/vote/+server.ts @@ -3,6 +3,12 @@ import { json } from '@sveltejs/kit'; import { _voteTimeout } from '../../../../../bots/[bot_id]/vote/+page.server'; import { BotApprovalStatus } from '@prisma/client'; import snowflake from '$lib/server/snowflake'; +import ChannelLog from '$lib/server/discord/channelLog'; +import { APP_URL } from '$env/static/private'; +import SafeBot from '$lib/structures/bot'; +import { InternalColors } from '$lib/server/colors'; + +const channelLog = new ChannelLog(); export async function POST({ locals, params }) { const bot = await prisma.bot.findUnique({ @@ -56,5 +62,15 @@ export async function POST({ locals, params }) { } }); + const safeBot = SafeBot(bot); + + await channelLog.sendLog( + `Bot voted for`, + `Bot [${safeBot?.username}](${APP_URL}/bots/${bot?.id}) was voted for by <@!${locals?.actor + ?.id}>, now at ${bot?.vote_count + 1} votes`, + null, + InternalColors.Green + ); + return json({ message: 'OK' }); } From 7478ba6a1a5e0cb7f727a5ae9d6fae260676702e Mon Sep 17 00:00:00 2001 From: Koffe <78866073+ThatKoffe@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:45:01 +0100 Subject: [PATCH 5/5] Remove botcard action seperator --- src/lib/components/cards/botCard.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/cards/botCard.svelte b/src/lib/components/cards/botCard.svelte index 280c9b2..4f32ad2 100644 --- a/src/lib/components/cards/botCard.svelte +++ b/src/lib/components/cards/botCard.svelte @@ -67,7 +67,7 @@ } .card-footer { - border-top: 1px solid rgba(255, 255, 255, 0.1); + /* border-top: 1px solid rgba(255, 255, 255, 0.1); */ /* padding: 0px 6px; border-radius: 5px; */ /* background-color: var(--mdc-theme-background); */