cocorum.chatapi
The primary use from this module is the ChatAPI class, a wrapper for Rumble's internal chat API. This class includes links to the chat-related methods of ServicePHP() (muting users for example). If you wish to use any two-way chat features, you must first create an instance of cocorum.servicephp.ServicePHP(), and then pass it to this class upon initialization.
All other classes are supporting sub-classes.
Internal chat API client
Interface with the Rumble chat API to send and receive messages, etc.
Copyright 2026 Wilbur Jaywright d.b.a. Marswide BGL.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
S.D.G.
BaseComment
A comment on a Rumble video
Source code in cocorum/basehandles.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
comment_id_b10
property
The base 10 ID of the comment
comment_id_b36
property
The base 36 ID of the comment
__eq__(other)
Determine if this comment is equal to another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Any
|
Object to compare to. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Comparison |
bool
|
Did it fit the criteria? |
Source code in cocorum/basehandles.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
__int__()
The comment in integer form (its ID)
Source code in cocorum/basehandles.py
81 82 83 | |
__str__()
The comment as a string (its text)
Source code in cocorum/basehandles.py
85 86 87 | |
delete()
Delete this comment
Source code in cocorum/basehandles.py
136 137 138 139 | |
pin(unpin=False)
Pin or unpin this comment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unpin
|
bool
|
If true, unpins instead of pinning comment. |
False
|
Source code in cocorum/basehandles.py
127 128 129 130 131 132 133 134 | |
restore()
Un-delete this comment
Source code in cocorum/basehandles.py
141 142 143 144 | |
BaseContentVotes
Likes and dislikes on a video or comment
Source code in cocorum/basehandles.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
__eq__(other)
Determine if this content votes is equal to another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Any
|
Object to compare to. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Comparison |
bool
|
Did it fit the criteria? |
Source code in cocorum/basehandles.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
__int__()
The integer form of the content votes
Source code in cocorum/basehandles.py
154 155 156 | |
__repr__()
String to represent this object
Source code in cocorum/basehandles.py
150 151 152 | |
BasePlaylist
A playlist of Rumble videos
Source code in cocorum/basehandles.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
playlist_id_b10
property
The numeric ID of the playlist in base 10
playlist_id_b64
property
The numeric ID of the playlist in base 64
__eq__(other)
Determine if this playlist is equal to another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Any
|
Object to compare to. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Comparison |
bool
|
Did it fit the criteria? |
Source code in cocorum/basehandles.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | |
__int__()
The playlist as an integer (it's ID in base 10)
Source code in cocorum/basehandles.py
248 249 250 | |
__repr__()
String to represent this object
Source code in cocorum/basehandles.py
256 257 258 | |
__str__()
The playlist as a string (it's ID in base 64)
Source code in cocorum/basehandles.py
252 253 254 | |
add_video(video_id)
Add a video to this playlist
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
video_id
|
SupportsInt | str
|
The numeric ID of the video to add, in base 10 or 36. |
required |
Source code in cocorum/basehandles.py
297 298 299 300 301 302 303 304 | |
delete()
Delete this playlist
Source code in cocorum/basehandles.py
343 344 345 346 | |
delete_video(video_id)
Remove a video from this playlist
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
video_id
|
SupportsInt | str
|
The numeric ID of the video to remove, in base 10 or 36. |
required |
Source code in cocorum/basehandles.py
306 307 308 309 310 311 312 313 | |
edit(title=None, description=None, visibility=None, channel_id=None)
Edit the details of this playlist. WARNING: The original object will probably be stale after this operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
The title of the playlist. Defaults to staying the same. |
None
|
description
|
str
|
Describe the playlist. Defaults to staying the same. |
None
|
visibility
|
str
|
Set to public, unlisted, or private via string. Defaults to staying the same. |
None
|
channel_id
|
SupportsInt | str
|
The ID of the channel to have the playlist under. TODO: Cannot be retrieved! Defaults to resetting to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
playlist |
APIPlaylist
|
The edit result. |
Source code in cocorum/basehandles.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
BaseUser
A Rumble user
Source code in cocorum/basehandles.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
user_id_b10
property
The numeric ID of the user in base 10
user_id_b36
property
The numeric ID of the user in base 36
__eq__(other)
Determine if this user is equal to another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Any
|
Object to compare to. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Comparison |
bool
|
Did it fit the criteria? |
Source code in cocorum/basehandles.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
__int__()
The user as an integer (it's ID in base 10)
Source code in cocorum/basehandles.py
188 189 190 | |
mute(duration=None, total=False)
Mute this user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
int
|
How long to mute the user in seconds. Defaults to infinite. |
None
|
total
|
bool
|
Wether or not they are muted across all videos. Defaults to False, just this video. |
False
|
Source code in cocorum/basehandles.py
228 229 230 231 232 233 234 235 236 237 238 | |
unmute()
Unmute this user.
Source code in cocorum/basehandles.py
240 241 242 | |
BaseUserBadge
A badge on a username
Source code in cocorum/basehandles.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
icon
property
The badge's icon as a bytestring
__eq__(other)
Check if this badge is equal to another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Any
|
Object to compare to. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Comparison |
bool
|
Did it fit the criteria? |
Source code in cocorum/basehandles.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
__repr__()
String to represent this object
Source code in cocorum/basehandles.py
59 60 61 | |
__str__()
The chat user badge in string form
Source code in cocorum/basehandles.py
55 56 57 | |
Channel
Bases: Chatter
A channel in the SSE chat
Source code in cocorum/chatapi.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
channel_id
property
The ID of this channel in base 10
channel_id_b10
property
The ID of this channel in base 10
channel_id_b36
property
The ID of this channel in base 36
is_appearing
property
Is the user of this channel still appearing as it?
user = None
instance-attribute
The user who owns this channel, if we can find them from the chat's user dict
user_id
property
The numeric ID of the user of this channel in base 10
user_id_b10
property
The numeric ID of the user of this channel in base 10
user_id_b36
property
The numeric ID of the user of this channel in base 36
__init__(jsondata, chat)
A channel in the internal chat API
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
The JSON data block for the channel |
required |
chat
|
ChatAPI
|
Our parent chat API wrapper |
required |
Source code in cocorum/chatapi.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
ChatAPI
The Rumble internal chat API
Source code in cocorum/chatapi.py
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 | |
badges = {}
instance-attribute
User badge types by slug
channels = {}
instance-attribute
Channels by channel ID
chat_running = True
instance-attribute
Status of wether the chat is still open
client = ssec.EventSource(self.sse_url, headers=(static.RequestHeaders.sse_api))
instance-attribute
The client for the chat SSE stream
history
property
The chat history, trimmed to history_len
history_len = history_len
instance-attribute
How many messages to store in history
last_send_time = 0
instance-attribute
The last time we sent a message
message_api_url = static.URI.ChatAPI.message.format(stream_id_b10=(self.stream_id_b10))
instance-attribute
The URL of the chat API
pinned_message = None
instance-attribute
If a message is pinned, it is assigned to this
scraper = scraping.Scraper(self.servicephp) if self.servicephp else None
instance-attribute
An HTML scraper for getting data like mute records
servicephp = servicephp
instance-attribute
The ServicePHP wrapper for two-way chat interaction
session_cookie
property
The session cookie we are logged in with
sse_url = static.URI.ChatAPI.sse_stream.format(stream_id_b10=(self.stream_id_b10))
instance-attribute
The URL of the chat SSE stream
stream_id = utils.ensure_b36(stream_id)
instance-attribute
The stream ID in base 36
stream_id_b10
property
The chat ID in use
users = {}
instance-attribute
Users by user ID
__init__(stream_id, servicephp=None, history_len=1000)
The Rumble internal chat API
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream_id
|
(int, str)
|
Stream ID in base 10 int or base 36 str. WARNING: If a str is passed, this WILL ASSUME BASE 36 even if only digits are present! Convert to int before passing if it is base 10. |
required |
servicephp
|
ServicePHP
|
A logged in Service.PHP agent for two-way. Defaults to None, view chat as a guest. |
None
|
history_len
|
int
|
Length of message history to store. Defaults to 1000. |
1000
|
Source code in cocorum/chatapi.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 | |
__next_event_json()
Wait for the next event from the SSE and parse the JSON
Returns:
| Name | Type | Description |
|---|---|---|
json |
dict
|
The next event |
Source code in cocorum/chatapi.py
768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | |
__repr__()
String to represent this object
Source code in cocorum/chatapi.py
584 585 586 | |
clear_mailbox()
Delete anything in the mailbox
Source code in cocorum/chatapi.py
833 834 835 | |
close()
Close the chat connection
Source code in cocorum/chatapi.py
588 589 590 591 | |
command(command_message)
Send a native chat command
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command_message
|
str
|
The message you would send to launch this command in chat. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
JSON |
dict
|
The JSON returned by the command. |
Source code in cocorum/chatapi.py
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 | |
delete_message(message)
Delete a message in chat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
SupportsInt
|
Object which when converted to integer is the target message ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
success |
bool
|
Wether the operation succeeded or not. NOTE: Method will also print an error message if it failed. |
Source code in cocorum/chatapi.py
671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | |
get_message()
Return the next chat message (parsing any additional data). Waits for it to come in, returns None if chat closed.
Returns:
| Name | Type | Description |
|---|---|---|
result |
Message | None
|
Either the next chat message or NoneType. |
Source code in cocorum/chatapi.py
881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 | |
load_badges(jsondata)
Create our dictionary of badges from an SSE data JSON
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
A JSON data block from an SSE event. |
required |
Source code in cocorum/chatapi.py
866 867 868 869 870 871 872 873 874 | |
mute_user(user, duration=None, total=False)
Mute a user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user
|
str
|
Username to mute. |
required |
duration
|
int
|
How long to mute the user in seconds. Defaults to infinite. |
None
|
total
|
bool
|
Wether or not they are muted across all videos. Defaults to False, just this video. |
False
|
Source code in cocorum/chatapi.py
730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 | |
parse_init_data(jsondata)
Extract initial chat data from the SSE init event JSON
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
The JSON data returned by the initial SSE connection. |
required |
Source code in cocorum/chatapi.py
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 | |
pin_message(message)
Pin a message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
SupportsInt
|
Converting this to int must return a chat message ID. |
required |
Source code in cocorum/chatapi.py
706 707 708 709 710 711 712 713 714 | |
send_message(text, channel_id=None)
Send a message in chat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The message text. |
required |
channel_id
|
int
|
Numeric ID of the channel to use. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ID |
int
|
The ID of the sent message. |
User |
User
|
Your current chat user information. |
Source code in cocorum/chatapi.py
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | |
unmute_user(user)
Unmute a user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user
|
str
|
Username to unmute |
required |
Source code in cocorum/chatapi.py
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 | |
unpin_message(message=None)
Unpin the pinned message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
SupportsInt
|
Message to unpin. Defaults to None, unpin known pinned message. |
None
|
Source code in cocorum/chatapi.py
716 717 718 719 720 721 722 723 724 725 726 727 728 | |
update_channels(jsondata)
Update our dictionary of channels from an SSE data JSON
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
A JSON data block from an SSE event. |
required |
Source code in cocorum/chatapi.py
851 852 853 854 855 856 857 858 859 860 861 862 863 864 | |
update_mailbox(jsondata)
Parse chat messages from an SSE data JSON
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
A JSON data block from an SSE event. |
required |
Source code in cocorum/chatapi.py
822 823 824 825 826 827 828 829 830 831 | |
update_users(jsondata)
Update our dictionary of users from an SSE data JSON
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
A JSON data block from an SSE event. |
required |
Source code in cocorum/chatapi.py
837 838 839 840 841 842 843 844 845 846 847 848 849 | |
ChatAPIObj
Bases: JSONObj
Object in the internal chat API
Source code in cocorum/chatapi.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
chat = chat
instance-attribute
Our parent chat API wrapper
__init__(jsondata, chat)
Object in the internal chat API
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
The JSON data block for the object |
required |
chat
|
ChatAPI
|
Our parent chat API wrapper |
required |
Source code in cocorum/chatapi.py
40 41 42 43 44 45 46 47 48 49 50 | |
Chatter
Bases: JSONUserAction, ChatAPIObj
A user or channel in the internal chat API (abstract)
Source code in cocorum/chatapi.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
link
property
The user's subpage of Rumble.com
__init__(jsondata, chat)
A user or channel in the internal chat API (abstract)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
The JSON data block for the user/channel |
required |
chat
|
ChatAPI
|
Our parent chat API wrapper |
required |
Source code in cocorum/chatapi.py
56 57 58 59 60 61 62 63 64 | |
__repr__()
String to represent this object
Source code in cocorum/chatapi.py
66 67 68 | |
GiftPurchaseNotification
Bases: ChatAPIObj
A subscription gift under a message
Source code in cocorum/chatapi.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
creator_channel_id
property
The numeric ID of the channel whose stream this gift was given on, in base 10 (can be zero)
creator_channel_id_b10
property
The numeric ID of the channel whose stream this gift was given on, in base 10 (can be zero)
creator_channel_id_b36
property
The numeric ID of the channel whose stream this gift was given on, in base 36 (can be zero)
creator_user_id
property
The numeric ID of the user whose stream this gift was given on, in base 10
creator_user_id_b10
property
The numeric ID of the user whose stream this gift was given on, in base 10
creator_user_id_b36
property
The numeric ID of the user whose stream this gift was given on, in base 36
gift_type
property
TODO
message = message
instance-attribute
Our parent ChatAPI message
purchased_by
property
The username of who purchased this gift
total_gifts
property
The number of subscriptions in this gift
video_id
property
The numeric ID of the stream this gift was sent on, in base 10
video_id_b10
property
The numeric ID of the stream this gift was sent on, in base 10
video_id_b36
property
The numeric ID of the stream this gift was sent on, in base 36
__init__(jsondata, message)
A subscription gift under a message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
The JSON data block for the message. |
required |
message
|
Message
|
Our parent ChatAPI message |
required |
Source code in cocorum/chatapi.py
241 242 243 244 245 246 247 248 249 250 251 | |
__repr__()
String to represent this object
Source code in cocorum/chatapi.py
253 254 255 | |
Message
Bases: ChatAPIObj
A single chat message in the internal chat API
Source code in cocorum/chatapi.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |
channel
property
Reference to the channel that posted this message, if there was one and we can find it
channel_id
property
The numeric ID of the channel who posted the message, if there is one, in base 10
channel_id_b10
property
The ID of the channel who posted the message, if there is one, in base 10
channel_id_b36
property
The ID of the channel who posted the message, if there is one, in base 36
deleted = False
instance-attribute
Was this message deleted?
gift_purchase_notification
property
Are we a gifted subs notification? Returns JSON wrapper if yes, False if no
Returns:
| Name | Type | Description |
|---|---|---|
Data |
GiftPurchaseNotification | bool
|
A simple container for the data, or False |
is_rant
property
Is this message a rant?
message_id
property
The unique numerical ID of the chat message in base 10
message_id_b10
property
The unique numerical ID of the chat message in base 10
message_id_b36
property
The unique numerical ID of the chat message in base 36
raid_notification
property
Are we a raid notification? Returns associated JSON data if yes, False if no
rant_duration
property
The duration the rant will show for, returns 0 if message is not a rant
rant_expires_on
property
When the rant expires, returns message creation time if message is not a rant
rant_price_cents
property
The price of the rant, returns 0 if message is not a rant
text
property
The text of the message
time
property
The time the message was sent on, in seconds since the Epoch UTC
user
property
Reference to the user who posted this message, if we can find them
user_id
property
The numerical ID of the user who posted the message in base 10
user_id_b10
property
The numeric ID of the user in base 10
user_id_b36
property
The numeric ID of the user in base 36
__eq__(other)
Compare this chat message with another
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Any
|
Object to compare to. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Comparison |
bool
|
Did it fit the criteria? |
Source code in cocorum/chatapi.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | |
__init__(jsondata, chat)
A single chat message in the internal chat API
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
The JSON data block for the message |
required |
chat
|
ChatAPI
|
Our parent chat API wrapper |
required |
Source code in cocorum/chatapi.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
__int__()
The chat message in integer (ID) form
Source code in cocorum/chatapi.py
382 383 384 | |
__repr__()
String to represent this object
Source code in cocorum/chatapi.py
378 379 380 | |
__str__()
The chat message in string form
Source code in cocorum/chatapi.py
374 375 376 | |
delete()
Delete this message from the chat
Source code in cocorum/chatapi.py
501 502 503 | |
pin()
Pin this message
Source code in cocorum/chatapi.py
505 506 507 | |
unpin()
Unpin this message if it was pinned
Source code in cocorum/chatapi.py
509 510 511 | |
User
User in the internal chat API
Source code in cocorum/chatapi.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
badges
property
Badges the user has
channel_id
property
The numeric channel ID that the user is appearing with in base 10
channel_id_b10
property
The numeric channel ID that the user is appearing with in base 10
channel_id_b36
property
The numeric channel ID that the user is appearing with in base 36
color
property
The color of our username (RGB tuple)
is_follower
property
Is this user following the livestreaming channel?
previous_channel_ids = []
instance-attribute
A list of channels the user has appeared as, including the current one
servicephp = self.chat.servicephp
instance-attribute
Our parent chat API's ServicePHP instance, if it has one
user_id
property
The numeric ID of the user in base 10
__init__(jsondata, chat)
A user in the internal chat API
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jsondata
|
dict
|
The JSON data block for the user |
required |
chat
|
ChatAPI
|
Our parent chat API wrapper |
required |
Source code in cocorum/chatapi.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
UserBadge
Bases: ChatAPIObj, BaseUserBadge
A badge of a user
Source code in cocorum/chatapi.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
icon_url
property
The URL of the badge's icon
label
property
A dictionary of lang:label pairs
slug = slug
instance-attribute
The unique identification for this badge
__init__(slug, jsondata, chat)
A user badge in the internal chat API
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slug
|
str
|
The unique identification for this badge |
required |
jsondata
|
dict
|
The JSON data block for the user badge |
required |
chat
|
ChatAPI
|
Our parent chat API wrapper |
required |
Source code in cocorum/chatapi.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
S.D.G.