mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
Add proxy permission errors, refactor proxy matching, change member name length error handling. Closes #25.
This commit is contained in:
parent
5d3cb7b6bf
commit
c36a054519
7 changed files with 149 additions and 117 deletions
|
|
@ -1,25 +1,27 @@
|
|||
import discord
|
||||
import humanize
|
||||
from typing import Tuple
|
||||
|
||||
import discord
|
||||
|
||||
import pluralkit
|
||||
from pluralkit import db
|
||||
from pluralkit.bot.utils import escape
|
||||
from pluralkit.member import Member
|
||||
from pluralkit.switch import Switch
|
||||
from pluralkit.system import System
|
||||
from pluralkit.utils import get_fronters
|
||||
|
||||
|
||||
def truncate_field_name(s: str) -> str:
|
||||
return s[:256]
|
||||
|
||||
|
||||
def truncate_field_body(s: str) -> str:
|
||||
return s[:1024]
|
||||
|
||||
|
||||
def truncate_description(s: str) -> str:
|
||||
return s[:2048]
|
||||
|
||||
|
||||
def truncate_title(s: str) -> str:
|
||||
return s[:256]
|
||||
|
||||
|
|
@ -33,7 +35,7 @@ def success(text: str) -> discord.Embed:
|
|||
|
||||
def error(text: str, help: Tuple[str, str] = None) -> discord.Embed:
|
||||
embed = discord.Embed()
|
||||
embed.description = truncate_description(s)
|
||||
embed.description = truncate_description(text)
|
||||
embed.colour = discord.Colour.dark_red()
|
||||
|
||||
if help:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue