Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from discord.ext.commands import Bot
- from os import listdir
- TOKEN = "NTQwMjQ4NzYwMDM5NzY4MDg0.DzUNJw.MjA6LfATzirsDf9liuKcOmnPMk4"
- PREFIX = ">"
- bot = Bot(command_prefix=PREFIX)
- @bot.event
- async def on_ready():
- print(f"Logged in as {bot.user.name} [{bot.user.id}]")
- print("guilds:")
- for guild in bot.guilds:
- print(f"\t{guild.name}")
- cogs = [f[:-3] for f in listdir() if "cog" == f[-6:-3]]
- print("Cogs:")
- for cog in cogs:
- try:
- bot.load_extension(cog)
- print(f"\t{cog}")
- except Exception as e:
- print(f"Failed to load cog: {cog[:-4]}")
- print(f"{type(e).__name__}: {e}")
- bot.run(TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement