mirror of
https://code.lenaisten.de/Lenaisten/lenaverse-bot.git
synced 2024-12-22 19:13:01 +00:00
dummy commands
This commit is contained in:
parent
5a630aff26
commit
ad7350b4c1
3 changed files with 20 additions and 3 deletions
|
@ -1,12 +1,14 @@
|
|||
import logging
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands import Bot
|
||||
|
||||
from .commands import foo, ping
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class LenaverseBot(commands.Bot):
|
||||
class LenaverseBot(Bot):
|
||||
def __init__(self) -> None:
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
|
@ -16,6 +18,10 @@ class LenaverseBot(commands.Bot):
|
|||
intents=intents,
|
||||
)
|
||||
|
||||
self.add_command(ping)
|
||||
self.add_command(foo)
|
||||
|
||||
async def on_ready(self) -> None:
|
||||
_logger.info(self.guilds)
|
||||
assert self.user is not None
|
||||
_logger.info(f"{self.user.name} has connected to Discord!")
|
||||
|
|
11
lenaverse_bot/core/commands.py
Normal file
11
lenaverse_bot/core/commands.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from discord.ext import commands
|
||||
|
||||
|
||||
@commands.hybrid_command()
|
||||
async def ping(ctx: commands.Context):
|
||||
await ctx.send("pong")
|
||||
|
||||
|
||||
@commands.hybrid_command()
|
||||
async def foo(ctx: commands.Context, arg: str):
|
||||
await ctx.send(arg)
|
|
@ -4,7 +4,7 @@ from .core.bot import LenaverseBot
|
|||
|
||||
|
||||
def main() -> None:
|
||||
TOKEN = os.getenv("TTSBOT_TOKEN") or ""
|
||||
TOKEN = os.getenv("TTSBOT_TOKEN", "")
|
||||
|
||||
bot = LenaverseBot()
|
||||
bot.run(
|
||||
|
|
Loading…
Reference in a new issue