Returns a coroutine that will resolve once a reply
        (that is, a message being a reply) arrives. The
        arguments are the same as those for `get_response`.
556369
async def get_reply(self, message=None, *, timeout=None):
        
        return await self._get_message(
            message, self._reply_indices, self._pending_replies, timeout,
            lambda x, y: x.reply_to_msg_id == y
        )
447094
def reply(self, timeout=None):
        
        self._wait_on_signal(self._response_received)
        if self._response_exception is not None:
            msg = self._response_exception.message
            raise YamcsError(msg)
        return self._response_reply
585893
def rpc_reply(id: Union[str, int], result: Optional[object],
              warnings: Optional[List[Warning]] = None) -> rpcq.messages.RPCReply:
    
    warnings = warnings or []

    return rpcq.messages.RPCReply(
        jsonrpc='2.0',
        id=id,
        result=result,
        warnings=[rpc_warning(warning) for warning in warnings]
    )
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()
1262407
def got_response(self):
        
        return any(message.sender != self.initiator
                   for message in self.messages)
990620
def wait_for_responses(self, client):
        
        assert_open(self)

        if self.has_pending_requests:
            raise RuntimeError('Cannot wait for responses if there are '
                               'pending requests outstanding.  You need '
                               'to wait for pending requests to be sent '
                               'first.')

        pending = self.pending_responses
        self.pending_responses = []
        for command_name, options, promise in pending:
            value = client.parse_response(
                self.connection, command_name, **options)
            promise.resolve(value)
864214
async def append(self, reply: Reply) \
            -> None:
        
        result = reply.result
        identifier = result.get(f.IDENTIFIER.nm)
        txnId = result.get(TXN_ID)
        logger.debug("Reply being sent {}".format(reply))
        if self._isNewTxn(identifier, reply, txnId):
            self.addToProcessedTxns(identifier, txnId, reply)
        if identifier not in self.responses:
            self.responses[identifier] = asyncio.Queue()
        await self.responses[identifier].put(reply)
1115793
function (res, res_obj) {

    // return response if exist, otherwise response might be returned 
    // AFTER some callback is done handling (i.e., response will be returned within the handler)
    if (typeof res_obj === 'string') {
        LOG.sys('replying a string: ' + res_obj);
        res.writeHead(200, {'Content-Type': 'text/plain'});                     
        res.end(res_obj);            
    }
    else {
        LOG.sys('replying a JSON: ' + JSON.stringify(res_obj));
        res.writeHead(200, {'Content-Type': 'application/json'});                     
        res.end(JSON.stringify(res_obj));        
    }
}
265660
async def _handle_message(self,
                              message: BaseMessage,
                              responder: Responder) -> Optional[Dict]:
        

        async def noop(request: Request, responder: Responder):
            pass

        mm = MiddlewareManager.instance()
        reg_manager = self.register\
            .work_on_register(message.get_conversation().id)

        async with reg_manager as reg:
            request = Request(message, reg)
            await request.transform()

            if not request.stack.layers:
                return

            logger.debug('Incoming message: %s', request.stack)
            await mm.get('pre_handle', noop)(request, responder)

            # noinspection PyBroadException
            try:
                state, trigger, dnr = \
                    await self._build_state(request, message, responder)
            except Exception:
                logger.exception('Error while finding a transition from %s',
                                 reg.get(Register.STATE))
                reporter.report(request, None)
                return

            if state is None:
                logger.debug(
                    'No next state found but "%s" is not confusing, stopping',
                    request.message,
                )
                return

            state = await self._run_state(responder, state, trigger, request)

            # noinspection PyBroadException
            try:
                await responder.flush(request)
            except MissingTranslationError as e:
                responder.clear()
                responder.send([RawText(str(e))])
                await responder.flush(request)

                reporter.report(request, state.name())
                logger.exception('Missing translation in state %s',
                                 state.name())
            except Exception:
                reporter.report(request, state.name())
                logger.exception('Could not flush content after %s',
                                 state.name())
            else:
                if not dnr:
                    reg.replacement = await self._build_state_register(
                        state,
                        request,
                        responder,
                    )
                return reg.replacement
1248749
def get_replies_to(self, msg):
        
        mid = msg.get_message_id()
        msg_hash = self.get_messages()
        for m in msg_hash.keys():
            if m.get_message_id() == mid:
                return msg_hash[m]
        return None
1198519
def handle_response(message)
    msg    = Messages::Response.new(:message => message,
                                    :headers => self.message_headers)
    res = err = nil
    begin
      res = @dispatcher.handle_response(msg.result)
    rescue Exception => e
      err = e
    end

    @response_lock.synchronize {
      result = [msg.msg_id, res]
      result << err if !err.nil?
      @responses << result
      @response_cv.broadcast
    }
  end
313109
async def get_reply_message(self):
        
        if self._reply_message is None:
            if not self.reply_to_msg_id:
                return None

            # Bots cannot access other bots' messages by their ID.
            # However they can access them through replies...
            self._reply_message = await self._client.get_messages(
                await self.get_input_chat() if self.is_channel else None,
                ids=types.InputMessageReplyTo(self.id)
            )
            if not self._reply_message:
                # ...unless the current message got deleted.
                #
                # If that's the case, give it a second chance accessing
                # directly by its ID.
                self._reply_message = await self._client.get_messages(
                    self._input_chat if self.is_channel else None,
                    ids=self.reply_to_msg_id
                )

        return self._reply_message
9750
async def route_msg(self, msg):
        
        if msg.correlation_id in self._futures:
            self._set_reply(msg.correlation_id, msg)
        else:
            await self._push_incoming(msg)
448870
def gotMessage(self, message_id, message):
        
        d = defer.maybeDeferred(self._handle_message, message)
        d.addCallback(self.generate_response)
        d.addCallback(lambda resp: self.reply(message_id, resp))
        return d
146509
public ZapReply nextReply(boolean wait)
    {
        if (!repliesEnabled) {
            System.out.println("ZAuth: replies are disabled. Please use replies(true);");
            return null;
        }
        return ZapReply.recv(replies, wait);
    }
52852
def get_encrypted_reply(self, message):
        
        reply = self.get_reply(message)
        if not reply:
            self.logger.warning("No handler responded message %s" % message)
            return ''
        if self.use_encryption:
            return self.crypto.encrypt_message(reply)
        else:
            return reply.render()
1365669
def respond_via_request(self, task):
        
        warn(f"Detected slow response into webhook. "
             f"(Greater than {RESPONSE_TIMEOUT} seconds)\n"
             f"Recommended to use 'async_task' decorator from Dispatcher for handler with long timeouts.",
             TimeoutWarning)

        dispatcher = self.get_dispatcher()
        loop = dispatcher.loop

        try:
            results = task.result()
        except Exception as e:
            loop.create_task(
                dispatcher.errors_handlers.notify(dispatcher, types.Update.get_current(), e))
        else:
            response = self.get_response(results)
            if response is not None:
                asyncio.ensure_future(response.execute_response(dispatcher.bot), loop=loop)