discord
folder in the UtilsX pip installation location.1Fetching example...
commands.Bot
we'll use BotX
from utilsx.discord
. (This isn't required as default for UtilsX to work module but its a shorter/easier way to create your bot instance.)self.embed(target, message, *args)
. This then constructs your embed and sends it.1Fetching example...
var = Prettier(*args)
, yeah, thats all! In the example all the text we send (if we don't use other color codes) will be yellow. If you want to set another color you can provide a color code or use our enum codes. (like shown in the example).Prettier.print()
statement takes a required message argument. But if you want to add a timestamp that will be formatted and shown before the message you can provide a datetime object.Retrieves if the bot its case_insensitive status.
Retrieves the bot description.
Retrieves the bot prefix.
1Fetching example...
commands.Cog
implemented Cog object. This processes the bot COG object.get_embed
is set to true.utilsx.discord
exceptions..format
raises an error due to missing keys.print(f"{Formats.underline.value}Underline text{Formats.default.value}")
default, dim, underline, blink, inverted, hidden
print(f"{Colors.yellow.value}Yellow text{Colors.default.value}")
default, black, red, green, yellow, blue, magenta, cyan, light_gray, dark_gray, light_red, light_green, light_yellow, light_blue, light_magenta, light_cyan, white
print(f"{Backgrounds.red.value}This text has a red background{Backgrounds.default.value}")
default, black, red, green, yellow, blue, magenta, cyan, light_gray, dark_gray, light_red, light_green, light_yellow, light_blue, light_magenta, light_cyan, white