This repository was archived by the owner on Jan 21, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.tools_test_new_help.py
More file actions
51 lines (43 loc) · 1.64 KB
/
.tools_test_new_help.py
File metadata and controls
51 lines (43 loc) · 1.64 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
#!/usr/bin/env python
"""
Test script to validate the new interactive help cog loads properly.
"""
import asyncio
import discord
from discord.ext import commands
async def test_help_cog():
"""Simulate loading the help cog."""
print("Creating minimal bot...")
intents = discord.Intents.default()
# Use a small subclass that declares `available_cogs` as a class attribute
class TestBot(commands.Bot):
available_cogs = []
bot = TestBot(command_prefix="f?", intents=intents, help_command=None)
# Add some mock cogs to available_cogs (set on the class so instance attribute restrictions don't apply)
TestBot.available_cogs = ['admin', 'economy', 'fun', 'tags', 'community']
print("Loading help cog...")
try:
from cogs import help as help_module
await help_module.setup(bot)
print("✅ Help cog loaded successfully!")
# Check if the cog is registered
help_cog = bot.get_cog('HelpCog')
if help_cog:
print(f"✅ HelpCog registered: {help_cog}")
# Check if help command exists
help_cmd = bot.get_command('help')
if help_cmd:
print(f"✅ Help command registered: {help_cmd}")
else:
print("❌ Help command not found!")
else:
print("❌ HelpCog not registered!")
except Exception as e:
print(f"❌ Failed to load help cog: {e}")
import traceback
traceback.print_exc()
return False
return True
if __name__ == "__main__":
success = asyncio.run(test_help_cog())
exit(0 if success else 1)