Skip to content

GramIO API Reference / gramio/dist / AllowedUpdatesFilter

Class: AllowedUpdatesFilter ​

Defined in: gramio/index.d.ts:64

Fluent, immutable builder for the Telegram Bot API allowed_updates list.

Instances directly extend Array<AllowedUpdateName>, so they can be passed wherever allowedUpdates is expected without any conversion.

Example ​

typescript
import { AllowedUpdatesFilter } from "gramio";

// All updates (opt-in types included: chat_member, message_reaction, message_reaction_count)
bot.start({ allowedUpdates: AllowedUpdatesFilter.all });

// Telegram's default set (opt-in types excluded)
bot.start({ allowedUpdates: AllowedUpdatesFilter.default });

// Explicit list
bot.start({ allowedUpdates: AllowedUpdatesFilter.only("message", "callback_query") });

// All except poll events
bot.start({ allowedUpdates: AllowedUpdatesFilter.all.except("poll", "poll_answer") });

// Default + opt-in to chat_member
bot.start({ allowedUpdates: AllowedUpdatesFilter.default.add("chat_member") });

Extends ​

Indexable ​

[n: number]: AllowedUpdateName

Constructors ​

Constructor ​

new AllowedUpdatesFilter(updates): AllowedUpdatesFilter

Defined in: gramio/index.d.ts:66

Internal

use static factory methods instead

Parameters ​

ParameterType
updatesreadonly AllowedUpdateName[]

Returns ​

AllowedUpdatesFilter

Overrides ​

Array<AllowedUpdateName>.constructor

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
[unscopables]readonlyobjectIs an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.Array.[unscopables]typescript/lib/lib.es2015.symbol.wellknown.d.ts:95
[unscopables].[iterator]?publicboolean--typescript/lib/lib.es2015.iterable.d.ts:76
[unscopables].[unscopables]?readonlybooleanIs an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.-typescript/lib/lib.es2015.symbol.wellknown.d.ts:95
[unscopables].at?publicboolean--typescript/lib/lib.es2022.array.d.ts:22
[unscopables].concat?publicboolean--typescript/lib/lib.es5.d.ts:1351
[unscopables].copyWithin?publicboolean--typescript/lib/lib.es2015.core.d.ts:60
[unscopables].entries?publicboolean--typescript/lib/lib.es2015.iterable.d.ts:81
[unscopables].every?publicboolean--typescript/lib/lib.es5.d.ts:1438
[unscopables].fill?publicboolean--typescript/lib/lib.es2015.core.d.ts:49
[unscopables].filter?publicboolean--typescript/lib/lib.es5.d.ts:1474
[unscopables].find?publicboolean--typescript/lib/lib.es2015.core.d.ts:27
[unscopables].findIndex?publicboolean--typescript/lib/lib.es2015.core.d.ts:39
[unscopables].flat?publicboolean--typescript/lib/lib.es2019.array.d.ts:73
[unscopables].flatMap?publicboolean--typescript/lib/lib.es2019.array.d.ts:62
[unscopables].forEach?publicboolean--typescript/lib/lib.es5.d.ts:1462
[unscopables].includes?publicboolean--typescript/lib/lib.es2016.array.include.d.ts:23
[unscopables].indexOf?publicboolean--typescript/lib/lib.es5.d.ts:1423
[unscopables].join?publicboolean--typescript/lib/lib.es5.d.ts:1362
[unscopables].keys?publicboolean--typescript/lib/lib.es2015.iterable.d.ts:86
[unscopables].lastIndexOf?publicboolean--typescript/lib/lib.es5.d.ts:1429
[unscopables].length?publicbooleanGets or sets the length of the array. This is a number one higher than the highest index in the array.-typescript/lib/lib.es5.d.ts:1327
[unscopables].map?publicboolean--typescript/lib/lib.es5.d.ts:1468
[unscopables].pop?publicboolean--typescript/lib/lib.es5.d.ts:1340
[unscopables].push?publicboolean--typescript/lib/lib.es5.d.ts:1345
[unscopables].reduce?publicboolean--typescript/lib/lib.es5.d.ts:1486
[unscopables].reduceRight?publicboolean--typescript/lib/lib.es5.d.ts:1499
[unscopables].reverse?publicboolean--typescript/lib/lib.es5.d.ts:1367
[unscopables].shift?publicboolean--typescript/lib/lib.es5.d.ts:1372
[unscopables].slice?publicboolean--typescript/lib/lib.es5.d.ts:1382
[unscopables].some?publicboolean--typescript/lib/lib.es5.d.ts:1456
[unscopables].sort?publicboolean--typescript/lib/lib.es5.d.ts:1393
[unscopables].splice?publicboolean--typescript/lib/lib.es5.d.ts:1402
[unscopables].toLocaleString?publicboolean--typescript/lib/lib.es5.d.ts:1335
[unscopables].toString?publicboolean--typescript/lib/lib.es5.d.ts:1331
[unscopables].unshift?publicboolean--typescript/lib/lib.es5.d.ts:1417
[unscopables].values?publicboolean--typescript/lib/lib.es2015.iterable.d.ts:91
lengthpublicnumberGets or sets the length of the array. This is a number one higher than the highest index in the array.Array.lengthtypescript/lib/lib.es5.d.ts:1327
[species]readonlyArrayConstructor-Array.[species]typescript/lib/lib.es2015.symbol.wellknown.d.ts:314

Accessors ​

all ​

Get Signature ​

get static all(): AllowedUpdatesFilter

Defined in: gramio/index.d.ts:71

All update types, including the opt-in ones: chat_member, message_reaction, and message_reaction_count.

Returns ​

AllowedUpdatesFilter


default ​

Get Signature ​

get static default(): AllowedUpdatesFilter

Defined in: gramio/index.d.ts:82

Telegram's default update set.

Receive all updates except chat_member, message_reaction, and message_reaction_count — the three types that Telegram requires to be explicitly listed in allowed_updates.

This matches what Telegram does when allowed_updates is omitted or passed as an empty array.

Returns ​

AllowedUpdatesFilter

Methods ​

[iterator]() ​

[iterator](): ArrayIterator<AllowedUpdateName>

Defined in: typescript/lib/lib.es2015.iterable.d.ts:76

Iterator

Returns ​

ArrayIterator<AllowedUpdateName>

Inherited from ​

Array.[iterator]


add() ​

add(...types): AllowedUpdatesFilter

Defined in: gramio/index.d.ts:101

Return a new filter with the given types added. Already-present types are silently deduplicated.

Parameters ​

ParameterType
...typesAllowedUpdateName[]

Returns ​

AllowedUpdatesFilter

Example ​

typescript
AllowedUpdatesFilter.default.add("chat_member", "message_reaction")

at() ​

at(index): AllowedUpdateName

Defined in: typescript/lib/lib.es2022.array.d.ts:22

Returns the item located at the specified index.

Parameters ​

ParameterTypeDescription
indexnumberThe zero-based index of the desired code unit. A negative index will count back from the last item.

Returns ​

AllowedUpdateName

Inherited from ​

Array.at


concat() ​

Call Signature ​

concat(...items): AllowedUpdateName[]

Defined in: typescript/lib/lib.es5.d.ts:1351

Combines two or more arrays. This method returns a new array without modifying any existing arrays.

Parameters ​
ParameterTypeDescription
...itemsConcatArray<AllowedUpdateName>[]Additional arrays and/or items to add to the end of the array.
Returns ​

AllowedUpdateName[]

Inherited from ​

Array.concat

Call Signature ​

concat(...items): AllowedUpdateName[]

Defined in: typescript/lib/lib.es5.d.ts:1357

Combines two or more arrays. This method returns a new array without modifying any existing arrays.

Parameters ​
ParameterTypeDescription
...items(AllowedUpdateName | ConcatArray<AllowedUpdateName>)[]Additional arrays and/or items to add to the end of the array.
Returns ​

AllowedUpdateName[]

Inherited from ​

Array.concat


copyWithin() ​

copyWithin(target, start, end?): this

Defined in: typescript/lib/lib.es2015.core.d.ts:60

Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

Parameters ​

ParameterTypeDescription
targetnumberIf target is negative, it is treated as length+target where length is the length of the array.
startnumberIf start is negative, it is treated as length+start. If end is negative, it is treated as length+end.
end?numberIf not specified, length of the this object is used as its default value.

Returns ​

this

Inherited from ​

Array.copyWithin


entries() ​

entries(): ArrayIterator<[number, AllowedUpdateName]>

Defined in: typescript/lib/lib.es2015.iterable.d.ts:81

Returns an iterable of key, value pairs for every entry in the array

Returns ​

ArrayIterator<[number, AllowedUpdateName]>

Inherited from ​

Array.entries


every() ​

Call Signature ​

every<S>(predicate, thisArg?): this is S[]

Defined in: typescript/lib/lib.es5.d.ts:1438

Determines whether all the members of an array satisfy the specified test.

Type Parameters ​
Type Parameter
S extends AllowedUpdateName
Parameters ​
ParameterTypeDescription
predicate(value, index, array) => value is SA function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.
thisArg?anyAn object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
Returns ​

this is S[]

Inherited from ​

Array.every

Call Signature ​

every(predicate, thisArg?): boolean

Defined in: typescript/lib/lib.es5.d.ts:1447

Determines whether all the members of an array satisfy the specified test.

Parameters ​
ParameterTypeDescription
predicate(value, index, array) => unknownA function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.
thisArg?anyAn object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
Returns ​

boolean

Inherited from ​

Array.every


except() ​

except(...types): AllowedUpdatesFilter

Defined in: gramio/index.d.ts:110

Return a new filter with the given types removed.

Parameters ​

ParameterType
...typesAllowedUpdateName[]

Returns ​

AllowedUpdatesFilter

Example ​

typescript
AllowedUpdatesFilter.all.except("poll", "poll_answer", "chosen_inline_result")

fill() ​

fill(value, start?, end?): this

Defined in: typescript/lib/lib.es2015.core.d.ts:49

Changes all array elements from start to end index to a static value and returns the modified array

Parameters ​

ParameterTypeDescription
valueAllowedUpdateNamevalue to fill array section with
start?numberindex to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.
end?numberindex to stop filling the array at. If end is negative, it is treated as length+end.

Returns ​

this

Inherited from ​

Array.fill


filter() ​

Call Signature ​

filter<S>(predicate, thisArg?): S[]

Defined in: typescript/lib/lib.es5.d.ts:1474

Returns the elements of an array that meet the condition specified in a callback function.

Type Parameters ​
Type Parameter
S extends AllowedUpdateName
Parameters ​
ParameterTypeDescription
predicate(value, index, array) => value is SA function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
thisArg?anyAn object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
Returns ​

S[]

Inherited from ​

Array.filter

Call Signature ​

filter(predicate, thisArg?): AllowedUpdateName[]

Defined in: typescript/lib/lib.es5.d.ts:1480

Returns the elements of an array that meet the condition specified in a callback function.

Parameters ​
ParameterTypeDescription
predicate(value, index, array) => unknownA function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
thisArg?anyAn object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
Returns ​

AllowedUpdateName[]

Inherited from ​

Array.filter


find() ​

Call Signature ​

find<S>(predicate, thisArg?): S

Defined in: typescript/lib/lib.es2015.core.d.ts:27

Returns the value of the first element in the array where predicate is true, and undefined otherwise.

Type Parameters ​
Type Parameter
S extends AllowedUpdateName
Parameters ​
ParameterTypeDescription
predicate(value, index, obj) => value is Sfind calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.
thisArg?anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
Returns ​

S

Inherited from ​

Array.find

Call Signature ​

find(predicate, thisArg?): AllowedUpdateName

Defined in: typescript/lib/lib.es2015.core.d.ts:28

Parameters ​
ParameterType
predicate(value, index, obj) => unknown
thisArg?any
Returns ​

AllowedUpdateName

Inherited from ​

Array.find


findIndex() ​

findIndex(predicate, thisArg?): number

Defined in: typescript/lib/lib.es2015.core.d.ts:39

Returns the index of the first element in the array where predicate is true, and -1 otherwise.

Parameters ​

ParameterTypeDescription
predicate(value, index, obj) => unknownfind calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.
thisArg?anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

Returns ​

number

Inherited from ​

Array.findIndex


flat() ​

flat<A, D>(this, depth?): FlatArray<A, D>[]

Defined in: typescript/lib/lib.es2019.array.d.ts:73

Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

Type Parameters ​

Type ParameterDefault type
A-
D extends number1

Parameters ​

ParameterTypeDescription
thisA-
depth?DThe maximum recursion depth

Returns ​

FlatArray<A, D>[]

Inherited from ​

Array.flat


flatMap() ​

flatMap<U, This>(callback, thisArg?): U[]

Defined in: typescript/lib/lib.es2019.array.d.ts:62

Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.

Type Parameters ​

Type ParameterDefault type
U-
Thisundefined

Parameters ​

ParameterTypeDescription
callback(this, value, index, array) => U | readonly U[]A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array.
thisArg?ThisAn object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value.

Returns ​

U[]

Inherited from ​

Array.flatMap


forEach() ​

forEach(callbackfn, thisArg?): void

Defined in: typescript/lib/lib.es5.d.ts:1462

Performs the specified action for each element in an array.

Parameters ​

ParameterTypeDescription
callbackfn(value, index, array) => voidA function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
thisArg?anyAn object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns ​

void

Inherited from ​

Array.forEach


includes() ​

includes(searchElement, fromIndex?): boolean

Defined in: typescript/lib/lib.es2016.array.include.d.ts:23

Determines whether an array includes a certain element, returning true or false as appropriate.

Parameters ​

ParameterTypeDescription
searchElementAllowedUpdateNameThe element to search for.
fromIndex?numberThe position in this array at which to begin searching for searchElement.

Returns ​

boolean

Inherited from ​

Array.includes


indexOf() ​

indexOf(searchElement, fromIndex?): number

Defined in: typescript/lib/lib.es5.d.ts:1423

Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

Parameters ​

ParameterTypeDescription
searchElementAllowedUpdateNameThe value to locate in the array.
fromIndex?numberThe array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

Returns ​

number

Inherited from ​

Array.indexOf


join() ​

join(separator?): string

Defined in: typescript/lib/lib.es5.d.ts:1362

Adds all the elements of an array into a string, separated by the specified separator string.

Parameters ​

ParameterTypeDescription
separator?stringA string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.

Returns ​

string

Inherited from ​

Array.join


keys() ​

keys(): ArrayIterator<number>

Defined in: typescript/lib/lib.es2015.iterable.d.ts:86

Returns an iterable of keys in the array

Returns ​

ArrayIterator<number>

Inherited from ​

Array.keys


lastIndexOf() ​

lastIndexOf(searchElement, fromIndex?): number

Defined in: typescript/lib/lib.es5.d.ts:1429

Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.

Parameters ​

ParameterTypeDescription
searchElementAllowedUpdateNameThe value to locate in the array.
fromIndex?numberThe array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.

Returns ​

number

Inherited from ​

Array.lastIndexOf


map() ​

map<U>(callbackfn, thisArg?): U[]

Defined in: typescript/lib/lib.es5.d.ts:1468

Calls a defined callback function on each element of an array, and returns an array that contains the results.

Type Parameters ​

Type Parameter
U

Parameters ​

ParameterTypeDescription
callbackfn(value, index, array) => UA function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
thisArg?anyAn object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns ​

U[]

Inherited from ​

Array.map


pop() ​

pop(): AllowedUpdateName

Defined in: typescript/lib/lib.es5.d.ts:1340

Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

Returns ​

AllowedUpdateName

Inherited from ​

Array.pop


push() ​

push(...items): number

Defined in: typescript/lib/lib.es5.d.ts:1345

Appends new elements to the end of an array, and returns the new length of the array.

Parameters ​

ParameterTypeDescription
...itemsAllowedUpdateName[]New elements to add to the array.

Returns ​

number

Inherited from ​

Array.push


reduce() ​

Call Signature ​

reduce(callbackfn): AllowedUpdateName

Defined in: typescript/lib/lib.es5.d.ts:1486

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters ​
ParameterTypeDescription
callbackfn(previousValue, currentValue, currentIndex, array) => AllowedUpdateNameA function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
Returns ​

AllowedUpdateName

Inherited from ​

Array.reduce

Call Signature ​

reduce(callbackfn, initialValue): AllowedUpdateName

Defined in: typescript/lib/lib.es5.d.ts:1487

Parameters ​
ParameterType
callbackfn(previousValue, currentValue, currentIndex, array) => AllowedUpdateName
initialValueAllowedUpdateName
Returns ​

AllowedUpdateName

Inherited from ​

Array.reduce

Call Signature ​

reduce<U>(callbackfn, initialValue): U

Defined in: typescript/lib/lib.es5.d.ts:1493

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Type Parameters ​
Type Parameter
U
Parameters ​
ParameterTypeDescription
callbackfn(previousValue, currentValue, currentIndex, array) => UA function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
initialValueUIf initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
Returns ​

U

Inherited from ​

Array.reduce


reduceRight() ​

Call Signature ​

reduceRight(callbackfn): AllowedUpdateName

Defined in: typescript/lib/lib.es5.d.ts:1499

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters ​
ParameterTypeDescription
callbackfn(previousValue, currentValue, currentIndex, array) => AllowedUpdateNameA function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
Returns ​

AllowedUpdateName

Inherited from ​

Array.reduceRight

Call Signature ​

reduceRight(callbackfn, initialValue): AllowedUpdateName

Defined in: typescript/lib/lib.es5.d.ts:1500

Parameters ​
ParameterType
callbackfn(previousValue, currentValue, currentIndex, array) => AllowedUpdateName
initialValueAllowedUpdateName
Returns ​

AllowedUpdateName

Inherited from ​

Array.reduceRight

Call Signature ​

reduceRight<U>(callbackfn, initialValue): U

Defined in: typescript/lib/lib.es5.d.ts:1506

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Type Parameters ​
Type Parameter
U
Parameters ​
ParameterTypeDescription
callbackfn(previousValue, currentValue, currentIndex, array) => UA function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
initialValueUIf initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
Returns ​

U

Inherited from ​

Array.reduceRight


reverse() ​

reverse(): AllowedUpdateName[]

Defined in: typescript/lib/lib.es5.d.ts:1367

Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.

Returns ​

AllowedUpdateName[]

Inherited from ​

Array.reverse


shift() ​

shift(): AllowedUpdateName

Defined in: typescript/lib/lib.es5.d.ts:1372

Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

Returns ​

AllowedUpdateName

Inherited from ​

Array.shift


slice() ​

slice(start?, end?): AllowedUpdateName[]

Defined in: typescript/lib/lib.es5.d.ts:1382

Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.

Parameters ​

ParameterTypeDescription
start?numberThe beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0.
end?numberThe end index of the specified portion of the array. This is exclusive of the element at the index 'end'. If end is undefined, then the slice extends to the end of the array.

Returns ​

AllowedUpdateName[]

Inherited from ​

Array.slice


some() ​

some(predicate, thisArg?): boolean

Defined in: typescript/lib/lib.es5.d.ts:1456

Determines whether the specified callback function returns true for any element of an array.

Parameters ​

ParameterTypeDescription
predicate(value, index, array) => unknownA function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.
thisArg?anyAn object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

Returns ​

boolean

Inherited from ​

Array.some


sort() ​

sort(compareFn?): this

Defined in: typescript/lib/lib.es5.d.ts:1393

Sorts an array in place. This method mutates the array and returns a reference to the same array.

Parameters ​

ParameterTypeDescription
compareFn?(a, b) => numberFunction used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. [11,2,22,1].sort((a, b) => a - b)

Returns ​

this

Inherited from ​

Array.sort


splice() ​

Call Signature ​

splice(start, deleteCount?): AllowedUpdateName[]

Defined in: typescript/lib/lib.es5.d.ts:1402

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters ​
ParameterTypeDescription
startnumberThe zero-based location in the array from which to start removing elements.
deleteCount?numberThe number of elements to remove. Omitting this argument will remove all elements from the start paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
Returns ​

AllowedUpdateName[]

An array containing the elements that were deleted.

Inherited from ​

Array.splice

Call Signature ​

splice(start, deleteCount, ...items): AllowedUpdateName[]

Defined in: typescript/lib/lib.es5.d.ts:1412

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters ​
ParameterTypeDescription
startnumberThe zero-based location in the array from which to start removing elements.
deleteCountnumberThe number of elements to remove. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
...itemsAllowedUpdateName[]Elements to insert into the array in place of the deleted elements.
Returns ​

AllowedUpdateName[]

An array containing the elements that were deleted.

Inherited from ​

Array.splice


toArray() ​

toArray(): AllowedUpdateName[]

Defined in: gramio/index.d.ts:112

Convert to a plain AllowedUpdateName[] array.

Returns ​

AllowedUpdateName[]


toLocaleString() ​

Call Signature ​

toLocaleString(): string

Defined in: typescript/lib/lib.es5.d.ts:1335

Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.

Returns ​

string

Inherited from ​

Array.toLocaleString

Call Signature ​

toLocaleString(locales, options?): string

Defined in: typescript/lib/lib.es2015.core.d.ts:62

Parameters ​
ParameterType
localesstring | string[]
options?NumberFormatOptions & DateTimeFormatOptions
Returns ​

string

Inherited from ​

Array.toLocaleString


toString() ​

toString(): string

Defined in: typescript/lib/lib.es5.d.ts:1331

Returns a string representation of an array.

Returns ​

string

Inherited from ​

Array.toString


unshift() ​

unshift(...items): number

Defined in: typescript/lib/lib.es5.d.ts:1417

Inserts new elements at the start of an array, and returns the new length of the array.

Parameters ​

ParameterTypeDescription
...itemsAllowedUpdateName[]Elements to insert at the start of the array.

Returns ​

number

Inherited from ​

Array.unshift


values() ​

values(): ArrayIterator<AllowedUpdateName>

Defined in: typescript/lib/lib.es2015.iterable.d.ts:91

Returns an iterable of values in the array

Returns ​

ArrayIterator<AllowedUpdateName>

Inherited from ​

Array.values


from() ​

Call Signature ​

static from<T>(arrayLike): T[]

Defined in: typescript/lib/lib.es2015.core.d.ts:70

Creates an array from an array-like object.

Type Parameters ​
Type Parameter
T
Parameters ​
ParameterTypeDescription
arrayLikeArrayLike<T>An array-like object to convert to an array.
Returns ​

T[]

Inherited from ​

Array.from

Call Signature ​

static from<T, U>(arrayLike, mapfn, thisArg?): U[]

Defined in: typescript/lib/lib.es2015.core.d.ts:78

Creates an array from an iterable object.

Type Parameters ​
Type Parameter
T
U
Parameters ​
ParameterTypeDescription
arrayLikeArrayLike<T>An array-like object to convert to an array.
mapfn(v, k) => UA mapping function to call on every element of the array.
thisArg?anyValue of 'this' used to invoke the mapfn.
Returns ​

U[]

Inherited from ​

Array.from

Call Signature ​

static from<T>(iterable): T[]

Defined in: typescript/lib/lib.es2015.iterable.d.ts:99

Creates an array from an iterable object.

Type Parameters ​
Type Parameter
T
Parameters ​
ParameterTypeDescription
iterableIterable<T, any, any> | ArrayLike<T>An iterable object to convert to an array.
Returns ​

T[]

Inherited from ​

Array.from

Call Signature ​

static from<T, U>(iterable, mapfn, thisArg?): U[]

Defined in: typescript/lib/lib.es2015.iterable.d.ts:107

Creates an array from an iterable object.

Type Parameters ​
Type Parameter
T
U
Parameters ​
ParameterTypeDescription
iterableIterable<T, any, any> | ArrayLike<T>An iterable object to convert to an array.
mapfn(v, k) => UA mapping function to call on every element of the array.
thisArg?anyValue of 'this' used to invoke the mapfn.
Returns ​

U[]

Inherited from ​

Array.from


isArray() ​

static isArray(arg): arg is any[]

Defined in: typescript/lib/lib.es5.d.ts:1518

Parameters ​

ParameterType
argany

Returns ​

arg is any[]

Inherited from ​

Array.isArray


of() ​

static of<T>(...items): T[]

Defined in: typescript/lib/lib.es2015.core.d.ts:84

Returns a new array from a set of elements.

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterTypeDescription
...itemsT[]A set of elements to include in the new array object.

Returns ​

T[]

Inherited from ​

Array.of


only() ​

static only(...types): AllowedUpdatesFilter

Defined in: gramio/index.d.ts:91

Create a filter with exactly the specified update types.

Parameters ​

ParameterType
...typesAllowedUpdateName[]

Returns ​

AllowedUpdatesFilter

Example ​

typescript
AllowedUpdatesFilter.only("message", "callback_query", "inline_query")