Skip to content

Commit c117446

Browse files
committed
remake sqlitedao with battlemaster and cmdv2 affected, add clan and login to web
1 parent 8b33892 commit c117446

12 files changed

Lines changed: 597 additions & 387 deletions

File tree

deploy/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
web:
1515
image: zzbslayer/kokkoro_bot:latest
1616
ports:
17-
- "5100:5001"
17+
- "5560:5001"
1818
volumes:
1919
- ~/.kokkoro:/root/.kokkoro
2020
command: python3.8 -u /bot/run_web.py

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
web:
1616
image: zzbslayer/kokkoro_bot:latest
1717
ports:
18-
- "5100:5001"
18+
- "5560:5001"
1919
volumes:
2020
- ./:/bot/
2121
- ~/.kokkoro:/root/.kokkoro

kokkoro/bot/discord/discord_util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ def remove_mention_me(raw_message) -> (str, bool):
1616
Pattern in official document is <@![a-z0-9A-Z]+>
1717
e.g. <@!12345>
1818
19-
But the `at` sent by ios discord is <@[a-z0-9A-Z]>
19+
But the `at` sent by iOS discord is <@[a-z0-9A-Z]>
2020
e.g. <@12345>
2121
2222
So temp solution is <@!?[a-z0-9A-Z]+>
2323
'''
24-
dc_at_pattern = r'<@!?[a-z0-9A-Z]+>'
24+
dc_at_pattern = r'<@!?[a-z0-9A-Z]+>'
2525
def normalize_message(raw_message: str) -> str:
2626
"""
2727
规范化 at 信息,"<@!123> waht<@!312>a12" => "@123 waht @312 a12"
@@ -33,7 +33,7 @@ def normalize_message(raw_message: str) -> str:
3333

3434
def normalize_at(raw_at):
3535
"""
36-
规范化 at 信息,"<@!123>" => " @123 "
36+
规范化 at 信息,"<@!123>" => " @123 "
3737
ios: "<@123>" => " @123 "
3838
"""
39-
return f' @{raw_at[3:-1]} ' if '!' in raw_at else f' @{raw_at[2:-1]} '
39+
return f' @{raw_at[3:-1]} ' if '!' in raw_at else f' @{raw_at[2:-1]} '

kokkoro/config_example/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import matplotlib.font_manager as font_manager
55

66
from .__bot__ import *
7+
from .__web__ import *
78

89
for module in MODULES_ON:
910
try:

kokkoro/modules/pcrclanbattle/clanbattle/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .argparse import ArgParser
66
from .exception import *
77

8+
from kokkoro import config
89
from kokkoro.typing import *
910
from kokkoro.common_interface import KokkoroBot, EventInterface
1011
from kokkoro.service import Service
@@ -22,7 +23,7 @@ def cb_cmd(prefixes, parser:ArgParser) -> Callable:
2223
prefixes = cb_prefix(prefixes)
2324
if not isinstance(prefixes, Iterable):
2425
raise ValueError('`name` of cb_cmd must be `str` or `Iterable[str]`')
25-
26+
2627
def deco(func):
2728
@wraps(func)
2829
async def wrapper(bot: KokkoroBot, ev: EventInterface):
@@ -44,6 +45,8 @@ async def wrapper(bot: KokkoroBot, ev: EventInterface):
4445

4546

4647
from .cmdv2 import *
48+
if config.ENABLE_WEB:
49+
from .cmd_web import *
4750

4851

4952
QUICK_START = f'''
@@ -105,4 +108,4 @@ async def cb_help(bot: KokkoroBot, ev:EventInterface):
105108
# content='命令一览表')
106109
# await session.send(msg)
107110

108-
from . import report
111+
from . import report

0 commit comments

Comments
 (0)