Пример #1
0
 def init(self, cfg_name, *args, **kwargs):
     self.__config = json_reader.read(cfg_name)
     self.__cfg_name = cfg_name
Пример #2
0
 def __init__(self, cfg_name, *args, **kwargs):
     self.config = json_reader.read(cfg_name)
Пример #3
0
async def on_message(message):
    # if message.author.bot:
    #     return
    await commands_tracker.identify_command(message)


@client.event
async def on_reaction_add(reaction, user):
    for command in commands_tracker.commands:
        await command.on_reaction_add(reaction, user)


@client.event
async def on_reaction_remove(reaction, user):
    for command in commands_tracker.commands:
        await command.on_reaction_remove(reaction, user)


@client.event
async def on_ready():
    global commands_tracker
    commands_tracker = CommandTracker(client)

    print('Loaded Discord.py version {}'.format(discord.__version__))
    print('Connected as {0.user}'.format(client))
    print('RelBot version {0}{1}'.format(app_info['ver'],
                                         '-' + app_info['env']))


client.run(json_reader.read('token'))
Пример #4
0
 def init(self, cfg_name, *args, **kwargs):
     try:
         self.config = json_reader.read(cfg_name)
     except JSONDecodeError as e:
         raise e
Пример #5
0
 def init(self, *args, **kwds):
     self.config = json_reader.read(CONFIG_NAME)
     self.verify_table_exists('users')
     self.connection = None