import discord def get_help_message(method): """ get_help_message(method) Returns the information and usage of each of dale bot's funtions. When adding a new feature to dale bot, please add some information about it here """ supported_methods = { '8ball': [ 'Ask dale bot a question and it will give you an 8ball response', '\nUsage: !8ball Will I win the lottery tomorrow?' ], 'ask': [ 'Submits your query to wolfram alpha. If that cannot be answered, tries wikipedia\n', '\nUsage: !ask 100lbs to KG' ], 'avatar': [ 'Returns the avatar for the mentioned user', '\nUsage: !avatar @somebody' ], 'birb': [ 'Returns a random bird photo', '\nUsage: !birb' ], 'bf5': [ 'Returns some API stats about a battlefield 5 character', '\nUsage: !bf5 ' ], 'dale': [ 'Posts a photo or video of Dale, the goodest boy.', '\nUsage: !dale' ], 'redpanda': [ 'Returns a random red panda photo', '\nUsage: !redpanda' ], 'panda': [ 'Returns a random panda photo', '\nUsage: !panda' ], 'koala': [ 'Returns a random koala photo', '\nUsage: !koala' ], 'clap': [ 'Returns the shittiest meme created by sassy girls on twitter this century', 'Usage: !clap some text to be meme\'mt' ], 'simp': [ 'Returns a license to be a simp', 'Usage: !simp https://some.photo.jpg' ], 'horny': [ 'Returns a license to be horny', 'Usage: !horny https://some.photo.jpg' ], 'wasted': [ 'Overlays the GTAV wasted text over the image you link', 'Usage: !wasted https://some.photo.jpg' ], 'cleanup': [ 'Admin use only. Deletes dale bot\'s messages from the channel', 'Usage: !cleanup' ], 'corona': [ 'Pulls the latest corona virus stats per state from Johns Hopkins data', 'Usage: !corona \neg: !corona Colorado' ], 'decide': [ 'dale-bot will help make the tough decisions for you', ' If there is only one option, it will give you a yes or no', '\nUsage: !decide cake or pie\n!decide should I do my homework' ], 'ffxiv': [ 'Pulls a characters data from the lodestone API\n', 'Usage: !ffxiv \n', 'eg: !ffxiv Slamsong Bardley Adamantoise\n\n', 'Did you know that the critically acclaimed MMORPG Final Fantasy XIV has a free trial,\n', 'and includes the entirety of A Realm Reborn AND the award-winning Heavensward expansion\n', 'up to level 60 with no restrictions on playtime? Sign up, and enjoy Eorzea today!' ], 'define': [ 'Returns a definiton of a word from urban dictionary', '\nUsage: !define loli' ], 'dog': [ 'Returns the URL to a G O O D B O Y E or G I R L', '\nUsage: !dog' ], 'emoji': [ 'Uploads the passed in URL to the server as an emoji.', '\nDiscord does not support GIFS. It will throw an error if you try.' '\nUsage: !emoji http://pictures.com/some_image.png my_new_emoji\n', 'or `!emoji del some_emoji` to delete' ], 'excuse': [ 'Generates a random excuse you can give your boss', '\nUsage: !excuse' ], 'greentext': [ 'Grabs a greentext story from redditchat so you can laugh at the misfortune of others', '\nUsage: !greentext' ], 'help': [ 'Shows you this message' ], 'homepage': [ 'This function now outputs the SWEET-ASS picture of the day.', ' Note this picture only changes once a day.', '\nUsage: !homepage' ], 'invite': [ 'Generates a one time use invite to the voice channel you are currently in.\n', 'if you are not in a voice channel, the invite will be for whatever channel !invite was typed in.\n' 'You can also specify if you want it to be a temporary invite by adding `temp` to the end\n', 'Usage: !invite or !invite temp' ], 'issue': [ 'Creates an issue on gitlab with the passed in parameters\n', 'Usage: !issue ; ', ], 'icon': [ 'Returns the server\'s icon URL\n', 'Usage: !icon', ], 'info': [ 'Returns a blurb with information about the discord server\n', 'Usage: !info', ], 'lewd': [ 'Returns a URL for a lewd image.', 'Can only be used in NSFW channels.', '\nUsage: !lewd' ], 'purge': [ 'By default, will delete your last 20 messages. You can override this', ' with your own number. \nUsage: !purge or !purge 15' ], 'roles': [ 'dale bot will PM you a message with all the roles you have on the server' ], 'wallpaper': [ 'Returns the URL for a 4k wallpaper. You can enter', 'a search term as well. Supports multiple search terms as well', '\nUsage: !wallpaper flowers or !wallpaper mountain flowers sky ' ], 'message': [ 'You can ask me a question directly and I will do my best to answer it.', '\nUsage: @dale-bot what is the capital of France?' ], 'meme': [ 'Generates a meme on the fly!', '\nExamples of all templates can be seen here https://memegen.link/examples' '\n\nUsage: !meme doge top text; bottom text' ], 'nft': [ 'Polls opensea and gets a random monkey from bored ape yacht club', '\nUsage: !nft' ], 'owo': [ 'Returns some fucky wucky text\n', 'Usage: !owo what the fuck did you just fucking say about me you little shit?' ], 'pout': [ 'Returns the URL for an anime girl pouting you filthy weeb\n', 'Usage: !pout' ], 'rat': [ 'Returns a random rat photo', '\nUsage: !rat' ], 'roll': [ 'Rolls N number of Y sided die\n', 'Usage: !roll 3d20\n', 'You can also add a modifier on the end with a +', 'Usage: !roll 2d20+5' ], 'smug': [ 'Returns the URL for smug anime girl' ], 'source': [ "Links you to the git repo with dale-bot's source code" ], 'stock': [ 'Returns basic stock information for the stock you entered.', '\nUsage: !stock AAPL TSLA' ], 'trackdays': [ 'Returns the track schedule for the tracks we frequent (buttonwillow and thunderhill).\n', # 'Use abbreviations to reference the tracks, as follows\n', # 'bw = Buttonwillow Raceway\n', # 'willow = Willow Springs\n', # 'streets = Streets of Willow Springs\n', # 'laguna = WeatherTech Raceway Laguna Seca\n', # 'thill = Thunderhill Raceway Park\n', # 'sonoma = Sonoma Raceway\n', # 'acs = Auto Club Speedway\n', 'Usage: !trackdays' ], 'tts': [ 'Uploads a file with the specified text as an MP3.\nThis is advanced shitposting', '\nUsage: !tts who watches the watchmen?', '\nTo list all languages, you can type `!tts langs`' ], 'youtube': [ 'Searches youtube for the query string and returns the first result', '\nUsage: !youtube sick bmx tricks' ], 'wink': [ 'returns a anime girl winking at you', '\nUsage: !wink' ], 'verify': [ 'Adds the twitter blue check mark to the previous message\n', '\nLiterally thats all it does\n' '\nUsage: !verify' ], } return "```css\n{}: {}\n```".format(method, ' '.join(supported_methods[method])) def get_help_embed(bot): categories = { 'fun': ['nft', 'bf5', 'ffxiv', 'clap', 'youtube', 'excuse', 'greentext', 'lewd', 'message', 'meme', 'homepage', 'pout', 'roll', 'smug', 'owo', 'wink', 'verify', 'horny', 'wasted', 'simp', 'trackdays'], 'util': ['ask', 'corona', 'emoji', '8ball', 'decide', 'info', 'icon', 'wallpaper', 'stock', 'tts', 'issue'], 'users': ['help', 'invite', 'purge', 'roles', 'source'], 'pictures of animals': ['birb', 'redpanda', 'dale', 'dog', 'rat', 'koala', 'panda', 'raccoon', 'fox', 'cat', 'kangaroo'], 'admin': ['cleanup'] } description = "\nBelow you can see all the commands I know.\n\n**Have a nice day!**" embed = discord.Embed(description=description, color=0x428bca, type="rich") embed.set_author(name="Hello! I'm {}".format(bot.user.name), icon_url=bot.user.default_avatar_url) for category in categories: command_list = [] for command in categories[category]: command_list.append("`{}`".format(command)) embed.add_field(name="**%s**" % str(category).upper(), value=', '.join(command_list), inline=False) description2 = "**Use `!help ` for more information about a command.** \n\n" + \ "**Examples:** \n `!help dog` for detailed help for the dog command \n\n" + \ "**Useful links:** [My source code](https://git.luker.gq/ldooks/dragon-bot), [Donate](https://cash.me/$ldooks) \n\n" + \ "**Invite me to another server:** [Click here](https://discord.com/oauth2/authorize?client_id=%s&scope=bot&permissions=8)" % bot.user.id embed.add_field(name="\u200b", value=description2, inline=False) return embed def parse_message(message): method = message.split()[1] try: explanation = get_help_message(method) except KeyError: return "This command could not be found." return explanation