This repository was archived by the owner on Jan 22, 2021. It is now read-only.
forked from scarletcafe/jishaku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelp_command.py
74 lines (48 loc) · 2.25 KB
/
help_command.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*- coding: utf-8 -*-
"""
jishaku.help_command
~~~~~~~~~~~~~~~~~~~~
HelpCommand subclasses with jishaku features
:copyright: (c) 2019 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
from discord.ext import commands
from jishaku.paginators import PaginatorEmbedInterface, PaginatorInterface
class DefaultPaginatorHelp(commands.DefaultHelpCommand):
"""
A subclass of :class:`commands.DefaultHelpCommand` that uses a PaginatorInterface for pages.
"""
def __init__(self, **options):
paginator = options.pop('paginator', commands.Paginator(max_size=1985))
super().__init__(paginator=paginator, **options)
async def send_pages(self):
destination = self.get_destination()
interface = PaginatorInterface(self.context.bot, self.paginator, owner=self.context.author)
await interface.send_to(destination)
class DefaultEmbedPaginatorHelp(commands.DefaultHelpCommand):
"""
A subclass of :class:`commands.DefaultHelpCommand` that uses a PaginatorEmbedInterface for pages.
"""
async def send_pages(self):
destination = self.get_destination()
interface = PaginatorEmbedInterface(self.context.bot, self.paginator, owner=self.context.author)
await interface.send_to(destination)
class MinimalPaginatorHelp(commands.MinimalHelpCommand):
"""
A subclass of :class:`commands.MinimalHelpCommand` that uses a PaginatorInterface for pages.
"""
def __init__(self, **options):
paginator = options.pop('paginator', commands.Paginator(prefix=None, suffix=None, max_size=1985))
super().__init__(paginator=paginator, **options)
async def send_pages(self):
destination = self.get_destination()
interface = PaginatorInterface(self.context.bot, self.paginator, owner=self.context.author)
await interface.send_to(destination)
class MinimalEmbedPaginatorHelp(commands.MinimalHelpCommand):
"""
A subclass of :class:`commands.MinimalHelpCommand` that uses a PaginatorEmbedInterface for pages.
"""
async def send_pages(self):
destination = self.get_destination()
interface = PaginatorEmbedInterface(self.context.bot, self.paginator, owner=self.context.author)
await interface.send_to(destination)