Coder Social home page Coder Social logo

omega-miya's Issues

重复签到bug

nonebot2_miya/omega_miya/plugins/omega_sign_in/utils.py 第335行,应为file://

吐槽一下数据库

为什么建库的时候不顺便存一下图片列表呢,url字段我之前以为是图片,结果是详情页....
然后由于这个原因,你查库获取图片的时候,只获取了pid,其他的数据是重新获取了一遍,
这个是我修改后的数据库

image

我又想到一个功能

不是经常有一些乱七八糟的邀人活动吗
image
可以做个功能,根据指定的关键词,撤回发言
大致想了想,然后我直接加到防闪图下面了
image

闪照功能

其实我自己做了,不过做的比较糙,在nonebot2_miya/omega_miya/utils/Omega_plugin_utils/rules.py中添加
from nonebot.adapters.cqhttp import MessageEvent
def has_flash_permission() -> Rule:
async def _has_flash_permission(bot: Bot, event: MessageEvent, state: T_State) -> bool:
msg = str(event.get_message())
# 检查当前消息类型
if 'type=flash,' in msg:
return True
else:
return False
return Rule(_has_flash_permission)
就能检测闪照了
顺便吐槽一句,github的代码块功能真烂

Future: Pixiv订阅

订阅画师作品更新
因画师作品内容不定,将不与萌图插件共用pixiv_illust表

Future: 综合管理功能

TODO

  • 把Omega_auto_manager里面功能重构整合
    • ✅自定义欢迎信息
    • ✅按规则同意加好友请求(申请加好友验证码)
    • ✅自动同意被邀请进群(验证邀请人权限)
    • ✅退群命令
  • ✅群身份检测和处理
  • ✅ban/de-ban
  • ✅流控限制
  • ✅定时消息

订阅warning

image
/usr/local/lib/python3.9/dist-packages/apscheduler/triggers/cron/init.py:159: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
return self.timezone.localize(datetime(**values))
/usr/local/lib/python3.9/dist-packages/apscheduler/triggers/cron/init.py:146: PytzUsageWarning: The normalize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
return self.timezone.normalize(dateval + difference), fieldnum

image

/usr/local/lib/python3.9/dist-packages/apscheduler/util.py:95: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
if obj.zone == 'local':

Future: Twitter订阅

订阅推特更新

目前Subscription表sub_id字段为int,为满足之后可能更多的订阅类型的需要,计划将该字段调整为str类型,并对其他相关字段进行优化,数据表结构将不可避免地再进行一次调整QAQ

数据库初始化失败

数据库初始化失败, error: InternalError("(pymysql.err.InternalError) (1071, 'Specified key was too long; max key length is 767 bytes')")

