示例#1
0
文件: bot.py 项目: elfq/Bakery
from templatebot import Bot
from discord import AllowedMentions, Activity, Game
from os import environ as env
from dotenv import load_dotenv
import discord
from discord.ext import fancyhelp

bot = Bot(
    name="BakeryBot",
    command_prefix="b!",
    allowed_mentions=AllowedMentions(everyone=False, roles=False, users=True),
    help_command=fancyhelp.EmbeddedHelpCommand(color=0x4e5d94),
    activity=Game("with cakes ЁЯН░"),
)

bot.VERSION = "1.0.0"

bot.load_initial_cogs("cogs.bakery", "cogs.bake", "cogs.shop")


@bot.event
async def on_command_error(ctx, error):
    await ctx.send(f"ЁЯТе {error}")


bot.run(env.get("TOKEN", None))
示例#2
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"))
示例#3
0
文件: main.py 项目: powerboyop/Coffee
from templatebot import Bot
from discord import AllowedMentions, Activity, Game
from os import environ as env
from dotenv import load_dotenv
import discord
from discord.ext import fancyhelp

bot = Bot(
    name="Coffee",
    command_prefix=";;",
    allowed_mentions=AllowedMentions(everyone=False, roles=False, users=True),
    help_command=fancyhelp.EmbeddedHelpCommand(color=0x2F3136),
    activity=Game("with logs 📝"),
)

bot.VERSION = "2.0.0"

bot.load_initial_cogs("cogs.logs", "cogs.mod", "cogs.setup", "cogs.top-gg")


@bot.event
async def on_command_error(ctx, error):
    await ctx.send(f"💥 {error}")
    # Lazy error_handling, will be changed soon!


bot.run(env.get("TOKEN", None))
示例#4
0
from templatebot import Bot
from discord import AllowedMentions, Activity, Game
from os import environ as env
from dotenv import load_dotenv

from cogs.help import BakerHelp
from utils.database import DatabaseInterface

load_dotenv(".env")

bot = Bot(
    name="BakerBot",
    command_prefix="b!",
    logging_url=env.get("WEBHOOK", None),
    allowed_mentions=AllowedMentions(everyone=False,
                                     roles=False,
                                     users=False,
                                     replied_user=True),
    help_command=BakerHelp(),
    activity=Game("with cupcakes"),
)

bot.VERSION = "1.0.0"
bot.db = DatabaseInterface()

bot.load_initial_cogs("cogs.profile", "cogs.dev", "cogs.recipe",
                      "cogs.utility", "cogs.help")

bot.run(env.get("TOKEN", None))
示例#5
0
        if not gconf:
            p = config.get("prefix", "!")
        else:
            p = gconf["prefix"]
    return p


# Create the bot itself
bot = Bot(
    name="ToxBot",
    command_prefix=get_prefix,
    intents=intents,
    allowed_mentions=AllowedMentions(replied_user=False, roles=False),
    help_command=None,
)
bot.VERSION = "V1.0.0-alpha"
bot.ENV = config.get("env", "prod")
bot.config = config
bot.db = DatabaseInterface(config, load("static/default.yml"))
bot.api = HTTPClient(config["msgsafe"])
bot.times = AverageQueue()

# Load the cogs we need
bot.load_initial_cogs(
    "cogs.ui",
    "cogs.detector",
)

# Run the bot
bot.run(TOKEN)
示例#6
0
from templatebot import Bot
from discord import Intents

from utils.config import ConfigLoader

config = ConfigLoader()
botconf = config.get("bot", {})

bot = Bot(
    name="ResearchBot",
    command_prefix=botconf.get("prefix", "!"),
    intents=Intents.all(),
    logging_url=botconf.get("webhook"),
    help_command=None,
)

bot.cfg = config

bot.load_initial_cogs("cogs.amp", "cogs.autopin", "cogs.links", "cogs.alerts",
                      "cogs.issues")

bot.run(botconf["token"])
示例#7
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"))