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']
api: MeowerAPI
cache: Cache
callbacks: Dict[str, List[CoroutineType]]
cogs: Dict[str, Cog]
command(name=None, args=0, aliases: List[str] | None = None)[source]
async direct(data: dict)[source]
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

get_chat(chat_id: str)[source]
get_context(message: Post)[source]
async handle_bot_pmsg(origin)[source]
async handle_bridges(message: Post)[source]
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
async raw_message(data: dict)[source]
register_cog(cog: Cog)[source]
run(username, password, server='wss://server.meower.org')[source]

Runs the bot (Blocking)

async run_commands(message: Post)[source]
async sendPacket(message: dict)[source]
server: str
async start(username, password, server='wss://server.meower.org')[source]

Runs The bot (Blocking)

async statuscode(status, listerner)[source]
async ulist(ulist: List[str])[source]

Gets called when a user connects to meower.

This is a callback for MeowerBot.bot.Bot.event()

update_commands()[source]
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