Skip to content

Community creation via environment variable #808

@Matobi98

Description

@Matobi98

Re-enable community creation via environment variable

Background

The /community command that triggers the community creation wizard
(COMMUNITY_WIZARD_SCENE_ID) is currently commented out in
bot/modules/community/index.ts. The wizard itself is fully implemented in
scenes.ts, but there is no way for users to invoke it.

Proposed solution

Introduce a COMMUNITY_CREATION_ENABLED environment variable (default: false)
that controls whether the /community command is registered at bot startup.

Behavior:

  • COMMUNITY_CREATION_ENABLED=false (default) — /community is not registered;
    community creation is disabled
  • COMMUNITY_CREATION_ENABLED=true/community is registered and users can
    create communities through the existing wizard flow

Implementation

  1. Add COMMUNITY_CREATION_ENABLED=false to .env-sample with a comment explaining it
  2. In bot/modules/community/index.ts, replace the commented-out block with a
    conditional registration:
if (process.env.COMMUNITY_CREATION_ENABLED === 'true') {
  bot.command('community', userMiddleware, async ctx => {
    await ctx.scene.enter('COMMUNITY_WIZARD_SCENE_ID', { bot, user: ctx.user });
  });
}

3. No changes needed to the wizard scene itself  it is already complete

Why default to false?

Community creation should be opt-in at the instance level. Bot operators may
want to run a closed instance where only pre-existing communities are allowed,
without exposing the creation flow to all users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions