Attempts to send a message to the specified destination in Discord.
        Extends Legobot.Lego.handle()

        Args:
            message (Legobot.Message): message w/ metadata to send.
549310
def handle(self, message):
        '''
        
        '''

        logger.debug(message)
        if Utilities.isNotEmpty(message['metadata']['opts']):
            target = message['metadata']['opts']['target']
            self.botThread.create_message(target, message['text'])
469697
def send(self, message):
        
        if "call_id" not in message:
            message["call_id"] = self.gen_call_id()

        self._ws.send(message.to_json())
819255
async def send_message(self, *args, **kwargs):
        
        return await self._client.send_message(
            self.input_entity, *args, **kwargs)
1206093
def send(self, message):
        
        message = message.SerializeToString()
        self.socket.sendall(struct.pack('!I', len(message)) + message)

        length = struct.unpack('!I', self.socket.recv(4))[0]
        response = riemann_client.riemann_pb2.Msg()
        response.ParseFromString(socket_recvall(self.socket, length))

        if not response.ok:
            raise RiemannError(response.error)

        return response
880222
def send_to_queue(self, message):
        
        if not self.queue_delivery:
            raise RuntimeError("No queue_path provided")

        return self.queue_delivery.send(*self._message_args(message))
84436
def send_ClientCutText(self, message):
        
        self.sendMessage(struct.pack("!BxxxI", 6, len(message)))
        self.sendMessage(message)
1350755
def send_message(self, message):
        
        if not isinstance(message, txdbus.DbusMessage):
            raise TypeError('message: expecting DbusMessage instance (got {!r})',
                                type(message).__name__)
        self._name_acquired.wait()
        if self._error:
            raise compat.saved_exc(self._error)
        elif self._transport is None:
            raise DbusError('not connected')
        self._writer.write(message.rawMessage)
1372265
function send(message) {
            dispatch(function deliver() {
                try {
                    context.behavior(message);
                } catch (exception) {
                    fail(exception);
                };
            });
        }
653400
private void handleOutgoingMessage(MessageEnvelope message) {
		methodMapCatchAll = new ArrayList<FbBotClassMethod>();
		boolean isAuthorized = false;
		for (BotDefinition defClass : ConfigurationUtils.getBotDefinitionInstances()) {

			if (defClass.getClass().isAnnotationPresent(Bot.class)) {
				Bot botClass = defClass.getClass().getAnnotation(Bot.class);
				if (botClass.state().equals(BotBeanState.PROTOTYPE)) {
					try {
						defClass = defClass.getClass().newInstance();
					} catch (InstantiationException e) {
						e.printStackTrace();
					} catch (IllegalAccessException e) {
						e.printStackTrace();
					}
				}

				// Check authorization first.
				boolean authorizationFound = false;
				for (Method authorizationMethod : defClass.getClass().getMethods()) {
					if (authorizationMethod.isAnnotationPresent(BotAuthorization.class)) {
						authorizationFound = true;
						Boolean ob = false;
						try {

							defClass.getClass().getSuperclass()
									.getDeclaredMethod(CONST_INCOMING_MSG_SETNAME, MessageEnvelope.class)
									.invoke(defClass, message);

							ob = (Boolean) authorizationMethod.invoke(defClass, message);

						} catch (IllegalArgumentException e) {
							e.printStackTrace();
						} catch (IllegalAccessException e) {
							e.printStackTrace();
						} catch (InvocationTargetException e) {
							e.printStackTrace();
						} catch (SecurityException e) {
							e.printStackTrace();
						} catch (NoSuchMethodException e) {
							e.printStackTrace();
						}
						if (ob) {
							isAuthorized = true;
							break;
						}
					}
				}
				
				if(!authorizationFound) {
					isAuthorized = true;
				}


				// if (isAuthorized) {
				for (Method method : defClass.getClass().getMethods()) {

					if (method.isAnnotationPresent(FbBotMillController.class)) {
						FbBotMillController botMillController = method.getAnnotation(FbBotMillController.class);
						if (isAuthorized || botMillController.skipAuthorization()) {
							try {
								if (botMillController.pattern().equals(".*.")
										|| botMillController.eventType().equals(FbBotMillEventType.ANY)) {
									FbBotClassMethod fbCm = new FbBotClassMethod();
									fbCm.setCls(defClass);
									fbCm.setMethod(method);
									methodMapCatchAll.add(fbCm);
								} else {
									FbBotMillEvent event = toEventActionFrame(botMillController);
									if (event.verifyEventCondition(message)) {

										defClass.getClass().getSuperclass()
												.getDeclaredMethod(CONST_INCOMING_MSG_SETNAME, MessageEnvelope.class)
												.invoke(defClass, message);

										defClass.getClass().getSuperclass()
												.getDeclaredMethod(CONST_EVENT_SETNAME, FbBotMillEvent.class)
												.invoke(defClass, event);

										FbBotApi.setFbBot(defClass);

										method.invoke(defClass, message);
										return;
									}
								}
							} catch (Exception e) {
								e.printStackTrace();
								return;
							}
						}
					}
				}
				// }
			}
		}

		// Run the catch all last. This is to ensure that every possible AI
		// logic within the source was
		// scanned and considered.
		// if (isAuthorized) {
		synchronized (this) {
			for (FbBotClassMethod catchAllMethod : methodMapCatchAll) {
				if (catchAllMethod.getMethod().isAnnotationPresent(FbBotMillController.class)) {
					FbBotMillController botMillController = catchAllMethod.getMethod()
							.getAnnotation(FbBotMillController.class);
					if (isAuthorized || botMillController.skipAuthorization()) {
						try {

							FbBotMillEvent event = toEventActionFrame(botMillController);
							if (event.verifyEventCondition(message)) {

								catchAllMethod.getCls().getClass().getSuperclass()
										.getDeclaredMethod(CONST_INCOMING_MSG_SETNAME, MessageEnvelope.class)
										.invoke(catchAllMethod.getCls(), message);

								catchAllMethod.getCls().getClass().getSuperclass()
										.getDeclaredMethod(CONST_EVENT_SETNAME, FbBotMillEvent.class)
										.invoke(catchAllMethod.getCls(), event);

								FbBotApi.setFbBot(catchAllMethod.getCls());
								catchAllMethod.getMethod().invoke(catchAllMethod.getCls(), message);
								return;

							}
						} catch (Exception e) {
							e.printStackTrace();
							return;
						}
					}
				}
			}
		}
		// }
	}
872456
def send_message(self, message):
        
        if not self.live():
            raise IOError("Connection is not live.")

        message.add_flag(BEGIN_END_FLAG)
        self.write(message.buffer)
214991
def dispatch(self, message):
        

        for validator, callback in self.validators:
            if not validator.matches(message):
                continue

            callback(message)
            return

        raise ArgumentError("No handler was registered for message", message=message)
260204
def send(self, cmd, *payload):
        

        # If it's closed, raise an error up front
        if not self._sock:
            raise ConnectionClosed("Connection closed")

        # Construct the outgoing message
        msg = json.dumps(dict(cmd=cmd, payload=payload)) + '\n'

        # Send it
        try:
            self._sock.sendall(msg)
        except socket.error:
            # We'll need to re-raise
            e_type, e_value, e_tb = sys.exc_info()

            # Make sure the socket is closed
            self.close()

            # Re-raise
            raise e_type, e_value, e_tb
223568
def handle_message(self, message):
        
        try:
            if "eta" in message.options:
                self.logger.debug("Pushing message %r onto delay queue.", message.message_id)
                self.broker.emit_before("delay_message", message)
                self.delay_queue.put((message.options.get("eta", 0), message))

            else:
                actor = self.broker.get_actor(message.actor_name)
                self.logger.debug("Pushing message %r onto work queue.", message.message_id)
                self.work_queue.put((actor.priority, message))
        except ActorNotFound:
            self.logger.error(
                "Received message for undefined actor %r. Moving it to the DLQ.",
                message.actor_name, exc_info=True,
            )
            message.fail()
            self.post_process_message(message)
283600
async def send(self, msg: Message):
        
        if not msg.sender:
            msg.sender = str(self.agent.jid)
            logger.debug(f"Adding agent's jid as sender to message: {msg}")
        await self.agent.container.send(msg, self)
        msg.sent = True
        self.agent.traces.append(msg, category=str(self))
841807
def send(self, command, payload):
        
        request = WorkRequest(command, payload)
        logging.info("Sending {} message to queue {}.".format(request.command, self.queue_name))
        # setting protocol to version 2 to be compatible with python2
        self.connection.send_durable_message(self.queue_name, pickle.dumps(request, protocol=2))
        logging.info("Sent {} message.".format(request.command, self.queue_name))
58660
def send(self, message):
        
        message.update(self._globalFields)
        errors = []
        for dest in self._destinations:
            try:
                dest(message)
            except:
                errors.append(sys.exc_info())
        if errors:
            raise _DestinationsSendError(errors)
290198
def _route_message(self, message, data):
        
        # route message to handlers
        if message.namespace in self._handlers:

            # debug messages
            if message.namespace != NS_HEARTBEAT:
                self.logger.debug(
                    "[%s:%s] Received: %s", self.fn or self.host, self.port,
                    _message_to_string(message, data))

            # message handlers
            try:
                handled = \
                    self._handlers[message.namespace].receive_message(
                        message, data)

                if not handled:
                    if data.get(REQUEST_ID) not in self._request_callbacks:
                        self.logger.debug(
                            "[%s:%s] Message unhandled: %s",
                            self.fn or self.host, self.port,
                            _message_to_string(message, data))
            except Exception:  # pylint: disable=broad-except
                self.logger.exception(
                    ("[%s:%s] Exception caught while sending message to "
                     "controller %s: %s"), self.fn or self.host, self.port,
                    type(self._handlers[message.namespace]).__name__,
                    _message_to_string(message, data))

        else:
            self.logger.debug(
                "[%s:%s] Received unknown namespace: %s",
                self.fn or self.host, self.port,
                _message_to_string(message, data))