Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ ADMIN_IDS=YOUR_TELEGRAM_USER_ID
AFFILIATE_SOURCE=GambleCodez
ANNOUNCE_CHANNEL="-1002648883359"
BOTPRIVACYMODE="disabled"
# BOT_PRIVACY_MODE=private|public — controls whether bot receives all group messages.
BOT_PRIVACY_MODE=private
# BOT_PRIVACY_MODE="disabled" in BotFather/non-privacy mode so bot can read group messages.
BOT_PRIVACY_MODE="disabled"
BOT_TOKEN=
DEVICE=vps
DISCORD_CODE_GENERATION_IMAGE_URL=https://raw.githubusercontent.com/gamblecodezcom/Runewager/main/images/discord_code_generation.png
Expand Down
2 changes: 1 addition & 1 deletion RUNEWAGER_FUNCTIONALITY_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Notes:
## 14. Permissions & Access Control

- Admin identity is based on `ADMIN_IDS` env list.
- `.env.example` documents both `BOT_PRIVACY_MODE` and compatibility `BOTPRIVACYMODE`, plus Telegram/HTTPS/discovery keys used by runtime checks.
- `.env.example` documents both `BOT_PRIVACY_MODE="disabled"` (BotFather non-privacy mode) and compatibility `BOTPRIVACYMODE`, plus Telegram/HTTPS/discovery keys used by runtime checks.
- `requireAdmin(ctx)` gates command/callback execution.
- Admin mode UI toggle changes visibility of admin UI, not true authorization.
- Group approvals list controls where certain broadcast/group operations target.
Expand Down
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const PROMO_REQUIREMENT = {
const TELEGRAM_CHANNEL_ID = process.env.TELEGRAM_CHANNEL_ID || process.env.ANNOUNCE_CHANNEL || '';
const TELEGRAM_GROUP_ID = process.env.TELEGRAM_GROUP_ID || '';
const ANNOUNCE_CHANNEL = TELEGRAM_CHANNEL_ID;
const BOT_PRIVACY_MODE = String(process.env.BOT_PRIVACY_MODE || process.env.BOTPRIVACYMODE || '').trim().toLowerCase();

// Group chat_id for automatic Content Drops
const TIPS_GROUP = process.env.TIPS_GROUP || TELEGRAM_GROUP_ID || '';
Expand Down Expand Up @@ -12522,6 +12523,8 @@ bot.command('testall', async (ctx) => {
else fail('Configuration', 'ADMIN_IDS', 'No admin IDs configured');
if (BOT_TOKEN && BOT_TOKEN.length > 10) pass('Configuration', 'BOT_TOKEN');
else fail('Configuration', 'BOT_TOKEN', 'Missing or too short');
if (BOT_PRIVACY_MODE === 'disabled') pass('Environment Checks', 'BOT_PRIVACY_MODE=disabled');
else fail('Environment Checks', 'BOT_PRIVACY_MODE=disabled', `Expected "disabled" for group visibility, got: ${BOT_PRIVACY_MODE || 'unset'}`);
for (const [key, expected] of [['miniAppPlay', 't.me/RuneWager_bot/Play'], ['miniAppProfile', 't.me/RuneWager_bot/profile'], ['miniAppClaim', 't.me/RuneWager_bot/claim']]) {
if (LINKS[key] && LINKS[key].includes(expected)) pass('Configuration', `miniApp_link.${key}`);
else fail('Configuration', `miniApp_link.${key}`, `Expected ${expected}, got: ${LINKS[key]}`);
Expand Down Expand Up @@ -13396,7 +13399,7 @@ bot.command('list_groups', safeAdminHandler('list_groups', { usage: '/list_group
` Bot admin: ${isAdmin ? 'YES' : 'NO'}`,
` Missing permissions: ${missing.length ? missing.join(', ') : 'none'}`,
' Recommended BotFather: disable privacy mode if group message visibility is required.',
` Privacy mode: ${process.env.BOT_PRIVACY_MODE || 'unknown (check @BotFather)'}`,
` Privacy mode: ${BOT_PRIVACY_MODE || 'unknown (check @BotFather)'}`,
].join('\n'));
} catch (e) {
report.push(`\n• ${chatId}\n Error: ${e.message}`);
Expand Down