def get_help(message): """ Return the help file located in ./docs/help :param message: <Discord.message object> :return: <String> The local help file """ increment_usage(message.guild, 'help') return wrap(fetch_file('help', 'dict'), 1990)
def get_help(author): """ Get the help file in ./docs/help :param message: <Discord.message.author object> :return: <String> The local help file """ text = fetch_file('help', 'gif') banner = Embed(title='General Help', description=text) return banner
async def get_help(message): """ Get the help file in ./docs/help :param message: <Discord.message.author object> :return: <String> The local help file """ text = fetch_file('help', 'quotes') if not await is_admin(message.author, message): text = text.split('For Admins:')[0] banner = Embed(title='General Help', description=text) return banner
async def on_guild_join(guild): if VERBOSE >= 1: print('[+] Joined a new guild: {}'.format(guild.name)) config_file = config_create(guild) banner = 'Hello {}! \n{}'.format(guild.owner.mention, fetch_file('help', 'welcome')) await guild.owner.send( file=discord.File('{}/docs/header.png'.format(DEFAULT_DIR))) await guild.owner.send(banner, file=discord.File(config_file)) tquote.setup() util_setup()
async def get_help(message): """ Get the command help file from ./docs/help :param message: <Discord.message object> :return: <String> Containing help for the user's available options or list of locations """ increment_usage(message.guild, 'help') args = message.content.split() banner = Embed(title='Schedule') if len(args) < 3: # Get general help raw = fetch_file('help', 'schedule') if not await is_admin(message.author, message): raw = raw.split('For Admins:')[0] banner.add_field(name='Help', value=raw) else: # Get list of cities or continents raw = fetch_file('locales', args[2].lower()) banner.add_field(name='Locales in {}'.format((args[2].lower())), value=raw) return banner
async def get_help(result): increment_usage(result["message"].guild, 'help') help_ = fetch_file('help', 'general') if not await is_admin(result["message"].author, result["message"]): help_ = help_.split('For Admins:')[0] banner = Embed(title='General Help', description=help_) banner.add_field(name='Help support this bot!', value='All donations go to development and server costs.', inline=False) banner.add_field(name='PayPal', value=help_general['paypal']) # banner.add_field(name='Patreon', value=help_general['patreon']) banner.add_field(name='More Information', value='This bot is open source, find it at: {}'.format( help_general['github'])) banner.add_field(name='Invite the bot to your server.', value=help_general['invite'], inline=False) result["embed"] = banner return result
def get_help(message): """ Get the command help file from ./docs/help :param message: <Discord.message object> :return: <String> Containing help for the user's available options or list of locations """ increment_usage(message.guild, 'help') custom = '' try: guild_commands = custom_commands[message.guild.id] banner = Embed(title='Custom Command Help', description=fetch_file('help', 'custom')) for name, value in guild_commands.items(): custom = '{}`{}`: {}\n'.format(custom, name, value) available = Embed( title='Custom commands available in this server are:', description=custom) # banner.add_field(name='Custom commands available in this server are:', value=custom) return None, [banner, available] except Exception as e: if VERBOSE >= 0: print('[!] Exception in get help custom {}'.format(e)) pass
def get_help(message): increment_usage(message.guild, 'help') banner = Embed(title='Stats Help', description=fetch_file('help', 'stats')) return None, banner
async def wolfram(message): """ Return an image based response from the Wolfram Alpha API :param message: <Discord.message object> :return: <str> Banner or None """ increment_usage(message.guild, 'wolf') args = message.content.split() banner = Embed(title="Wolfram Alpha") try: if len(args) > 1: if args[1].lower() in {'simple', 'txt', 'text', 'textual'}: query_st = quote_plus(' '.join(args[2:])) query = URL_WOLF_TXT.format(WOLFRAM, query_st) async with aiohttp.ClientSession() as session: async with session.get(query) as resp: if resp.status == 200: text = await resp.read() elif resp.status == 501: return 'Wolfram cannot interpret your request.' else: return [ '[!] Wolfram Server Status {}'.format( resp.status), None ] text = text.decode('UTF-8') banner.add_field(name=' '.join(args[2:]), value=text) return banner elif args[1].lower() in { 'complex', 'graphic', 'graphical', 'image', 'img', 'gif' }: query_st = quote_plus(' '.join(args[2:])) query = URL_WOLF_IMG.format(WOLFRAM, query_st) file_path = '{}/log/wolf/{}.gif'.format( DEFAULT_DIR, message.id) async with aiohttp.ClientSession() as session: async with session.get(query) as resp: if resp.status == 200: f = await aiofiles.open(file_path, mode='wb') await f.write(await resp.read()) await f.close() return [None, file_path] elif resp.status == 501: return [ 'Wolfram cannot interpret your request.', None ] else: return [ '[!] Wolfram Server Status {}'.format( resp.status), None ] banner = Embed(title='Wolfram Help', description=fetch_file('help', 'wolfram')) return banner except Exception as e: if VERBOSE >= 0: print('[!] Wolfram failed to process command on: {}'.format( message.content)) print('[!] {}'.format(e)) return None