Commands
Chat commands
The base ChatCommand abstract class, and some commonly used derivatives S.D.G.
ChatCommand
Chat command abstract class
Source code in rumchat_actor/commands.py
23 24 25 26 27 28 29 30 31 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 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 |
|
help_message
property
writable
The help message for this command
__init__(name, actor, target=None, **kwargs)
Chat command abstract class Instance this object, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The !name of the command. |
required |
actor
|
RumleChatActor
|
The RumleChatActor host object. |
required |
cooldown
|
int | float
|
How long to wait before allowing the command to be run again. Defaults to static.Message.send_cooldown |
required |
amount_cents
|
int
|
The minimum cost of the command. Defaults to free. |
required |
exclusive
|
bool
|
If this command can only be run by users with allowed badges. Defaults to False. |
required |
allowed_badges
|
list
|
Badges that are allowed to run this command (if it is exclusive); ignored if exclusive is False. "admin" is added internally. Defaults to ["subscriber"] |
required |
free_badges
|
list
|
Badges which, if borne, give the user free-of-charge command access even if amount_cents > 0. "admin" is added internally. Defaults to ["moderator"] |
required |
target
|
callable
|
The command function(message, act_props, actor) to call. Defaults to self.run |
None
|
Source code in rumchat_actor/commands.py
25 26 27 28 29 30 31 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 |
|
call(message, act_props)
The command was called
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
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 |
|
run(message, act_props)
Dummy run method, for when calling the command was successful.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
ClipDownloadingCommand
Bases: ChatCommand
Save clips of the livestream by downloading stream chunks from Rumble, works remotely
Source code in rumchat_actor/commands.py
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 512 513 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 |
|
help_message
property
The help message for this command
__init__(actor, name='clip', default_duration=60, max_duration=120, clip_save_path='.' + os.sep)
Save clips of the livestream by downloading stream chunks from Rumble, works remotely. Instance this object, optionally pass it to the init method of a ClipUploader, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
RumbleChatActor
|
The Rumchat Actor. |
required |
name
|
str
|
The name of the command. Defaults to "clip" |
'clip'
|
default_duration
|
int
|
How long the clip will last in seconds if no duration is specified on run. Defaults to 60 |
60
|
max_duration
|
int
|
How long the clip can be set to be in seconds on run. Defaults to 120 |
120
|
clip_save_path
|
str
|
Where to save clips to when they are made. Defaults to "." |
'.' + sep
|
Source code in rumchat_actor/commands.py
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 |
|
form_ts_into_clip(filename, use_ts)
Do the actual TS [down]loading and processing, and save the video clip. This method should be a thread target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
The base name to save the clip file with, with no extension or path. |
required |
use_ts
|
list
|
The list of TS file names to use for this clip. |
required |
Source code in rumchat_actor/commands.py
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 |
|
get_quality_info()
Get information on the stream quality options: Download time, TS length, availability
Source code in rumchat_actor/commands.py
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 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 |
|
get_ts_list(quality)
Download an m3u8 playlist and parse it for TS filenames
Parameters:
Name | Type | Description | Default |
---|---|---|---|
quality
|
str
|
The quality specifier used in the TS URL. |
required |
Returns:
Name | Type | Description |
---|---|---|
Files |
list
|
Lines of the TS playlist that do not start with # |
Source code in rumchat_actor/commands.py
400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
|
record_loop()
Start and run the recorder system
Source code in rumchat_actor/commands.py
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 |
|
run(message, act_props)
Make a clip
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
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 |
|
save_clip(duration, filename=None)
Start a clip saver thread with the given parameters
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
How long the clip should be. |
required |
filename
|
str
|
What to name the saved clip file. Defaults to None, auto-generate a filename. |
None
|
Source code in rumchat_actor/commands.py
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 |
|
ClipRecordingCommand
Bases: ChatCommand
Save clips of the livestream by duplicating then trimming an in-progress recording by OBS
Source code in rumchat_actor/commands.py
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 |
|
help_message
property
The help message for this command
recording_container
property
The container format of the recording
recording_copy_fn
property
The filename of the temporary recording copy
recording_filename
property
The filename of the running OBS recording
__init__(actor, name='clip', default_duration=60, max_duration=120, recording_load_path='.', clip_save_path='.' + os.sep)
Save clips of the livestream by duplicating then trimming an in-progress recording by OBS. Instance this object, optionally pass it to the init method of a ClipUploader, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
RumbleChatActor
|
The Rumchat Actor. |
required |
name
|
str
|
The name of the command. Defaults to "clip" |
'clip'
|
default_duration
|
int
|
How long the clip will last in seconds if no duration is specified on run. Defaults to 60 |
60
|
max_duration
|
int
|
How long the clip can be set to be in seconds on run. Defaults to 120 |
120
|
recording_load_path
|
str
|
Where recordings from OBS are stored, used for filedialog init. Defaults to "." |
'.'
|
clip_save_path
|
str
|
Where to save clips to when they are made. Defaults to "." |
'.' + sep
|
Source code in rumchat_actor/commands.py
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 |
|
form_recording_into_clip(duration, filename)
Do the actual file operations to save a clip. This method should be a thread target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
The length of the clip in seconds. |
required |
filename
|
str
|
The base filename of the clip, with no path or extension. |
required |
Source code in rumchat_actor/commands.py
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 |
|
run(message, act_props)
Make a clip. TODO mostly identical to ClipDownloadingCommand().run()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
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 |
|
save_clip(duration, filename=None)
Start a clip saver thread with the given parameters
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
The length of the clip in seconds. |
required |
filename
|
str
|
The base filename of the clip, with no path or extension. Defaults to None, auto-generate the filename. |
None
|
Source code in rumchat_actor/commands.py
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 |
|
ClipReplayBufferCommand
Bases: ChatCommand
Save clips of the livestream by triggering OBS to save its replay buffer
Source code in rumchat_actor/commands.py
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 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 |
|
help_message
property
The help message for this command
running_clipsaves
property
writable
How many clip save threads are currently running
__init__(actor, name='clip', cooldown=120, addr='localhost', port=4455, password='', save_format=static.Clip.save_extension)
Save clips of the livestream by triggering OBS to save its replay buffer. Instance this object, optionally pass it to the init method of a ClipUploader, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
RumbleChatActor
|
The Rumchat Actor. |
required |
name
|
str
|
The name of the command. Defaults to "clip" |
'clip'
|
cooldown
|
int
|
Command cooldown in seconds. |
120
|
addr
|
str
|
IP address of the computer running OBS. Defaults to "localhost", meaning this computer. |
'localhost'
|
port
|
4455
|
Port that OBS WebSocket is listening on. Defaults to 4455, currently OBS's default. |
4455
|
password
|
str
|
OBS WebSocket password, if you have one set. Defaults to empty. |
''
|
save_format
|
str
|
Filename extension for the format that replay buffers are saved in. Defaults to static.Clip.save_extension |
save_extension
|
Source code in rumchat_actor/commands.py
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 |
|
run(message, act_props)
Make a clip. TODO mostly identical to ClipDownloadingCommand().run()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 |
|
save_buffer_as_clip(desired_filename)
Do the actual file operations to save a clip. This method should be a thread target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
The base filename of the clip, with no path or extension, renamed from whatever OBS named it. |
required |
Source code in rumchat_actor/commands.py
943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 |
|
save_clip(filename=None)
Start a clip saver thread with the given parameters
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
The base filename of the clip, with no path or extension. Defaults to None, auto-generate the filename. |
None
|
Source code in rumchat_actor/commands.py
919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 |
|
HelpCommand
Bases: ChatCommand
List available commands, or show help for a specific command
Source code in rumchat_actor/commands.py
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 |
|
help_message
property
The help message for this command
__init__(actor, name='help')
List available commands, or show help for a specific command. Instance this object, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
RumbleChatActor
|
The Rumble chat actor host. |
required |
name
|
str
|
The command name. |
'help'
|
Source code in rumchat_actor/commands.py
269 270 271 272 273 274 275 276 277 |
|
run(message, act_props)
Run the help command
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
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 |
|
KillswitchCommand
Bases: ChatCommand
A killswitch for Rumchat Actor, in case moderators or admin need to shut it down from the chat
Source code in rumchat_actor/commands.py
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 |
|
help_message
property
The help message for this command
__init__(actor, name='killswitch', allowed_badges=['moderator'])
A killswitch for Rumchat Actor, in case moderators or admin need to shut it down from the chat. Instance this object, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
RumbleChatActor
|
The RumleChatActor host object. |
required |
name
|
str
|
The !name of the command. |
'killswitch'
|
allowed_badges
|
list
|
Badges that are allowed to run this command. "admin" is added internally. Defaults to ["moderator"] |
['moderator']
|
Source code in rumchat_actor/commands.py
321 322 323 324 325 326 327 328 329 330 331 332 |
|
run(message, act_props)
Shut down Rumchat Actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
339 340 341 342 343 344 345 346 347 348 349 350 351 |
|
MessageCommand
Bases: ChatCommand
Post a single message in chat
Source code in rumchat_actor/commands.py
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 |
|
__init__(actor, name, text, help_message=None)
Post a single message in chat. Instance this object, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
RumbleChatActor
|
The Rumble chat actor host. |
required |
name
|
str
|
The command name. |
required |
text
|
str
|
A message to format with the commander's username. |
required |
help_message
|
str
|
The message that the help command will display. Defaults to None |
None
|
Source code in rumchat_actor/commands.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
run(message, act_props)
Post the message
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
258 259 260 261 262 263 264 265 |
|
RaffleCommand
Bases: ChatCommand
Create, enter, and draw from raffles
Source code in rumchat_actor/commands.py
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 |
|
help_message
property
The help message for this command
__init__(actor, name='raffle')
Create, enter, and draw from raffles. Instance this object, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
RumbleChatActor
|
The Rumchat Actor. |
required |
name
|
str
|
The name of the command. Defaults to "raffle" |
'raffle'
|
Source code in rumchat_actor/commands.py
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 |
|
count_entries(message)
Report the number of entries made so far
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The message of the count request. |
required |
Source code in rumchat_actor/commands.py
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 |
|
draw_entry(message)
Draw a winner
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The message of the winner draw request. |
required |
Source code in rumchat_actor/commands.py
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 |
|
make_entry(message)
Make an entry
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The message of the user who wishes to enter. |
required |
Source code in rumchat_actor/commands.py
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 |
|
remove_entry(message)
Remove an entry
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The message of the removal request. |
required |
Source code in rumchat_actor/commands.py
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 |
|
report_winner(message)
Report the current winner
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The message of the winner display request. |
required |
Source code in rumchat_actor/commands.py
1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 |
|
reset(message)
Reset the raffle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The message of the reset request. |
required |
Source code in rumchat_actor/commands.py
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 |
|
run(message, act_props)
Run the raffle command
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 |
|
TTSCommand
Bases: ChatCommand
Text-to-speech command
Source code in rumchat_actor/commands.py
146 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 183 184 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 |
|
default_voice
property
The default TTS voice as a say(text) callable
help_message
property
The help message for this command
__init__(*args, name='tts', no_double_sound=True, voices={}, **kwargs)
Text-to-speech command. Instance this object, then pass it to RumbleChatActor().register_command().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
RumleChatActor
|
The RumleChatActor host object. |
required |
name
|
str
|
The !name of the command. Defaults to "tts" |
'tts'
|
no_double_sound
|
bool
|
Do not play if act_props["sound"] is True. Defaults to True |
True
|
voices
|
dict
|
Dict of voice_name : say(text) callable. |
{}
|
cooldown
|
int | float
|
How long to wait before allowing the command to be run again. Defaults to static.Message.send_cooldown |
required |
amount_cents
|
int
|
The minimum cost of the command. Defaults to free. |
required |
exclusive
|
bool
|
If this command can only be run by users with allowed badges. Defaults to False. |
required |
allowed_badges
|
list
|
Badges that are allowed to run this command (if it is exclusive); ignored if exclusive is False. "admin" is added internally. Defaults to ["subscriber"] |
required |
free_badges
|
list
|
Badges which, if borne, give the user free-of-charge command access even if amount_cents > 0. "admin" is added internally. Defaults to ["moderator"] |
required |
Source code in rumchat_actor/commands.py
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 |
|
run(message, act_props)
Run the TTS
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Message
|
The chat message that called us. |
required |
act_props
|
dict
|
Message action recorded properties. |
required |
Source code in rumchat_actor/commands.py
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 |
|
speak(text, voice=None)
Speak text with voice
Parameters:
Name | Type | Description | Default |
---|---|---|---|
voice
|
str
|
The key of the voice in our voices dict. Defaults to None |
None
|
Source code in rumchat_actor/commands.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|