async def on_ready(): print('bot ready') game = discord.Game('{}info'.format(Tokens.prefix())) await client.change_presence(status=discord.Status.online, activity=game) core.clientusers = client.users users = User.load_all()
for ability in item['abilities']: endstring += '**{}** \n'.format(ability) return form.basic(item2, endstring) def effect_info(effect): effect2 = effect effect = load_effects()[effect] effectname = '{} {}'.format(effect2, effect['emoji']) endstring = effect['description'] return form.basic(effectname, endstring) prefix = Tokens.prefix() async def info(par, player, cha): if len(par) < 2: await cha.send(embed=form.info()) return if par[1] in ['b', 'battle', 'battles']: if len(par) < 3: await cha.send(embed=form.basic('Battles', all_battles(player))) return else: embed = Battles.battle_info(par[2]) await cha.send(embed=embed) return
def invite(): return 'https://discordapp.com/oauth2/authorize?client_id={}&scope=bot&permissions=201848896'.format( Tokens.client())
from core import Tokens from files import User import commands client = discord.Client() if __name__ == '__main__': @client.event async def on_ready(): print('bot ready') game = discord.Game('{}info'.format(Tokens.prefix())) await client.change_presence(status=discord.Status.online, activity=game) core.clientusers = client.users users = User.load_all() @client.event async def on_message(message): msg = message cha = message.channel par = Parsing.parse_msg(message) if par is not None: await commands.execute(par, msg) else: par = Parsing.parse_ans(message) if par is not None: await commands.answer(par, msg) client.run(Tokens.discord())