Initializes a new instance of the TelegramApi class.
The NationStates API instance used by this API. Only this API should use this instance.
The telegram client key used by this API.
The number of seconds between refreshes for a telegram job with the refresh option enabled. Defaults to 60.
Gets the NationStates API instance used by this API.
Gets whether or not existing telegrams in the queue are blocked from being sent.
If set to true, blocks the API from sending any further telegrams. If set to false, normal operation will resume.
Whether or not existing telegrams in the queue should be blocked from being sent.
Gets whether or not new telegrams are blocked from being added to the queue.
If set to true, prevents any new telegrams from being added to the queue. If set to false, normal operation will resume.
Whether or not new telegrams should be blocked from being added to the queue.
Gets the telegram client key used by this API.
Gets the event handler called when the API finishes sending telegrams for a particular job.
The new event handler.
Sets the event handler called when the API finishes sending telegrams for a particular job.
The new event handler.
Gets the event handler called when the API begins sending telegrams for a particular job.
Sets the event handler called when the API begins sending telegrams for a particular job.
The new event handler.
Gets the event handler called when new recipients are added to a job.
The new event handler.
Sets the event handler called when new recipients are added to a job.
The new event handler.
Gets the event handler called when the API fails to send a telegram to a recipient.
The new event handler.
Sets the event handler called when the API fails to send a telegram to a recipient.
The new event handler.
Gets the event handler called when the API successfully sends a telegram to a recipient.
The new event handler.
Sets the event handler called when the API successfully sends a telegram to a recipient.
The new event handler.
Gets the number of seconds between refreshes for a telegram job with the refresh option enabled.
Gets whether or not this API is currently sending telegrams.
Gets whether or not telegrams are queued.
Cancels the job with the specified ID.
The ID of the job to cancel.
Cancels all requests in the telegram queue and turns off the API scheduler.
After this function is called, no further telegrams can be sent using this API instance, including telegrams currently in the queue.
Cancels all requests in the API queue.
Creates a job with the specified parameters.
The TRL string.
Information about the telegram to send.
Whether the list of recipients should be refreshed by re-evaluating the TRL string at periodic intervals.
Rules for when to override API caching when re-evaluating a TRL string during a refresh.
Whether to not actually send any telegrams to the specified recipients.
A promise returning the created telegram job.
Parses and evaluates a TRL string.
A TRL string.
A promise returning the nations represented by the specified TRL string.
Gets the telegram job with the specified ID.
The telegram job ID.
The telegram job with the specified ID.
Called when a recipient entry in the queue is processed in order to determine if a job is complete.
The job associated with the recipient.
Called when an attempt is made to send a telegram to the specified recipient that fails.
The specified recipient.
The error associated with the failure.
Called when a telegram is sent successfully to the specified recipient.
The specified recipient.
Sends a telegram to the specified recipient.
The specified recipient.
Sends a telegram to the specified recipient.
The specified recipient.
Sends telegrams to the recipients defined by the specified template recipient language string.
The TRL string.
Information about the telegram to send.
Whether the list of recipients should be refreshed by re-evaluating the TRL string at periodic intervals. Defaults to false.
Rules for when to override API caching when re-evaluating a TRL string during a refresh. By default, all primitives override caches except categories and census.
Whether to not actually send any telegrams to the specified recipients. Defaults to false.
A promise returning the ID of the telegram job associated with this request.
Throws an error if the specified TRL string is not valid.
A TRL string.
Generated using TypeDoc
Sends telegrams to a list of NationStates nations defined using a powerful query language called Telegram Recipient Language.