Adds Do Not Contact

        :param obj_id: int
        :param channel: str
        :param reason: str
        :param channel_id: int
        :param comments: str
        :return: dict|str
491959
def add_dnc(
        self,
        obj_id,
        channel='email',
        reason=MANUAL,
        channel_id=None,
        comments='via API'
    ):
        
        data = {
            'reason': reason,
            'channelId': channel_id,
            'comments': comments
        }
        response = self._client.session.post(
            '{url}/{id}/dnc/add/{channel}'.format(
                url=self.endpoint_url, id=obj_id, channel=channel
            ),
            data=data
        )
        return self.process_response(response)
935174
def delete_comment(self, resource_id, ent_id):
        
        self.requester.post(
            '/{endpoint}/{entity}/{id}/delete_comment?id={ent_id}',
            endpoint=self.endpoint, entity=self.entity,
            id=resource_id, ent_id=ent_id
        )
504546
def channel(self, channel_id=None):
        
        if channel_id in self.channels:
            return self.channels[channel_id]

        return Channel(self, channel_id)
234269
def update_offer_comment(self, offer_comment_id, offer_comment_dict):
        
        return self._create_put_request(
            resource=OFFER_COMMENTS,
            billomat_id=offer_comment_id,
            send_data=offer_comment_dict
        )
332003
def conversations_invite(
        self, *, channel: str, users: List[str], **kwargs
    ) -> SlackResponse:
        
        self._validate_xoxp_token()
        kwargs.update({"channel": channel, "users": users})
        return self.api_call("conversations.invite", json=kwargs)
1173278
def unsubscribe_user_from_discussion(recID, uid):
    
    query = """DELETE FROM "cmtSUBSCRIPTION"
                     WHERE id_bibrec=%s AND id_user=%s"""
    params = (recID, uid)
    try:
        res = run_sql(query, params)
    except:
        return 0
    if res > 0:
        return 1
    return 0
293912
def commit_channel(self, channel_id):
        
        payload = {
            "channel_id":channel_id,
            "stage": config.STAGE,
        }
        response = config.SESSION.post(config.finish_channel_url(), data=json.dumps(payload))
        if response.status_code != 200:
            config.LOGGER.error("\n\nCould not activate channel: {}\n".format(response._content.decode('utf-8')))
            if response.status_code == 403:
                config.LOGGER.error("Channel can be viewed at {}\n\n".format(config.open_channel_url(channel_id, staging=True)))
                sys.exit()
        response.raise_for_status()
        new_channel = json.loads(response._content.decode("utf-8"))
        channel_link = config.open_channel_url(new_channel['new_channel'])
        return channel_id, channel_link
627601
def get_issue_comment(self, id):
        
        assert isinstance(id, (int, long)), id
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self._parentUrl(self.issue_url) + "/comments/" + str(id)
        )
        return github.IssueComment.IssueComment(self._requester, headers, data, completed=True)
507028
def remove_comment(self, topic_id, comment_id, reason='0', other=None):
        
        params = {'cid': comment_id}
        data = {'cid': comment_id, 'ck': self.api.ck(), 'reason': reason, 'other': other, 'submit': '确定'}
        r = self.api.req(API_GROUP_REMOVE_COMMENT % topic_id, 'post', params, data)
        if r.text.find('douban_admin') > -1:
            r = self.api.req(API_GROUP_ADMIN_REMOVE_COMMENT % topic_id, 'post', params, data)
        self.api.logger.debug('remove comment final url is <%s>' % r.url)
        return r
1087146
def addcomment(self, invoice_increment_id,
            comment=None, email=False, include_comment=False):
        
        if comment is None:
            comment = ""
        return bool(
            self.call(
                'sales_order_invoice.addComment',
                [invoice_increment_id, comment, email, include_comment]
            )
        )
1042996
async def channel_cmd(self, ctx, *, channel : discord.Channel = None):
        

        if channel is None:
            channel = ctx.message.channel

        ignored = self.config.get('ignored', [])
        if channel.id in ignored:
            await self.bot.responses.failure(message='That channel is already ignored.')
            return

        ignored.append(channel.id)
        await self.config.put('ignored', ignored)
        await self.bot.responses.success(message='Channel <#{}> will be ignored.'.format(channel.id))
788299
function(id, params, headers, callback) {
        var url;
        url = this.client.url() + ("comments/" + (id || ''));
        return this.client.patch(url, params, headers, callback);
      }
346770
def delete_communication_channel_id(self, id, user_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - user_id
        """ID"""
        path["user_id"] = user_id

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        self.logger.debug("DELETE /api/v1/users/{user_id}/communication_channels/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("DELETE", "/api/v1/users/{user_id}/communication_channels/{id}".format(**path), data=data, params=params, single_item=True)
193622
def create_message(self, channel_id, text):
        

        baseurl = self.rest_baseurl + \
            '/channels/{}/messages'.format(channel_id)
        requests.post(baseurl,
                      headers=self.headers,
                      data=json.dumps({'content': text}))
159591
def push_msg(self, channel_id, msg):
        

        if type(msg) is not str:
            msg = urlencode(msg)

        return self.push(channel_id, msg)
920140
def create_request_comment(self, issue_id_or_key, body, public=True):
        
        log.warning('Creating comment...')
        data = {"body": body, "public": public}

        return self.post('rest/servicedeskapi/request/{}/comment'.format(issue_id_or_key), data=data)
99751
def request_comments(self, id, **kwargs):
        ""
        api_path = "/api/v2/requests/{id}/comments.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)