Skip to content

Commit

Permalink
Simplify variables names on findTrollHouse
Browse files Browse the repository at this point in the history
  • Loading branch information
ryukinix committed Jul 23, 2020
1 parent 5362b51 commit 0c48540
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions troll_shield.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@ var log = logger.New(os.Stderr, "", logger.LstdFlags)
// findTrollHouse return the troll house group name if is well-known
// otherwise, returns a empty string
func findTrollHouse(bot *tgbotapi.BotAPI, userID int) (string, error) {
var error error = nil
var error error
for _, trollGroup := range trollGroups {
chatMemberConf := tgbotapi.ChatConfigWithUser{
c, err := bot.GetChatMember(tgbotapi.ChatConfigWithUser{
SuperGroupUsername: trollGroup,
UserID: userID,
}
chatMember, err := bot.GetChatMember(chatMemberConf)
})
if err != nil {
error = err
continue
}
if chatMember.IsMember() || chatMember.IsCreator() || chatMember.IsAdministrator() {
if c.IsMember() || c.IsCreator() || c.IsAdministrator() {
return trollGroup, nil
}
}
Expand Down

0 comments on commit 0c48540

Please sign in to comment.