-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
51 lines (38 loc) · 1.17 KB
/
main.py
File metadata and controls
51 lines (38 loc) · 1.17 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
import discord
from discord.ext import commands
import asyncio
intents = discord.Intents.default()
intents.members = True
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)
initial_extensions = [
"cogs.warnings",
"cogs.moderation",
]
async def load_extensions():
for ext in initial_extensions:
try:
await bot.load_extension(ext)
print(f"✅ Cog {ext} cargado")
except Exception as e:
print(f"❌ Error al cargar {ext}: {e}")
# =====================
# EVENTOS
# =====================
@bot.event
async def on_ready():
await bot.change_presence(
status=discord.Status.online,
activity=discord.Game("🛠️ Moderando el servidor")
)
try:
synced = await bot.tree.sync()
print(f"🌐 Slash commands sincronizados ({len(synced)})")
except Exception as e:
print(f"❌ Error al sincronizar slash commands: {e}")
print(f"✅ Bot conectado como {bot.user}")
async def main():
await load_extensions()
await bot.start("TOKEN BOT")
if __name__ == "__main__":
asyncio.run(main())