[thing_id] +String+ fullname of a post (or self.post?), comment (and private message?)
 [text] :nodoc:
971574
def leave_a_comment thing_id, text
      Module.nesting[1].logger.warn "leaving a comment on '#{thing_id}'"
      json(:post, "/api/comment",
        thing_id: thing_id,
        text: text,
      ).tap do |result|
        fail result["json"]["errors"].to_s unless result["json"]["errors"].empty?
      end
    end
1052220
def post_molo_comment(request, next=None, using=None):
    
    data = request.POST.copy()
    if 'submit_anonymously' in data:
        data['name'] = 'Anonymous'
    # replace with our changed POST data

    # ensure we always set an email
    data['email'] = request.user.email or 'blank@email.com'

    request.POST = data
    return post_comment(request, next=next, using=next)
749991
def find_namelists(text, before_contains=nil)
      return nil if !text
      result = ""
      lines = "#{text}"
      before_contains = "" if !before_contains
      while lines =~ /^\s*?namelist\s+\/\s*?(\w+)\s*?\/([\s\w\,]+)$/i
        lines = $~.post_match
        nml_comment = COMMENTS_ARE_UPPER ? 
            find_comments($~.pre_match) : find_comments($~.post_match)
        nml_name = $1
        nml_args = $2.split(",")
        result << "\n\n=== NAMELIST <tt><b>" + nml_name + "</tt></b>\n\n"
        result << nml_comment + "\n" if nml_comment
        if lines.split("\n")[0] =~ /^\//i
          lines = "namelist " + lines
        end
        result << find_arguments(nml_args, "#{text}" + "\n" + before_contains)
      end
      return result
    end
268386
def say(text, quick_replies: [], user: @user)
      message_options = {
        recipient: { id: user.id },
        message: { text: text }
      }
      if quick_replies && !quick_replies.empty?
        message_options[:message][:quick_replies] = UI::QuickReplies
                                                      .build(*quick_replies)
      end

      send_message(message_options)
    end
914710
def get_discussion_post(discussion_id, post_id, params = nil)
      raise Error, "Discussion ID is required" unless discussion_id.is_a? Numeric
      raise Error, "Discussion Post ID is required" unless post_id.is_a? Numeric
      get("/#{workroom_check(params)}discussions/#{discussion_id}/discussion_posts/#{post_id}.json")
    end
323479
def p_text(self, text):
        ''''''
        item = text[1]
        text[0] = item if item[0] != "\n" else u""
        if len(text) > 2:
            text[0] += "\n"
747962
def get_by_id(self, reply_id):
        '''
        
        '''
        reply = MReply.get_by_uid(reply_id)
        logger.info('get_reply: {0}'.format(reply_id))

        self.render('misc/reply/show_reply.html',
                    reply=reply,
                    username=reply.user_name,
                    date=reply.date,
                    vote=reply.vote,
                    uid=reply.uid,
                    userinfo=self.userinfo,
                    kwd={})
971195
def comment_admin_urlname(action):
    
    comment = get_comment_model()
    return 'admin:%s_%s_%s' % (
        comment._meta.app_label, comment._meta.model_name,
        action)
644979
def post_comment(self, bugid, comment):
        ''''''
        data = {'id': bugid, "comment": comment}
        return self._post('bug/{bugid}/comment'.format(bugid=bugid), json.dumps(data))
1367783
def comment(data, what):
    
    data = data.splitlines()

    data = map(
        lambda x: "#" + x if x.strip().split() == what.split() else x,
        data
    )

    return "\n".join(data)
714252
def post_message(params)
      self.class.post('/chat.postMessage', body: params.merge({token: @token})).tap do |response|
        raise "error posting message: #{response.fetch('error', 'unknown error')}" unless response['ok']
      end
    end
212259
async def on_message(message):
    

    # Simplify message info
    server = message.server
    author = message.author
    channel = message.channel
    content = message.content

    data = datatools.get_data()

    if not data["discord"]["servers"][server.id][_data.modulename]["activated"]:
        return

    # Only reply to server messages and don't reply to myself
    if server is not None and author != channel.server.me:
        # Commands section
        prefix = data["discord"]["servers"][server.id]["prefix"]
        if content.startswith(prefix):
            # Parse message
            package = content.split(" ")
            command = package[0][len(prefix):]

            # Commands
            if command == 'gamedeals':
                await client.send_typing(channel)

                # Get posts from Reddit API
                posts = api_reddit.get_top10()

                if posts:
                    for post in posts:
                        # Create embed UI
                        embed = ui_embed.success(channel, post)
                        await embed.send()
                else:
                    embed = ui_embed.no_results(channel)
                    await embed.send()
912002
function mention(value, fromIndex) {
  var index = value.indexOf('@', fromIndex)

  if (index !== -1 && repo(value.charCodeAt(index - 1))) {
    return mention(value, index + 1)
  }

  return index
}
347437
def comment(self, text, comment_prefix='#'):
        
        comment = Comment(self._container)
        if not text.startswith(comment_prefix):
            text = "{} {}".format(comment_prefix, text)
        if not text.endswith('\n'):
            text = "{}{}".format(text, '\n')
        comment.add_line(text)
        self._container.structure.insert(self._idx, comment)
        self._idx += 1
        return self
743431
def code(self, text):
        

        comm = self.nextValidComment(text)
        while comm:
            text = text[:comm.start()] + text[comm.end():]
            comm = self.nextValidComment(text, comm.end(0))
        return text
900363
def itemComment(self, commentId):
        
        url = "%s/comments/%s" % (self.root, commentId)
        params = {
            "f": "json"
        }
        return self._get(url,
                            params,
                            securityHandler=self._securityHandler,
                            proxy_port=self._proxy_port,
                             proxy_url=self._proxy_url)
857022
def resolve_post(self, post):
        
        try:
            cid = post["id"]
        except KeyError:
            cid = post

        params = {
            "cid": cid,
            "resolved": "true"
        }

        return self._rpc.content_mark_resolved(params)