Add privacy policy command
This commit is contained in:
@@ -7,6 +7,7 @@ DATABASE_SECRET=
|
||||
LINK_SECRET=super_secret_for_url_discord
|
||||
E621_BASE_URL=https://e621.net
|
||||
E926_BASE_URL=https://e926.net
|
||||
PRIVACY_POLICY_URL=
|
||||
GIT_REPO_BASE_URL=https://github.com/e621ng/e621ng
|
||||
REDIS_URL=localhost:6379
|
||||
PORT=8000
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { ApplicationIntegrationType, ChatInputCommandInteraction, Client, InteractionContextType, MessageFlags, SlashCommandBuilder } from 'discord.js';
|
||||
import { config } from '../config';
|
||||
|
||||
export default {
|
||||
name: 'privacy',
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('privacy')
|
||||
.setDescription('Get a link to the privacy policy.')
|
||||
.setIntegrationTypes(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)
|
||||
.setContexts(InteractionContextType.Guild, InteractionContextType.BotDM),
|
||||
handler: async function (client: Client, interaction: ChatInputCommandInteraction) {
|
||||
await interaction.reply({ content: `You can view my privacy policy here: ${config.PRIVACY_POLICY_URL}`, flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
};
|
||||
+2
-1
@@ -2,7 +2,7 @@ import dotenv from 'dotenv';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const { DISCORD_TOKEN, DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET, DISCORD_GUILD_ID, RELEASE_SECRET, DATABASE_SECRET, LINK_SECRET, E621_BASE_URL, E926_BASE_URL, GIT_REPO_BASE_URL, REDIS_URL, PORT, DEBUG } = process.env;
|
||||
const { DISCORD_TOKEN, DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET, DISCORD_GUILD_ID, RELEASE_SECRET, DATABASE_SECRET, LINK_SECRET, E621_BASE_URL, E926_BASE_URL, PRIVACY_POLICY_URL, GIT_REPO_BASE_URL, REDIS_URL, PORT, DEBUG } = process.env;
|
||||
|
||||
export const config = {
|
||||
DISCORD_TOKEN,
|
||||
@@ -14,6 +14,7 @@ export const config = {
|
||||
LINK_SECRET,
|
||||
E621_BASE_URL,
|
||||
E926_BASE_URL,
|
||||
PRIVACY_POLICY_URL: PRIVACY_POLICY_URL ?? '',
|
||||
GIT_REPO_BASE_URL,
|
||||
PORT: parseInt(PORT as string),
|
||||
REDIS_URL,
|
||||
|
||||
Reference in New Issue
Block a user