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
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 243 244 245 246 247 248 249 250 251 252 253 |
|
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
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
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
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
load_sound(fn)
Load a sound from a file to use as a blip
Source code in rumchat_actor/actions.py
215 216 217 218 219 220 221 |
|
reduce_rarity()
Reduce the remembered rarity of a message
Source code in rumchat_actor/actions.py
228 229 230 231 232 233 234 235 236 237 |
|
RantTTSManager
System to TTS rant messages, with threshhold settings
Source code in rumchat_actor/actions.py
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 |
|
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
75 76 77 78 79 80 81 82 83 |
|
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
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
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
100 101 102 103 104 105 106 107 |
|
Thanker
Bases: Thread
Thank followers and subscribers in the chat
Source code in rumchat_actor/actions.py
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 |
|
__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
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 |
|
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
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
|
run()
Continuously check for new followers and subscribers
Source code in rumchat_actor/actions.py
304 305 306 307 308 309 310 311 312 313 314 315 316 |
|
TimedMessagesManager
System to send messages on a timed basis
Source code in rumchat_actor/actions.py
129 130 131 132 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 |
|
__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
131 132 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 |
|
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
161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
sender_loop()
Continuously wait till it is time to send another message
Source code in rumchat_actor/actions.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
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
20 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 |
|