Skip to content

Commit

Permalink
20220904 2343
Browse files Browse the repository at this point in the history
  • Loading branch information
yasutakatou authored Sep 4, 2022
1 parent 8413d39 commit 281daf1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions slabot.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,10 @@ func socketMode(sig chan string, api *slack.Client, needSCP bool) {

switch command {
case "RULES":
rules := returnRules(initUsers(event.User))
rInt := initUsers(event.User)

if len(rules) > 0 {
if rInt != -1 {
rules := returnRules(rInt)
text := slack.NewTextBlockObject(slack.MarkdownType, "Please select *RULE*.", false, false)
textSection := slack.NewSectionBlock(text, nil, nil)

Expand Down Expand Up @@ -1370,15 +1371,15 @@ func Exists(filename string) bool {
}

func initUsers(User string) int {
usertNum := 0
usertNum := -1

for i := 0; i < len(allows); i++ {
if allows[i].ID == User {
usertNum = i
}
}

if usertNum == 0 {
if usertNum == -1 {
return -1
}

Expand Down Expand Up @@ -1662,7 +1663,7 @@ func lookup(host int) string {
}

func executer(sig chan string, userInt, hostInt int, Command, channel string, needSCP bool) {
prompt := "[@" + lookup(udata[userInt].HOST) + " " + udata[userInt].PWD + "]$ " + Command + "\n"
prompt := "[" + lookup(udata[userInt].HOST) + " " + udata[userInt].PWD + "]$ " + Command + "\n"
done := false
strs := ""
dFlag := false
Expand Down

0 comments on commit 281daf1

Please sign in to comment.