A template Discord bot
Project description
vcokltfre/template-bot-v2
A rewrite of TemplateBot with improvements
Usage:
from templatebot import Bot
bot = Bot(name="MyBot", command_prefix="!")
bot.load_initial_cogs() # Required, even when empty, to load the default cog and jishaku
bot.run("token")
Logging
The bot has two types of logging, synchronoush and asynchronous. Generally speaking you will want to use async logging, since it won't block while you're running the bot, however if you're logging something before running the bot, you may want to use the sync methods. These methods can be accessed through templatebot.Bot.logger
class WebhookLogger:
...
## Synchronous methods
def debug_s(self, content):
self.send("debug", content)
def info_s(self, content):
self.send("info", content)
def warn_s(self, content):
self.send("warn", content)
def error_s(self, content):
self.send("error", content)
def critical_s(self, content):
self.send("critical", content)
## Asynchronous methods
async def debug(self, content):
await self.send_async("debug", content)
async def info(self, content):
await self.send_async("info", content)
async def warn(self, content):
await self.send_async("warn", content)
async def error(self, content):
await self.send_async("error", content)
async def critical(self, content):
await self.send_async("critical", content)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
templatebot-1.0.3.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file templatebot-1.0.3.tar.gz
.
File metadata
- Download URL: templatebot-1.0.3.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2caf725ed7819aef9ebfe0ddf72b1d1aeeadcd30c00bfea0155737c9218ad07d |
|
MD5 | 6245467a6608b86895e9e18a4da58f64 |
|
BLAKE2b-256 | faf7ccb702748763cd7872cab02b28be710984ae67afec6bc7d98fa29575f1d0 |
File details
Details for the file templatebot-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: templatebot-1.0.3-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b611520fe563fe9a9a7749a322be2ae4f710a94c32d77b8b489676eed4bdd07c |
|
MD5 | 13b22db50161017444fb276065fe7f5e |
|
BLAKE2b-256 | a10081c05713bd2398dcb9b91c7145652edaf1ccf24e7e43375cf7c0527543d5 |