Sends a text message to all the registered bots. Used to simulate a user
typing in chat with your bot.

@param message
the message to send.
779980
public void sendTextMessage(String message) {
		MessageEnvelope envelope = new MessageEnvelope();
		ReceivedMessage body = new ReceivedMessage();

		body.setText(message);
		envelope.setMessage(body);
		envelope.setSender(new User(facebookMockId));

		System.out.println("Sending message: [" + message + "] as user : ["
				+ facebookMockId + "].");
		forward(envelope);
		System.out.println("Sent!");
	}
1023647
def send(self, message, *args, **kwargs):
        '''
        
        '''
        self._messages.put((message, args, kwargs), False)
1294329
public function setMessage(\TelegramBot\Api\Types\Message $message): void
	{
		$this->message = $message;
		$this->chatId = $this->message->getChat()->getId();
		$this->userId = $this->message->getFrom()->getId();
	}
583917
public boolean send(String topic, String message) throws IOException {
        List<Session> sessions = topicSubscribers.get(topic);
        if (sessions != null) {
            for (Session session : sessions) {
                session.getBasicRemote().sendText(message);
            }
        }
        return sessions != null;
    }
1251223
public void send(Type type, final String message) {

        final CmsNotificationMessage notificationMessage = new CmsNotificationMessage(Mode.NORMAL, type, message);
        m_messages.add(notificationMessage);
        if (hasWidget()) {
            m_widget.addMessage(notificationMessage);
        }
        Timer timer = new Timer() {

            @Override
            public void run() {

                removeMessage(notificationMessage);
            }
        };
        timer.schedule(4000 * (type == Type.NORMAL ? 1 : 2));

    }
1222649
public void sendMessage(Message message) throws RemoteException
    {
        Utility.getLogger().info("EJB sendMessage: " + message);
        if (((BaseMessage)message).isProcessedByClient())
            ((BaseMessage)message).setProcessedByClientSession(this.getParentSession());
        m_messageSender.sendMessage(message);
    }
440123
@Override
    public void send(Message msg) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "send", msg);

        //Defer straight through to the version with completion listner (which will do all the locking and checking).
        send_internal(msg, null);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "send");
    }
194334
protected function sendMessage(Message $message) {
		if(!$this->isIgnored($message)) {
			parent::sendMessage($message);
			$this->sentMessages[] = $message;
		}
	}
1029209
public void setMessage(String message) {
        this.message = message;
        if (errorMessage == null) {
            logger.debug("Setting status bar message to \"" + message + "\"");
            messageLabel.setText(this.message);
        }
    }
233754
public static void message(String message) {
           getMessageCenter().notify(new Message(message, Message.Severity.Info));
       }
306211
public static synchronized void log(RTMessage message)
	{
		if (enabled)
		{
			eventCount++;

			for (IRTLogger logger : loggers)
			{
				logger.log(message);
			}
		}
	}
632310
public void addMessage(Message message) {
        synchronized (messages) {
            api.addMessageToCache(message);
            if (messages.stream().map(Reference::get).anyMatch(message::equals)) {
                return;
            }
            // Add the message in the correct order
            messages.removeIf(messageRef -> messageRef.get() == null);
            Reference<Message> messageRef = new SoftReference<>(message, messagesCleanupQueue);
            int pos = Collections.binarySearch(messages, messageRef, Comparator.comparing(Reference::get));
            if (pos < 0) {
                pos = -pos - 1;
            }
            messages.add(pos, messageRef);
        }
    }
758673
@SneakyThrows
    public void commitAll(final String message) {
        this.gitInstance.add().addFilepattern(".").call();
        this.gitInstance.commit()
            .setMessage(message)
            .setAll(true)
            .setAuthor("CAS", "cas@apereo.org")
            .call();
    }
984995
public void sendMessage(String message, final Respoke.TaskCompletionListener completionListener) {
        if (isActive()) {
            JSONObject jsonMessage = new JSONObject();
            try {
                jsonMessage.put("message", message);
                byte[] rawMessage = jsonMessage.toString().getBytes(Charset.forName("UTF-8"));
                ByteBuffer directData = ByteBuffer.allocateDirect(rawMessage.length);
                directData.put(rawMessage);
                directData.flip();
                DataChannel.Buffer data = new DataChannel.Buffer(directData, false);

                if (dataChannel.send(data)) {
                    Respoke.postTaskSuccess(completionListener);
                } else {
                    Respoke.postTaskError(completionListener, "Error sending message");
                }
            } catch (JSONException e) {
                Respoke.postTaskError(completionListener, "Unable to encode message to JSON");
            }
        } else {
            Respoke.postTaskError(completionListener, "DataChannel not in an open state");
        }
    }
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;
						}
					}
				}
			}
		}
		// }
	}
432386
public void send(String channel, String message) {
		// CAUSE: Assignment to method parameter
		Pair<Boolean, String> sendValidation = isSendValid(channel, message, null, null);

		//String lMessage = message.replace("\n", "\\n");

		if (sendValidation != null && sendValidation.first) {
			try {
				String messageId = Strings.randomString(8);
				ArrayList<Pair<String, String>> messagesToSend = multiPartMessage(
						message, messageId);
				for (Pair<String, String> messageToSend : messagesToSend) {
					send(channel, messageToSend.second, messageToSend.first,
							sendValidation.second);
				}
			} catch (IOException e) {
				raiseOrtcEvent(EventEnum.OnException, this, e);
			}
		}
	}
288692
public void onMessage(WSMessage message) {
        log.trace("Listeners: {}", listeners.size());
        for (IWebSocketDataListener listener : listeners) {
            try {
                listener.onWSMessage(message);
            } catch (Exception e) {
                log.warn("onMessage exception", e);
            }
        }
    }