示例#1
0
文件: main.py 项目: vcokltfre/Soren
from templatebot import Bot
from datetime import datetime
from discord import Intents

from src.utils.loader import load
from src.utils.httpclient import ManagedHTTP

config = load()

bot = Bot(name="Soren",
          command_prefix=config.get("prefix", "~"),
          logging_url=config.get("logs", None),
          intents=Intents.all())
bot.started_at = datetime.utcnow()
bot.config = config
bot.httpclient = ManagedHTTP()
bot.load_initial_cogs(
    "src.cogs.core",
    "src.cogs.embeds",
    "src.cogs.web",
    "src.cogs.random",
)

bot.run(config.get("token"))
示例#2
0
from templatebot import Bot
from discord import Intents
from os import getenv
from botconfig.client import BotConfig
from discord.ext.commands import MinimalHelpCommand

intents = Intents.none()
intents.voice_states = True
intents.messages = True
intents.guilds = True

bot = Bot(
    name="Airhorn Supremacy",
    command_prefix="ah!",
    intents=Intents.default(),
    logging_url=getenv("WEBHOOK"),
    help_command=MinimalHelpCommand(),
)
bot.config = BotConfig(getenv("BOT_ID"), getenv("CONFIG_TOKEN"))

bot.load_initial_cogs("cogs.airhorn", "cogs.config")

bot.run(getenv("TOKEN"))