Commit graph

238 commits

Author SHA1 Message Date
teidesu
e68c9f4bb5 refactor: prettier-ed code, rearranged imports, fixed tests 2022-06-30 16:32:56 +03:00
teidesu
f2eb033e91 fix(dispatcher): fix not dispatching to children
i dont fucking know why that code didn't work, i hate js
2022-06-30 16:24:13 +03:00
teidesu
2c3529870a feat(client): updated to layer 143
also fixed some minor bugs
2022-06-18 22:47:31 +03:00
teidesu
e0d1102408 fix(tl): bumped minor version 2022-06-05 23:05:15 +03:00
teidesu
0633d0a817 fix(dispatcher): handlers without filters 2022-05-14 21:38:41 +03:00
teidesu
9034810ccd tl: updated to layer 142 2022-05-14 20:30:36 +03:00
teidesu
63d0ea2ddf feat(client): support join requests 2022-05-09 17:25:38 +03:00
teidesu
e187f8697e feat(filters): filter by sticker type 2022-05-06 20:02:54 +03:00
teidesu
9543f64558 feat(client): sticker choosing typing event
also prettier fucked everything up, fixed that
2022-05-06 17:53:44 +03:00
teidesu
252f94a594 fix(dispatcher): implemented userId filter
it got commented out when migrating to 64-bit ids, then i moved to using native numbers for them and forgot to update the filter
2022-05-06 13:56:15 +03:00
teidesu
a7e866f3eb refactor: assertNever util, use it in most places
haven't used it in some just yet because not everything is implemented (particularly, newer attachment types, typings, admin events, etc.)
2022-05-06 13:50:30 +03:00
teidesu
a1ea1315df tl: updated to layer 140 2022-04-28 17:23:44 +03:00
teidesu
2289cc690d build: migrated to pnpm, updated and cleaned up deps 2022-04-28 16:58:09 +03:00
teidesu
9493759572 build: updated to layer 139
didn't add any new layers' features, only bumped layer
2022-04-01 22:17:10 +03:00
teidesu
ec736f8590 some changes
i've been wanting to name a commit like this for my entire life, lol. seriously though, a lot has changed:
 - extracted TL-related stuff to `@mtcute/tl-utils` and `@mtcute/tl-runtime`, rewrote codegen in TS
 - updated to layer 134, moved to int64 identifiers
 - rewritten networking (mtproto), rewritten updates handling
 - *lots* of refactoring

 still a very early version though, there are a lot of improvements to be made, but at least it runs, lol

 also tl-reference will not be updated anytime soon because i want to rewrite it
2021-11-23 00:03:59 +03:00
teidesu
9b5ca0cb2a refactor: improved logging, moved to custom logger instead of debug 2021-08-14 12:57:26 +03:00
teidesu
4b22ee5b25 rename back to mtcute
idk lol
2021-08-05 20:38:24 +03:00
teidesu
6be71c3572 feat(client): support updateBotStopped 2021-08-04 13:23:39 +03:00
teidesu
a8d3543e64 build: preparing for publish, moved to strict typescript, fixed some stuff 2021-07-30 17:40:50 +03:00
teidesu
2f1c8548a0 build: renamed to mtqt 2021-07-25 21:03:40 +03:00
teidesu
3b523598ad build: changed license to lgplv3 2021-07-19 03:57:47 +03:00
teidesu
199e0a2a7d fix(dispatcher): adding raw handlers
removed from codegen and forgot to add in code, i'm dumb 🤷
2021-07-17 19:08:13 +03:00
teidesu
627fdbed2f refactor(dispatcher): big refactor, moved updates parsing to client, separated raw updates from parsed, moved Conversation to client package 2021-07-17 17:26:31 +03:00
teidesu
5b9ddc1f7b refactor(dispatcher): UpdateInfo<...> to ParsedUpdate 2021-07-14 22:34:03 +03:00
teidesu
3fcdd03877 feat(dispatcher): lastMessage and lastReceivedMessage getters for Conversation 2021-07-10 16:12:31 +03:00
teidesu
66e623f21d docs(dispatcher): improved docs for Conversation 2021-07-10 16:05:20 +03:00
teidesu
b9b2b9f6ba feat(dispatcher): Conversation class 2021-07-10 15:10:43 +03:00
teidesu
77d597e4db feat(dispatcher): history read update
also fixed imports/exports
2021-07-09 19:41:02 +03:00
teidesu
be8ffe5b5b feat(dispatcher): text-related filters (equals, contains, starts/ends with) 2021-07-09 01:50:39 +03:00
teidesu
c33646943c fix(dispatcher): middleware and event emitter related fixes 2021-07-09 01:49:53 +03:00
teidesu
231b10d8cd feat(dispatcher): made Dispatcher an EventEmitter
this adds a second option for updates dispatching which is not governed by any propagation or stuff.
useful for advanced use-cases.
2021-07-07 23:36:57 +03:00
teidesu
7c3f5cafa6 feat(dispatcher): deeplink filter 2021-07-06 18:38:06 +03:00
teidesu
c2130dec9f build(tl): updated to layer 131 2021-07-06 18:02:26 +03:00
teidesu
8b6d587399 fix(client): improved own username handling 2021-07-05 17:26:30 +03:00
teidesu
82db8453fc feat(dispatcher): basic middleware functionality 2021-07-03 16:42:41 +03:00
teidesu
d0e3ebda80 refactor: use type discrimination for media types in Message
this should result in cleaner code without the need to import everything
2021-07-01 22:20:16 +03:00
teidesu
2220371efd feat(dispatcher): conditional error propagation to client 2021-06-27 23:59:04 +03:00
teidesu
0ea953732b fix(dispatcher): removed @internal from non-filtered on* methods
i probably am in fact stupid
2021-06-26 23:34:08 +03:00
teidesu
090f42e559 build(tl): updated to layer 130 2021-06-26 17:13:13 +03:00
teidesu
cf7f8e74ea feat(dispatcher): throttle now actually throttles, and does not throw an error 2021-06-25 22:37:26 +03:00
teidesu
00d9228c1c feat(dispatcher): provide custom default state for wizard 2021-06-24 01:12:20 +03:00
teidesu
a2ad4128f1 fix(dispatcher): default state for merge 2021-06-24 01:12:00 +03:00
teidesu
b45cc0df69 feat: rate limiting 2021-06-20 17:54:28 +03:00
teidesu
6b622f8399 fix(dispatcher): exported defaultStateKeyDelegate 2021-06-20 03:17:04 +03:00
teidesu
481f0db129 fix(dispatcher): provide state type information to filters 2021-06-20 02:52:19 +03:00
teidesu
5e7706a5a3 feat(dispatcher): callback data builder 2021-06-20 01:29:40 +03:00
teidesu
73d9a850ee fix(client): exported MessageAction and MessageMedia 2021-06-19 23:41:29 +03:00
teidesu
035435900b feat(dispatcher): filters.start filter for /start 2021-06-19 20:59:35 +03:00
teidesu
fbb5d7005f feat(dispatcher): support regex commands 2021-06-19 20:53:51 +03:00
teidesu
1238e7c32c fix(dispatcher): improved typings for action filter 2021-06-19 20:11:06 +03:00
teidesu
f44bf77a07 feat(dispatcher): support usernames and me/self in userId and chatId filters 2021-06-19 19:53:31 +03:00
teidesu
f2671d3c0b fix(dispatcher): handle commands that contain bot username 2021-06-18 19:21:22 +03:00
teidesu
6c8eeb01d2 feat(dispatcher): wizard scene 2021-06-14 19:01:02 +03:00
teidesu
257f5392ea refactor(dispatcher): use enum instead of symbols for propagation 2021-06-14 18:58:07 +03:00
teidesu
707e317e16 stuff 2021-06-12 01:13:02 +03:00
teidesu
46317e8ddb fix(dispatcher): optimized every & some functions, improved types for them 2021-06-11 16:39:27 +03:00
teidesu
c46f113f1f build: preparing for publish x5
at this point i'm way too tired to describe what happened.
stuff added, stuff removed, stuff fixed, i don't even remember anymore lol
2021-06-09 01:47:22 +03:00
teidesu
7a0de134ba feat(dispatcher): local error handling 2021-06-07 23:59:17 +03:00
teidesu
21d69e466e fix: handle private chat sender 2021-06-07 15:27:16 +03:00
teidesu
280c9f51aa build: preparing to publish (part 2)
fixed imports, package.json files, improved package generation for certain packages, and more (i'm too lazy to describe all the magic that i've done)
2021-06-06 19:23:43 +03:00
teidesu
ae2dbcf03f build: fixed scripts, eslintignore, fixed linter warnings and re-formatted with prettier 2021-06-06 15:20:41 +03:00
teidesu
ecca291eba fix(dispatcher): handle custom key in getState 2021-05-31 23:29:26 +03:00
teidesu
9da72daac7 fix(dispatcher): do not propagate state and scene to children 2021-05-31 23:20:20 +03:00
teidesu
a0294b9a64 feat(dispatcher): fsm and scenes 2021-05-27 01:02:31 +03:00
teidesu
98fe7e3d31 refactor(dispatcher): avoid parsing unhandled updates 2021-05-23 15:38:03 +03:00
teidesu
b926178b9d refactor(dispatcher): store and lookup handlers by their type
avoids redundant loops over all registered handlers
2021-05-23 14:43:40 +03:00
teidesu
2d335af78e fix(dispatcher): reuse parsed updates in child dispatchers 2021-05-23 14:16:01 +03:00
teidesu
8e81ce21f2 fix(dispatcher): scheduled flag for new scheduled messages 2021-05-23 14:04:28 +03:00
teidesu
e6e28399b0 refactor: prefer switches over ifs when possible 2021-05-16 14:32:36 +03:00
teidesu
803daecdf3 feat(dispatcher): deleted messages update 2021-05-16 13:06:26 +03:00
teidesu
97ba7652ff refactor: use constructor check instead of instanceof where possible
this might just have introduced a bunch of errors, but ill test later
2021-05-15 21:17:49 +03:00
teidesu
46973c4830 fix(dispatcher): fixed field names because webstorm sucks 2021-05-11 22:34:13 +03:00
teidesu
d8cd13fd60 refactor(client): use ReadonlyArray for getter return types 2021-05-11 22:02:00 +03:00
teidesu
0f1edcfcf7 refactor: use UsersIndex and ChatsIndex types instead of bare record types 2021-05-11 21:46:59 +03:00
teidesu
db0d5f51e4 feat(dispatcher): filtering for service messages, by chat type and for text-only msgs 2021-05-10 17:30:05 +03:00
teidesu
cb01d8250e feat(client): renamed inputMediaTl to inputMedia and added it to every kind of media
also fixed imports/exports
2021-05-08 17:53:59 +03:00
teidesu
002d949a13 feat: user status and typing related methods and updates 2021-05-08 16:35:25 +03:00
teidesu
d36c1781bd feat(dispatcher): support poll related updates
also fixed a few type and export issues, and changed poll option generation to match tdlib and others
2021-05-07 15:37:17 +03:00
teidesu
6db771e3da feat(client): a lot of changes
- support web documents
 - support previews for locations
 - unify media interfaces, merge everything into sendMedia
 - support invoices, polls, venues (both sending and receiving)
2021-05-07 14:26:29 +03:00
teidesu
00c308dca7 feat(dispatcher): support more types in regex filter, inline filter for callback queries 2021-05-05 02:05:27 +03:00
teidesu
1fb7057866 feat: support callback queries 2021-05-05 01:50:04 +03:00
teidesu
95f6515340 fix(dispatcher/codegem): added @internal mark, also removed console log call 2021-05-05 00:45:09 +03:00
teidesu
1c1aed147a refactor(dispatcher): codegen for update types
i'm just too lazy to be bothered with pasting that. also, i forgot to implement builder for editMessage, teehee~
2021-05-05 00:43:35 +03:00
teidesu
23dcc4c1e5 feat: support for chosen inline query results 2021-05-04 14:07:40 +03:00
teidesu
3336f295ee feat: basic inline queries support (only articles for now) 2021-04-28 23:00:51 +03:00
teidesu
8bb23cd464 feat(dispatcher): chatMemberSelf filter 2021-04-27 20:42:23 +03:00
teidesu
fa3c719312 feat(dispatcher): support chat member updates 2021-04-27 20:31:04 +03:00
teidesu
70c01a62a3 refactor(updates): extracted dispatcher to own package, fixed various update related bugs 2021-04-23 22:35:37 +03:00