njyjn / attendancebot Goto Github PK
View Code? Open in Web Editor NEWA Telegram bot which helps Caregroup Leaders in Arrow Ministry tabulate their group attendance.
License: MIT License
A Telegram bot which helps Caregroup Leaders in Arrow Ministry tabulate their group attendance.
License: MIT License
Currently /event end
does not clear attendance data, only closes the event manually. Events automatically expire in 3 days but do not clear attendance data either. So CR has to manually enter /event clear
.
Add an expiry date to the cgs
collection (used to store tally for CG) and tally
collection (used to store tally for cluster and whole JC) as done for event
collection. Code below:
manager.py
begins = datetime.today()
expires = daysFrom(begins, 3)
expires_string = expires.strftime('%c')
events.save( { 'name': name, 'start': begins, 'end': expires, 'done': False, 'tally': 0, } )
/event report
2017-02-05 01:44:18,802 : INFO Received '/event report' from 'Justin' (87244565)
Traceback (most recent call last):
File "/home/justin/.local/lib/python3.5/site-packages/telepot/delegate.py", line 256, in wait_loop
j.on_message(msg)
File "/home/justin/.local/lib/python3.5/site-packages/telepot/helper.py", line 630, in augmented
return handler(msg)
File "/home/justin/.local/lib/python3.5/site-packages/telepot/helper.py", line 996, in on_message
self._router.route(msg)
File "/home/justin/.local/lib/python3.5/site-packages/telepot/helper.py", line 972, in route
return fn(msg, *args, **kwargs)
File "/home/justin/.local/lib/python3.5/site-packages/telepot/helper.py", line 980, in <lambda>
self._router = Router(flavor, {'chat': lambda msg: self.on_chat_message(msg),
File "main.py", line 183, in on_chat_message
reply(manager.printGrandTally())
File "/home/justin/webprojects/AttendanceBot/manager.py", line 409, in printGrandTally
total = getFinalString(tally.find_one( { } ))
File "/home/justin/webprojects/AttendanceBot/manager.py", line 387, in getFinalString
total = str(cgDoc['total'])
TypeError: 'NoneType' object is not subscriptable
2017-02-05 01:44:18,807 : ERROR on_close() called due to TypeError: 'NoneType' object is not subscriptable
Add try-except block to handle error, and send user an appropriate message.
/reject will send joining user an error/advisory message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.