Update module.py

- specify logging context
This commit is contained in:
Harsha Raghu
2022-01-18 00:16:14 +05:30
parent 724a39a940
commit 61d192e27b

View File

@@ -1,3 +1,4 @@
from multiprocessing import context
from LionModule import LionModule from LionModule import LionModule
from LionContext import register_reply_callback, unregister_reply_callback from LionContext import register_reply_callback, unregister_reply_callback
from meta.client import client from meta.client import client
@@ -9,17 +10,17 @@ module = LionModule("Topgg")
@module.launch_task @module.launch_task
async def register_hook(client): async def register_hook(client):
client.log("register_reply_hook " )
init_webhook() init_webhook()
register_reply_callback(reply) register_reply_callback(reply)
client.log("Registered LionContext reply util hook.", context="Topgg" )
@module.unload_task @module.unload_task
async def unregister_hook(client): async def unregister_hook(client):
client.log("register_reply_hook " )
unregister_reply_callback(reply) unregister_reply_callback(reply)
client.log("Unregistered LionContext reply util hook.", context="Topgg" )
def reply(util_func, *args, **kwargs): def reply(util_func, *args, **kwargs):
# *args will have LionContext # *args will have LionContext
@@ -43,6 +44,5 @@ def reply(util_func, *args, **kwargs):
args['content'] = "\n\nUpvote me to get 🌟**+25% Economy Boost**🌟 - Use `!vote`" args['content'] = "\n\nUpvote me to get 🌟**+25% Economy Boost**🌟 - Use `!vote`"
args = tuple(args) args = tuple(args)
client.log('test')
return [args, kwargs] return [args, kwargs]