예제 #1
0
async def set_tz(ctx: MessageContext, tz: str) -> None:
    if command.has_diceboss_role(ctx.message.author):
        try:
            ctx.server_ctx.tz = tz
            await ctx.channel.send(f"Set this server's timezone to '{tz}'")
        except Exception as e:
            await ctx.channel.send(f"Unknown timezone '{tz}'")
    else:
        insult = command.get_witty_insult()
        await ctx.channel.send(
            f"You're not a diceboss.\nDon't try that shit again, {insult}.")
async def set_turbo_ban_timing_threshold(ctx: MessageContext,
                                         threshold: int) -> None:
    """Set the turbo ban timing threshold (maximum number of seconds before a turbo banned is issued) for this server"""
    if command.has_diceboss_role(ctx.message.author):
        ctx.server_ctx.turbo_ban_timing_threshold = threshold
        await ctx.channel.send(
            f"<@{ctx.discord_id}> set the turbo ban timing threshold to {threshold}"
        )
    else:
        insult = command.get_witty_insult()
        await ctx.channel.send(
            f"You're not a diceboss.\nDon't try that shit again, {insult}.")
예제 #3
0
async def set_ban_reaction_threshold(ctx: MessageContext,
                                     threshold: int) -> None:
    """Set the ban reaction threshold (how many reactions before a ban occurs) for this server"""
    if command.has_diceboss_role(ctx.message.author):
        ctx.server_ctx.ban_reaction_threshold = threshold
        await ctx.channel.send(
            f"<@{ctx.discord_id}> set the ban reaction threshold to {threshold}"
        )
    else:
        insult = command.get_witty_insult()
        await ctx.channel.send(
            f"You're not a diceboss.\nDon't try that shit again, {insult}.")
예제 #4
0
async def clear_stats(ctx: MessageContext) -> None:
    """Clear all stats in the server's roll record (PERMANENT)"""
    if command.has_diceboss_role(ctx.message.author):
        db_helper.clear_all(ctx.db_conn, ctx.server_ctx.guild_id)
        ctx.server_ctx.current_roll = ctx.server_ctx.DEFAULT_CURRENT_ROLL
        await ctx.channel.send(
            "All winner/loser stats have been cleared for this server.\n"
            f"The next roll for this server has been reset to {ctx.server_ctx.current_roll}"
        )
    else:
        insult = command.get_witty_insult()
        await ctx.channel.send(
            f"You're not a diceboss.\nDon't try that shit again, {insult}.")
예제 #5
0
async def set_msg(
    ctx: MessageContext,
    win_or_lose: SetMessageSubcommand,
    msg: GreedyStr,
) -> None:
    """Set the win/loss message in this server for critical success or failure"""
    if command.has_diceboss_role(ctx.message.author):
        if win_or_lose is SetMessageSubcommand.WIN:
            ctx.server_ctx.critical_success_msg = msg
            await ctx.channel.send(f"Set the win message to '{msg}'")
        else:
            ctx.server_ctx.critical_failure_msg = msg
            await ctx.channel.send(f"Set the lose message to '{msg}'")
    else:
        insult = command.get_witty_insult()
        await ctx.channel.send(
            f"You're not a diceboss.\nDon't try that shit again, {insult}.")