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
- Add
COMMUNITY_CREATION_ENABLED=false to .env-sample with a comment explaining it
- 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.
Re-enable community creation via environment variable
Background
The
/communitycommand that triggers the community creation wizard(
COMMUNITY_WIZARD_SCENE_ID) is currently commented out inbot/modules/community/index.ts. The wizard itself is fully implemented inscenes.ts, but there is no way for users to invoke it.Proposed solution
Introduce a
COMMUNITY_CREATION_ENABLEDenvironment variable (default:false)that controls whether the
/communitycommand is registered at bot startup.Behavior:
COMMUNITY_CREATION_ENABLED=false(default) —/communityis not registered;community creation is disabled
COMMUNITY_CREATION_ENABLED=true—/communityis registered and users cancreate communities through the existing wizard flow
Implementation
COMMUNITY_CREATION_ENABLED=falseto.env-samplewith a comment explaining itbot/modules/community/index.ts, replace the commented-out block with aconditional registration: