Add comments/docstrings to bot.py
This commit is contained in:
parent
8b36f6c0b2
commit
1199c74aa7
|
@ -11,20 +11,34 @@ from discord.ext import commands
|
||||||
###############
|
###############
|
||||||
|
|
||||||
def init_bot() -> commands.Bot:
|
def init_bot() -> commands.Bot:
|
||||||
|
"""
|
||||||
|
Initializes the bot object
|
||||||
|
|
||||||
|
:return: Bot class object
|
||||||
|
"""
|
||||||
intents = Intents.default()
|
intents = Intents.default()
|
||||||
intents.message_content = True
|
intents.message_content = True
|
||||||
return commands.Bot(command_prefix="/", intents=intents)
|
return commands.Bot(command_prefix="/", intents=intents)
|
||||||
|
|
||||||
|
|
||||||
|
# Init bot object
|
||||||
bot = init_bot()
|
bot = init_bot()
|
||||||
|
|
||||||
|
|
||||||
def start() -> None:
|
def start() -> None:
|
||||||
|
"""
|
||||||
|
Starts bot polling
|
||||||
|
"""
|
||||||
bot.run(ENV.BOT_TOKEN.fget(None))
|
bot.run(ENV.BOT_TOKEN.fget(None))
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def create(ctx: commands.Context) -> None:
|
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
|
server = ctx.guild
|
||||||
db = ServersDB(server.id)
|
db = ServersDB(server.id)
|
||||||
circles_count = ENV.CIRCLES_COUNT.fget(None)
|
circles_count = ENV.CIRCLES_COUNT.fget(None)
|
||||||
|
|
Loading…
Reference in New Issue