#!/usr/bin/env python3 from common import utils utils.init_logging("webserver") import common.time import common.url import www.utils from common.config import config from www.server import app import www.index import www.help import www.notifications import www.login import www.archive import www.commands import www.spam import www.history import www.api import www.api_v2 import www.quotes import www.patreon import www.clips import www.prefs app.secret_key = config["session_secret"] app.config["PREFERRED_URL_SCHEME"] = config["preferred_url_scheme"], app.add_template_filter(common.time.nice_duration) app.add_template_filter(utils.ucfirst) app.add_template_filter(www.utils.timestamp) app.add_template_filter(common.url.https)
from common.utils import init_logging init_logging()
from common import utils utils.init_logging("eris") import asyncio import discord import blinker import logging import os from common.config import config from common import postgres from eris import rpc from eris.announcements import Announcements from eris.autotopic import Autotopic from eris.channel_reaper import ChannelReaper from eris.command_parser import CommandParser from eris.voice_channel_tracker import VoiceChannelTracker from eris.commands import register as register_commands log = logging.getLogger("eris") eris = discord.Client() engine, metadata = postgres.get_engine_and_metadata() # `discord.py`'s event handling is pretty poor. There can only be a single handler for an event. # Convert `discord.py`'s events into `blinker` signals to get around that. signals = blinker.Namespace() @eris.event async def on_ready():
#!/usr/bin/env python3 import logging from common import utils utils.init_logging("lrrbot") from lrrbot.main import bot, log import lrrbot.commands try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown()