@grammyjs/types 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/langs.d.ts +193 -0
- package/methods.d.ts +10 -9
- package/mod.d.ts +1 -0
- package/package.json +1 -1
package/langs.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/** A two-letter ISO 639-1 language code.
|
|
2
|
+
* @see https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
|
|
3
|
+
* @see https://www.loc.gov/standards/iso639-2/php/code_list.php
|
|
4
|
+
*/
|
|
5
|
+
export type LanguageCode = typeof LanguageCodes[keyof typeof LanguageCodes];
|
|
6
|
+
/**
|
|
7
|
+
* @see {@link LanguageCode}
|
|
8
|
+
*/
|
|
9
|
+
export declare const LanguageCodes: {
|
|
10
|
+
readonly Abkhazian: "ab";
|
|
11
|
+
readonly Afar: "aa";
|
|
12
|
+
readonly Afrikaans: "af";
|
|
13
|
+
readonly Akan: "ak";
|
|
14
|
+
readonly Albanian: "sq";
|
|
15
|
+
readonly Amharic: "am";
|
|
16
|
+
readonly Arabic: "ar";
|
|
17
|
+
readonly Aragonese: "an";
|
|
18
|
+
readonly Armenian: "hy";
|
|
19
|
+
readonly Assamese: "as";
|
|
20
|
+
readonly Avaric: "av";
|
|
21
|
+
readonly Avestan: "ae";
|
|
22
|
+
readonly Aymara: "ay";
|
|
23
|
+
readonly Azerbaijani: "az";
|
|
24
|
+
readonly Bambara: "bm";
|
|
25
|
+
readonly Bashkir: "ba";
|
|
26
|
+
readonly Basque: "eu";
|
|
27
|
+
readonly Belarusian: "be";
|
|
28
|
+
readonly Bengali: "bn";
|
|
29
|
+
readonly Bislama: "bi";
|
|
30
|
+
readonly Bosnian: "bs";
|
|
31
|
+
readonly Breton: "br";
|
|
32
|
+
readonly Bulgarian: "bg";
|
|
33
|
+
readonly Burmese: "my";
|
|
34
|
+
readonly Catalan: "ca";
|
|
35
|
+
readonly Chamorro: "ch";
|
|
36
|
+
readonly Chechen: "ce";
|
|
37
|
+
readonly Chichewa: "ny";
|
|
38
|
+
readonly Chinese: "zh";
|
|
39
|
+
readonly ChurchSlavonic: "cu";
|
|
40
|
+
readonly Chuvash: "cv";
|
|
41
|
+
readonly Cornish: "kw";
|
|
42
|
+
readonly Corsican: "co";
|
|
43
|
+
readonly Cree: "cr";
|
|
44
|
+
readonly Croatian: "hr";
|
|
45
|
+
readonly Czech: "cs";
|
|
46
|
+
readonly Danish: "da";
|
|
47
|
+
readonly Divehi: "dv";
|
|
48
|
+
readonly Dutch: "nl";
|
|
49
|
+
readonly Dzongkha: "dz";
|
|
50
|
+
readonly English: "en";
|
|
51
|
+
readonly Esperanto: "eo";
|
|
52
|
+
readonly Estonian: "et";
|
|
53
|
+
readonly Ewe: "ee";
|
|
54
|
+
readonly Faroese: "fo";
|
|
55
|
+
readonly Fijian: "fj";
|
|
56
|
+
readonly Finnish: "fi";
|
|
57
|
+
readonly French: "fr";
|
|
58
|
+
readonly WesternFrisian: "fy";
|
|
59
|
+
readonly Fulah: "ff";
|
|
60
|
+
readonly Gaelic: "gd";
|
|
61
|
+
readonly Galician: "gl";
|
|
62
|
+
readonly Ganda: "lg";
|
|
63
|
+
readonly Georgian: "ka";
|
|
64
|
+
readonly German: "de";
|
|
65
|
+
readonly Greek: "el";
|
|
66
|
+
readonly Kalaallisut: "kl";
|
|
67
|
+
readonly Guarani: "gn";
|
|
68
|
+
readonly Gujarati: "gu";
|
|
69
|
+
readonly Haitian: "ht";
|
|
70
|
+
readonly Hausa: "ha";
|
|
71
|
+
readonly Hebrew: "he";
|
|
72
|
+
readonly Herero: "hz";
|
|
73
|
+
readonly Hindi: "hi";
|
|
74
|
+
readonly HiriMotu: "ho";
|
|
75
|
+
readonly Hungarian: "hu";
|
|
76
|
+
readonly Icelandic: "is";
|
|
77
|
+
readonly Ido: "io";
|
|
78
|
+
readonly Igbo: "ig";
|
|
79
|
+
readonly Indonesian: "id";
|
|
80
|
+
readonly Interlingua: "ia";
|
|
81
|
+
readonly Interlingue: "ie";
|
|
82
|
+
readonly Inuktitut: "iu";
|
|
83
|
+
readonly Inupiaq: "ik";
|
|
84
|
+
readonly Irish: "ga";
|
|
85
|
+
readonly Italian: "it";
|
|
86
|
+
readonly Japanese: "ja";
|
|
87
|
+
readonly Javanese: "jv";
|
|
88
|
+
readonly Kannada: "kn";
|
|
89
|
+
readonly Kanuri: "kr";
|
|
90
|
+
readonly Kashmiri: "ks";
|
|
91
|
+
readonly Kazakh: "kk";
|
|
92
|
+
readonly CentralKhmer: "km";
|
|
93
|
+
readonly Kikuyu: "ki";
|
|
94
|
+
readonly Kinyarwanda: "rw";
|
|
95
|
+
readonly Kirghiz: "ky";
|
|
96
|
+
readonly Komi: "kv";
|
|
97
|
+
readonly Kongo: "kg";
|
|
98
|
+
readonly Korean: "ko";
|
|
99
|
+
readonly Kuanyama: "kj";
|
|
100
|
+
readonly Kurdish: "ku";
|
|
101
|
+
readonly Lao: "lo";
|
|
102
|
+
readonly Latin: "la";
|
|
103
|
+
readonly Latvian: "lv";
|
|
104
|
+
readonly Limburgan: "li";
|
|
105
|
+
readonly Lingala: "ln";
|
|
106
|
+
readonly Lithuanian: "lt";
|
|
107
|
+
readonly LubaKatanga: "lu";
|
|
108
|
+
readonly Luxembourgish: "lb";
|
|
109
|
+
readonly Macedonian: "mk";
|
|
110
|
+
readonly Malagasy: "mg";
|
|
111
|
+
readonly Malay: "ms";
|
|
112
|
+
readonly Malayalam: "ml";
|
|
113
|
+
readonly Maltese: "mt";
|
|
114
|
+
readonly Manx: "gv";
|
|
115
|
+
readonly Maori: "mi";
|
|
116
|
+
readonly Marathi: "mr";
|
|
117
|
+
readonly Marshallese: "mh";
|
|
118
|
+
readonly Mongolian: "mn";
|
|
119
|
+
readonly Nauru: "na";
|
|
120
|
+
readonly Navajo: "nv";
|
|
121
|
+
readonly NorthNdebele: "nd";
|
|
122
|
+
readonly SouthNdebele: "nr";
|
|
123
|
+
readonly Ndonga: "ng";
|
|
124
|
+
readonly Nepali: "ne";
|
|
125
|
+
readonly Norwegian: "no";
|
|
126
|
+
readonly NorwegianBokmål: "nb";
|
|
127
|
+
readonly NorwegianNynorsk: "nn";
|
|
128
|
+
readonly SichuanYi: "ii";
|
|
129
|
+
readonly Occitan: "oc";
|
|
130
|
+
readonly Ojibwa: "oj";
|
|
131
|
+
readonly Oriya: "or";
|
|
132
|
+
readonly Oromo: "om";
|
|
133
|
+
readonly Ossetian: "os";
|
|
134
|
+
readonly Pali: "pi";
|
|
135
|
+
readonly Pashto: "ps";
|
|
136
|
+
readonly Persian: "fa";
|
|
137
|
+
readonly Polish: "pl";
|
|
138
|
+
readonly Portuguese: "pt";
|
|
139
|
+
readonly Punjabi: "pa";
|
|
140
|
+
readonly Quechua: "qu";
|
|
141
|
+
readonly Romanian: "ro";
|
|
142
|
+
readonly Romansh: "rm";
|
|
143
|
+
readonly Rundi: "rn";
|
|
144
|
+
readonly Russian: "ru";
|
|
145
|
+
readonly NorthernSami: "se";
|
|
146
|
+
readonly Samoan: "sm";
|
|
147
|
+
readonly Sango: "sg";
|
|
148
|
+
readonly Sanskrit: "sa";
|
|
149
|
+
readonly Sardinian: "sc";
|
|
150
|
+
readonly Serbian: "sr";
|
|
151
|
+
readonly Shona: "sn";
|
|
152
|
+
readonly Sindhi: "sd";
|
|
153
|
+
readonly Sinhala: "si";
|
|
154
|
+
readonly Slovak: "sk";
|
|
155
|
+
readonly Slovenian: "sl";
|
|
156
|
+
readonly Somali: "so";
|
|
157
|
+
readonly SouthernSotho: "st";
|
|
158
|
+
readonly Spanish: "es";
|
|
159
|
+
readonly Sundanese: "su";
|
|
160
|
+
readonly Swahili: "sw";
|
|
161
|
+
readonly Swati: "ss";
|
|
162
|
+
readonly Swedish: "sv";
|
|
163
|
+
readonly Tagalog: "tl";
|
|
164
|
+
readonly Tahitian: "ty";
|
|
165
|
+
readonly Tajik: "tg";
|
|
166
|
+
readonly Tamil: "ta";
|
|
167
|
+
readonly Tatar: "tt";
|
|
168
|
+
readonly Telugu: "te";
|
|
169
|
+
readonly Thai: "th";
|
|
170
|
+
readonly Tibetan: "bo";
|
|
171
|
+
readonly Tigrinya: "ti";
|
|
172
|
+
readonly Tonga: "to";
|
|
173
|
+
readonly Tsonga: "ts";
|
|
174
|
+
readonly Tswana: "tn";
|
|
175
|
+
readonly Turkish: "tr";
|
|
176
|
+
readonly Turkmen: "tk";
|
|
177
|
+
readonly Twi: "tw";
|
|
178
|
+
readonly Uighur: "ug";
|
|
179
|
+
readonly Ukrainian: "uk";
|
|
180
|
+
readonly Urdu: "ur";
|
|
181
|
+
readonly Uzbek: "uz";
|
|
182
|
+
readonly Venda: "ve";
|
|
183
|
+
readonly Vietnamese: "vi";
|
|
184
|
+
readonly Volapük: "vo";
|
|
185
|
+
readonly Walloon: "wa";
|
|
186
|
+
readonly Welsh: "cy";
|
|
187
|
+
readonly Wolof: "wo";
|
|
188
|
+
readonly Xhosa: "xh";
|
|
189
|
+
readonly Yiddish: "yi";
|
|
190
|
+
readonly Yoruba: "yo";
|
|
191
|
+
readonly Zhuang: "za";
|
|
192
|
+
readonly Zulu: "zu";
|
|
193
|
+
};
|
package/methods.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { PassportElementError } from "./passport.js";
|
|
|
7
7
|
import type { LabeledPrice, ShippingOption } from "./payment.js";
|
|
8
8
|
import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
|
|
9
9
|
import type { Update } from "./update.js";
|
|
10
|
+
import type { LanguageCode } from "./langs.js";
|
|
10
11
|
/** Extracts the parameters of a given method name */
|
|
11
12
|
type Params<F, M extends keyof ApiMethods<F>> = Parameters<ApiMethods<F>[M]>;
|
|
12
13
|
/** Utility type providing the argument type for the given method name or `{}` if the method does not take any parameters */
|
|
@@ -1066,57 +1067,57 @@ export type ApiMethods<F> = {
|
|
|
1066
1067
|
/** An object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
|
|
1067
1068
|
scope?: BotCommandScope;
|
|
1068
1069
|
/** A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands */
|
|
1069
|
-
language_code?:
|
|
1070
|
+
language_code?: LanguageCode;
|
|
1070
1071
|
}): true;
|
|
1071
1072
|
/** Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success. */
|
|
1072
1073
|
deleteMyCommands(args: {
|
|
1073
1074
|
/** An object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
|
|
1074
1075
|
scope?: BotCommandScope;
|
|
1075
1076
|
/** A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands */
|
|
1076
|
-
language_code?:
|
|
1077
|
+
language_code?: LanguageCode;
|
|
1077
1078
|
}): true;
|
|
1078
1079
|
/** Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned. */
|
|
1079
1080
|
getMyCommands(args: {
|
|
1080
1081
|
/** An object, describing scope of users. Defaults to BotCommandScopeDefault. */
|
|
1081
1082
|
scope?: BotCommandScope;
|
|
1082
1083
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1083
|
-
language_code?:
|
|
1084
|
+
language_code?: LanguageCode;
|
|
1084
1085
|
}): BotCommand[];
|
|
1085
1086
|
/** Use this method to change the bot's name. Returns True on success. */
|
|
1086
1087
|
setMyName(args: {
|
|
1087
1088
|
/** New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. */
|
|
1088
1089
|
name?: string;
|
|
1089
1090
|
/** A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. */
|
|
1090
|
-
language_code?:
|
|
1091
|
+
language_code?: LanguageCode;
|
|
1091
1092
|
}): true;
|
|
1092
1093
|
/** Use this method to get the current bot name for the given user language. Returns BotName on success. */
|
|
1093
1094
|
getMyName(args: {
|
|
1094
1095
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1095
|
-
language_code?:
|
|
1096
|
+
language_code?: LanguageCode;
|
|
1096
1097
|
}): BotName;
|
|
1097
1098
|
/** Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success. */
|
|
1098
1099
|
setMyDescription(args: {
|
|
1099
1100
|
/** New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. */
|
|
1100
1101
|
description?: string;
|
|
1101
1102
|
/** A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description. */
|
|
1102
|
-
language_code?:
|
|
1103
|
+
language_code?: LanguageCode;
|
|
1103
1104
|
}): true;
|
|
1104
1105
|
/** Use this method to get the current bot description for the given user language. Returns BotDescription on success. */
|
|
1105
1106
|
getMyDescription(args: {
|
|
1106
1107
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1107
|
-
language_code?:
|
|
1108
|
+
language_code?: LanguageCode;
|
|
1108
1109
|
}): BotDescription;
|
|
1109
1110
|
/** Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success. */
|
|
1110
1111
|
setMyShortDescription(args: {
|
|
1111
1112
|
/** New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. */
|
|
1112
1113
|
short_description?: string;
|
|
1113
1114
|
/** A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description. */
|
|
1114
|
-
language_code?:
|
|
1115
|
+
language_code?: LanguageCode;
|
|
1115
1116
|
}): true;
|
|
1116
1117
|
/** Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success. */
|
|
1117
1118
|
getMyShortDescription(args: {
|
|
1118
1119
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1119
|
-
language_code?:
|
|
1120
|
+
language_code?: LanguageCode;
|
|
1120
1121
|
}): BotShortDescription;
|
|
1121
1122
|
/** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. */
|
|
1122
1123
|
setChatMenuButton(args: {
|
package/mod.d.ts
CHANGED