|
2 | 2 | import discord
|
3 | 3 | import re
|
4 | 4 | import requests
|
| 5 | +import time |
5 | 6 |
|
6 | 7 | from bs4 import BeautifulSoup
|
| 8 | +from random import randint |
7 | 9 | from redbot.core import checks, commands, Config
|
8 | 10 | from redbot.core.utils.menus import menu, DEFAULT_CONTROLS
|
9 | 11 |
|
10 | 12 |
|
11 |
| -__version__ = "1.0.1" |
| 13 | +__version__ = "1.1" |
12 | 14 |
|
13 | 15 | BaseCog = getattr(commands, "Cog", object)
|
14 | 16 |
|
@@ -60,6 +62,17 @@ async def picker(self, ctx, page_num: int = 1):
|
60 | 62 |
|
61 | 63 | await menu(ctx, embeds, DEFAULT_CONTROLS, page=page_num - 1)
|
62 | 64 |
|
| 65 | + @commands.guild_only() |
| 66 | + @picker.command() |
| 67 | + async def help(self, ctx): |
| 68 | + """ |
| 69 | + Show FFPicker help manual |
| 70 | + """ |
| 71 | + cmd = self.bot.get_command("help") |
| 72 | + prefix = await self.bot.db.guild(ctx.guild).prefix() |
| 73 | + ctx.message.content = prefix + cmd.name + " " + ctx.command.full_parent_name |
| 74 | + await self.bot.process_commands(ctx.message) |
| 75 | + |
63 | 76 | @commands.guild_only()
|
64 | 77 | @picker.command()
|
65 | 78 | @checks.is_owner()
|
@@ -283,3 +296,13 @@ async def showfic(self, ctx, num: int):
|
283 | 296 | msg = f"Showing story #{idx+1} added by {user}."
|
284 | 297 | em = self.format_embed(metadata)
|
285 | 298 | await ctx.send(msg, embed=em)
|
| 299 | + |
| 300 | + @commands.guild_only() |
| 301 | + @picker.command(name="random") |
| 302 | + async def showfic_random(self, ctx): |
| 303 | + """ |
| 304 | + Show a random story from the collection |
| 305 | + """ |
| 306 | + stories = await self.config.guild(ctx.guild).stories() |
| 307 | + cmd = self.bot.get_command("ffpicker show") |
| 308 | + await ctx.invoke(cmd, num=randint(1, len(stories))) |
0 commit comments