nonebot2/demo/__init__.py

23 lines
530 B
Python
Raw Normal View History

2018-08-15 23:43:33 +08:00
from os import path
2018-07-04 16:21:01 +08:00
import none
2018-08-15 23:43:33 +08:00
from demo import config
none.init(config)
2018-08-26 10:05:42 +08:00
2018-08-26 11:30:22 +08:00
@none.scheduler.scheduled_job('interval', seconds=20)
2018-08-26 10:05:42 +08:00
async def cb():
bot_ = none.get_bot()
try:
2018-08-26 11:30:22 +08:00
await bot_.send_private_msg(user_id=1002647525, message='')
2018-08-26 10:05:42 +08:00
except Exception as e:
none.logger.exception(e)
2018-07-04 16:21:01 +08:00
if __name__ == '__main__':
none.load_builtin_plugins()
2018-08-15 23:43:33 +08:00
none.load_plugins(path.join(path.dirname(__file__), 'plugins'),
'demo.plugins')
none.run(host=config.HOST, port=config.PORT)