Example #1
0
async def get_link(
    ctx: commands.Context, region: str, port: Optional[str] = None
) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.GET_LINK)

    await ctx.send(bot_utils.get_link(region=region, port=port))
Example #2
0
async def check_server(
    ctx: commands.Context, region: str, port: Optional[int] = None
) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.CHECK_SERVER)

    if region:
        await bot_utils.check_server(ctx, region, port=port)
    else:
        await bot_utils.error(ctx)
Example #3
0
async def add_player(ctx: commands.Context, *args) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.ADD_PLAYER)

    if username := "******".join(args):
        if username in ("Player",):
            await ctx.send("srysly??")
        else:
            if user_in(username):
                await ctx.send("he/she is already in the tracklist")
            else:
                tracklist.add(username)
                serialize_list.cache_clear()
                user_in.cache_clear()
                await bot_utils.save_tracklist(tracklist)
                await ctx.send(f"{username} is in tracklist now")
Example #4
0
async def remove_player(ctx: commands.Context, *args) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.ADD_PLAYER)

    username = "******".join(args)
    if username:
        if username in ("Player",):
            await ctx.send("srysly??")
        else:
            if username in tracklist:
                tracklist.remove(username)
                bot_utils.save_tracklist(tracklist)
                await ctx.send(f"{username} is in tracklist now")
            else:
                await ctx.send("he is already in not there")
    else:
        await bot_utils.error(ctx)
Example #5
0
async def get_list(ctx: commands.Context) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.GET_LIST)

    await ctx.send(serialize_list())
Example #6
0
async def check_list(ctx: commands.Context) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.CHECK_LIST)

    await bot_utils.check_tracklist(ctx, tracklist)
Example #7
0
async def search_player(ctx: commands.Context, *args) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.SEARCH_PLAYER)

    await bot_utils.search_player(ctx, args)
Example #8
0
async def check_servers(ctx: commands.Context, port: Optional[str] = None) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.CHECK_SERVERS)

    await bot_utils.check_servers(ctx, port=port)
Example #9
0
async def help(ctx: commands.Context) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.HELP)

    await ctx.send(embed=bot_utils.HELP_MSG)
Example #10
0
async def get_list(ctx: commands.Context) -> None:
    if __debug__:
        bot_utils.logger(ctx, bot_utils.Logger.GET_LIST)

    await ctx.send(" ".join([f"`{victim}`" for victim in tracklist]))