reorganized into a package
This commit is contained in:
34
main.py
Normal file
34
main.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
|
||||
from discord import Message, RawReactionActionEvent
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from kwaylon import Kwaylon
|
||||
|
||||
if __name__ == '__main__':
|
||||
# https://discordpy.readthedocs.io/en/stable/quickstart.html
|
||||
client = Kwaylon()
|
||||
|
||||
|
||||
@client.event
|
||||
async def on_ready():
|
||||
await client.handle_ready()
|
||||
|
||||
|
||||
@client.event
|
||||
async def on_message(message: Message):
|
||||
await client.handle_message(message)
|
||||
|
||||
|
||||
@client.event
|
||||
async def on_raw_reaction_add(payload: RawReactionActionEvent):
|
||||
await client.handle_raw_reaction(payload)
|
||||
|
||||
|
||||
@client.event
|
||||
async def on_raw_reaction_remove(payload: RawReactionActionEvent):
|
||||
await client.handle_raw_reaction(payload)
|
||||
|
||||
|
||||
load_dotenv()
|
||||
client.run(os.getenv('DISCORD_TOKEN'))
|
||||
Reference in New Issue
Block a user