diff --git a/bots/api/bot.py b/bots/api/bot.py index f974bf07..9f4c0065 100644 --- a/bots/api/bot.py +++ b/bots/api/bot.py @@ -70,6 +70,7 @@ async def get_target(target_id: str): ban = target.get_option('ban') typo_check = target.get_option('typo_check') dice_dc_reversed = target.get_option('dice_dc_reversed') + dice_default_face = target.get_option('dice_default_face') wiki_fandom_addon = target.get_option('wiki_fandom_addon') wordle_dark_theme = target.get_option('wordle_dark_theme') @@ -90,6 +91,7 @@ async def get_target(target_id: str): 'ban': ban, 'typoCheck': typo_check, 'diceDCReversed': dice_dc_reversed, + 'diceDefaultFace': dice_default_face, 'wordleDarkTheme': wordle_dark_theme, 'wiki': { 'fandomAddon': wiki_fandom_addon, diff --git a/config/config.toml.example b/config/config.toml.example index 5ee03356..5da83882 100644 --- a/config/config.toml.example +++ b/config/config.toml.example @@ -71,8 +71,6 @@ coin_faceup_rate = 4997 coin_facedown_rate = 4997 dice_limit = 100 dice_roll_limit = 10 -dice_mod_max = 10000 -dice_mod_min = -10000 dice_output_count = 50 dice_output_len = 200 dice_detail_count = 5 diff --git a/docs/DEPLOY.md b/docs/DEPLOY.md index 20147a70..3e717207 100644 --- a/docs/DEPLOY.md +++ b/docs/DEPLOY.md @@ -537,13 +537,9 @@ pip3 install matrix-nio[e2e] ; PIP `dice_roll_limit = 100` - 投掷骰子的最大次数。 -`dice_mod_max = 10000` - 投掷骰子的最大调节值。 +`dice_output_count = 50` - 输出时的最大数据量,超过则无法正常显示。 -`dice_mod_min = -10000` - 投掷骰子的最小调节值。 - -`dice_output_cnt = 50` - 输出时的最大数据量,超过则无法正常显示。 - -`dice_detail_cnt= 5` - 多次投掷骰子的总数,超过则不再显示详细信息。 +`dice_detail_count= 5` - 多次投掷骰子的总数,超过则不再显示详细信息。 `dice_count_limit = 10` - 骰子表达式最多的项数。 diff --git a/docs/DEPLOY_Docker.md b/docs/DEPLOY_Docker.md index d657274e..d0efc868 100644 --- a/docs/DEPLOY_Docker.md +++ b/docs/DEPLOY_Docker.md @@ -384,13 +384,9 @@ pip3 install matrix-nio[e2e] ; PIP `dice_roll_limit = 100` - 投掷骰子的最大次数。 -`dice_mod_max = 10000` - 投掷骰子的最大调节值。 +`dice_output_count = 50` - 输出时的最大数据量,超过则无法正常显示。 -`dice_mod_min = -10000` - 投掷骰子的最小调节值。 - -`dice_output_cnt = 50` - 输出时的最大数据量,超过则无法正常显示。 - -`dice_detail_cnt= 5` - 多次投掷骰子的总数,超过则不再显示详细信息。 +`dice_detail_count= 5` - 多次投掷骰子的总数,超过则不再显示详细信息。 `dice_count_limit = 10` - 骰子表达式最多的项数。 diff --git a/modules/dice/dice.py b/modules/dice/dice.py index e4ae1060..23e6870b 100644 --- a/modules/dice/dice.py +++ b/modules/dice/dice.py @@ -232,8 +232,8 @@ async def process_expression(msg, expr: str, times: int, dc): def parse_dice_expression(msg, dices): dice_item_list = [] patterns = [ - r'((?:\d+)?D(?:\d+|\%)?(?:(?:K|Q)?(?:\d+)?)?)', # 普通骰子 r'((?:\d+)?D?F)', # 命运骰子 + r'((?:\d+)?D(?:\d+|\%)?(?:(?:K|Q)?(?:\d+)?)?)', # 普通骰子 r'(\d+)', # 数字 r'(\(|\))', # 括号 ]