Files
outline/plugins/discord/server/env.ts
Sebastian Pietschner a9f1086422 Enhanced Discord Support (#7005)
* Add Discord Provider Prototype

* Add Discord Logo

* Add Plugin to Plugin Manager

* fixed discord auth support and added icon

* add csv role verification

* grab discord server icon and test server id and roles

* subdomain derived from server name

* use discord server specific nickname if available

* Cleanup and comment

* move discord api types to dev deps

* cleanup of server vs default params

* remove commented out lines

* revert envv.development

* revert in vscode

* update yarn lock

* add gif support for discord server icon

* add comment with docs link

* add env section for discord

* fix errors and clarify env

* add new cannot use without

* fix suggestions
2024-06-16 07:04:25 -07:00

36 lines
1018 B
TypeScript

import { IsOptional } from "class-validator";
import { Environment } from "@server/env";
import environment from "@server/utils/environment";
import { CannotUseWithout } from "@server/utils/validators";
class DiscordPluginEnvironment extends Environment {
/**
* Discord OAuth2 client credentials. To enable authentication with Discord.
*/
@IsOptional()
@CannotUseWithout("DISCORD_CLIENT_ID")
public DISCORD_CLIENT_ID = this.toOptionalString(
environment.DISCORD_CLIENT_ID
);
@IsOptional()
@CannotUseWithout("DISCORD_CLIENT_SECRET")
public DISCORD_CLIENT_SECRET = this.toOptionalString(
environment.DISCORD_CLIENT_SECRET
);
@IsOptional()
@CannotUseWithout("DISCORD_CLIENT_SECRET")
public DISCORD_SERVER_ID = this.toOptionalString(
environment.DISCORD_SERVER_ID
);
@CannotUseWithout("DISCORD_SERVER_ID")
@IsOptional()
public DISCORD_SERVER_ROLES = this.toOptionalCommaList(
environment.DISCORD_SERVER_ROLES
);
}
export default new DiscordPluginEnvironment();