summaryrefslogtreecommitdiff
path: root/ATRI/plugins/plugin_chat
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/plugins/plugin_chat')
-rw-r--r--ATRI/plugins/plugin_chat/__init__.py61
-rw-r--r--ATRI/plugins/plugin_chat/drifting_bottle.json2
2 files changed, 32 insertions, 31 deletions
diff --git a/ATRI/plugins/plugin_chat/__init__.py b/ATRI/plugins/plugin_chat/__init__.py
index d2c3250..83afc62 100644
--- a/ATRI/plugins/plugin_chat/__init__.py
+++ b/ATRI/plugins/plugin_chat/__init__.py
@@ -82,7 +82,7 @@ async def _poke(bot: Bot, event: Event, state: dict) -> None:
msg = choice([
"你再戳!", "?再戳试试?", "别戳了别戳了再戳就坏了555", "我爪巴爪巴,球球别再戳了", "你戳你🐎呢?!",
"那...那里...那里不能戳...绝对...", "(。´・ω・)ん?", "有事恁叫我,别天天一个劲戳戳戳!", "欸很烦欸!你戳🔨呢",
- "?"
+ "?", "差不多得了😅", "欺负咱这好吗?这不好", "我希望你耗子尾汁"
])
await pokehah.finish(msg)
@@ -273,21 +273,21 @@ async def _(bot: Bot, event: Event, state: dict) -> None:
await hitokoto.finish(info["hitokoto"])
-# laughFunny = on_command('来句笑话', rule=check_banlist())
+laughFunny = on_command('来句笑话', rule=check_banlist())
-# @laughFunny.handle() #type: ignore
-# async def _(bot: Bot, event: Event, state: dict) -> None:
-# name = event.sender['nickname']
-# result = []
[email protected]() #type: ignore
+async def _(bot: Bot, event: Event, state: dict) -> None:
+ name = event.sender['nickname']
+ result = []
-# LAUGH_FILE = Path('.') / 'ATRI' / 'plugins' / 'plugin_chat' / 'laugh.txt'
+ LAUGH_FILE = Path('.') / 'ATRI' / 'plugins' / 'plugin_chat' / 'laugh.txt'
-# with open(LAUGH_FILE, 'r', encoding='utf-8') as f:
-# for line in f:
-# result.append(line.strip('\n'))
+ with open(LAUGH_FILE, 'r', encoding='utf-8') as f:
+ for line in f:
+ result.append(line.strip('\n'))
-# resu = choice(result)
-# print(resu%name)
+ resu = choice(result)
+ await laughFunny.finish(resu.replace("%name", name))
# 扔漂流瓶
plugin_name = 'drifting-bottle'
@@ -405,29 +405,30 @@ async def _(bot: Bot, event: Event, state: dict) -> None:
# 舆情监听
-#publicOpinion = on_message(rule=check_banlist(True))
-#ban_temp_list = []
+publicOpinion = on_message(rule=check_banlist())
+ban_temp_list = []
-#@publicOpinion.handle()
-#async def _(bot: Bot, event: Event, state: dict) -> None:
- #global ban_temp_list
- #msg = str(event.message)
- #user = str(event.user_id)
+async def _(bot: Bot, event: Event, state: dict) -> None:
+ global ban_temp_list
+ msg = str(event.message)
+ user = str(event.user_id)
# 检查是否满足条件
- #if countX(ban_temp_list,
- #user) == Textcheck().get_times(str(Textcheck().check(msg))):
- #ban_temp_list = list(set(ban_temp_list))
- #ban(user)
+ if countX(ban_temp_list,
+ user) == Textcheck().get_times(str(Textcheck().check(msg))):
+ ban_temp_list = list(set(ban_temp_list))
+ ban(user)
+ await publicOpinion.finish(Textcheck().check(msg))
- #if Textcheck().check(msg) == "False":
- #return
+ if Textcheck().check(msg) == "False":
+ return
- #if Textcheck().check(msg):
- #if user in master:
- #await publicOpinion.finish("主人你给我注意点阿?!你这可是在死亡边缘试探呢!!")
+ if Textcheck().check(msg):
+ if user in master:
+ await publicOpinion.finish("主人你给我注意点阿?!你这可是在死亡边缘试探呢!!")
- #ban_temp_list.append(int(user))
+ ban_temp_list.append(int(user))
- #await publicOpinion.finish(Textcheck().check(msg))
+ await publicOpinion.finish(Textcheck().check(msg))
diff --git a/ATRI/plugins/plugin_chat/drifting_bottle.json b/ATRI/plugins/plugin_chat/drifting_bottle.json
index 9e26dfe..8a57a22 100644
--- a/ATRI/plugins/plugin_chat/drifting_bottle.json
+++ b/ATRI/plugins/plugin_chat/drifting_bottle.json
@@ -1 +1 @@
-{} \ No newline at end of file
+{"1": [1172294279, 516729280, "\u6ca1\u5565\uff0c\u9001\u4e00\u5f20\u6da9\u56fe8[CQ:image,file=542e3acdfba13430d61b084fb07a2812.image,url=http://gchat.qpic.cn/gchatpic_new/1172294279/516729280-3085694275-542E3ACDFBA13430D61B084FB07A2812/0?term=2]"]} \ No newline at end of file