KickChatRequests๏ƒ

Inherits: KickRequestBase < RefCounted < Object

Handles Kick API requests related to chat.

Description๏ƒ

KickChatRequests provides methods for sending chat messages to Kick channels.

Access this handler through KickAPI.get_chat().

func _ready():
    KickAPI.configure("your_token")
    KickAPI.request_completed.connect(_on_request_completed)

    # Send message as bot (to channel attached to token)
    KickAPI.get_chat().send_message("Hello Kick! ๐Ÿ‘‹", "bot")

    # Send message as user to specific channel
    KickAPI.get_chat().send_message("Hello everyone!", "user", 12345)

    # Reply to a specific message
    KickAPI.get_chat().send_message("Thanks for watching!", "bot", 0, "msg_abc123")

func _on_request_completed(signal_name: String, response_code: int, data: Dictionary):
    if signal_name == "chat_message_sent":
        # Output:
        # {
        #   "data": {
        #     "id": "msg_xyz789",
        #     "chatroom_id": 54321,
        #     "content": "Hello Kick! ๐Ÿ‘‹",
        #     "type": "bot",
        #     "created_at": "2024-01-15T12:30:45Z",
        #     "sender": {
        #       "id": 12345,
        #       "username": "bot_user",
        #       "slug": "bot_user"
        #     }
        #   },
        #   "message": "success"
        # }
        print("Message sent! ID: ", data["data"]["id"])
        print("Sent at: ", data["data"]["created_at"])

Tutorials๏ƒ

Methods๏ƒ

void

send_message(content: String, type: String, broadcaster_user_id: int = 0, reply_to_message_id: String = "")


Method Descriptions๏ƒ

void send_message(content: String, type: String, broadcaster_user_id: int = 0, reply_to_message_id: String = "") ๐Ÿ”—

Sends a chat message to a channel. The content must be 500 characters or less.

The type must be either "user" or "bot".

When sending as a user, broadcaster_user_id is required.

When sending as a bot, the message is sent to the channel attached to your token.

Optionally provide reply_to_message_id to reply to a specific message.

Results are returned via the KickAPI.request_completed signal with signal_name "chat_message_sent".