mirror of
https://github.com/pinpox/gitea-matrix-bot
synced 2024-11-22 19:31:58 +01:00
implement handler for subscribe command
This commit is contained in:
parent
2b793c6409
commit
0519d6c59d
13
bot.go
13
bot.go
@ -89,8 +89,19 @@ func (gb *GiteaBot) handleCommandListSubs(room string) {
|
||||
gb.SendToRoom(room, msg)
|
||||
}
|
||||
|
||||
func contains(s []string, e string) bool {
|
||||
for _, a := range s {
|
||||
if a == e {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (gb *GiteaBot) handleCommandAddSub(room, repo string) {
|
||||
gb.SendToRoom(room, "Not implemented yet")
|
||||
if !contains(gb.Subscriptions[repo], room) {
|
||||
gb.Subscriptions[repo] = append(gb.Subscriptions[repo], room)
|
||||
}
|
||||
}
|
||||
|
||||
func (gb *GiteaBot) handleCommandMakeAdmin(room, repo string) {
|
||||
|
Loading…
Reference in New Issue
Block a user