Reference
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.
Here you can find some information about events:
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 |
delete_server_comment |
Raw Data |
You can find more events in Boticord Documentation.
Types
- class boticordpy.types.BotVote(raw_data)
Model that represents information about bot’s vote.
- raw_data
Raw data from the Boticord API.
- Type
dict
- user_id
ID of user, who voted.
- Type
int
- at
Voting date.
- Type
datetime.datetime
- class boticordpy.types.Comment(raw_data)
Model that represents information about a comment.
- raw_data
Raw data from the Boticord API.
- Type
dict
- user_id
ID of comment author.
- Type
int
- comment
Comment.
- Type
str
- at
The comment creation time.
- Type
datetime.datetime
- class boticordpy.types.CommentData(raw_data)
Model that represents edited comment text data.
- old
Old comment text.
- Type
str
orNone
- new
New comment text.
- Type
str
orNone