Actions
Common message actions
Actions commonly run on chat messages S.D.G
ChatBlipper
Blip with chat activity, getting fainter as activity gets more common
Source code in rumchat_actor/actions.py
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 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
current_volume
property
Calculate the current volume based on how rare messages have been, from 0 to 1
__init__(sound_filename, rarity_regen_time=60, stay_dead_time=10, rarity_reduce=0.1)
Blip with chat activity, getting fainter as activity gets more common. Instance this object, then pass it to RumbleChatActor().register_message_action()
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sound_filename
|
str
|
The filename of the blip sound to play. |
required |
rarity_regen_time
|
int
|
How long before the blip volume regenerates to maximum, in seconds. |
60
|
stay_dead_time
|
int
|
Effectively more regen time, in seconds, but with the volume staying at zero for the duration. |
10
|
rarity_reduce
|
float
|
How much a message reduces the volume in factor, ranging from >0 to 1. |
0.1
|
Source code in rumchat_actor/actions.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
action(message, act_props, actor)
Blip for a chat message, taking rarity into account for the volume
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Message
|
The chat message to run this action on. |
required |
act_props
|
dict
|
Action properties, aka metadata about what other things did with this message |
required |
actor
|
RumbleChatActor
|
The chat actor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
act_props |
dict
|
Dictionary of additional recorded properties from running this action. |
Source code in rumchat_actor/actions.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
load_sound(fn)
Load a sound from a file to use as a blip
Source code in rumchat_actor/actions.py
222 223 224 225 226 227 228 | |
reduce_rarity()
Reduce the remembered rarity of a message
Source code in rumchat_actor/actions.py
235 236 237 238 239 240 241 242 243 244 | |
RantTTSManager
System to TTS rant messages, with threshhold settings
Source code in rumchat_actor/actions.py
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 | |
tts_amount_threshold
property
writable
The amount a rant must be to be TTS-ed, 0 means all rants are TTS-ed
__init__()
System to TTS rant messages, with threshhold settings. Instance this object, then pass it to RumbleChatActor().register_message_action()
Source code in rumchat_actor/actions.py
78 79 80 81 82 83 84 85 86 | |
action(message, act_props, actor)
TTS rants above the manager instance's threshhold
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Message
|
The chat message to run this action on. |
required |
act_props
|
dict
|
Action properties, aka metadata about what other things did with this message |
required |
actor
|
RumbleChatActor
|
The chat actor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
act_props |
dict
|
Dictionary of additional recorded properties from running this action. |
Source code in rumchat_actor/actions.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
set_rant_tts_sayer(new)
Set the callable to be used on rant TTS
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new
|
callable
|
The function or method to call, passing the message text. |
required |
Source code in rumchat_actor/actions.py
103 104 105 106 107 108 109 110 | |
Thanker
Bases: Thread
Thank followers and subscribers in the chat
Source code in rumchat_actor/actions.py
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 | |
__init__(actor, **kwargs)
Thank followers and subscribers in the chat. Instance this object, then pass it to RumbleChatActor().register_message_action()
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
actor
|
RumbleChatActor
|
The Rumble Chat Actor instance. |
required |
follower_message
|
str
|
Message to format with Cocorum Follower object. Defaults to static.Thank.DefaultMessages.follower |
required |
subscriber_message
|
str
|
Message to format with the Cocorum Subscriber object. Defaults to static.Thank.DefaultMessages.subscriber |
required |
gifted_subs_message
|
str
|
Message to format with the Cocorum GiftPurchaseNotification object. Defaults to static.Thank.DefaultMessages.gifted_subs |
required |
Source code in rumchat_actor/actions.py
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 | |
action(message, act_props, actor)
Check for subscription gifts, and thank for them
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Message
|
The chat message to run this action on. |
required |
act_props
|
dict
|
Action properties, aka metadata about what other things did with this message |
required |
actor
|
RumbleChatActor
|
The chat actor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
act_props |
dict
|
Dictionary of additional recorded properties from running this action. |
Source code in rumchat_actor/actions.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
run()
Continuously check for new followers and subscribers
Source code in rumchat_actor/actions.py
313 314 315 316 317 318 319 320 321 322 323 324 325 | |
TimedMessagesManager
System to send messages on a timed basis
Source code in rumchat_actor/actions.py
133 134 135 136 137 138 139 140 141 142 143 144 145 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 | |
__init__(actor, messages, delay=60, in_between=0)
System to send messages on a timed basis. Instance this object, then pass it to RumbleChatActor().register_message_action()
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
actor
|
RumbleChatActor
|
The actor, to send the timed messages, |
required |
messages
|
list
|
List of str messages to send |
required |
delay
|
int
|
Time between messages in seconds |
60
|
in_between
|
int
|
Number of messages that must be sent before we send another timed one |
0
|
Source code in rumchat_actor/actions.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
action(message, act_props, actor)
Count the messages sent
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Message
|
The chat message to run this action on. |
required |
act_props
|
dict
|
Action properties, aka metadata about what other things did with this message |
required |
actor
|
RumbleChatActor
|
The chat actor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
act_props |
dict
|
Dictionary of additional recorded properties from running this action. |
Source code in rumchat_actor/actions.py
166 167 168 169 170 171 172 173 174 175 176 177 178 | |
sender_loop()
Continuously wait till it is time to send another message
Source code in rumchat_actor/actions.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
UserAnnouncer
Announce new users as they arrive in the chat
Source code in rumchat_actor/actions.py
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 | |
__init__(announcer=None, known_users=[], special_announcers={})
Announce new users as they arrive in the chat
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
announcer
|
callable
|
Function or method to call. Will be passed the message action special of message, act_props, and actor. Should return act_props dict likewise. Defaults to None. |
None
|
known_users
|
list
|
List of users not to announce. Useful if you
only want this announcer to go off for brand new chatters. You
can save this list after actor exit from this object's
|
[]
|
special_announcers
|
dict[str, callable]
|
Dict of username to announcer callable pairs. Should take same args as regular announcers, but they will only be called on the username that matches them. |
{}
|
Source code in rumchat_actor/actions.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
action(message, act_props, actor)
Announce the user if they are new
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Message
|
The chat message to run this action on. |
required |
act_props
|
dict
|
Action properties, aka metadata about what other things did with this message |
required |
actor
|
RumbleChatActor
|
The chat actor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
act_props |
dict
|
Dictionary of additional recorded properties from running this action. |
Source code in rumchat_actor/actions.py
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 | |
ollama_message_moderate(message, act_props, actor)
Moderate a message with Ollama, deleting if needed
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Message
|
The chat message to run this action on. |
required |
act_props
|
dict
|
Action properties, aka metadata about what other things did with this message |
required |
actor
|
RumbleChatActor
|
The chat actor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
act_props |
dict
|
Dictionary of recorded properties from running this action. |
Source code in rumchat_actor/actions.py
21 22 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 | |