-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtest_bot.py
More file actions
54 lines (44 loc) · 1.75 KB
/
test_bot.py
File metadata and controls
54 lines (44 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# 𝕽𝕺𝕏𝖄•𝔹𝕒𝕤𝕚𝕔ℕ𝕖𝕖𝕕𝔹𝕠𝕥 ⚡️
# Test script to verify bot plugins are working
import asyncio
from pyrogram import Client
from config import RoxyBotConfig
async def test_bot():
"""Test bot connectivity and plugin loading"""
print("🔍 Testing Roxy Zip Maker Bot...\n")
# Validate config
try:
RoxyBotConfig.roxybot_validate_config()
print("✅ Configuration validated")
except Exception as e:
print(f"❌ Configuration error: {e}")
return
# Create client
app = Client(
name="RoxyZipMakerBot",
api_id=RoxyBotConfig.ROXYBOT_API_ID,
api_hash=RoxyBotConfig.ROXYBOT_API_HASH,
bot_token=RoxyBotConfig.ROXYBOT_BOT_TOKEN,
plugins=dict(root="ROXYBASICNEEDBOT/plugins"),
workdir="."
)
async with app:
# Get bot info
me = await app.get_me()
print(f"✅ Bot Username: @{me.username}")
print(f"✅ Bot ID: {me.id}")
print(f"✅ Bot Name: {me.first_name}")
# Check plugin handlers
if hasattr(app, 'dispatcher'):
print(f"\n📱 Total handlers registered: {len(app.dispatcher.groups)}")
print("\n🎯 Bot is working! Now test these commands:")
print(" 1. Send /start to your bot")
print(" 2. Send /help")
print(" 3. Send a photo or video")
print("\nIf bot doesn't respond:")
print(" - Make sure BOT_TOKEN is correct")
print(" - Check if bot is not already running elsewhere")
print(" - Verify you're messaging the correct bot")
if __name__ == "__main__":
asyncio.run(test_bot())
# 𝕽𝕺𝕏𝖄•𝔹𝕒𝕤𝕚𝕔ℕ𝕖𝕖𝕕𝔹𝕠𝕥 ⚡️