This repository has been archived by the owner on Oct 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24afc70
commit 7cdbab3
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import process from "node:process"; | ||
import MeteoriumClient from "../classes/client.js"; | ||
import { IntentsBitField } from "discord.js"; | ||
import { GuildFeatures } from "@prisma/client"; | ||
|
||
const client = new MeteoriumClient({ | ||
intents: [IntentsBitField.Flags.Guilds], | ||
}); | ||
const egfNS = client.logging.registerNamespace("InstallUtils").registerNamespace("EnableGuildFeature"); | ||
await client.login(); | ||
|
||
const guildId = process.env.METEORIUM_EGF_GUILDID; | ||
const feature = GuildFeatures[process.env.METEORIUM_EGF_FEATURENAME as "Moderation"]; | ||
if (guildId && feature) await client.guildFeatures.enableFeature(guildId, feature); | ||
else egfNS.error(`Configuration is incorrect, detected:\nGuild id: ${guildId}\nFeature: ${feature}`); | ||
|
||
await client.destroy(); | ||
|
||
egfNS.info("Done"); | ||
process.exit(0); |