Skip to content

Update and rename info.py to Bot.py#62

Open
Manuthakur01 wants to merge 1 commit intoLearningBotsOfficial:mainfrom
Manuthakur01:Manuthakur01-patch-1
Open

Update and rename info.py to Bot.py#62
Manuthakur01 wants to merge 1 commit intoLearningBotsOfficial:mainfrom
Manuthakur01:Manuthakur01-patch-1

Conversation

@Manuthakur01
Copy link

@Manuthakur01 Manuthakur01 commented Mar 3, 2026

Summary by CodeRabbit

  • Chores
    • Updated configuration and service credentials to new values

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

📝 Walkthrough

Walkthrough

Configuration values updated in Bot.py including API credentials (API_ID, API_HASH, BOT_TOKEN), admin/channel settings (ADMINS, USERNAME, LOG_CHANNEL, MOVIE_GROUP_LINK, CHANNELS), and database connection parameters (DATABASE_URI, DATABASE_NAME). No functional logic modifications.

Changes

Cohort / File(s) Summary
Configuration Defaults
Bot.py
Updated environment variable defaults: API credentials (API_ID, API_HASH, BOT_TOKEN), admin/user settings (ADMINS, USERNAME, LOG_CHANNEL, MOVIE_GROUP_LINK, CHANNELS), and database connection details (DATABASE_URI, DATABASE_NAME).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Credentials dance in fields of green,
New tokens shine where old had been,
Database paths now freshly set,
A config update without regret! 🔐✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions renaming info.py to Bot.py, but the actual changes are credential and configuration updates within the file, not a rename. Update the title to reflect the primary change: 'Update configuration and credentials in Bot.py' or similar, which accurately represents the credential and environment variable updates.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Bot.py`:
- Around line 16-18: The file currently embeds secrets as default values for
API_ID, API_HASH, BOT_TOKEN (and the DB URI at the later lines), so replace
those getenv calls that use hardcoded defaults with fail-fast required env
lookups (e.g., use environ[...] or an equivalent that raises when missing) for
API_ID, API_HASH, BOT_TOKEN and the DB connection variables referenced later
(lines ~28-29), remove all hardcoded tokens/credentials from the code, and
ensure the application raises a clear error at startup if any required
environment variable is not set so secrets must be provided via
environment/config management.
- Line 24: Default for MOVIE_GROUP_LINK in Bot.py contains a duplicated scheme
("https://https://...") making the URL invalid; update the MOVIE_GROUP_LINK
default to a valid URL (e.g., replace the current default with
"https://t.me/funchannel013") so environ.get('MOVIE_GROUP_LINK', ...) returns a
correct link when unset and ensure no extra scheme or whitespace remains.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 549ce66 and 31390b2.

📒 Files selected for processing (1)
  • Bot.py

Comment on lines +16 to +18
API_ID = int(environ.get('API_ID', '32130352'))
API_HASH = environ.get('API_HASH', 'fddbf986bb12dee0c05b32594188d75e')
BOT_TOKEN = environ.get('BOT_TOKEN', '8293394314:AAGNYE5w99XbCfV9zZRlhSBIVsLRIgWZr-A')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove committed secrets and require env vars at startup.

Line 16, Line 17, Line 18, Line 28, and Line 29 currently include hardcoded credentials/tokens (including DB credentials in URI). This is a critical secret-leak risk.

🔐 Proposed fix (fail-fast required envs, no secret defaults)
+def get_required_env(name):
+    value = environ.get(name)
+    if not value:
+        raise RuntimeError(f"Missing required environment variable: {name}")
+    return value
+
-API_ID = int(environ.get('API_ID', '32130352'))
-API_HASH = environ.get('API_HASH', 'fddbf986bb12dee0c05b32594188d75e')
-BOT_TOKEN = environ.get('BOT_TOKEN', '8293394314:AAGNYE5w99XbCfV9zZRlhSBIVsLRIgWZr-A')
+API_ID = int(get_required_env('API_ID'))
+API_HASH = get_required_env('API_HASH')
+BOT_TOKEN = get_required_env('BOT_TOKEN')

-DATABASE_URI = environ.get('DATABASE_URI', "mongodb+srv://manuthakur:[email protected]/?appName=manuthakur")
-DATABASE_NAME = environ.get('DATABASE_NAME', "manuthakur")
+DATABASE_URI = get_required_env('DATABASE_URI')
+DATABASE_NAME = get_required_env('DATABASE_NAME')

Also applies to: 28-29

🧰 Tools
🪛 Gitleaks (8.30.0)

[high] 17-17: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Bot.py` around lines 16 - 18, The file currently embeds secrets as default
values for API_ID, API_HASH, BOT_TOKEN (and the DB URI at the later lines), so
replace those getenv calls that use hardcoded defaults with fail-fast required
env lookups (e.g., use environ[...] or an equivalent that raises when missing)
for API_ID, API_HASH, BOT_TOKEN and the DB connection variables referenced later
(lines ~28-29), remove all hardcoded tokens/credentials from the code, and
ensure the application raises a clear error at startup if any required
environment variable is not set so secrets must be provided via
environment/config management.

ADMINS = [int(admin) if id_pattern.search(admin) else admin for admin in environ.get('ADMINS', '8553992570').split()]
USERNAME = environ.get('USERNAME', "https://t.me/manuthakur01") # ADMIN USERNAME
LOG_CHANNEL = int(environ.get('LOG_CHANNEL', '-1003885974344'))
MOVIE_GROUP_LINK = environ.get('MOVIE_GROUP_LINK', 'https://https://t.me/funchannel013')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix malformed default URL for movie group link.

Line 24 default value has a double scheme (https://https://...), so it resolves to an invalid URL when MOVIE_GROUP_LINK is unset.

🔧 Proposed fix
-MOVIE_GROUP_LINK = environ.get('MOVIE_GROUP_LINK', 'https://https://t.me/funchannel013')
+MOVIE_GROUP_LINK = environ.get('MOVIE_GROUP_LINK', 'https://t.me/funchannel013')
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
MOVIE_GROUP_LINK = environ.get('MOVIE_GROUP_LINK', 'https://https://t.me/funchannel013')
MOVIE_GROUP_LINK = environ.get('MOVIE_GROUP_LINK', 'https://t.me/funchannel013')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Bot.py` at line 24, Default for MOVIE_GROUP_LINK in Bot.py contains a
duplicated scheme ("https://https://...") making the URL invalid; update the
MOVIE_GROUP_LINK default to a valid URL (e.g., replace the current default with
"https://t.me/funchannel013") so environ.get('MOVIE_GROUP_LINK', ...) returns a
correct link when unset and ensure no extra scheme or whitespace remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant