コード例 #1
0
ファイル: commands.py プロジェクト: JuhaJGamer/taubot
def process_add_tax_bracket(author: AccountId, message: str, server: Server,
                            **kwargs):
    assert_authorized(author, server, Authorization.ADMIN)
    results = parse_add_tax_bracket(message)
    if results is None:
        raise CommandException('**LEARN TO FORMAT SMH**')
    start, end, rate, name = results
    server.add_tax_bracket(author, start, end, rate, name)
    return f"Success, you can now steal from people at `{rate}%`,\n \
コード例 #2
0
def add_tax_bracket(author: Union[AccountId, str], start: Fraction,
                    end: Fraction, rate: Fraction, name: str, server: Server):
    """Add a tax bracket to a server with authorization from author"""
    author = _get_account(author, server)
    _assert_authorized(author, None)
    server.add_tax_bracket(author, start, end, rate, name)