import os import nextcord from nextcord.ext import commands import config def main(): # Allows privledged intents for monitoring members joining, roles editing, and role assignments # These need to be enabled in the developer portal as well intents = nextcord.Intents.default() # Required in order to read messages (eg. prefix commands) intents.message_content = True # To enable the guilds priveleged intent: # intents.guilds = True # To enable the members priveleged intent: # intents.members = True bot = commands.Bot(intents=intents) # Get the modules of all cogs whose directory structure is ./cogs/ for folder in os.listdir("cogs"): bot.load_extension(f"cogs.{folder}") @bot.listen() async def on_ready(): """When Discord is connected""" assert bot.user is not None print(f"{bot.user.name} has connected to Discord!") # Run Discord bot bot.run(config.DISCORD_TOKEN) if __name__ == "__main__": main()