MeowerBot.bot module
- class MeowerBot.bot.Bot(prefix=None)[source]
Bases:
Client
A class that holds all the networking for a Meower bot to function and run
- BOT_NO_PMSG_RESPONSE = ['I:500 | Bot', 'I: 500 | Bot', 'I: 100 | Bot', 'I: 100 | Bot']
- cache: Cache
- callbacks: Dict[str, List[CoroutineType]]
- async disconnect()[source]
Gets called when the bot gets disconnected from meower
This is a callback for
MeowerBot.bot.Bot.event()
- async error(err: Exception)[source]
Handles errors for the bot.
This is a callback for
MeowerBot.bot.Bot.event()
- event(func: Callable)[source]
Creates a callback that takes over the original functionality of the bot.
Valid callbacks are defined in
CallBackIds
- Parameters:
func (Callable) – The callback function
- Raises:
TypeError – The func provided does not have a valid callback name
- property latency: float
Gets the latency of the bot
- Returns:
Bot latency
- Return type:
int
- listen(callback: str | None = None)[source]
Does the same thing as :meth MeowerBot.bot.Bot.event:but does not replace the bot’s original functionality
Valid callbacks are defined in
CallBackIds
:raises TypeError: The listener provided is not valid
- async login(token: str)[source]
Gets called when the bot is fully ready and logged into meower
This is a callback for
MeowerBot.bot.Bot.event()
- async message(message: Post)[source]
Method for overiding how the bot handles messages.
This is a callback for
MeowerBot.bot.Bot.event()
- password: str
- server: str
- async ulist(ulist: List[str])[source]
Gets called when a user connects to meower.
This is a callback for
MeowerBot.bot.Bot.event()
- user: PartialUser | User
- userlist: List[str]
- username: str
- ws: websockets.WebSocketClientProtocol
- class MeowerBot.bot.CallBackIds(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Callbacks that the bot calls. You can find more documentation in
MeowerBot.bot.Bot
- direct = 'direct'
- disconnect = 'disconnect'
- error = 'error'
- login = 'login'
- message = 'message'
- raw_message = 'raw_message'
- statuscode = 'statuscode'
- ulist = 'ulist'
- MeowerBot.bot.cbids
alias of
CallBackIds