tuxbot-bot/tuxbot/core/utils/functions/prefix.py

25 lines
526 B
Python
Raw Permalink Normal View History

from typing import List, Optional
import discord
2020-10-19 00:53:26 +02:00
from tuxbot.core.config import search_for
def get_prefixes(tux, guild: Optional[discord.Guild]) -> List[str]:
"""Get custom prefixes for one guild.
Parameters
----------
tux:Tux
The bot instance.
guild:Optional[discord.Guild]
The required guild prefixes.
Returns
-------
List[str]
List of all prefixes.
"""
if not guild:
return []
2020-10-19 00:53:26 +02:00
return search_for(tux.config.Servers, guild.id, "prefixes", [])