Comments (12)
the step by step description helps me a lot, to understand the procedure.
from defrag-api.
I'm not sure wether you understood correctly what I was trying to say on Telegram. The goal is not exactly writing a module for the Bot, but to write a framework that can be implemented by bots, e.g. karatekbot. So my thought would be that you write a module for defrag / the API that generates a captcha image and the possibility to validate the users input regarding that image.
from defrag-api.
ok, then i did not understand correctly. Thanks for explaining again.
from defrag-api.
Just to get it right: with the API that generates the captcha image, we validate also if the user is no bot?
from defrag-api.
but our bots in this framework communicate with the users
from defrag-api.
Just to get it right: with the API that generates the captcha image, we validate also if the user is no bot?
Your question is: "If a bot joins a chat, what should the captcha-bot do"?
Jens is the expert on bots, so he should tell you. But if this is your question, I think the logic goes like this:
- if the entity is not a bot, start the captcha authentication flow; if failed, ban
- if the entity is a bot, check if the bot's id belongs to any any of the openSUSE's bots; if not, ban
In other words, you end up banning every entity that is either an unknown bot or a user who failed the captcha.
By the way there are 2 parts in this feature:
- Generate a random captcha image.
- Send the captcha, listen for the reply, and ban if failed.
(2) heavily depends on your knowledge of Matrix and Telegram's API (for the latter see: https://core.telegram.org/bots/api). (1) on the other hand can be done without any knowledge of these APIs.
from defrag-api.
yes, i found the page: https://core.telegram.org/bots/api.
thanks!
from defrag-api.
i have not deep knowledge of Matrix and Telegram API, so i'll find a way.
from defrag-api.
i have not deep knowledge of Matrix and Telegram API, so i'll find a way.
Then you can start with (1) :D
from defrag-api.
So, let me make clear how I think is the best way for this to work.
- User joins a chat
- [bot] The bot of the platform the user is on reacts, maybe checks of it already knows the user from another chat and if not, proceeds
- [bot] sends request to the defrag API and asks for a captcha
- [API] generates a captcha image, together with an ID, and stores the solution for the captcha together with the ID. Returns ID and image to the bot.
- [bot] sends the captcha image to the group. Keeps the message ID of the image associated with the captcha ID in memory.
- [user] Sends solutions to the captcha. If not, [bot] bans user.
- [bot] sends input to defrag, together with captcha ID
- [API] validates input based on the stored solution associated with the captcha ID
- [API] returns a boolean that includes wether the user completed the captcha correctly
- [bot] If the boolean from 9. is true, delete the captcha image and allow the user to send messages, if it is false ban the user
So defrag must only implement what is done by the API, so everything that starts with [API]. The bot side of things can then be implemented by the bot developers, probably me, as I am planning to rewrite my bot to benefit from this API.
I hope this makes clear how I think it should be done. If you think another way is better, please tell me.
from defrag-api.
@MehmetKay-sudo For generating captcha images, you can look at the (uncompleted) work I did on my telegram bot. Check the send_captcha()
function in https://github.com/KaratekHD/Nemesis/blob/master/tg_bot/modules/welcome.py
It's not a good implementation, but should give you an idea how the captcha
library works.
from defrag-api.
from defrag-api.
Related Issues (20)
- Feature: Search the wiki HOT 1
- Comment and add tests for all functions HOT 1
- Feature: Package search HOT 1
- async/sync: offloading entire function call trees to starlette-managed threads (fully sync) VS thin sync-to-async wrappers (fully async) HOT 3
- Profiling: some tools HOT 3
- Feature: Caching HOT 1
- Replace logger with aiologger HOT 5
- querying information about a bug gives internal server error HOT 2
- Tests HOT 1
- Add a code formatter like `black` HOT 6
- Review of the data flow in view of a sound authentication / authorization scheme
- Restructuring top-level main & init HOT 1
- Repository permissions HOT 2
- Python Dependency Manager: Pipenv? HOT 2
- Unit test coverage...
- Python 3.10
- telegram feature /bugs for searching openSUSE bugzilla
- Type annotations and formatter HOT 6
- Other platforms than Telegram? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from defrag-api.