summaryrefslogtreecommitdiff
path: root/proto/strfail.go
blob: 1ce160c2bc3302815894c41dfbdf09f62c6f31a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package proto

func Strfail(fail Object) string {
	switch fail.Kind {
	case "bad-target":
		return "unknown user or channel"
	case "unknown-name":
		return "unknown user or channel name"
	case "invalid":
		return "invalid action"
	case "forbidden":
		return "you don't have permission to do that"
	case "name-taken":
		return "name is in use: " + fail.Fields[""]
	case "invalid-name":
		return "name is too long or contains invalid characters: " + fail.Fields[""]
	case "too-long":
		return "message or status is too long"
	case "not-in-channel":
		return "you are not a member of this channel: " + fail.Fields[""]
	case "bad-reply":
		return "this is not a message you can reply to"
	default:
		return "unknown error"
	}
}