Example #1
0
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))
Example #2
0
File: bot.py Project: 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))
Example #3
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)