Moved handlers to another location
This commit is contained in:
38
poster.py
38
poster.py
@@ -116,13 +116,12 @@ pid = getpid()
|
||||
|
||||
|
||||
# Imports ==================================================================================================================================
|
||||
from modules.commands.general import *
|
||||
from modules.commands_register import register_commands
|
||||
from plugins.commands.general import *
|
||||
|
||||
if configGet("submit", "mode"):
|
||||
from modules.callbacks.submission import *
|
||||
from modules.commands.mode_submit import *
|
||||
from modules.handlers.submission import *
|
||||
from plugins.callbacks.submission import *
|
||||
from plugins.commands.mode_submit import *
|
||||
from plugins.handlers.submission import *
|
||||
|
||||
if configGet("api_based", "mode"):
|
||||
from modules.api_client import authorize
|
||||
@@ -139,6 +138,35 @@ if configGet("api_based", "mode"):
|
||||
# # else:
|
||||
# # logWrite(f"Got raw update of type {type(update)} with contents {update}", debug=True)
|
||||
|
||||
# async def main():
|
||||
|
||||
# await app.start()
|
||||
|
||||
# logWrite(locale("startup", "console", locale=configGet("locale")).format(str(pid)))
|
||||
|
||||
# if configGet("startup", "reports"):
|
||||
# await app.send_message(configGet("admin"), locale("startup", "message", locale=configGet("locale")).format(str(pid)))
|
||||
|
||||
# if configGet("post", "mode"):
|
||||
# scheduler.start()
|
||||
|
||||
# if configGet("api_based", "mode"):
|
||||
# token = authorize()
|
||||
# if len(get(f'{configGet("address", "posting", "api")}/albums?q={configGet("queue", "posting", "api", "albums")}', headers={"Authorization": f"Bearer {token}"}).json()["results"]) == 0:
|
||||
# post(f'{configGet("address", "posting", "api")}/albums?name={configGet("queue", "posting", "api", "albums")}&title={configGet("queue", "posting", "api", "albums")}', headers={"Authorization": f"Bearer {token}"})
|
||||
|
||||
# await idle()
|
||||
|
||||
# await app.send_message(configGet("admin"), locale("shutdown", "message", locale=configGet("locale")).format(str(pid)))
|
||||
# logWrite(locale("shutdown", "console", locale=configGet("locale")).format(str(pid)))
|
||||
|
||||
# killProc(pid)
|
||||
|
||||
# if __name__ == "__main__":
|
||||
# if find_spec("uvloop") is not None:
|
||||
# uvloop.install()
|
||||
# asyncio.run(main())
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
logWrite(locale("startup", "console", locale=configGet("locale")).format(str(pid)))
|
||||
|
Reference in New Issue
Block a user