Exemplo n.º 1
0
    def __init__(self, bot):
        self._bot = bot

        self._bot_cog = Bot(bot)
        self._others_cog = Others(bot)
        self._playlist_cog = Playlist(bot)
        self._song_cog = Song(bot)
        self._user_cog = User(bot)

        bot.client.add_check(self._command_check)
        bot.client.add_listener(self._on_command_error, 'on_command_error')
        bot.client.add_listener(self._on_command_completion,
                                'on_command_completion')

        bot.client.add_cog(self._bot_cog)
        bot.client.add_cog(self._others_cog)
        bot.client.add_cog(self._playlist_cog)
        bot.client.add_cog(self._song_cog)
        bot.client.add_cog(self._user_cog)
Exemplo n.º 2
0
from commands.objects.guildconfig import RoleConfig
from util import Util, CustomHelp, init_logger

from config.loader import cfg

path = os.path.dirname(os.path.abspath(__file__))

# Bot definition
client = Bot(command_prefix=cfg['prefix'],
             help_command=CustomHelp(),
             case_insensitive=True)

# Get logger
logger = init_logger(path)

# Init slotlist buffer
state = ClientState()

# Get guild configs
guildConfig = RoleConfig(os.path.join(path, 'config', 'guildConfig.yml'))
guildConfig.load()

# Add commands
client.add_cog(User(client=client, state=state, guild_config=guildConfig))
client.add_cog(Moderator(client=client, state=state, guild_config=guildConfig))
client.add_cog(Admin(client=client, state=state, guild_config=guildConfig))

client.add_cog(Util(client=client, cfg=cfg, logger=logger))

client.run(cfg['token'])