twitch-bot-tools/README.md
Knut Ahlers 8d438c6c01
Add Discord Invite Connector
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-09-13 23:45:54 +02:00

91 lines
3.1 KiB
Markdown

# Luzifer / twitch-bot-tools
This repository contains a collection of tools to be executed through the [twitch-bot](https://github.com/Luzifer/twitch-bot) [`script` actor](https://luzifer.github.io/twitch-bot/configuration/actors/#execute-script--command).
## automod-debug
Pretty-print issues Twitch AutoMod had with the message
```yaml
- description: AutoMod Debug
actions:
- type: script
attributes:
command:
- /data/scripts/automod-debug/automod-debug
match_message: '!autodebug (.+)'
```
## dc-invite
Create a Discord invite and send the invite link through a whisper
```yaml
- description: Discord-Invite
actions:
- type: script
attributes:
command:
- /data/bin/dc-invite
- --channel-id=1234... # Right-click on channel, copy ID
#- --discord-bot-token=... # Can provide through env: DISCORD_BOT_TOKEN
- --message-template
- 'Hey, hier ist der Invite für meinen Discord: https://discord.gg/%s'
- --send-to={{ fixUsername .user }}
- type: discordhook
attributes:
content: |
Ein Discord-Invite (`{{ .invite_code }}`) wurde erstellt:
`{{ fixUsername .user }}` ({{ .user_id }})
hook_url: https://discord.com/api/webhooks/...
username: Invite-Bot
match_channels:
- '#luziferus'
match_event: channelpoint_redeem
disable_on_template: '{{ ne .reward_id "45d441e9-6a00-4c3e-8bd8-b2cd8b913753" }}'
```
## dice
Throw `N` `M`-sided dices and print the result into the chat
```yaml
- description: 'Mini-Game: Flip a Coin'
actions:
- type: script
attributes:
command:
- /data/scripts/dice/dice
- -b
- --sides=2
- --count=1
- --template
- '{{ mention .user }} {{ "Deine Münze ist gefallen: Du hast {{ range .results }} {{ if eq . 1 }}Kopf{{ else }}Zahl{{ end }}{{ end }}" }}'
match_message: ^!(?:coin|m(?:ue|ü)nze)$
- description: 'Mini-Game: Throw a Dice'
actions:
- type: script
attributes:
command:
- /data/scripts/dice/dice
- -b
- --sides=6
- --count=1
- --template
- '{{ mention .user }} {{ "Deine Würfel sind gefallen: {{ .count }}w{{ .sides }} ergab{{ if gt .count 1 }}en{{ end }}:{{ range $i, $v := .results }}{{ if gt $i 0 }},{{ end }} {{ $v }}{{ end }} {{ if gt .count 1 }}(Summe {{ .sum }}){{ end }}" }}'
match_message: ^!(?:dice|w(?:ue|ü)rfel)$
- description: 'Mini-Game: Throw a specific Dice'
actions:
- type: script
attributes:
command:
- /data/scripts/dice/dice
- -b
- --sides={{ group 2 }}
- --count={{ if eq (group 1) "" }}1{{else}}{{ group 1 }}{{end}}
- --template
- '{{ mention .user }} {{ "Deine Würfel sind gefallen: {{ .count }}w{{ .sides }} ergab{{ if gt .count 1 }}en{{ end }}:{{ range $i, $v := .results }}{{ if gt $i 0 }},{{ end }} {{ $v }}{{ end }} {{ if gt .count 1 }}(Summe {{ .sum }}){{ end }}" }}'
match_message: ^!(?:dice|w(?:ue|ü)rfel) ([1-9]|)w([0-9]{1,3})
```