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"))
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))
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)
if not last: return c = await db.get_channel(channel.id) if not c: print("Channel not in db") return pins = await channel.pins() if len(pins) < 50: print("Pins arent full") return ac = bot.get_channel(c[0]) if not ac: print("Archive channel is None") return print("Reposting...") m = pins[-1] embed = Embed(title=f"#{channel} | Pins", colour=0x87CEEB) embed.description = m.content embed.add_field(name="", value=f"[Jump to Message]({m.jump_url})") embed.set_author(name=str(m.author), icon_url=str(m.author.avatar_url)) await ac.send(embed=embed) await m.unpin() print("Reposted.") bot.run(getenv("TOKEN"))
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"])