boticordpy/docs/reference.rst

64 lines
2 KiB
ReStructuredText
Raw Normal View History

2021-09-12 12:50:38 +03:00
.. currentmodule:: boticordpy
2021-09-12 13:18:22 +03:00
.. reference:
2021-09-12 12:50:38 +03:00
2021-09-19 12:11:14 +03:00
Reference
==============
2021-09-12 12:50:38 +03:00
Event Reference
---------------
Example of event creation:
::
from discord.ext import commands
from boticordpy import BoticordWebhook, BoticordClient
bot = commands.Bot(command_prefix="!")
boticord = BoticordClient(bot, "boticord-api-token")
boticord_webhook = BoticordWebhook(bot, boticord).bot_webhook("/bot", "X-Hook-Key")
boticord_webhook.run(5000)
@boticord.event("edit_bot_comment")
async def on_boticord_comment_edit(data):
print(data)
You can name the function whatever you want, but the decorator must always specify an existing event as an argument.
.. warning::
All the events must be a **coroutine**. If they aren't, then you might get unexpected
errors. In order to turn a function into a coroutine they must be ``async def``
functions.
2021-09-19 12:11:14 +03:00
+------------------------+----------------------------------+
| Boticord Events | Returns Type |
+========================+==================================+
| new_bot_comment | types.Comment |
+------------------------+----------------------------------+
| edit_bot_comment | types.EditedComment |
+------------------------+----------------------------------+
| delete_bot_comment | types.Comment |
+------------------------+----------------------------------+
| new_bot_bump | types.BotVote |
+------------------------+----------------------------------+
| new_server_comment | Raw Data |
+------------------------+----------------------------------+
| edit_server_comment | Raw Data |
+------------------------s+---------------------------------+
| delete_server_comment | Raw Data |
+------------------------+----------------------------------+
You can find more events in Boticord Documentation.
Types
------------
.. autoclass:: boticordpy.types
:members: