-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomCommandsBroadcasts.example.txt
75 lines (71 loc) · 6.3 KB
/
customCommandsBroadcasts.example.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
72
73
74
75
# This program has per default the ability to add/edit/delete custom commands
# and broadcasts if you are at least a moderator in the chat. The commands and
# broadcasts are persistently saved in a database.
# > Add a custom command with an ID, a RegEx expression to detect it and capture
# contents of the match (https://regex101.com/) and a message. Optionally a
# cooldown (in s) and user level (broadcaster, mod, vip, none) are also
# supported
!addcc id regex message[ -ul=userLevel][ -cd=cooldownInS]
# > A single property (cooldownInS, count, description, id, message, regex,
# userLevel) can be edited of an existing custom command
!editcc id option optionValue
# > And using the custom command ID it can be deleted
!delcc id
# > Add a custom broadcast with an ID, a cron expression to determine when the
# broadcast should be sent (https://crontab.cronhub.io/) and a message
!addcb id cronString message
# > A single property (cronString, description, id, message) can be edited of an
# existing custom broadcast
!editcb id option optionValue
# > And using the custom broadcast ID it can be deleted
!delcb id
# Custom command examples:
# > Reply > USER
!addcc ping ^\s*!ping(?:\s|$) '@$(USER) pong'
# > Random numbers > RANDOM_NUMBER
!addcc random ^\s*!random(?:\s|$) $(RANDOM_NUMBER=0<->100)%
# > Count command calls > COUNT
!addcc count ^\s*!count(?:\s|$) 'the test command was called $(COUNT) time$(IF_GREATER=$(COUNT)>1|s)'
# > Add a cooldown to a command
!addcc cooldown ^\s*!cooldown(?:\s|$) 'This command can only be executed every 30s' -cd=30
# > Reference parts of a message > REGEX_GROUP,IF_NOT_UNDEFINED
!addcc references ^\s*!regex(?:\s+(.*?)\s*$|\s|$) 'Detected the command !regex with $(IF_NOT_UNDEFINED=$(REGEX_GROUP=1)|"$(REGEX_GROUP=1)" as query)$(IF_UNDEFINED=$(REGEX_GROUP=1)|no query after the command :\()'
# > Use Twitch API for more specific shoutouts > REGEX_GROUP,TWITCH_API_GET_GAME
!addcc shoutout ^\s*!so\s+@?(\S+)\s*(?:.*)$ '/announce Go check out $(REGEX_GROUP=1) at https://www.twitch.tv/$(REGEX_GROUP=1) <3 They were last playing $(TWITCH_API_GET_GAME=$(REGEX_GROUP=1))' -ul=mod
# > Use Twitch API to get the follow age >
# REGEX_GROUP,TWITCH_API_GET_FOLLOW_AGE,TIME_IN_S_TO_HUMAN_READABLE_STRING_SHORT
!addcc followage ^\s*!followage(?:\s+(.*?)\s*$|\s|$) '@$(USER)$(IF_NOT_UNDEFINED=$(REGEX_GROUP=1)| $(REGEX_GROUP=1) followed the channel since $(TIME_IN_S_TO_HUMAN_READABLE_STRING_SHORT=$(TWITCH_API_GET_FOLLOW_AGE=$(REGEX_GROUP=1))))$(IF_UNDEFINED=$(REGEX_GROUP=1)| You followed the channel since $(TIME_IN_S_TO_HUMAN_READABLE_STRING_SHORT=$(TWITCH_API_GET_FOLLOW_AGE=$(USER))))'
# > Use Twitch API to get/set the title >
# REGEX_GROUP,TWITCH_API_GET_TITLE,TWITCH_API_SET_TITLE [user:edit:broadcast
# scope necessary to set the title]
!addcc title ^\s*!title(?:\s+(.*?)\s*$|\s|$) '@$(USER)$(IF_NOT_UNDEFINED=$(REGEX_GROUP=1)| You updated the title to "$(TWITCH_API_SET_TITLE=$(REGEX_GROUP=1))")$(IF_UNDEFINED=$(REGEX_GROUP=1)| The current title is "$(TWITCH_API_GET_TITLE)")' -ul=mod
# > Use Twitch API to get/set the game >
# REGEX_GROUP,TWITCH_API_GET_GAME,TWITCH_API_SET_GAME [user:edit:broadcast
# scope necessary to set the game]
!addcc game ^\s*!game(?:\s+(.*?)\s*$|\s|$) '@$(USER) $(IF_NOT_UNDEFINED=$(REGEX_GROUP=1)|You updated the game to "$(TWITCH_API_SET_GAME=$(REGEX_GROUP=1))")$(IF_UNDEFINED=$(REGEX_GROUP=1)|The current game is "$(TWITCH_API_GET_GAME)")' -ul=mod
# > Use Twitch API to get random chatters > TWITCH_API_RANDOM_USER
!addcc random_user ^\s*!randomHug(?:\s|$) '$(USER) gave $(TWITCH_API_RANDOM_USER) a warm hug'
# > Death counter that works across commands [1/4] > CUSTOM_DATA
!addcc 'death counter add' ^\s*!death(?:\s|$) '@$(USER) death was added, streamer died $(CUSTOM_DATA=death+#=1) time$(IF_NOT_EQUAL=$(CUSTOM_DATA=death<#>0)!==1|s)' -ul=mod
# > Death counter that works across commands [2/4] > CUSTOM_DATA
!addcc 'death counter get' ^\s*!deaths(?:\s|$) '@$(USER) streamer died $(CUSTOM_DATA=death<#>0) time$(IF_NOT_EQUAL=$(CUSTOM_DATA=death<#>0)!==1|s)'
# > Death counter that works across commands [3/4] > CUSTOM_DATA
!addcc 'death counter set' ^\s*!resetDeaths(?:\s+(.*?)\s*$|\s|$) '@$(USER) $(IF_NOT_UNDEFINED=$(REGEX_GROUP=1)|deaths were set to "$(REGEX_GROUP=1)", streamer died $(CUSTOM_DATA=death#=$(REGEX_GROUP=1)))$(IF_UNDEFINED=$(REGEX_GROUP=1)|deaths were reset to 0, streamer died $(CUSTOM_DATA=death#=0)) time$(IF_NOT_EQUAL=$(CUSTOM_DATA=death<#>0)!==1|s)' -ul=mod
# > Death counter that works across commands [4/4] > CUSTOM_DATA
!addcc 'death counter remove' ^\s*!removeDeath(?:\s|$) '@$(USER) death was removed, streamer died $(CUSTOM_DATA=death-#=1) time$(IF_NOT_EQUAL=$(CUSTOM_DATA=death<#>0)!==1|s)' -ul=mod
# > Quote database [1/3] > CUSTOM_DATA_LIST
!addcc 'quote list add' ^\s*!quoteAdd\s+(.*\s*)(?:\s|$) '@$(USER) Quote was added "$(CUSTOM_DATA_LIST=quote+=$(REGEX_GROUP=1))"' -ul=mod
# > Quote database [2/3] > CUSTOM_DATA_LIST
!addcc 'quote list get index or random' ^\s*!quote(?:\s+([0-9]+))?(?:\s|$) '@$(USER) Quote "$(IF_UNDEFINED=$(REGEX_GROUP=1)|$(CUSTOM_DATA_LIST=quote=@=$(RANDOM_NUMBER=0<-]$(CUSTOM_DATA_LIST_SIZE=quote))))$(IF_NOT_UNDEFINED=$(REGEX_GROUP=1)|$(CUSTOM_DATA_LIST=quote=@=$(REGEX_GROUP=1)))"'
# > Quote database [3/3] > CUSTOM_DATA_LIST
!addcc 'quote list remove index' ^\s*!quoteRemove\s+([0-9]+)(?:\s|$) '@$(USER) $(IF_UNDEFINED=$(REGEX_GROUP=1)|No quote index was found!)$(IF_NOT_UNDEFINED=$(REGEX_GROUP=1)|Removed quote: "$(CUSTOM_DATA_LIST=quote-@=$(REGEX_GROUP=1))")' -ul=mod
# > Score metrics [1/2] > CUSTOM_DATA_LIST
!addcc 'score list' ^\s*!scoresAdd\s+(-?[0-9]+)(?:\s|$) '@$(USER) $(IF_NOT_UNDEFINED=$(REGEX_GROUP=1)|\(added to the scores $(CUSTOM_DATA_LIST=scores+#=$(REGEX_GROUP=1))\) )sum=$(CUSTOM_DATA_LIST_SUM=scores) average=$(CUSTOM_DATA_LIST_AVERAGE=scores) max=$(CUSTOM_DATA_LIST_MAX=scores) min=$(CUSTOM_DATA_LIST_MIN=scores) size=$(CUSTOM_DATA_LIST_SIZE=scores)' -ul=mod
# > Score metrics [2/2] > CUSTOM_DATA_LIST
!addcc 'scores list reset' ^\s*!scoresReset(?:\s|$) '@$(USER) Scores were reset$(CUSTOM_DATA_LIST_CLEAR_NUMBER=scores)' -ul=mod
# > List all available macros and plugins for debugging > HELP
!addcc help ^\s*!help(?:\s|$) $(HELP) -ul=mod
# Custom broadcast examples:
!addcb 'Custom timer 1' '*/30 * * * * *' 'Test every 30 seconds: $(RANDOM_NUMBER)%'
!addcb 'Custom timer 2' '*/15 * * * *' 'Test every 15 minutes'
!addcb 'Custom timer 3' '0 */1 * * *' 'Test every hour'