FilesBot icon indicating copy to clipboard operation
FilesBot copied to clipboard

Sequence of file link Robot Generate is just numbers

Open AhyaH-YHWH opened this issue 4 years ago • 10 comments

Please generate a random word ( 10 or 15 Characters For Example) after each message robot receive and send it to linked channel of Robot, after message itself say "ra2nd1o5mw3ord"

so the link the bot generate will be ( id number of message in Linked channel of Bot)

https://t.me/FilesBot?start=ra2nd1o5mw3ord_id https://t.me/FilesBot?start=ra2nd1o5mw3ord_10 instead of

https://t.me/FilesBot?start=view_10_tg for 10th message in the Linked Channel of Robot

so that random users can't find bot files Thanks

AhyaH-YHWH avatar Nov 17 '20 17:11 AhyaH-YHWH

If I have bot username, I will generate all links like https://t.me/FilesBot?start=view_12_tg https://t.me/FilesBot?start=view_109_tg

and see the files users forwarded to bot

but this way, Random users can only access Files, if they have exact word in link

AhyaH-YHWH avatar Nov 17 '20 18:11 AhyaH-YHWH

@SpEcHiDe time to use uuid :-)

code-rgb avatar Nov 18 '20 04:11 code-rgb

Uhm, it makes sense

skrtdev avatar Dec 27 '20 12:12 skrtdev

I think, need a database if this needs to be implemented.

SpEcHiDe avatar Dec 27 '20 12:12 SpEcHiDe

I think, need a database if this needs to be implemented.

No, it’s not needed, you can use some algorithms

skrtdev avatar Dec 27 '20 12:12 skrtdev

Wait, it’s not possibile with an algorithm without using a db. Sorry I was wrong.

I’m thinking about it, let’s see if I find something

skrtdev avatar Dec 27 '20 13:12 skrtdev

it is not impossible, ideally you can use any algorithm which supports 2 way hashing (and returns a hash less than 64 characters), but I think not using a DB is over-engineering the problem..😅

SpEcHiDe avatar Dec 27 '20 13:12 SpEcHiDe

Yeah but:

  1. 2 way hashing is useless: everyone can access any file
  2. In order to use DB on heroku you have to use Heroku’s own DB, and this prevent the bot to be hosted in other places

Also, if we’ll use a 2 way hashing, I’d like to use my own base26 encoding, that encodes every int in a string composed by only a-z lowercase letters

skrtdev avatar Dec 27 '20 13:12 skrtdev

  1. I think we can override DATABASE_URL but I am not sure about it.

SpEcHiDe avatar Dec 27 '20 13:12 SpEcHiDe

Adding the DataBase to bot is useful to many users.It will be fast enough.

Brooklyn888 avatar May 18 '22 11:05 Brooklyn888