mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-28 00:31:14 +00:00
Rename package to "nonebot"
This commit is contained in:
@ -1,22 +1,22 @@
|
||||
from os import path
|
||||
|
||||
import none
|
||||
import nonebot
|
||||
from demo import config
|
||||
|
||||
none.init(config)
|
||||
nonebot.init(config)
|
||||
|
||||
|
||||
@none.scheduler.scheduled_job('interval', seconds=20)
|
||||
@nonebot.scheduler.scheduled_job('interval', seconds=20)
|
||||
async def cb():
|
||||
bot_ = none.get_bot()
|
||||
bot_ = nonebot.get_bot()
|
||||
try:
|
||||
await bot_.send_private_msg(user_id=1002647525, message='哇')
|
||||
except Exception as e:
|
||||
none.logger.exception(e)
|
||||
nonebot.logger.exception(e)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
none.load_builtin_plugins()
|
||||
none.load_plugins(path.join(path.dirname(__file__), 'plugins'),
|
||||
'demo.plugins')
|
||||
none.run(host=config.HOST, port=config.PORT)
|
||||
nonebot.load_builtin_plugins()
|
||||
nonebot.load_plugins(path.join(path.dirname(__file__), 'plugins'),
|
||||
'demo.plugins')
|
||||
nonebot.run(host=config.HOST, port=config.PORT)
|
||||
|
Reference in New Issue
Block a user