AW EVENT BOTGRAM

From ActiveWiki
Jump to navigation Jump to search
Minimum requirements
Added in version 3.5
SDKbuild 37
Universebuild 51


AW_EVENT_BOTGRAM

Description

Bot telegram received.

Attributes

AW_BOTGRAM_FROM_NAME
AW_BOTGRAM_FROM
AW_BOTGRAM_TEXT

Usage

Send a botgram to the current instance.

void handle_botgram (void)
{
  printf ("Botgram From %s (#%d): %s\n",
          aw_string (AW_BOTGRAM_FROM_NAME),
          aw_int (AW_BOTGRAM_FROM),
          aw_string (AW_BOTGRAM_TEXT));
}

aw_event_set (AW_EVENT_BOTGRAM, handle_botgram);
aw_int_set (AW_BOTGRAM_TYPE, 0);
aw_int_set (AW_BOTGRAM_TO, aw_int (AW_LOGIN_OWNER));
aw_string_set (AW_BOTGRAM_TEXT, "Hello");

if (rc = aw_botgram_send ())
  printf ("Unable to send botgram reason %d\n", rc);

Triggered by