From bda8dde0698920ef89f716f6f4ee1f1afd7e4a3a Mon Sep 17 00:00:00 2001 From: lyx0 Date: Thu, 28 Oct 2021 17:25:50 +0200 Subject: [PATCH] add limitations for join and part command --- pkg/handlers/command.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/handlers/command.go b/pkg/handlers/command.go index 24065b6..e01d5af 100644 --- a/pkg/handlers/command.go +++ b/pkg/handlers/command.go @@ -142,13 +142,22 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { } case "join": + if msgLen == 1 || message.User.ID != "31437432" { + nb.Send(target, "You are not allowed to do this") + return + } db.AddChannel(cmdParams[1], nb.MongoClient) nb.Send(message.Channel, "Joined") return case "part": + if msgLen == 1 || message.User.ID != "31437432" { + nb.Send(target, "You are not allowed to do this") + return + } db.PartChannel(cmdParams[1], nb.MongoClient) nb.Send(message.Channel, "Parted") + return case "firstline": if msgLen == 1 {