Traceback (most recent call last):
  File "/www/workplace/omega-miya/omega_miya/utils/Omega_Base/database.py", line 45, in database_init
    await conn.run_sync(Base.metadata.create_all)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/ext/asyncio/engine.py", line 472, in run_sync
    return await greenlet_spawn(fn, conn, *arg, **kw)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 120, in greenlet_spawn
    result = context.throw(*sys.exc_info())
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/schema.py", line 4744, in create_all
    bind._run_ddl_visitor(
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2081, in _run_ddl_visitor
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/visitors.py", line 485, in traverse_single
    return meth(obj, **kw)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 846, in visit_metadata
    self.traverse_single(
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/visitors.py", line 485, in traverse_single
    return meth(obj, **kw)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 902, in visit_table
    self.traverse_single(index, create_ok=True)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/visitors.py", line 485, in traverse_single
    return meth(obj, **kw)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 933, in visit_index
    self.connection.execute(CreateIndex(index))
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/future/engine.py", line 280, in execute
    return self._execute_20(
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1582, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 77, in _execute_on_connection
    return connection._execute_ddl(
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1352, in _execute_ddl
    ret = self._execute_context(
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1813, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1994, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
    raise exception
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1770, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/dialects/mysql/aiomysql.py", line 95, in execute
    return self.await_(self._execute_async(operation, parameters))
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 62, in await_only
    return current.driver.switch(awaitable)
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 115, in greenlet_spawn
    value = await result
  File "/usr/local/python3/lib/python3.9/site-packages/sqlalchemy/dialects/mysql/aiomysql.py", line 107, in _execute_async
    result = await self._cursor.execute(operation, parameters)
  File "/usr/local/python3/lib/python3.9/site-packages/aiomysql/cursors.py", line 239, in execute
    await self._query(query)
  File "/usr/local/python3/lib/python3.9/site-packages/aiomysql/cursors.py", line 457, in _query
    await conn.query(q)
  File "/usr/local/python3/lib/python3.9/site-packages/aiomysql/connection.py", line 428, in query
    await self._read_query_result(unbuffered=unbuffered)
  File "/usr/local/python3/lib/python3.9/site-packages/aiomysql/connection.py", line 622, in _read_query_result
    await result.read()
  File "/usr/local/python3/lib/python3.9/site-packages/aiomysql/connection.py", line 1105, in read
    first_packet = await self.connection._read_packet()
  File "/usr/local/python3/lib/python3.9/site-packages/aiomysql/connection.py", line 593, in _read_packet
    packet.check_error()
  File "/usr/local/python3/lib/python3.9/site-packages/pymysql/protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "/usr/local/python3/lib/python3.9/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1071, 'Specified key was too long; max key length is 767 bytes')
[SQL: CREATE UNIQUE INDEX ix_omega_pixiv_tag_tagname ON omega_pixiv_tag (tagname)]
(Background on this error at: http://sqlalche.me/e/14/2j85)

Future: Web GUI 界面

  • 基础功能重构,函数、类等全部改小、精简
  • 新增后台管理功能,考虑使用成熟的开源 Web UI 实现
  • 后期考虑全插件 GUI 适配

签到触发两次

是否与我设置的配置文件,可以不加分号触发命令有关
image

关于功能的疑问&一些建议

疑问:
1.来点萌图 / 来点涩图这个功能是要自己导入图片吗?使用/来点萌图都会提示找不到萌图QAQ(机器人已部署在外网)
建议:
1.能否增加油管订阅
2.能否增加推特订阅
3.能否增加嘴臭功能
4.抽卡功能增加PCR和原神

pixiv根据pid获取作品多图问题

这个功能好像是不可用的,我昨天试了发多图的pid,返回的只有第一张
我之前以为是没有这个功能,然后发现是好像功能失效了
image

问个问题,非bug

我自己写了一些ghs的插件,发的内容都比较那啥
我想起之前在tg的时候,那边很多机器人都是发完一段时间后自动撤回
这个框架能做自动撤回吗

没有群组命令权限

没配置超级用户的qq号无法使用命令吗?另外问一下机器人是在国内服务器挂的,http代理应该怎么搞?难道装个v2ray吗?

签到插件启动出错

启动时会报错def __get_level(favorability: float) -> tuple[int, int, int]: 的 'type' object is not subscriptable
但我删掉-> tuple[int, int, int]就能正常使用 能知道是什么原因吗

关于代理问题

我想看Pixiv日榜,然后发现图片下载失败,
于是我挂了代理,依然失败,这是为什么?是我哪里没有配置吗
QQ图片20210414152319
QQ图片20210414152335
QQ图片20210414152338
QQ图片20210414152341

图片添加噪点防河蟹

刚才看群友聊天说为了防和谐,有人用发作业的形式发涩图
然后忽然想起之防和谐做的发送前添加噪点,用了几个星期,效果还行,r18的都不会和谐掉

import cv2
import numpy as np
def random_noise(image):
'''
添加随机噪点(实际上就是随机在图像上将像素点的灰度值变为255即白色)
:param image: 需要加噪的图片途径
:param noise_num: 添加的噪音点数目,几个就行
:return: img_noise
'''
#
noise_num = random.randint(1, 10)
# 参数image:,noise_num:
img = cv2.imread(image)
img_noise = img
# cv2.imshow("src", img)
rows, cols, chn = img_noise.shape
# 加噪声
for i in range(noise_num):
x = np.random.randint(0, rows) # 随机生成指定范围的整数
y = np.random.randint(0, cols)
img_noise[x, y, :] = 255
cv2.imwrite(image, img_noise)

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.