예제 #1
0
 async def version(self, bot, channel):
     """Display the current version numbers"""
     await bot.client.send_typing(channel)
     commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'])
     mtgjson = database.mtgjson_version()
     return await bot.client.send_message(
         channel,
         "I am currently running mtgbot version `{commit}`, and mtgjson version `{mtgjson}`"
         .format(commit=commit, mtgjson=mtgjson))
예제 #2
0
 async def version(self, channel: TextChannel, **_: Dict[str, Any]) -> None:
     """Display the current version numbers"""
     commit = subprocess.check_output(
         ['git', 'rev-parse', 'HEAD'],
         universal_newlines=True).strip('\n').strip('"')
     mtgjson = database.mtgjson_version()
     return await channel.send(
         'I am currently running mtgbot version `{commit}`, and mtgjson version `{mtgjson}`'
         .format(commit=commit, mtgjson=mtgjson))
예제 #3
0
def init() -> None:
    current_version = fetcher.mtgjson_version()
    if pkg_resources.parse_version(
            current_version) > pkg_resources.parse_version(
                database.mtgjson_version()):
        print('Database update required')
        update_database(current_version)
        set_legal_cards()
        update_cache()
        reindex()