bot.utils.helpers
#
Helper utils.
Module Contents#
Classes#
Metaclass for ABCs meant to be implemented as Cogs. |
Functions#
|
Return index of n`th occurrence of `substring in string, or None if not found. |
|
Return True if string has at least count lines. |
|
Return base64 data with padding characters to ensure its length is a multiple of 4. |
|
Remove subdomains from a URL whilst preserving the original URL composition. |
|
Accept a message that may contain links, suppresses them, and returns them. |
- class bot.utils.helpers.CogABCMeta(*args: Any, **kwargs: Any)[source]#
Bases:
discord.ext.commands.CogMeta
,abc.ABCMeta
Metaclass for ABCs meant to be implemented as Cogs.
- bot.utils.helpers.find_nth_occurrence(string: str, substring: str, n: int) int | None [source]#
Return index of n`th occurrence of `substring in string, or None if not found.
- bot.utils.helpers.has_lines(string: str, count: int) bool [source]#
Return True if string has at least count lines.
- bot.utils.helpers.pad_base64(data: str) str [source]#
Return base64 data with padding characters to ensure its length is a multiple of 4.