Coder Social home page Coder Social logo

fywinds / takker Goto Github PK

View Code? Open in Web Editor NEW
83.0 2.0 11.0 214.22 MB

一个基于Nonebot2和go-cqhttp的娱乐性qq机器人,已停更

License: GNU Affero General Public License v3.0

Python 94.05% Shell 0.02% HTML 4.53% CSS 1.41%
nonebot nonebot2 takker qqbot

takker's Introduction

Hi 👋, I'm FYWinds

giphy

Profile Views

⚗️ Skills(maybe)

Python TypeScript Lua Markdown

📖 Learning

.Net C# Java Kotlin

🔭 Want to learn

Go Rust Haskell HTML5 CSS3

💻 My gears

Windows 11 Windows Terminal PowerShell VS Code Insiders IntelliJ IDEA

Manjaro zsh4humans VS Code Insiders

🕹️ I play games on

Steam Xbox

takker's People

Contributors

fywinds avatar jiritichy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

takker's Issues

询问,语音无法发送问题

这是最后一个问题了QAQ

12-08 19:33:32 [SUCCESS] nonebot | CQHTTP 1975969493 | [message.group.normal]: Message -2092313627 from 3116556127@[群:814476238] "亚托莉|atri"
12-08 19:33:32 [INFO] nonebot | Event will be handled by <Matcher from atri, type=message, priority=0, temp=True>
12-08 19:33:32 [INFO] nonebot | Matcher <Matcher from atri, type=message, priority=0, temp=True> running complete
12-08 19:33:32 [ERROR] nonebot | Running matcher <Matcher from atri, type=message, priority=0, temp=True> failed.
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\takker\bot.py", line 29, in
nonebot.run(app="mp_main:app")
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot_init_.py", line 278, in run
get_driver().run(host, port, *args, **kwargs)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 256, in run
uvicorn.run(
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\uvicorn\main.py", line 447, in run
server.run()
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\uvicorn\server.py", line 68, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\message.py", line 128, in _check_matcher
await _run_matcher(Matcher, bot, event, state)

File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\message.py", line 156, in _run_matcher
await matcher.run(bot, event, state)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\matcher.py", line 597, in run
await handler(self, bot, event, self.state)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\handler.py", line 64, in call
await self.func(
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\matcher.py", line 458, in wrapper
await func_handler(matcher, bot, event, state)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\handler.py", line 64, in call
await self.func(
File "C:\Users\Administrator\Desktop\takker\plugins\atri.py", line 64, in _g
await atri.send(record(voice, "atri"))
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\matcher.py", line 495, in send
return await bot.send(event=event, message=_message, **kwargs)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters\cqhttp\bot.py", line 471, in send
return await self.send_msg(**params)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters\cqhttp\bot.py", line 416, in call_api
return await super().call_api(api, **data)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters_bot.py", line 172, in call_api
raise exception
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters_bot.py", line 155, in call_api
result = await self._call_api(api, **data)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters\cqhttp\bot.py", line 363, in _call_api
return _handle_api_result(await ResultStore.fetch(
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\adapters\cqhttp\bot.py", line 192, in _handle_api_result
raise ActionFailed(**result)
nonebot.adapters.cqhttp.exception.ActionFailed: <ActionFailed data=None, echo={'seq': 23}, msg=SEND_MSG_API_ERROR, retcode=100, status=failed, wording=请参考 go-cqhttp 端输出>

星座运势查询报错

12-09 17:38:52 [SUCCESS] nonebot | CQHTTP 1975969493 | [message.group.normal]: Message -2038913020 from 3116556127@[群:681688017] "sluck"
12-09 17:38:52 [INFO] nonebot | Event will be handled by <Matcher from starluck, type=message, priority=20, temp=False>
12-09 17:38:52 [INFO] nonebot | Matcher <Matcher from starluck, type=message, priority=20, temp=False> running complete
12-09 17:38:52 [ERROR] nonebot | Running matcher <Matcher from starluck, type=message, priority=20, temp=False> failed.
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\takker\bot.py", line 29, in
nonebot.run(app="mp_main:app")
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot_init_.py", line 278, in run
get_driver().run(host, port, *args, **kwargs)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 256, in run
uvicorn.run(
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\uvicorn\main.py", line 447, in run
server.run()
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\uvicorn\server.py", line 68, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\message.py", line 128, in _check_matcher
await _run_matcher(Matcher, bot, event, state)

File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\message.py", line 156, in run_matcher
await matcher.run(bot, event, state)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\matcher.py", line 597, in run
await handler(self, bot, event, self.state)
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\nonebot\handler.py", line 64, in call
await self.func(
File "C:\Users\Administrator\Desktop\takker\plugins\starluck.py", line 111, in handle_starluck_receive
await make_cache(stars, stars_cn)
File "C:\Users\Administrator\Desktop\takker\plugins\starluck.py", line 223, in make_cache
resp_body = (await get_data(stars[i]))["204017771"]["day"]
File "C:\Users\Administrator\Desktop\takker\plugins\starluck.py", line 147, in get_data
return response.json()
File "C:\Users\Administrator\Desktop\takker.venv\lib\site-packages\httpx_models.py", line 1514, in json
return jsonlib.loads(self.text, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json_init
.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

运行报错

C:\Users\Administrator\Desktop\takker-master>poetry run bot.py

OSError

[WinError 193] %1 不是有效的 Win32 应用程序。

at c:\users\administrator\appdata\local\programs\python\python39\lib\subproces
s.py:1416 in _execute_child
1412│ sys.audit("subprocess.Popen", executable, args, cwd, en
v)
1413│
1414│ # Start the process
1415│ try:
→ 1416│ hp, ht, pid, tid = _winapi.CreateProcess(executabl
e, args,
1417│ # no special security
1418│ None, None,
1419│ int(not close_fds),
1420│ creationflags,

C:\Users\Administrator\Desktop\takker-master>

一个小建议

希望可以输入指令pix后直接发送原图。在QQ端看的很模糊且点链接查看略显麻烦。还望采纳。

安装依赖时报错是怎么回事,操作系统是Windows Server 2012 R2

C:\Users\Administrator\Desktop\takker-master>poetry install --no-dev
Installing dependencies from lock file

Package operations: 2 installs, 0 updates, 0 removals

? Installing opencv-python (4.5.4.58)
? Installing wordcloud (1.8.1)

RuntimeError

Invalid hashes (sha256:7651f5e88ba794b20bcf1c030d8de440929f9a65e1d498fb4006cee
8c58fb7e5) for opencv-python (4.5.4.58) using archive opencv_python-4.5.4.58-cp3
9-cp39-win_amd64.whl. Expected one of sha256:02872e0a9358526646d691f390143e9c211
09c210095314abaa0641211cda077, sha256:085c5fcf5a6479c34aca3fd0f59055e704083d6a44
009d6583c675ff1a5a0625, sha256:0d6249a49122a78afc6685ddb1377a87e46414ae61c84535c
4c6024397f1f3e8, sha256:0eba0bfe62c48a02a5af3a0944e872c99f57f98653bed14d51c6991a
58f9e1d1, sha256:215bdf069847d4e3b0447a34e9eb4046dd4ca523d41fe4381c1c55f6704fd0d
c, sha256:22bcc3153a7d4f95aff79457eef81ef5e40ab1851b189e014412b5e9fbee2573, sha2
56:26feeeb280de179f5dbb8976ebf7ceb836bd263973cb5daec8ca36e8ef7b5773, sha256:2fff
48a641a74d1def31c1e88f9e5ce50ba4d0f87d085dfbf8bc844e12f6cd54, sha256:315c357522b
6310ef7a0718d9f0c5d3110e59c19140705499a3c29bdd8c0124f, sha256:48288428f407bacba5
f73d460feb4a1ecafe87db3d7cfc0730a49fb32f589bbf, sha256:4a13381bdfc0fb4b080efcc27
c46561d0bd752f126226e9f19aa9cbcf6677f40, sha256:4abe9c4fb6fe16daa9fcdd68b5357d35
30431341aa655203f8e84f394e1fe6d4, sha256:4b614fbd81aeda53ce28e645aaee18fda7c7f2a
48eb7f1a70a7c6c3427946342, sha256:5370a11757fbe94b176771269aff599f4da8676c2a672b
13bcbca043f2e3eea8, sha256:637f4d3ad81bd27f273ede4c5fa6c26afb85c097c9715baf107cc
270e37f5fea, sha256:69a78e40a374ac14e4bf15a13dbb6c30fd2fbd5fcd3674d020a31b88861d
5aaf, sha256:6b87bab220d17e03eeedbcc6652d9d7e7bb09886dbd0f810310697a948b4c6fd, s
ha256:887a61097092dc0bf23fa24646dbc8cfeeb753649cb28a3782a93a6879e3b7d2, sha256:8
ddf4dcd8199209e33f21deb0c6d8ab62b21802816bba895fefc346b6d2e522d, sha256:8f7886ac
abaebf0361bd3dbccaa0d08e3f65ab13b7c739eb11e028f01ad13582, sha256:92e9b2261ec7642
29c948d77fe0d922ee033348ca6519939b87861016c1614b3, sha256:9998ce60884f3cda074f02
b56d2b57ee6bd863e2ddba132da2b0af3b9487d584, sha256:9b2c198af083a693d42a82bddc4d1
f7e6bb02c64192ff7fac1fd1d43a8cf1be6, sha256:9bcca50c5444b5cfb01624666b69f91ba8f2
d2bf4ef37b111697aafdeb81c99f, sha256:a2a7f09b8843b85f3e1b02c5ea3ddc0cb9f5ad96983
80109b37069ee8db7746d, sha256:ac852fcaac93439f2f7116ddffdc23fd366c872200ade22724
46f9898180cecb, sha256:bc34cdbfbab463750713118c8259a5d364547adab8ed91e94ba888349
f33590a, sha256:c44f5c51e92322ed832607204249c190764dec6cf29e8ba6d679b10326be1c1b
, sha256:d4b1d0b98ee72ba5dd720166790fc93ce459281e138ee79b0d41420b3da52b2e, sha25
6:eaa144013b597e4dcabc8d8230edfe810319de01b5609556d415a20e2b707547.

at c:\users\administrator\appdata\local\programs\python\python39\lib\site-pack
ages\poetry\installation\executor.py:627 in _download_link

EnvCommandError

Command C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\takker
-reborn-LDKRhFMo-py3.9\Scripts\pip.exe install --no-deps file:///C:/Users/Admini
strator/AppData/Local/pypoetry/Cache/artifacts/f4/27/cf/a52e6185703aea1a019cc582
979fa2285190b8ea18928a99f6500cd2e1/wordcloud-1.8.1.tar.gz errored with the follo
wing return code 1, and output:
Processing c:\users\administrator\appdata\local\pypoetry\cache\artifacts\f4\27
\cf\a52e6185703aea1a019cc582979fa2285190b8ea18928a99f6500cd2e1\wordcloud-1.8.1.t
ar.gz
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: wordcloud
Building wheel for wordcloud (setup.py): started
Building wheel for wordcloud (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\t
akker-reborn-LDKRhFMo-py3.9\Scripts\python.exe' -u -c 'import io, os, sys, setup
tools, tokenize; sys.argv[0] = '"'"'C:\Users\Administrator\AppData\Local\Te
mp\1\pip-req-build-50w265pt\setup.py'"'"'; file='"'"'C:\Users\Administr
ator\AppData\Local\Temp\1\pip-req-build-50w265pt\setup.py'"'"';f = getattr
(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.S
tringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace
('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'
"'"'))' bdist_wheel -d 'C:\Users\Administrator\AppData\Local\Temp\1\pip-wheel-m5
afk0pk'
cwd: C:\Users\Administrator\AppData\Local\Temp\1\pip-req-build-50w265pt

Complete output (20 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\wordcloud
copying wordcloud\color_from_image.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\tokenization.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\wordcloud.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\wordcloud_cli.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud_version.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud_init_.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud_main_.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\stopwords -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\DroidSansMono.ttf -> build\lib.win-amd64-3.9\wordcloud
UPDATING build\lib.win-amd64-3.9\wordcloud/_version.py
set build\lib.win-amd64-3.9\wordcloud/_version.py to '1.8.1'
running build_ext
building 'wordcloud.query_integral_image' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Micros
oft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

----------------------------------------
ERROR: Failed building wheel for wordcloud
Running setup.py clean for wordcloud

Failed to build wordcloud
Installing collected packages: wordcloud
Running setup.py install for wordcloud: started
Running setup.py install for wordcloud: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs
\takker-reborn-LDKRhFMo-py3.9\Scripts\python.exe' -u -c 'import io, os, sys, set
uptools, tokenize; sys.argv[0] = '"'"'C:\Users\Administrator\AppData\Local\
Temp\1\pip-req-build-50w265pt\setup.py'"'"'; file='"'"'C:\Users\Adminis
trator\AppData\Local\Temp\1\pip-req-build-50w265pt\setup.py'"'"';f = getat
tr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io
.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().repla
ce('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exe
c'"'"'))' install --record 'C:\Users\Administrator\AppData\Local\Temp\1\pip-reco
rd-4fb5qbs5\install-record.txt' --single-version-externally-managed --compile --
install-headers 'C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs
\takker-reborn-LDKRhFMo-py3.9\include\site\python3.9\wordcloud'
cwd: C:\Users\Administrator\AppData\Local\Temp\1\pip-req-build-50w265
pt
Complete output (22 lines):
running install
C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\takker-reb
orn-LDKRhFMo-py3.9\lib\site-packages\setuptools\command\install.py:34: Setuptool
sDeprecationWarning: setup.py install is deprecated. Use build and pip and other
standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\wordcloud
copying wordcloud\color_from_image.py -> build\lib.win-amd64-3.9\wordcloud

  copying wordcloud\tokenization.py -> build\lib.win-amd64-3.9\wordcloud
  copying wordcloud\wordcloud.py -> build\lib.win-amd64-3.9\wordcloud
  copying wordcloud\wordcloud_cli.py -> build\lib.win-amd64-3.9\wordcloud
  copying wordcloud\_version.py -> build\lib.win-amd64-3.9\wordcloud
  copying wordcloud\__init__.py -> build\lib.win-amd64-3.9\wordcloud
  copying wordcloud\__main__.py -> build\lib.win-amd64-3.9\wordcloud
  copying wordcloud\stopwords -> build\lib.win-amd64-3.9\wordcloud
  copying wordcloud\DroidSansMono.ttf -> build\lib.win-amd64-3.9\wordcloud
  UPDATING build\lib.win-amd64-3.9\wordcloud/_version.py
  set build\lib.win-amd64-3.9\wordcloud/_version.py to '1.8.1'
  running build_ext
  building 'wordcloud.query_integral_image' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Micr

osoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tool
s/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Administrator\AppData
\Local\pypoetry\Cache\virtualenvs\takker-reborn-LDKRhFMo-py3.9\Scripts\python.ex
e' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users
\Administrator\AppData\Local\Temp\1\pip-req-build-50w265pt\setup.py'"'"';
file='"'"'C:\Users\Administrator\AppData\Local\Temp\1\pip-req-build-
50w265pt\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if
os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; se
tup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec
(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Administra
tor\AppData\Local\Temp\1\pip-record-4fb5qbs5\install-record.txt' --single-versio
n-externally-managed --compile --install-headers 'C:\Users\Administrator\AppData
\Local\pypoetry\Cache\virtualenvs\takker-reborn-LDKRhFMo-py3.9\include\site\pyth
on3.9\wordcloud' Check the logs for full command output.

at c:\users\administrator\appdata\local\programs\python\python39\lib\site-pack
ages\poetry\utils\env.py:1183 in run
1179│ output = subprocess.check_output(
1180│ cmd, stderr=subprocess.STDOUT, **kwargs
1181│ )
1182│ except CalledProcessError as e:
→ 1183│ raise EnvCommandError(e, input=input
)
1184│
1185│ return decode(output)
1186│
1187│ def execute(self, bin, *args, **kwargs):

C:\Users\Administrator\Desktop\takker-master>

无法找到指定的模块

07-23 23:21:25 [ERROR] nonebot | Failed to import "bili_sub"
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\bot\takker\bot.py", line 22, in
nonebot.load_plugins("plugins")
File "C:\Users\Administrator\Desktop\bot\takker.venv\lib\site-packages\nonebot\plugin_init_.py", line 997, in loa
_plugins
result = context.run(_load_plugin, manager, plugin_name)

File "C:\Users\Administrator\Desktop\bot\takker.venv\lib\site-packages\nonebot\plugin_init_.py", line 945, in lo
d_plugin
module = manager.load_plugin(plugin_name)
File "C:\Users\Administrator\Desktop\bot\takker.venv\lib\site-packages\nonebot\plugin\manager.py", line 161, in load
plugin
return importlib.import_module(f"{self.namespace}.{name}")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\importlib_init
.py", line 127, in import_m
dule
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in load_unlocked
File "C:\Users\Administrator\Desktop\bot\takker.venv\lib\site-packages\nonebot\plugin\manager.py", line 267, in exec
module
super().exec_module(module)
File "", line 850, in exec_module
File "", line 228, in call_with_frames_removed
File "C:\Users\Administrator\Desktop\bot\takker\plugins\bili_sub_init
.py", line 11, in
from utils.img_util import create_image_from_text
File "C:\Users\Administrator\Desktop\bot\takker\utils\img_util.py", line 7, in
import cv2
File "C:\Users\Administrator\Desktop\bot\takker.venv\lib\site-packages\cv2_init
.py", line 5, in
from .cv2 import *
ImportError: DLL load failed while importing cv2: 找不到指定的模块。

询问,超级用户名单应该怎么填写

SUPERUSERS: List[Union[int, str]] = ["12345678", "0", "0", 3116556127]
群聊发送perm list一直回复参数错误
example: SUPERUSERS: List[Union[int, str]] = ["12345678", "0", "0", 12345678] # 超级用户名单

群管插件

将gocq支持的群管理相关api均设计命令
包括但不限于

  • 禁言
  • 踢群
  • 修改群名片
  • 修改群荣誉
  • 修改群聊名称
  • ......

重新设计权限系统

重构现有的权限/插件管理系统

  • 对旧版数据的自动转换与兼容
  • 权限/插件开启 的优先度重新安排
  • 非侵入式修改插件权限
  • 更直观的权限/插件状态
  • 更简便的操作

启动出错

→ 1704│                     raise child_exception_type(errno_num, err_msg, err_filename)

天气问题

有的地区可以,天气北京可以返回照片,天气南京就报错。
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Administrator\Desktop\takker\resources\img//weather/icon/151.png'
丢失的图片怎么获取?

【!】暂停维护

由于高考原因近期内暂停维护
一些bug还有新功能也暂时不会修复/添加
会在7月份开始逐渐恢复维护
届时会有一次较大的breaking更新

关于工具文件夹 utils 下 text_util.py 中 cut_text() 函数的 bug

关于工具文件夹 utilstext_util.pycut_text() 函数的 bug

问题描述

cut_text() 函数在 bilibili 链接解析 cut 简介时概率触发:报错 index out of range,尝试修复(见 复现及修复 部分)后结果不美观

报错信息

Line 131: 
    if p[-1] == "\n":
IndexError: string index out of range

复现及修复

import string

# 源于 utils/text_util.py
def cut_text(str, cut):
    """
    :说明: `get_cut_str`
    > 长文本自动换行切分

    :参数:
      * `str: [type]`: 文本
      * `cut: [type]`: 换行宽度,需要至少大于20

    :返回:
      - `List`: 切分后的文本列表
    """
    punc = """,,、。.??)》】“"‘';;::!!·`~%^& """
    si = 0
    i = 0
    next_str = str
    str_list = []
    for s in next_str:
        if s in string.printable:
            si += 1
        else:
            si += 2
        i += 1
        if next_str[0] == "\n":
            next_str = next_str[1:]
        elif s == "\n":
            str_list.append(next_str[: i - 1])
            next_str = next_str[i - 1 :]
            si = 0
            i = 0
            continue
        if si > cut:
            try:
                if next_str[i] in punc:
                    i += 1
                if next_str[i] in string.ascii_letters:
                    for j in range(i, i - 18, -1):
                        if next_str[j] == " ":
                            i = j + 1
                            break
            except IndexError:
                str_list.append(next_str)
                return str_list
            str_list.append(next_str[:i])
            next_str = next_str[i:]
            si = 0
            i = 0
    str_list.append(next_str)
    i = 0
    non_wrap_str = []
    for p in str_list:
        # FIXME 原文件: index out of range
        # ----------------------------
        # if p[-1] == "\n":
        #     p = p[:-1]
        # ----------------------------
        # 修改后: 不会 index out of range 但效果不美观
        # ----------------------------
        if p.endswith("\n"):
            p = p[:-1]
        # ----------------------------
        non_wrap_str.append(p)
        i += 1
    return non_wrap_str

# 出问题的字符串
src = """https://youtu.be/m_RqjvVvvfA
💗🎃💗※イヤホンで聴くと左右動いて、とっても楽しくてオススメです。💗🎃💗

「ヒトよ、一夜に一目惚レ!?」

新曲完成しました。
ゾクゾクしたいそんな夜にどうぞ…

テーマは『信じてる』
イラストは田ゃむさん。イラスト最高なのでフォローするように。

もしよかったらコメント、チャンネル登録♪
「なんねぇコレ!?」と思ったら低評価ボタン🥰お待ちしてます。

映像・音楽:みつあくま https://twitter.com/mitsu_akuma
イラスト:田ゃむ https://twitter.com/tanabe0607
https://twitter.com/tanabe0607/status...
終わりペンギン:もずくず https://twitter.com/mzkzmm


プロセカNEXT応募曲です。ニーゴ好きでスマンな🥺
第9回プロセカNEXT応募楽曲

コミュニティも最近、お世辞抜きに賑わいつつ更新中😍(国籍言語問わず絡んでね)
https://www.youtube.com/channel/UCtne...

ジャンル:HYPER J-POP
#初音ミク #プロセカNEXT #みつあくま
サブテーマは処女懐胎 (Virgin birth)


Hey, rumors I heard recently
I feel so sad that I feel like I'm going to vomit
Day By Day, Mirror with bloody cracks
The girl was crouching and laughing at the front door

I put up with the pain
I'm used to the liquid with a bitter taste
I would be confused without you
Hey you? I will be a girl who is convenient for you...

Love...

Evidence destruction, girl innocence
Please keep it secret from mom
The bruise has disappeared, but the life (body) remains dirty
Are you ready? not yet
Crack in the heart It's just strange
Macaroons that are hard and cannot be chewed
Where should I hide it? I can't rely on anyone
Are you ready? that's enough

Common worries
Waste money Temporary illness
Give up and light a lighter

Hey, that child with the nickname "bye fungus"
Bye-bye, missing from Friday
The hair quality was terrible
Is it fate that both parents and children cry in the locker?

Prohibition of unexplained use
Irresponsible and precious warmth
There were a lot of talisman stuck in the locker
Hey, Don't be silly

(At first glance!?)

Evidence destruction, display of girl
Without knowing mom
Spinning from pleasure
Innocently frozen finger
Hey good?
It's okay today

Feelings are anemic, bleeding ^^
Junk Kagura Karma
Who should I go to?
I can't tell anyone
I'm done ...
that's enough"""

# 此行源于 plugins/bili_resolve.py (line 130 in `binfo_image_create()` function)
# dynamic_cut_str = "\n".join(cut_text(dynamic, 58))

# 问题复现
items = cut_text(src, 58)
for item in items:
    # 文本 cut 后 
    print(item)

运行结果

https://youtu.be/m_RqjvVvvfA
💗🎃💗※イヤホンで聴くと左右動いて、とっても楽しくてオススメ
です。💗🎃💗
「ヒトよ、一夜に一目惚レ!?」
新曲完成しました。
ゾクゾクしたいそんな夜にどうぞ…
テーマは『信じてる』
イラストは田ゃむさん。イラスト最高なのでフォローするように。
もしよかったらコメント、チャンネル登録♪
「
なんねぇコレ!?」と思ったら低評価ボタン🥰お待ちしてます。
映
像・音楽:みつあくま https://twitter.com/mitsu_akuma
イラスト:田ゃむ https://twitter.com/tanabe0607
https://twitter.com/tanabe0607/status...
終わりペンギン:もずくず https://twitter.com/mzkzmm
プロセカNEXT応募曲です。ニーゴ好きでスマンな🥺
第
9回プロセカNEXT応募楽曲
コミュニティも最近、お世辞抜きに賑わいつつ更新中😍(国籍言語
問わず絡んでね)
https://www.youtube.com/channel/UCtne...
ジャンル:HYPER J-POP
#初音ミク #プロセカNEXT #みつあくま
サブテーマは処女懐胎 (Virgin birth)
Hey, rumors I heard recently
I
 feel so sad that I feel like I'm going to vomit
Day By Day, Mirror with bloody cracks
The girl was crouching and laughing at the front door
I put up with the pain
I'm used to the liquid with a bitter taste
I would be confused without you
Hey you? I will be a girl who is convenient for you...
Love...
Evidence destruction, girl innocence
Please keep it secret from mom
The bruise has disappeared, but the life (body) remains 
di
rty
Are you ready? not
 yet
Crack in the heart It's just st
range
Macaroons that are hard and cannot be 
chewed
Where should I hide it? I can't rely on
 anyone
Are you ready? that'

s enough

Comm
on worries
Waste money Tempor
ary illness
Give up and lig

ht a lighter

Hey, that child with the nicknam
e "bye fungus"
Bye-bye, miss
ing from Friday
The hair qual
ity was terrible
Is it fate that both parents and children 
c

ry in the locker?

Prohibition
 of unexplained use
Irresponsible
 and precious warmth
There were a lot of talisma
n stuck in the lock

er
Hey, Don't be si

lly

(At first glance!?)

Evidence de
struction, display 
of girl
Without knowin
g mom
Spinning from plea
sure
Inno
cently frozen f

inger
Hey good?
It's okay today
Feelings are anem
ic, bleeding ^^
Jun
k Kagura Karma
Who 
should I go 
to?
I can't tell anyone
I'm done ...
that's enough

预期结果

https://youtu.be/m_RqjvVvvfA
💗🎃💗※イヤホンで聴くと左右動いて、
とっても楽しくてオススメです。💗🎃💗

「ヒトよ、一夜に一目惚レ!?」

新曲完成しました。
ゾクゾクしたいそんな夜にどうぞ…

テーマは『信じてる』
イラストは田ゃむさん。
イラスト最高なのでフォローするように。

もしよかったらコメント、チャンネル登録♪
「なんねぇコレ!?」と思ったら低評価ボタン🥰お待ちしてます。

映像・音楽:みつあくま
https://twitter.com/mitsu_akuma
イラスト:田ゃむ
https://twitter.com/tanabe0607
https://twitter.com/tanabe0607/status...
終わりペンギン:もずくず
https://twitter.com/mzkzmm


プロセカNEXT応募曲です。ニーゴ好きでスマンな🥺
第9回プロセカNEXT応募楽曲

コミュニティも最近、お世辞抜きに賑わいつつ更新中😍
(国籍言語問わず絡んでね)
https://www.youtube.com/channel/UCtne...

ジャンル:HYPER J-POP
#初音ミク #プロセカNEXT #みつあくま
サブテーマは処女懐胎 (Virgin birth)


Hey, rumors I heard recently
I feel so sad that I feel like
I'm going to vomit Day By Day,
Mirror with bloody cracks
The girl was crouching
and laughing at the front door

I put up with the pain
I'm used to the liquid with a bitter taste
I would be confused without you
Hey you?
I will be a girl who is convenient for you...

Love...

Evidence destruction, girl innocence
Please keep it secret from mom
The bruise has disappeared,
but the life (body) remains dirty
Are you ready? not yet
Crack in the heart It's just strange
Macaroons that are hard and cannot be chewed
Where should I hide it?
I can't rely on anyone
Are you ready? that's enough

Common worries
Waste money Temporary illness
Give up and light a lighter

Hey, that child with the nickname "bye fungus"
Bye-bye, missing from Friday
The hair quality was terrible
Is it fate that both parents
and children cry in the locker?

Prohibition of unexplained use
Irresponsible and precious warmth
There were a lot of talisman stuck in the locker
Hey, Don't be silly

(At first glance!?)

Evidence destruction, display of girl
Without knowing mom
Spinning from pleasure
Innocently frozen finger
Hey good?
It's okay today

Feelings are anemic, bleeding ^^
Junk Kagura Karma
Who should I go to?
I can't tell anyone
I'm done ...
that's enough

启动出错

root@VM-16-3-ubuntu:/www/wwwroot/takker-1.3.0# poetry run python bot.py
02-27 16:32:57 [INFO] utils | 已禁用uvicorn自动重载
Traceback (most recent call last):
File "bot.py", line 5, in
from service.init import init_bot_startup, update_plugin_list
File "/www/wwwroot/takker-1.3.0/service/init.py", line 5, in
from service.db.db_connect import db_init
File "/www/wwwroot/takker-1.3.0/service/db/db_connect.py", line 8, in
models: list[str] = [
TypeError: 'type' object is not subscriptable
root@VM-16-3-ubuntu:/www/wwwroot/takker-1.3.0#

虚拟环境并启动Bot出错

在tmux用了python -m poetry shell后出现错误。
Spawning shell within /root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9
root@ubuntu-2004-tt:~/qbot/takker# . /root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9/bin/activate
并且后面命令行前面带有(takker-reborn-NcqX0U7w-py3.9)。

python bot.py报错

Traceback (most recent call last):
File "/root/qbot/takker/bot.py", line 1, in
import nonebot
File "/root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9/lib/python3.9/site-packages/nonebot/init.py", line 138, in
from .command import CommandSession, CommandGroup
File "/root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9/lib/python3.9/site-packages/nonebot/command/init.py", line 927, in
from nonebot.command.group import CommandGroup
File "/root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9/lib/python3.9/site-packages/nonebot/command/group.py", line 3, in
from nonebot.plugin import on_command
File "/root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9/lib/python3.9/site-packages/nonebot/plugin/init.py", line 17, in
from nonebot.matcher import Matcher
File "/root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9/lib/python3.9/site-packages/nonebot/matcher.py", line 16, in
from nonebot.rule import Rule
File "/root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9/lib/python3.9/site-packages/nonebot/rule.py", line 21, in
from nonebot import get_driver
ImportError: cannot import name 'get_driver' from partially initialized module 'nonebot' (most likely due to a circular import) (/root/.cache/pypoetry/virtualenvs/takker-reborn-NcqX0U7w-py3.9/lib/python3.9/site-packages/nonebot/init.py)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.