system_messages: add docstring for send_sys_message

This commit is contained in:
Luna 2019-03-20 03:42:11 -03:00
parent 30dae2bf0e
commit c07a1e28bd
1 changed files with 20 additions and 1 deletions

View File

@ -133,7 +133,26 @@ async def _handle_gdm_icon_edit(app, channel_id, author_id):
async def send_sys_message(app, channel_id: int, m_type: MessageType,
*args, **kwargs) -> int:
"""Send a system message."""
"""Send a system message.
The handler for a given message type MUST return an integer, that integer
being the message ID generated. This function takes care of feching the
message and dispatching the needed event.
Parameters
----------
app
The app instance.
channel_id
The channel ID to send the system message to.
m_type
The system message's type.
Returns
-------
int
The message ID.
"""
try:
handler = {
MessageType.CHANNEL_PINNED_MESSAGE: _handle_pin_msg,