1
0
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:
Pablo Ovelleiro Corral 2019-04-14 21:01:45 +02:00
parent 2b793c6409
commit 0519d6c59d
No known key found for this signature in database
GPG Key ID: F7C1D57C8464E825

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) {