Skip to content

Commit

Permalink
Save banee name.
Browse files Browse the repository at this point in the history
This makes it easier to remember which key is
which.
  • Loading branch information
Arkaeriit committed Sep 3, 2024
1 parent eee6c30 commit f964aa6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ func promptCMD(line string, u *User) {
func listBansCMD(_ string, u *User) {
msg := "Bans by ID: \n"
for i := 0; i < len(Bans); i++ {
msg += Cyan.Cyan(strconv.Itoa(i+1)) + ". " + Bans[i].ID + " \n"
msg += Cyan.Cyan(strconv.Itoa(i+1)) + ". " + Bans[i].ID + " (" + Bans[i].Name + ") \n"
}
u.room.broadcast(Devbot, msg)
}
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const (
type Ban struct {
Addr string
ID string
Name string
UseTime bool
UnbanTime time.Time
}
Expand Down Expand Up @@ -617,7 +618,7 @@ func (u *User) ban(banMsg string, useTime bool, unbanTime time.Time) {
if u.addr == "" && u.id == "" {
return
}
Bans = append(Bans, Ban{u.addr, u.id, useTime, unbanTime})
Bans = append(Bans, Ban{u.addr, u.id, stripansi.Strip(u.Name), useTime, unbanTime})
saveBans()
uid := u.id
u.close(banMsg)
Expand Down

0 comments on commit f964aa6

Please sign in to comment.