mirror of https://gitlab.com/litecord/litecord.git
system_messages: add docstring for send_sys_message
This commit is contained in:
parent
30dae2bf0e
commit
c07a1e28bd
|
|
@ -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,
|
async def send_sys_message(app, channel_id: int, m_type: MessageType,
|
||||||
*args, **kwargs) -> int:
|
*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:
|
try:
|
||||||
handler = {
|
handler = {
|
||||||
MessageType.CHANNEL_PINNED_MESSAGE: _handle_pin_msg,
|
MessageType.CHANNEL_PINNED_MESSAGE: _handle_pin_msg,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue