PUT /comments/1/delete
502232
def delete
      security_transgression_unless @comment.can_be_deleted_by?(@user)

      @comment.errors.add(:base, t('commontator.comment.errors.already_deleted')) \
        unless @comment.delete_by(@user)

      respond_to do |format|
        format.html { redirect_to @thread }
        format.js { render :delete }
      end
    end
227697
def add_comment(self, post=None, name=None, email=None, pub_date=None,
                    website=None, body=None):
        
        if post is None:
            if not self.posts:
                raise CommandError("Cannot add comments without posts")
            post = self.posts[-1]
        post["comments"].append({
            "user_name": name,
            "user_email": email,
            "submit_date": pub_date,
            "user_url": website,
            "comment": body,
        })
890718
def files_comments_delete(self, *, file: str, id: str, **kwargs) -> SlackResponse:
        
        kwargs.update({"file": file, "id": id})
        return self.api_call("files.comments.delete", json=kwargs)
1160932
function () {
                var comment;

                if (input.charAt(i) !== '/') { return; }

                if (input.charAt(i + 1) === '/') {
                    return new(tree.Comment)($re(/^\/\/.*/), true, i, env.currentFileInfo);
                }
                comment = $re(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/);
                if (comment) {
                    return new(tree.Comment)(comment, false, i, env.currentFileInfo);
                }
            }
788299
function(id, params, headers, callback) {
        var url;
        url = this.client.url() + ("comments/" + (id || ''));
        return this.client.patch(url, params, headers, callback);
      }
411150
def community_post_comment_delete(self, post_id, id, **kwargs):
        ""
        api_path = "/api/v2/community/posts/{post_id}/comments/{id}.json"
        api_path = api_path.format(post_id=post_id, id=id)
        return self.call(api_path, method="DELETE", **kwargs)
423959
def assign_comments(self, tree, comments):
        
        comments = list(comments)
        comments.sort(key=lambda c: c.line)

        idx_by_line = {0: 0}  # {line_no: comment_idx}

        for i, c in enumerate(comments):
            if c.line not in idx_by_line:
                idx_by_line[c.line] = i

        idx = []

        # convert comment tokens to strings, and remove any line breaks
        self.comments = [c.value.strip() for c in comments]
        last_comment_line = max(idx_by_line.keys())

        # make a list with an entry for each line
        # number associated with a comment list index

        for i in range(last_comment_line, 0, -1):
            if i in idx_by_line:
                # associate line with new comment
                idx.append(idx_by_line[i])
            else:
                # associate line with following comment
                idx.append(idx[-1])

        idx.append(0)  # line numbers start from 1
        idx.reverse()
        self.idx = idx
        self._assign_comments(tree, 0)
173434
def edit(user_name, repo_name, comment_id, params={})
      _update_user_repo_params(user_name, repo_name)
      _validate_user_repo_params(user, repo) unless user? && repo?
      _validate_presence_of comment_id

      normalize! params
      # _merge_mime_type(:issue_comment, params)
      filter! VALID_ISSUE_COMMENT_PARAM_NAME, params
      assert_required_keys(%w[ content ], params)

      put_request("/1.0/repositories/#{user}/#{repo.downcase}/issues/comments/#{comment_id}", params)
    end
737808
protected function putToPost(): void
    {
        $request = $this->requestStack->getCurrentRequest();
        $put = $request->getContent();
        parse_str($put, $_POST);

        $_SERVER['REQUEST_METHOD'] = 'POST';
    }
1033706
def delete(self, comment_id, issue_id=None, repo_slug=None):
        
        issue_id = issue_id or self.issue_id
        repo_slug = repo_slug or self.bitbucket.repo_slug or ''
        url = self.bitbucket.url('DELETE_COMMENT',
                                 username=self.bitbucket.username,
                                 repo_slug=repo_slug,
                                 issue_id=issue_id,
                                 comment_id=comment_id)
        return self.bitbucket.dispatch('DELETE', url, auth=self.bitbucket.auth)
729609
async def abort(self, *, comment: str = None):
        
        params = {
            "system_id": self.system_id
        }
        if comment:
            params["comment"] = comment
        self._data = await self._handler.abort(**params)
        return self
906342
function attachCommentsToFile(files, comments) {
    return files.filter(function(file) {
        return file.comments = comments.filter(function(comment) {
            if (file.filename === comment.path) {
                return comment.reply = attachCommentReply.call(this, comment);
            }
        }.bind(this));
    }.bind(this));
}
937748
def delete_box_comment(self, box_key, comment_key):
		'''
		'''
		#does not work
		self._raise_unimplemented_error()

		uri = '/'.join([self.api_uri,
						self.boxes_suffix,
						box_key,
						self.comments_suffix,
						comment_key
						])
		return self._req('delete', uri)
853954
public function afterDelete()
    {
        parent::afterDelete();
        Comment::deleteAll(['model' => self::COMMENT_FOR, 'parent_id' => $this->id]);
        Tag::updateFrequency($this->tags, '');
        PostAuthor::updateAuthors($this->id, $this->_oldAuthors, []);
    }
896132
public function delete_comments($list) {
        global $DB;
        $ids = explode('-', $list);
        foreach ($ids as $id) {
            $id = (int)$id;
            if ($DB->record_exists('comments', array('id' => $id))) {
                $DB->delete_records('comments', array('id' => $id));
            }
        }
        return true;
    }
330616
public function removeComment()
    {
        $id = isset($_POST['id']) ? (int) $_POST['id'] : 0;

        if (!$comment = get_comment($id)) {
            wp_send_json_error('Comment is missing');
        }

        if (!current_user_can('edit_comment', $comment->comment_ID) && !($comment->user_id == get_current_user_id())) {
            wp_send_json_error('Missing authorization');
        }

        // Validate nonce
        if (!check_ajax_referer("delete-comment_$id", 'nonce', false)) {
            wp_send_json_error('Nonce failed');
        }

        $trashed = wp_trash_comment($comment);
        if ($trashed) {
            wp_send_json_success('Deletion was successful');
        }

        wp_send_json();
    }
1349733
function comment_destroy_batch( $ids )
	{
		$params = array();
		if (is_array($ids) && !empty($ids)) {
			foreach($ids as $k => $v) {
				$this->id_format($ids[$k]);
			}
			$params['cids'] = join(',', $ids);
		} else {
			$params['cids'] = $ids;
		}
		return $this->oauth->post( 'comments/destroy_batch', $params);
	}