Webhook class

Update fetcher which uses the webhook method.

To learn how to use it instead of long polling, see TeleDart.start documentation.

Inheritance

Constructors

Webhook(Telegram telegram, String url, HttpServer _server, {String? ipAddress, File? certificate, File? privateKey, int port = 443, int? serverPort, bool uploadCertificate = false, int maxConnections = 40, List<String>? allowedUpdates, bool? dropPendingUpdates, String? secretToken})
Setup webhook

Properties

allowedUpdates List<String>?
getter/setter pair
certificate File?
getter/setter pair
dropPendingUpdates bool?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
ipAddress String?
getter/setter pair
maxConnections int
getter/setter pair
port int
getter/setter pair
privateKey File?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secretToken String?
getter/setter pair
serverPort int?
getter/setter pair
telegram Telegram
final
uploadCertificate bool
getter/setter pair
url String
getter/setter pair

Methods

emitUpdate(Update update) → void
Add update to the stream.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onUpdate() Stream<Update>
When update is added to stream.
inherited
setWebhook() Future<bool>
start() Future<void>
Apply webhook configuration on Telegram API, and start the webhook server.
override
stop({bool? dropPendingUpdates}) Future<void>
Remove webhook configuration from Telegram API, and stop the webhook server.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createHttpsWebhok(Telegram telegram, String url, File certificate, File privateKey, {String? ipAddress, int port = 80, int? serverPort, bool uploadCertificate = false, int maxConnections = 40, List<String>? allowedUpdates, bool? dropPendingUpdates, String? secretToken}) Future<Webhook>
createHttpWebhok(Telegram telegram, String url, {String? ipAddress, int port = 80, int? serverPort, int maxConnections = 40, List<String>? allowedUpdates, bool? dropPendingUpdates, String? secretToken}) Future<Webhook>