rename user/channel Reply* to Message*
This commit is contained in:
parent
0a5cbe98c0
commit
4bb84cbbfa
30
state.go
30
state.go
@ -67,30 +67,30 @@ type User struct {
|
||||
LastActive time.Time
|
||||
}
|
||||
|
||||
// Reply returns an event which can be used to send a response to the user
|
||||
// Message returns an event which can be used to send a response to the user
|
||||
// as a private message.
|
||||
func (u *User) Reply(message string) *Event {
|
||||
func (u *User) Message(message string) *Event {
|
||||
return &Event{Command: PRIVMSG, Params: []string{u.Nick}, Trailing: message}
|
||||
}
|
||||
|
||||
// Replyf returns an event which can be used to send a response to the user
|
||||
// Messagef returns an event which can be used to send a response to the user
|
||||
// as a private message. format is a printf format string, which a's
|
||||
// arbitrary arugments will be passed to.
|
||||
func (u *User) Replyf(format string, a ...interface{}) *Event {
|
||||
return u.Reply(fmt.Sprintf(format, a...))
|
||||
func (u *User) Messagef(format string, a ...interface{}) *Event {
|
||||
return u.Message(fmt.Sprintf(format, a...))
|
||||
}
|
||||
|
||||
// ReplyTo returns an event which can be used to send a response to the
|
||||
// MessageTo returns an event which can be used to send a response to the
|
||||
// user in a channel as a private message.
|
||||
func (u *User) ReplyTo(channel, message string) *Event {
|
||||
func (u *User) MessageTo(channel, message string) *Event {
|
||||
return &Event{Command: PRIVMSG, Params: []string{u.Nick}, Trailing: channel + ": " + message}
|
||||
}
|
||||
|
||||
// ReplyTof returns an event which can be used to send a response to the
|
||||
// MessageTof returns an event which can be used to send a response to the
|
||||
// channel. format is a printf format string, which a's arbitrary arugments
|
||||
// will be passed to.
|
||||
func (u *User) ReplyTof(channel, format string, a ...interface{}) *Event {
|
||||
return u.ReplyTo(channel, fmt.Sprintf(format, a...))
|
||||
func (u *User) MessageTof(channel, format string, a ...interface{}) *Event {
|
||||
return u.MessageTo(channel, fmt.Sprintf(format, a...))
|
||||
}
|
||||
|
||||
// Lifetime represents the amount of time that has passed since we have first
|
||||
@ -124,16 +124,16 @@ type Channel struct {
|
||||
Joined time.Time
|
||||
}
|
||||
|
||||
// Reply returns an event which can be used to send a response to the channel.
|
||||
func (c *Channel) Reply(message string) *Event {
|
||||
// Message returns an event which can be used to send a response to the channel.
|
||||
func (c *Channel) Message(message string) *Event {
|
||||
return &Event{Command: PRIVMSG, Params: []string{c.Name}, Trailing: message}
|
||||
}
|
||||
|
||||
// Replyf returns an event which can be used to send a response to the
|
||||
// Messagef returns an event which can be used to send a response to the
|
||||
// channel. format is a printf format string, which a's arbitrary arugments
|
||||
// will be passed to.
|
||||
func (c *Channel) Replyf(format string, a ...interface{}) *Event {
|
||||
return c.Reply(fmt.Sprintf(format, a...))
|
||||
func (c *Channel) Messagef(format string, a ...interface{}) *Event {
|
||||
return c.Message(fmt.Sprintf(format, a...))
|
||||
}
|
||||
|
||||
// Lifetime represents the amount of time that has passed since we have first
|
||||
|
Loading…
Reference in New Issue
Block a user