Add comments/docstrings to bot.py

This commit is contained in:
trueold89 2024-06-03 16:59:02 +03:00
parent 8b36f6c0b2
commit 1199c74aa7
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
1 changed files with 14 additions and 0 deletions

View File

@ -11,20 +11,34 @@ from discord.ext import commands
###############
def init_bot() -> commands.Bot:
"""
Initializes the bot object
:return: Bot class object
"""
intents = Intents.default()
intents.message_content = True
return commands.Bot(command_prefix="/", intents=intents)
# Init bot object
bot = init_bot()
def start() -> None:
"""
Starts bot polling
"""
bot.run(ENV.BOT_TOKEN.fget(None))
@bot.command()
async def create(ctx: commands.Context) -> None:
"""
Creates a group of voice channels to move the user and adds their id to the database
:param ctx: Command context
"""
server = ctx.guild
db = ServersDB(server.id)
circles_count = ENV.CIRCLES_COUNT.fget(None)