Init Framework
This commit is contained in:
@@ -7,6 +7,7 @@ from .stats import *
|
||||
from .user_config import *
|
||||
from .workout import *
|
||||
from .todo import *
|
||||
from .topgg import *
|
||||
from .reminders import *
|
||||
from .renting import *
|
||||
from .moderation import *
|
||||
|
||||
3
bot/modules/topgg/__init__.py
Normal file
3
bot/modules/topgg/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .module import module
|
||||
|
||||
from . import topgg
|
||||
3
bot/modules/topgg/module.py
Normal file
3
bot/modules/topgg/module.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from LionModule import LionModule
|
||||
|
||||
module = LionModule("Topgg")
|
||||
29
bot/modules/topgg/topgg.py
Normal file
29
bot/modules/topgg/topgg.py
Normal 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}")
|
||||
Reference in New Issue
Block a user