Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TODO #1

Open
6 tasks done
hansputera opened this issue Apr 26, 2023 · 3 comments
Open
6 tasks done

TODO #1

hansputera opened this issue Apr 26, 2023 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@hansputera
Copy link
Owner

hansputera commented Apr 26, 2023

Todo List

  • Menambahkan slash command support.
Contoh slash command:
 1. /download https://otakudesu.lol/episode/...
 2. /cari@utekedesu_bot One piece
 3. /download@utekedesu_bot https://otakudesu.lol/episode/....
  • Bot mampu mengolah kembali pesan masa lalu apabila user mengedit pesan sebelumnya.
Contohnya:
---------------------
User (pesan baru) : /cari Boruto  (pesan A)
Bot (pesan baru): "Boruto (...)" (pesan B)

(setelah 5 detik atau beberapa lamanya)

User (edit pesan): /cari One Piece (pesan A)
Bot (edit pesan): "One Piece (...)" (pesan B)

--------------------------
Maksud disini ialah bot mampu menggunakan kembali pesan yang berlalu apabila user mengedit pesan sebelumnya juga. 
Untuk expiration time disini maksimal adalah 1 menit untuk mengurangi memory usage.
(I'll use file caching in next time)
  • Menambahkan button data caching (expiration time = 5 mins)
  • Menambahkan fitur query resolver (untuk resolve permintaan dengan username request)
Contohnya:
1. @utekdesu_bot cari one piece
2. @utekedesu_bot download https://otakudesu.lol/episode/...
  • Membuat commands handler
## Command Handler File Schema:

Arg# -> Object
Arg#name -> String
Arg#type -> Union(Option, Arg)
Arg#required -> Boolean

Command# -> Class
Command#name -> String
Command#aliases -> Array<String>
Command#args -> Array<Arg>
Command#flags -> Array<String>
Command#handle -> AsyncFunction(m -> [@structures/Message.js:MessageEvent]): void


## [@frameworks/GramJs.ts]

TelegramFramework#
TelegramFramework#(...)
TelegramFramework#commands -> KeyValue<@Key -> string, @Value -> Command>
  • Membuat table dalam database MySQL untuk menyimpan data file yang telah terdownload
Table `files` schema:

id -> INT INCREMENT NOT NULL
file_id -> UNSIGNED BIGINT NOT NULL
chat_id -> UNSIGNED INT NOT NULL
created_at -> DATETIME NOT NULL
updated_at -> DATETIME NOT NULL
@hansputera hansputera added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 26, 2023
@hansputera hansputera self-assigned this Apr 26, 2023
@hansputera hansputera added help wanted Extra attention is needed question Further information is requested labels Apr 26, 2023
@hansputera hansputera pinned this issue Apr 26, 2023
@hansputera
Copy link
Owner Author

hansputera commented Apr 26, 2023

Priorities:

  1. command handler
  2. mysql table
  3. query resolver
  4. slash command
  5. button data caching
  6. editable message

@hansputera
Copy link
Owner Author

hansputera commented Apr 27, 2023

Lupa nambahin:

  • Menambahkan args, flags parser
Karena di [@structures/Message.ts] udah dipisah command namenya jadi,
kita sisa ambil aja sisanya sebagai array.

Contoh:

pure text: "/cari boruto --minimalist"
preprocess: "boruto --minimalist"

Data diatas udah ada untuk saat ini, jadi sisa di proses lagi aja menjadi flags, dan args.
Contoh flags (--minimalist, --red, --green, --blue)

Flags, dan args ini juga akan saling berkaitan, karena dalam args juga ada tipe option.

Option itu berupa seperti ini bentuknya (--key=value),
sehingga dapatnya juga harus dari flags, dan dimasukan ke dalam args -> { name: key, value: value }

-------------------------------------
Kalau args sendiri, nanti juga ada parsing untuk tipe arg, misal integer,
maka value yang akan diberikan kepada Command juga hasil value dari argnya adalah number

@hansputera
Copy link
Owner Author

Semua task yang terdaftar sudah terlaksana, hal yang perlu ditambahkan untuk User Experience:

  1. Video stream download progress tracker
  2. Video stream download mirror selection (seleksi mirror web stream video melalui button)
  3. Increase video stream download speed
  4. Add "help" or "menu" command to show available commands

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant