BaseFilter {telegram.bot} | R Documentation |
The base of all filters
Description
Base class for all Message Filters.
Usage
BaseFilter(filter)
as.BaseFilter(x, ...)
is.BaseFilter(x)
Arguments
filter |
If you want to create your own filters you can call this
generator passing by a |
x |
Object to be coerced or tested. |
... |
Further arguments passed to or from other methods. |
Details
See filtersLogic
to know more about combining filter
functions.
Examples
## Not run:
# Create a filter function
text_or_command <- function(message) !is.null(message$text)
# Make it an instance of BaseFilter with its generator:
text_or_command <- BaseFilter(filter = text_or_command)
# Or by coercing it with as.BaseFilter:
text_or_command <- as.BaseFilter(function(message) !is.null(message$text))
## End(Not run)
[Package telegram.bot version 3.0.0 Index]