我正在写一个Bot
for Telegram
using Python
( Using this as a Base ) 和Google App Engine
.
我创建了一个Datastore
存储用户在聊天中发送内容的频率的位置,并通过说更新计数器以防止垃圾邮件If Counter > x don't answer
。
class SpamFilterDB(ndb.Model):
UserID = ndb.IntegerProperty()
ChatID = ndb.IntegerProperty()
Counter = ndb.IntegerProperty()
一些示例数据:
现在我想在某个定义的时间(例如每天)再次将所有用户的计数器减少 x,以允许用户再次使用机器人。
怎么做?
注意:我想说我的 Python 技能还处于初级水平。