Init Framework

This commit is contained in:
Harsha Raghu
2022-01-13 14:03:23 +05:30
parent 67fc05d496
commit 3e0c1be33e
4 changed files with 36 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ from .stats import *
from .user_config import * from .user_config import *
from .workout import * from .workout import *
from .todo import * from .todo import *
from .topgg import *
from .reminders import * from .reminders import *
from .renting import * from .renting import *
from .moderation import * from .moderation import *

View File

@@ -0,0 +1,3 @@
from .module import module
from . import topgg

View File

@@ -0,0 +1,3 @@
from LionModule import LionModule
module = LionModule("Topgg")

View File

@@ -0,0 +1,29 @@
from meta import client
import discord
import topgg
# client.log("test")
import topgg
# This example uses topggpy's webhook system.
client.topgg_webhook = topgg.WebhookManager(client).dbl_webhook("/dblwebhook", "nopassword123")
# The port must be a number between 1024 and 49151.
client.topgg_webhook.run(5000) # this method can be awaited as well
@client.event
async def on_dbl_vote(data):
"""An event that is called whenever someone votes for the bot on Top.gg."""
client.log(f"Received a vote:\n{data}")
if data["type"] == "test":
# this is roughly equivalent to
# `return await on_dbl_test(data)` in this case
return client.dispatch("dbl_test", data)
@client.event
async def on_dbl_test(data):
"""An event that is called whenever someone tests the webhook system for your bot on Top.gg."""
client.log(f"Received a test vote:\n{data}")