Skip to content

Commit f505b11

Browse files
committed
robot: add permission level for selfbots
Fixes #95.
1 parent 8c2a1ba commit f505b11

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config.go

+4
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ func (robo *Robot) SetTwitchChannels(ctx context.Context, global Global, channel
309309
DisableSpeak: true,
310310
DisableMemes: true,
311311
}
312+
case strings.EqualFold(p.Level, "selfbot"):
313+
perms[p.ID] = channel.UserPerms{DisableLearn: true}
312314
case strings.EqualFold(p.Level, "moderator"):
313315
perms[p.ID] = channel.UserPerms{Moderator: true}
314316
}
@@ -322,6 +324,8 @@ func (robo *Robot) SetTwitchChannels(ctx context.Context, global Global, channel
322324
DisableSpeak: true,
323325
DisableMemes: true,
324326
}
327+
case strings.EqualFold(p.Level, "selfbot"):
328+
perms[p.ID] = channel.UserPerms{DisableLearn: true}
325329
case strings.EqualFold(p.Level, "moderator"):
326330
perms[p.ID] = channel.UserPerms{Moderator: true}
327331
}

example.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ meme = '^\S*$'
127127
# Access levels for users.
128128
# Each entry must have a name or ID and a level. If both a name and ID are
129129
# given, the name is ignored.
130-
# The valid levels are 'ignore' to disable use of all commands, including
131-
# prompting, or 'moderator' to add use of moderation commands.
130+
# The valid levels are 'ignore' to disable learning and use of all commands,
131+
# including prompting; 'selfbot' to disable learning but still allow commmands;
132+
# or 'moderator' to add use of moderation commands.
132133
# Note that on Twitch, the broadcaster and channel moderators always have
133134
# moderator privileges.
134135
# Unlike most strings, these are not expanded with environment variables.

0 commit comments

Comments
 (0)