refactor: rename MessageType to IRCMessageType with full API
All checks were successful
check / check (push) Successful in 4s

- Rename MessageType to IRCMessageType (custom int type)
- .Name() returns just the name (e.g. "RPL_LUSEROP")
- .String() returns name + code (e.g. "RPL_LUSEROP <252>")
- .Code() returns zero-padded 3-digit string (e.g. "252")
- .Int() returns the bare int value
- Add FromInt() package-level function with validation
- Update all call sites to use new type and methods
This commit is contained in:
user
2026-03-10 10:31:22 -07:00
parent 164fec3fc8
commit ba2c113a85
3 changed files with 198 additions and 162 deletions

View File

@@ -746,8 +746,8 @@ func scanMessages(
code, _ := strconv.Atoi(msg.Command)
msg.Code = code
if name := irc.Name(irc.MessageType(code)); name != "" {
msg.Command = name
if mt, err := irc.FromInt(code); err == nil {
msg.Command = mt.Name()
}
}