Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

点赞功能的半成品 #58

Merged
merged 9 commits into from
Oct 22, 2023
Merged

点赞功能的半成品 #58

merged 9 commits into from
Oct 22, 2023

Conversation

Tosd0
Copy link
Contributor

@Tosd0 Tosd0 commented Oct 22, 2023

#57

@LambdaYH
Copy link
Collaborator

试过用state就行了,看看有啥要加的(比如likes

@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

诶 是我这里的问题吗,,竟然成下面这个样子了,nb-cli是最新的

欢迎使用 NoneBot CLI!
[?] 你想要进行什么操作? 管理 NB CLI.
[?] 你想要进行什么操作? 更新 cli.
Requirement already satisfied: nb-cli in /root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages (1.2.5)
root@VM-4-8-ubuntu:~/GZbot2# poetry run nb datastore upgrade
10-22 14:15:11 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_datastore"
Usage:  [OPTIONS] COMMAND [ARGS]...
Try ' --help' for help.

Error: No such command 'install'.

@LambdaYH
Copy link
Collaborator

其实不运行也没事,试过会自动更新表结构,只是datastore建议运行,
需要依赖加一下
https://github.com/he0119/nonebot-plugin-datastore#%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%94%AF%E6%8C%81%E9%9C%80%E5%AE%89%E8%A3%85-nb-cli-10

@LambdaYH
Copy link
Collaborator

(不过现在datastore作者都开始迁移到nb orm了,本来也想迁移的,但是gocq停止维护后就先摆一摆看看风向

@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

其实不运行也没事,试过会自动更新表结构,只是datastore建议运行, 需要依赖加一下 https://github.com/he0119/nonebot-plugin-datastore#%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%94%AF%E6%8C%81%E9%9C%80%E5%AE%89%E8%A3%85-nb-cli-10

Requirement already satisfied: nonebot-plugin-datastore[cli] in /root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages (1.1.2)
然而还是有这个报错(´・Д・)」那就不运行了 笑死

(不过现在datastore作者都开始迁移到nb orm了,本来也想迁移的,但是gocq停止维护后就先摆一摆看看风向

gocq停更了 ob协议应该不受影响吧,看他们说Lagrange以及很多框架都在适配ob v11()
确实迁移新数据库好麻烦()那就摆一摆

@LambdaYH
Copy link
Collaborator

试试poetry shell进去后再运行(

@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

我服了,难道不运行upgrade不行吗

10-22 14:28:29 [ERROR] uvicorn | Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1963, in _exec_single_context
    self.dialect.do_execute(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
    cursor.execute(statement, parameters)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 113, in execute
    self._adapt_connection._handle_exception(error)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 254, in _handle_exception
    raise error
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 95, in execute
    self.await_(_cursor.execute(operation, parameters))
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 102, in await_only
    return current.driver.switch(awaitable)  # type: ignore[no-any-return]
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 160, in greenlet_spawn
    value = await result
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/cursor.py", line 37, in execute
    await self._execute(self._cursor.execute, sql, parameters)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/cursor.py", line 31, in _execute
    return await self._conn._execute(fn, *args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/core.py", line 129, in _execute
    return await future
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/core.py", line 102, in run
    result = function()
sqlite3.OperationalError: Cannot add a NOT NULL column with default value NULL

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 677, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 168, in _lifespan_manager
    await self._lifespan.startup()
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot/drivers/_lifespan.py", line 36, in startup
    await self._run_lifespan_func(self._startup_funcs)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot/drivers/_lifespan.py", line 30, in _run_lifespan_func
    await cast(ASYNC_LIFESPAN_FUNC, func)()
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_datastore/db.py", line 104, in init_db
    await upgrade(config, "head")
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_datastore/script/command.py", line 245, in upgrade
    await run_migration()
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_datastore/script/utils.py", line 122, in run_migration
    await connection.run_sync(do_run_migrations, plugin_name)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/engine.py", line 841, in run_sync
    return await greenlet_spawn(fn, self._proxied, *arg, **kw)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 167, in greenlet_spawn
    result = context.switch(value)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_datastore/script/utils.py", line 114, in do_run_migrations
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/runtime/environment.py", line 868, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/runtime/migration.py", line 622, in run_migrations
    step.migration_fn(**kw)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_bottle/migrations/01a750736ea0_add_like.py", line 28, in upgrade
    with op.batch_alter_table("nonebot_plugin_bottle_bottle", schema=None) as batch_op:
  File "/usr/local/lib/python3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/operations/base.py", line 383, in batch_alter_table
    impl.flush()
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/operations/batch.py", line 113, in flush
    fn(*arg, **kw)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/ddl/impl.py", line 322, in add_column
    self._exec(base.AddColumn(table_name, column, schema=schema))
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/ddl/impl.py", line 193, in _exec
    return conn.execute(  # type: ignore[call-overload]
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1413, in execute
    return meth(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/sql/ddl.py", line 181, in _execute_on_connection
    return connection._execute_ddl(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1525, in _execute_ddl
    ret = self._execute_context(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1841, in _execute_context
    return self._exec_single_context(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1982, in _exec_single_context
    self._handle_dbapi_exception(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2339, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1963, in _exec_single_context
    self.dialect.do_execute(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
    cursor.execute(statement, parameters)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 113, in execute
    self._adapt_connection._handle_exception(error)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 254, in _handle_exception
    raise error
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 95, in execute
    self.await_(_cursor.execute(operation, parameters))
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 102, in await_only
    return current.driver.switch(awaitable)  # type: ignore[no-any-return]
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 160, in greenlet_spawn
    value = await result
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/cursor.py", line 37, in execute
    await self._execute(self._cursor.execute, sql, parameters)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/cursor.py", line 31, in _execute
    return await self._conn._execute(fn, *args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/core.py", line 129, in _execute
    return await future
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/core.py", line 102, in run
    result = function()
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Cannot add a NOT NULL column with default value NULL
[SQL: ALTER TABLE nonebot_plugin_bottle_bottle ADD COLUMN "like" INTEGER NOT NULL]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
image

@LambdaYH
Copy link
Collaborator

我服了,难道不运行upgrade不行吗

10-22 14:28:29 [ERROR] uvicorn | Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1963, in _exec_single_context
    self.dialect.do_execute(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
    cursor.execute(statement, parameters)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 113, in execute
    self._adapt_connection._handle_exception(error)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 254, in _handle_exception
    raise error
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 95, in execute
    self.await_(_cursor.execute(operation, parameters))
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 102, in await_only
    return current.driver.switch(awaitable)  # type: ignore[no-any-return]
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 160, in greenlet_spawn
    value = await result
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/cursor.py", line 37, in execute
    await self._execute(self._cursor.execute, sql, parameters)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/cursor.py", line 31, in _execute
    return await self._conn._execute(fn, *args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/core.py", line 129, in _execute
    return await future
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/core.py", line 102, in run
    result = function()
sqlite3.OperationalError: Cannot add a NOT NULL column with default value NULL

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 677, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 168, in _lifespan_manager
    await self._lifespan.startup()
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot/drivers/_lifespan.py", line 36, in startup
    await self._run_lifespan_func(self._startup_funcs)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot/drivers/_lifespan.py", line 30, in _run_lifespan_func
    await cast(ASYNC_LIFESPAN_FUNC, func)()
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_datastore/db.py", line 104, in init_db
    await upgrade(config, "head")
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_datastore/script/command.py", line 245, in upgrade
    await run_migration()
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_datastore/script/utils.py", line 122, in run_migration
    await connection.run_sync(do_run_migrations, plugin_name)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/engine.py", line 841, in run_sync
    return await greenlet_spawn(fn, self._proxied, *arg, **kw)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 167, in greenlet_spawn
    result = context.switch(value)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_datastore/script/utils.py", line 114, in do_run_migrations
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/runtime/environment.py", line 868, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/runtime/migration.py", line 622, in run_migrations
    step.migration_fn(**kw)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/nonebot_plugin_bottle/migrations/01a750736ea0_add_like.py", line 28, in upgrade
    with op.batch_alter_table("nonebot_plugin_bottle_bottle", schema=None) as batch_op:
  File "/usr/local/lib/python3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/operations/base.py", line 383, in batch_alter_table
    impl.flush()
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/operations/batch.py", line 113, in flush
    fn(*arg, **kw)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/ddl/impl.py", line 322, in add_column
    self._exec(base.AddColumn(table_name, column, schema=schema))
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/alembic/ddl/impl.py", line 193, in _exec
    return conn.execute(  # type: ignore[call-overload]
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1413, in execute
    return meth(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/sql/ddl.py", line 181, in _execute_on_connection
    return connection._execute_ddl(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1525, in _execute_ddl
    ret = self._execute_context(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1841, in _execute_context
    return self._exec_single_context(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1982, in _exec_single_context
    self._handle_dbapi_exception(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2339, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1963, in _exec_single_context
    self.dialect.do_execute(
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
    cursor.execute(statement, parameters)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 113, in execute
    self._adapt_connection._handle_exception(error)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 254, in _handle_exception
    raise error
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 95, in execute
    self.await_(_cursor.execute(operation, parameters))
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 102, in await_only
    return current.driver.switch(awaitable)  # type: ignore[no-any-return]
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 160, in greenlet_spawn
    value = await result
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/cursor.py", line 37, in execute
    await self._execute(self._cursor.execute, sql, parameters)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/cursor.py", line 31, in _execute
    return await self._conn._execute(fn, *args, **kwargs)
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/core.py", line 129, in _execute
    return await future
  File "/root/.cache/pypoetry/virtualenvs/gzbot2-_9hSRCdM-py3.10/lib/python3.10/site-packages/aiosqlite/core.py", line 102, in run
    result = function()
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Cannot add a NOT NULL column with default value NULL
[SQL: ALTER TABLE nonebot_plugin_bottle_bottle ADD COLUMN "like" INTEGER NOT NULL]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
image

马上修(,在空数据库里测试所以没出现这个问题

@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

试试poetry shell进去后再运行(

也不行——
这个算是datastore的问题吗 我去那边问吧(

@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

马上修(,在空数据库里测试所以没出现这个问题

笑死()

@LambdaYH
Copy link
Collaborator

试试poetry shell进去后再运行(

也不行—— 这个算是datastore的问题吗 我去那边问吧(

image

我用pdm不会有问题

@LambdaYH
Copy link
Collaborator

LambdaYH commented Oct 22, 2023

修好了,但是可能之前迁移失败的数据库里得点drop nonebot_plugin_bottle_like

@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

我吐了 我突然发现got好像会直接阻断事件进程。。
这样用户在捡完漂流瓶后,下一个指令就无法触发任何的东西了,我去翻文档 got和receive都做不到不中断,同时监听的。
可能得把+这一个字符单独注册成一个命令了()

@LambdaYH
Copy link
Collaborator

试试看最新的pr

@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

试试看最新的pr

我本来还注册了一个新的指令,绷不住了
还因为nonebot无法匹配非纯文本感到无语,结果matcher block竟然都能改吗(惊)
翻遍了偌大的文档,差点引入plugin-alconna。本来还想到一个投机取巧的方式,设一个config,通过一个,我也不知道是不是bug的东西来绕开start cmd。
卧槽。真的可行,给跪了
应该是没有其他问题了

@LambdaYH
Copy link
Collaborator

用rule也行

@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

用rule也行

Rule在文档里提及的好少……所以就没看明白()
https://nonebot.dev/docs/appendices/rule#rule

编:如果是rule的话就直接写fullmatch("+")?

@LambdaYH
Copy link
Collaborator

LambdaYH commented Oct 22, 2023

用rule也行

Rule在文档里提及的好少……所以就没看明白() https://nonebot.dev/docs/appendices/rule#rule

编:如果是rule的话就直接写fullmatch("+")?

大概用 on_message吧(,然后写rule判断要不要触发(不知道你要怎样的非纯文本

@LambdaYH LambdaYH merged commit 1ed0180 into Todysheep:main Oct 22, 2023
@Tosd0
Copy link
Contributor Author

Tosd0 commented Oct 22, 2023

用rule也行

Rule在文档里提及的好少……所以就没看明白() https://nonebot.dev/docs/appendices/rule#rule
编:如果是rule的话就直接写fullmatch("+")?

大概用 on_message吧(,然后写rule判断要不要触发(不知道你要怎样的非纯文本

哦哦!好像可行 但是不用去想了毕竟肯定比这个麻烦哈哈哈哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants