Giter Site home page Giter Site logo

castpod's Introduction

castpod's People

Contributors

dahawong 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

Watchers

 avatar  avatar  avatar

Forkers

nonomal mayuxi jv0id

castpod's Issues

i18n

功能描述
国际化

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. _()
  2. gettext
  3. python_i18n
  4. search api 地区也需要转换,可在偏好设置中配置
  5. command scope
  6. User.language_code
  7. 自定义 chat_data['language'],可在偏好设置中配置
  8. decorator
  9. #46
  10. Readme

python-telegram-bot v13.6

功能描述
ptb 更新到了 13.6,为 bot 带来一些新变化。

实现方式

  1. callback_data 不再受制于 64 个字符,也就是说 inline-keyboard-button 可以传入其他类型的数据。
  2. ptb 为绝大多数 class 添加了 slots,减少内存使用。
  3. 传给 bot 的 defaults 不被推荐

如果您是开发者,可以提供相关的技术细节以供我们参考学习:

  1. Arbitrary callback_data

ValidationError (Podcast:6038ac1d9e5274ce0172763e) (Invalid scheme in URL: : ['website'])

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 24, in subscribe_feed
user.subscribe(podcast)
File "/home/daha/project/castpod/castpod/models.py", line 52, in subscribe
podcast.renew()
File "/home/daha/project/castpod/castpod/models.py", line 204, in renew
self.save()
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/document.py", line 378, in save
self.validate(clean=clean)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/base/document.py", line 433, in validate
raise ValidationError(message, errors=errors)

为播客广场中的消息添加按钮

功能描述
重构:修改原来的 text url 为真实的 url button。

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. 订阅
  2. 收藏
  3. 相关链接

Trying to dereference unknown document DBRef('podcast', ObjectId('6038b2cd9e5274ce017276f5'))

问题出现在 @castpodbot 之后,没有关键字的时候触发。

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/inline_query.py", line 31, in handle_inline_query
run_async(query.answer, list(results), **kwargs)
File "/home/daha/project/castpod/castpod/callbacks/inline_query.py", line 49, in show_subscription
podcast = subscription.podcast
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/fields.py", line 1225, in get
raise DoesNotExist("Trying to dereference unknown document %s" % value)

新指令:/wander & /favorite

功能描述
新功能:添加我的收藏指令(/favorite)、闲庭信步(/wander)指令。

实现方式

/favorite

  1. 以音频媒体组的形式回复
  2. 前提是用户收藏过单集

/wander

  1. 5 条编辑精选单集,考虑和 podsletter/weekpick 结合。(podsletter 每周精选 5 个不同播客单集)
  2. inline keyboard button
    - 继续漫步:推荐新的一批播客
    - 返回上一次漫步

人间指南 #10 下载失败

"p" tag is not closed

这类错误可能难以自动消除,需要规避异常,提供一个默认的相关链接地址。

取消订阅的播客重新订阅,收藏状态未清空

描述问题
取消订阅的播客重新订阅,收藏状态未清空

如何复现
我在进行如下操作的时候,机器人出错了:

  1. 订阅一个播客
  2. 收藏该播客
  3. 取消订阅后重新订阅
  4. 此时收藏状态依然存在

结果说明
应该看到收藏状态为空,但是却显示已收藏

始终置顶最近更新的单集

功能描述
新功能:每当播客单集更新,将其置顶,并将过去最旧的单集取消置顶,保持置顶列表中播客的个数(比如 5 个)。

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. 置顶最新更新的单集
  2. 自动删除置顶信息
  3. 取消最旧单集的置顶
  4. 置顶列表中播客的数量(有无、多少、有限无限)都可以在偏好设置中配置。

模糊搜索已订阅播客

功能描述
输入文本,返回模糊检索得到的第一个结果。(以前是完全匹配才返回结果)

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. Mongoengine search_text()

优化时间轴的呈现

功能描述
有的播客时间轴内容较长,考虑对其进行缩减。

实现方式

  1. 分页处理,每页至多 4 条时间轴,或根据文本实际长度判断
  2. 提供折叠键
  3. 提供偏好设置选项

修改订阅源文件下载地址

功能描述
服务端优化

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. 在 utils - parse_doc 中
  2. download 路径改成 public/subscriptions

如果您是开发者,可以提供相关的技术细节以供我们参考学习:

  1. File.download(custom_path: str = None, out: IO = None, timeout: int = None) → Union[str, IO]

开发者/管理员后台

功能描述
新功能:只有机器人拥有者可以管理的操作台

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. 主播的管理(增删改查)
  2. 使用者账号管理(查看、封禁)
  3. 统计数据(命令的使用次数)

mongoengine.errors.DoesNotExist: subscriptions matching query does not exist.

Traceback (most recent call last):
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/callback_query.py", line 109, in confirm_unsubscribe
user.unsubscribe(podcast)
File "/home/daha/project/castpod/castpod/models.py", line 57, in unsubscribe
self.update(pull__subscriptions=self.subscriptions.get(podcast=podcast))
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/base/datastructures.py", line 273, in get
raise DoesNotExist("%s matching query does not exist." % self._name)
mongoengine.errors.DoesNotExist: subscriptions matching query does not exist.

Bot API 5.3/ ptb v13.7

功能描述
bot api 更新至 5.3,带来一些新功能:

  1. command 以 menu 的形式移动到输入框左侧,得到了视觉强化;这个更改表明了 telegram 对 command 的重视;
  2. command scope 的诞生,不同的私聊、群聊、管理员、特殊用户(如开发者)可以拥有不同的指令。

相关议题

  1. #26
  2. #36
  3. #38
  4. #51
  5. 划分私聊、群聊的指令域

技术细节

  1. command scope
  2. ptb - 设置指令
  3. ptb - 指令域

<urlopen error timed out>

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 24, in subscribe_feed
user.subscribe(podcast)
File "/home/daha/project/castpod/castpod/models.py", line 52, in subscribe
podcast.renew()
File "/home/daha/project/castpod/castpod/models.py", line 182, in renew
result = feedparser.parse(self.feed)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/feedparser/api.py", line 214, in parse
data = _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/feedparser/api.py", line 114, in _open_resource
return http.get(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/feedparser/http.py", line 158, in get
f = opener.open(request)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 543, in _open
'_open', req)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 1393, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 1352, in do_open
raise URLError(err)

自定义单集 logo 加载过慢

功能描述
界面优化

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. 压缩 logo(降低清晰度?)并重新保存

通过多种方式获取主播 email

功能描述
优化:邮箱信息可能存在多个字段中,目前只检测了一种。

实现方式
以一天世界为例,参考以下数据:

{'author': '不鳥萬如一',
 'author_detail': {'email': '[email protected]', 'name': '不鳥萬如一'},
 'authors': [{'email': '[email protected]', 'name': '不鳥萬如一'}],
 'generator': 'Typlog (https://typlog.com)',
 'generator_detail': {'name': 'Typlog (https://typlog.com)'},
 'image': {'href': 'https://i.typlog.com/yitianshijie/7W/tnVvKh-Z0xzWG-t4G7mA.png?x-oss-process=style/sl'},
 'itunes_explicit': None,
 'itunes_type': 'episodic',
 'language': 'zh',
 'link': 'https://castro.fm/podcast/7b953900-6471-4629-a1bc-1c7167a51352',
 'links': [{'href': 'https://yitianshijie.net',
            'rel': 'alternate',
            'type': 'text/html'},
           {'href': 'https://yitianshijie.net/episodes/feed.xml',
            'rel': 'self',
            'type': 'application/rss+xml'},
           {'href': 'https://pubsubhubbub.appspot.com/',
            'rel': 'hub',
            'type': 'text/html'},
           {'href': 'https://itunes.apple.com/podcast/id1099645400',
            'icon': 'podcast',
            'rel': 'alternate',
            'title': 'iTunes',
            'type': 'text/html'},
           {'href': 'https://overcast.fm/itunes1099645400',
            'icon': 'overcast',
            'rel': 'alternate',
            'title': 'Overcast',
            'type': 'text/html'},
           {'href': 'https://castro.fm/podcast/7b953900-6471-4629-a1bc-1c7167a51352',
            'icon': 'castro',
            'rel': 'alternate',
            'title': 'Castro',
            'type': 'text/html'}],
 'published': 'Tue, 29 Jun 2021 10:43:39 +0000',
 'published_parsed': time.struct_time(tm_year=2021, tm_mon=6, tm_mday=29, tm_hour=10, tm_min=43, tm_sec=39, tm_wday=1, tm_yday=180, tm_isdst=0),
 'publisher_detail': {'email': '[email protected]', 'name': '不鳥萬如一'},
 'rights': 'IPN',
 'rights_detail': {'base': 'https://yitianshijie.net/episodes/feed.xml',
                   'language': None,
                   'type': 'text/plain',
                   'value': 'IPN'},
 'subtitle': '浓烟烈焰,摄魄勾魂;翱翔万里,神采飞扬',
 'subtitle_detail': {'base': 'https://yitianshijie.net/episodes/feed.xml',
                     'language': None,
                     'type': 'text/plain',
                     'value': '浓烟烈焰,摄魄勾魂;翱翔万里,神采飞扬'},
 'summary': '一天世界,昆乱不挡。不鳥萬如一主理。IPN 出品。\n'
            '\n'
            '《一天世界》博客:http://blog.yitianshijie.net',
 'summary_detail': {'base': 'https://yitianshijie.net/episodes/feed.xml',
                    'language': None,
                    'type': 'text/plain',
                    'value': '一天世界,昆乱不挡。不鳥萬如一主理。IPN 出品。\n'
                             '\n'
                             '《一天世界》博客:http://blog.yitianshijie.net'},
 'tags': [{'label': None,
           'scheme': 'http://www.itunes.com/',
           'term': 'Technology'}],
 'title': '一天世界',
 'title_detail': {'base': 'https://yitianshijie.net/episodes/feed.xml',
                  'language': None,
                  'type': 'text/plain',
                  'value': '一天世界'}}

'NoneType' object has no attribute 'subscribers'

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/utils.py", line 127, in wrapped
func(update, context, *args, **kwargs)
File "/home/daha/project/castpod/castpod/callbacks/command.py", line 19, in start
user.subscribe(podcast)
File "/home/daha/project/castpod/castpod/models.py", line 50, in subscribe
if self in podcast.subscribers:

群组模式

功能描述
新功能:群组管理员在 Bot 中添加订阅,该群便可以收到节目更新

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. 新的指令
  • 思考与主播模式的区别

'NoneType' object is not iterable

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/inline_query.py", line 31, in handle_inline_query
run_async(query.answer, list(results), **kwargs)

用 InlineQueryResultCachedPhoto 替代 InlineQueryResultPhoto

在 Podcast 模型中添加 logo file id 字段,存储 Telegram 中的 file_id。

在播客页即上传 logo 本身,以替代原来的 url 获取方式。上传后获取 logo 的 file id 并存储下来。

这样便可以直接调取 telegram 缓存的图片。

show_podcast 函数无法解析某些 message

描述问题
can't find end of the entity starting at byte offset 120

错误截图
Traceback (most recent call last):
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 442, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 160, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 233, in show_podcast
reply_markup=InlineKeyboardMarkup(page.keyboard())

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/message.py", line 647, in reply_text
entities=entities,
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/bot.py", line 126, in decorator
result = func(*args, **kwargs)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/bot.py", line 482, in send_message
api_kwargs=api_kwargs,
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/bot.py", line 295, in _message
result = self._post(endpoint, data, timeout=timeout, api_kwargs=api_kwargs)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/bot.py", line 259, in _post
f'{self.base_url}/{endpoint}', data=data, timeout=effective_timeout
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/utils/request.py", line 354, in post
**urlopen_kwargs,
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/utils/request.py", line 272, in _request_wrapper
raise BadRequest(message)
telegram.error.BadRequest: Can't parse entities: can't find end of the entity starting at byte offset 120

object has no attribute 'author_detail'

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 24, in subscribe_feed
user.subscribe(podcast)
File "/home/daha/project/castpod/castpod/models.py", line 52, in subscribe
podcast.renew()
File "/home/daha/project/castpod/castpod/models.py", line 199, in renew
self.host = unescape(feed.author_detail.name or '')
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/feedparser/util.py", line 158, in getattr
raise AttributeError("object has no attribute '%s'" % key)

过长的播客无法下载

需要一个异常捕获,当 Telegram 超时的时候,告知使用者请等待至节目传送回来。

利用 context.bot_data 暂时存储 播客id、节目id、下载者 id。发送完毕时清空。

每周精选 podsletter

功能描述
新项目,不完全与开发相关。

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. newsletter
  2. 推送私聊/群组
  3. #38 /wander 结合
  4. 听众投稿通道 - via bot

The read operation timed out

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 24, in subscribe_feed
user.subscribe(podcast)
File "/home/daha/project/castpod/castpod/models.py", line 52, in subscribe
podcast.renew()

** File "/home/daha/project/castpod/castpod/models.py", line 182, in renew
result = feedparser.parse(self.feed)**

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/feedparser/api.py", line 214, in parse
data = _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/feedparser/api.py", line 114, in _open_resource
return http.get(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/feedparser/http.py", line 158, in get
f = opener.open(request)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 543, in _open
'_open', req)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 1393, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/urllib/request.py", line 1353, in do_open
r = h.getresponse()
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/http/client.py", line 1369, in getresponse
response.begin()
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/http/client.py", line 310, in begin
version, status, reason = self._read_status()
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/http/client.py", line 271, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib-python/3/ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/lib_pypy/_cffi_ssl/_stdssl/init.py", line 647, in read
raise socket.timeout("The read operation timed out")

优化用户链接

用户链接可以直接用 User.link 生成,尤其在开发者链接处。

ValidationError (Episode:None) (size.30.1 MB could not be converted to int: ['audio'])

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 24, in subscribe_feed
user.subscribe(podcast)
File "/home/daha/project/castpod/castpod/models.py", line 52, in subscribe
podcast.renew()
File "/home/daha/project/castpod/castpod/models.py", line 197, in renew
self.update(push__episodes=episode)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/document.py", line 610, in update
return self._qs.filter(**self._object_key).update_one(**kwargs)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/queryset/base.py", line 636, in update_one
**update,
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/queryset/base.py", line 555, in update
update = transform.update(queryset._document, **update)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/queryset/transform.py", line 317, in update
value = field.prepare_query_value(op, value)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/fields.py", line 973, in prepare_query_value
return self.field.prepare_query_value(op, value)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/fields.py", line 795, in prepare_query_value
super().prepare_query_value(op, value)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/base/fields.py", line 192, in prepare_query_value
self.validate(value)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/fields.py", line 774, in validate
self.document_type.validate(value, clean)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/base/document.py", line 433, in validate
raise ValidationError(message, errors=errors)

播客源链接的 Validation

功能描述
服务端优化:由于 mongoengine 自带的 URL 认证不支持 http 以及会带来一系列其他问题,所以暂时将的 URL 认证模式改成了 StringField。但这并不是好的做法。

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤:

  1. 使用自定义的正则表达式覆写 mongoengine 自带认证

ValidationError (Episode:None) (url.Invalid URL: https://media.devchat.tv/ruby-rogues/RR259JayBobo.mp3?rss=true : ['audio'])

File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
handler.handle_update(update, self, check, context)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/ext/handler.py", line 156, in handle_update
return self.callback(update, context)
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 24, in subscribe_feed
user.subscribe(podcast)
File "/home/daha/project/castpod/castpod/models.py", line 52, in subscribe
podcast.renew()
File "/home/daha/project/castpod/castpod/models.py", line 197, in renew
self.update(push__episodes=episode)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/document.py", line 610, in update
return self._qs.filter(**self._object_key).update_one(**kwargs)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/queryset/base.py", line 636, in update_one
**update,
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/queryset/base.py", line 555, in update
update = transform.update(queryset._document, **update)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/queryset/transform.py", line 317, in update
value = field.prepare_query_value(op, value)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/fields.py", line 973, in prepare_query_value
return self.field.prepare_query_value(op, value)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/fields.py", line 795, in prepare_query_value
super().prepare_query_value(op, value)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/base/fields.py", line 192, in prepare_query_value
self.validate(value)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/fields.py", line 774, in validate
self.document_type.validate(value, clean)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/base/document.py", line 433, in validate
raise ValidationError(message, errors=errors)

我的收藏

功能描述
界面重构:/manage 中提供「我的收藏」
跳转按钮,同样以 reply keyboard 的形式管理

实现方式

  1. 管理界面和收藏界面互相跳转
  2. 替换之前的变量名 fav 为 saved star

'NoneType' object has no attribute 'delete'

Traceback (most recent call last):
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 71, in save_subscription
podcast = Podcast.validate_feed(feed['url'])
File "/home/daha/project/castpod/castpod/models.py", line 170, in validate_feed
return podcast or cls(feed=feed).save()
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/document.py", line 378, in save
self.validate(clean=clean)
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/mongoengine/base/document.py", line 433, in validate
raise ValidationError(message, errors=errors)
mongoengine.errors.ValidationError: ValidationError (Podcast:None) (Invalid scheme http in URL: http://pan.icu/feed: ['feed'])

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/daha/download/pypy3.7-v7.3.2-linux64/site-packages/telegram/utils/promise.py", line 77, in run
self._result = self.pooled_function(*self.args, **self.kwargs)
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 118, in save_subscription
raise e
File "/home/daha/project/castpod/castpod/callbacks/message.py", line 75, in save_subscription
podcast.delete()
AttributeError: 'NoneType' object has no attribute 'delete'

Common FM 疑似节目冗余

如何复现
我在进行如下操作的时候,机器人出错了:

  1. inline query 不断下拉

结果说明
应该看到正常顺序,但是出现乱序、多数的情况

MongoDB Persistence

功能描述
用 mongodb 实现对话数据、机器人数据的长效存储

实现方式
你希望怎么实现它?比如提供一些可能的操作步骤

如果您是开发者,可以提供相关的技术细节以供我们参考学习:

  1. pgsql persistence

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.