added join an leave msgs and reduced outpud blob on exit
This commit is contained in:
1 parent
4d34daa1e7
commit
b3c7b34863
2 files changed
+64
-2
No files matched your search
@@ -9,6 +9,7 @@ load_dotenv()
|
||||
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
intents.members = True
|
||||
|
||||
bot = commands.Bot(command_prefix=None, intents=intents)
|
||||
|
||||
@@ -36,12 +37,25 @@ async def load_extensions():
|
||||
if filename.endswith(".py"):
|
||||
await bot.load_extension(f"commands.{filename[:-3]}")
|
||||
print(f"Loaded extension: commands.{filename[:-3]}")
|
||||
|
||||
for filename in os.listdir("./extensions"):
|
||||
if filename.endswith(".py"):
|
||||
await bot.load_extension(f"extensions.{filename[:-3]}")
|
||||
print(f"Loaded extension: extensions.{filename[:-3]}")
|
||||
|
||||
async def main():
|
||||
async with bot:
|
||||
bot.database = Database()
|
||||
|
||||
await load_extensions()
|
||||
await bot.start(os.getenv("DISCORD_TOKEN"))
|
||||
|
||||
try:
|
||||
await bot.start(os.getenv("DISCORD_TOKEN"))
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
asyncio.run(main())
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
asyncio.run(main())
|
||||
except KeyboardInterrupt:
|
||||
print("\nShutting down... byeeeeee :3 👋")
|
||||
Reference in new issue
Block a user