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 logging
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext.commands import Bot
|
||||||
|
|
||||||
|
from .commands import foo, ping
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class LenaverseBot(commands.Bot):
|
class LenaverseBot(Bot):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
intents.message_content = True
|
intents.message_content = True
|
||||||
|
@ -16,6 +18,10 @@ class LenaverseBot(commands.Bot):
|
||||||
intents=intents,
|
intents=intents,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.add_command(ping)
|
||||||
|
self.add_command(foo)
|
||||||
|
|
||||||
async def on_ready(self) -> None:
|
async def on_ready(self) -> None:
|
||||||
|
_logger.info(self.guilds)
|
||||||
assert self.user is not None
|
assert self.user is not None
|
||||||
_logger.info(f"{self.user.name} has connected to Discord!")
|
_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:
|
def main() -> None:
|
||||||
TOKEN = os.getenv("TTSBOT_TOKEN") or ""
|
TOKEN = os.getenv("TTSBOT_TOKEN", "")
|
||||||
|
|
||||||
bot = LenaverseBot()
|
bot = LenaverseBot()
|
||||||
bot.run(
|
bot.run(
|
||||||
|
|
Loading…
Reference in a new issue