// ReplyToMessage ...
484290
func (sp *SendText) ReplyToMessage(rm int) *SendText {
	sp.ReplyToMessageID = &rm
	return sp
}
803477
func (p *peer) ReplyCode(reqID uint64, codes [][]byte) *reply {
	data, _ := rlp.EncodeToBytes(codes)
	return &reply{p.rw, CodeMsg, reqID, data}
}
895120
func (r *Reply) String() string {
	switch r.Type {
	case ErrorReply:
		return r.Err.Error()
	case StatusReply:
		fallthrough
	case BulkReply:
		return string(r.buf)
	case IntegerReply:
		return strconv.FormatInt(r.int, 10)
	case NilReply:
		return "<nil>"
	case MultiReply:
		s := "[ "
		for _, e := range r.Elems {
			s = s + e.String() + " "
		}
		return s + "]"
	}

	// This should never execute
	return ""
}
306870
func (m *MockConnector) ReplyTarget(msg *Message) string {
	ret := m.ctrl.Call(m, "ReplyTarget", msg)
	ret0, _ := ret[0].(string)
	return ret0
}
539682
func NewMessageAction(label, text string) *MessageAction {
	return &MessageAction{
		Label: label,
		Text:  text,
	}
}
624153
func (c Conversation) QueryMessage() ValidMessage {
	queryMessage := []byte("?OTRv")

	if c.Policies.has(allowV2) {
		queryMessage = append(queryMessage, '2')
	}

	if c.Policies.has(allowV3) {
		queryMessage = append(queryMessage, '3')
	}

	suffix := "?"
	if c.friendlyQueryMessage != "" {
		suffix = "? " + c.friendlyQueryMessage
	}

	return append(queryMessage, suffix...)
}
1332434
func replyError(c context.Context, rw http.ResponseWriter, err error, msg string, args ...interface{}) {
	code := http.StatusBadRequest
	if transient.Tag.In(err) {
		code = http.StatusInternalServerError
	}
	msg = fmt.Sprintf(msg, args...)
	logging.Errorf(c, "HTTP %d: %s", code, msg)
	http.Error(rw, msg, code)
}
100295
func (s LoginSession) Reply(r Replier, comment string) error {
	req := &request{
		url: "https://www.reddit.com/api/comment",
		values: &url.Values{
			"thing_id": {r.replyID()},
			"text":     {comment},
			"uh":       {s.modhash},
		},
		cookie:    s.cookie,
		useragent: s.useragent,
	}

	body, err := req.getResponse()
	if err != nil {
		return err
	}

	if !strings.Contains(body.String(), "data") {
		return errors.New("failed to post comment")
	}

	return nil
}
868259
func replyWithError(w http.ResponseWriter, status, message string, args ...interface{}) error {
	return replyWithJSON(w, map[string]string{
		"status":        status,
		"error_message": fmt.Sprintf(message, args...),
	})
}
794827
func (sp *SendVideo) ReplyToMessage(rm int) *SendVideo {
	sp.ReplyToMessageID = &rm
	return sp
}
215011
func (p *peer) ReplyBlockHeaders(reqID uint64, headers []*types.Header) *reply {
	data, _ := rlp.EncodeToBytes(headers)
	return &reply{p.rw, BlockHeadersMsg, reqID, data}
}
216721
func (r *RoomService) Message(id string, msgReq *RoomMessageRequest) (*http.Response, error) {
	req, err := r.client.NewRequest("POST", fmt.Sprintf("room/%s/message", id), nil, msgReq)
	if err != nil {
		return nil, err
	}

	return r.client.Do(req, nil)
}
1369570
func replyWithJSON(w http.ResponseWriter, obj interface{}) error {
	w.Header().Set("Content-Type", "application/json; charset=utf-8")
	w.WriteHeader(http.StatusOK)
	enc := json.NewEncoder(w)
	enc.SetIndent("", "  ")
	enc.SetEscapeHTML(false)
	return enc.Encode(obj)
}
1150319
func (c *Conversation) Reply(text string, a ...interface{}) {
	prefix := ""

	if !c.message.IsDirectMessage() {
		prefix = "<@" + c.message.User() + ">: "
	}

	msg := c.message
	msg.SetText(prefix + fmt.Sprintf(text, a...))

	c.send(msg)
}
306146
func (p *peer) ReplyReceiptsRLP(reqID uint64, receipts []rlp.RawValue) *reply {
	data, _ := rlp.EncodeToBytes(receipts)
	return &reply{p.rw, ReceiptsMsg, reqID, data}
}
191538
func (r *Request) Reply(ok bool, payload []byte) error {
	if !r.WantReply {
		return nil
	}

	if r.ch == nil {
		return r.mux.ackRequest(ok, payload)
	}

	return r.ch.ackRequest(ok)
}
1260875
func replyError(c context.Context, rw http.ResponseWriter, err error) {
	if transient.Tag.In(err) {
		rw.WriteHeader(http.StatusInternalServerError)
	} else {
		rw.WriteHeader(http.StatusBadRequest)
	}
	templates.MustRender(c, rw, "pages/error.html", templates.Args{
		"Error": err.Error(),
	})
}