From 13e65ed7ac5d9bc53a03eb163d9cb02fc43e9e0c Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 2 Jun 2022 16:24:33 +0100 Subject: [PATCH] automatically set starboard channel topic --- src/database/settings.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/database/settings.ts b/src/database/settings.ts index 5210523..a164683 100644 --- a/src/database/settings.ts +++ b/src/database/settings.ts @@ -1,5 +1,7 @@ import { Prisma, Setting } from "@prisma/client"; +import { TextChannel } from "discord.js"; import { getClient } from "."; +import { getSpecialChannel } from "./channels"; /** * Get all settings for a specific guild @@ -45,4 +47,12 @@ export const setSetting = async ( }, }); } + + const starboardChannel = (await getSpecialChannel( + guildId, + "starboard" + )) as TextChannel; + starboardChannel.setTopic( + `a message requires ${settings.starboardThreshold} stars to make it to the starboard.` + ); };