Commit graph

53 commits

Author SHA1 Message Date
dc3edf3105
Pretty print everything
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2024-01-10 21:29:32 +05:30
42a85588fe
Adapt for new tg api changes
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2024-01-10 21:26:23 +05:30
664cdd591c
Update dependencies
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2024-01-10 12:26:48 +05:30
6f29a8c077
Disable web page previews for inline
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2023-11-12 11:25:34 +05:30
11742447a4
Fixup b7fb137def
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2023-06-04 15:29:26 +05:30
9d1c116643
Update copyright for 2023
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2023-05-25 11:24:12 +05:30
b7fb137def
Fix deeplinks on ios
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2023-05-25 11:23:51 +05:30
478e89b140
Raise connection pool for db
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2023-01-05 14:31:30 +05:30
20f397135b
REFACTOR: Use connection pooling
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-11-12 13:35:24 +05:30
4b55b1575c
Use proper fields for sendPhoto and sendDocument
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-11-12 13:05:32 +05:30
33894b0501
Dont make db calls if the inline query is null
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-08-22 14:04:48 +05:30
78964cdd45
Allow admins to forego ratelimits
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-05-08 21:46:46 +05:30
3939ad5069
Use NSFW instead of Censored in output
We should be clear to tell users that the media is nsfw and its fully at their own risk

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-23 18:38:51 +05:30
26aaa13f60
Fix start command
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 20:24:20 +05:30
1953d6f2cf
Dont send ftype on album
Album can contain heterogeneous types

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 20:20:59 +05:30
82083fedf7
Split strings for readability
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 20:17:40 +05:30
31ae8e1c1f
Make imports much cleaner
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 20:05:10 +05:30
010c834aac
Source code command to make the user clear on the bot source
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 20:03:44 +05:30
af6d4d68ab
Capitalize on inline
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 19:56:01 +05:30
d939f6942e
Drop unused import
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 19:43:43 +05:30
512cb26cba
Process inline queries for sharing
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 19:42:35 +05:30
bb22849959
Dont handle non-message updates
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 19:41:58 +05:30
5eac4c95d5
Move the response to switchinline
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-17 15:01:08 +05:30
ed158f0a47
Poll when webhook domain is missing
Hooks is not very easy to setup, so lets fallback to polling if the hook domain is not defined

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 18:15:59 +05:30
9c9a7f71f3
Dont allow older versions for norm and telebot
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 16:10:24 +05:30
3e5c1b415f
Enable webhooks on bot
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 15:45:01 +05:30
b90725d35b
Add an unban handler, helps unban mistakely auto-banned users
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 15:24:22 +05:30
11cbdcaced
Decouple the commands into independent handlers
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 15:08:42 +05:30
5efcf196f5
Silence all logs
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 12:49:45 +05:30
278a256d64
Add some comments
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 11:45:19 +05:30
a8bde2f198
License under AGPL
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 11:36:32 +05:30
eb7f3b76c6
Beautify the message sent
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 11:30:18 +05:30
e8efd87f71
Modify the functions to reflect the change in schema
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 09:50:07 +05:30
2dea576b58
Add a handler to cleanup old data
Also realign functions

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 09:44:57 +05:30
a87f37f689
Use Env variables for database
This will enable us to use postgres/sqlite without any code changes

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 09:36:04 +05:30
869820bc19
Add support for albums
This was hard

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-11 08:26:59 +05:30
b27f910362
Lock admin actions behind a env variable
ADMIN_ID is comma-separated values of the user-ids of admins who will have access to /ban

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-10 23:30:15 +05:30
5bf33a49ea
Introduce Rate-Limiting
Ratelimits a user for 30mins if they send more than 20 requests in a minute, also a schema change

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-10 23:24:48 +05:30
ba91151766
Add a check for non-existent hash
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 23:18:48 +05:30
9c41348338
Implement banning unwanted users
People might use this bot on very gore/spam this repeatedly, we can block off them

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 23:15:02 +05:30
d1bbc59e27
Handle stickers as well
Also move the deeplinks to elif

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 22:50:21 +05:30
5dc6903291
Handle deeplinks and respond from database
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 22:47:07 +05:30
5be6fb18ba
Use elif blocks instead of falling through each if
It cannot be a video and photo at the same time

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 22:26:19 +05:30
6c0db09773
Move the censoring logic to else clause
We dont ideally need this check when there is just plaintext

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 22:25:11 +05:30
2f859b5735
Perform a nice cleanup of the mess
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 22:10:27 +05:30
63e08ca1c6
Prepare for code cleanup and deeplink
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 21:11:01 +05:30
b92cce96b5
Use PascalCase instead of SNAKE_CASE
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 20:49:18 +05:30
373d3da86f
Use token from env
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 20:17:19 +05:30
c3268476bd
Insert the hash as well to db
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 20:00:05 +05:30
298431fe38
Insert data flowing into the db
* File hash is still broken, we will do it now

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2022-04-09 19:56:23 +05:30