[Cleanup] [p]cleanup bot includes aliases and CCs (#2213)

Resolves #1920.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
Toby Harradine
2018-10-15 22:29:07 +11:00
committed by GitHub
parent 1ba922eba2
commit ad51fa830b
2 changed files with 35 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ import random
from datetime import datetime, timedelta
from inspect import Parameter
from collections import OrderedDict
from typing import Mapping, Tuple, Dict
from typing import Mapping, Tuple, Dict, Set
import discord
@@ -553,3 +553,14 @@ class CustomCommands(commands.Cog):
else:
return raw_result
return str(getattr(first, second, raw_result))
async def get_command_names(self, guild: discord.Guild) -> Set[str]:
"""Get all custom command names in a guild.
Returns
--------
Set[str]
A set of all custom command names.
"""
return set(await CommandObj.get_commands(self.config.guild(guild)))