Comments (11)
In channels only their administrators can ever write messages. Broadcast groups aren't channels. They are special types of supergroups, which can have more than 200000 members, but can't change chatPermissions
to allow ordinary members to write messages. If chat permissions can be changed in the group, then it isn't a broadcast group. You need to checK chat permissions to see what types of messages non-administrator users can send to the chat currently.
from td.
It is up to specific app when it shows or not the input field.
from td.
I also check for chat.permissions.canSendBasicMessages
, but some groups still come through where users can send basic text messages. How do I get only those chats where there is no input field at the bottom in telegram for normal users?
from td.
So as I understand only (chat.type as TdApi.ChatTypeSupergroup).isChannel
should be the right way to check if only admins can post? If so, why do I still get some channels where users can freely send text messages? This is how I check for channels:
return this.type is TdApi.ChatTypeSupergroup &&
(this.type as TdApi.ChatTypeSupergroup).isChannel &&
this.permissions.canSendBasicMessages.not()
from td.
No. Channels and supergroups are very different and have a lot of other differencies. Ordinary users can never post to channels or broadcast groups, but the ability to send messages can be also disabled in regular supergroups via chat permissions.
from td.
Ok, I'll try to clarify what I mean: I filter for channels using .isChannel
. But I also get one or two groups such as t.me/tdlibchat. In Telegram app, t.me/tdlibchat appears under groups.
from td.
tdlibchat
isn't a channel. It is a regular supergroup.
from td.
Exactly. It is a regular supergroup, but its messages show up in my results even when I filter chats for (this.type as TdApi.ChatTypeSupergroup).isChannel
. I can't understand why. By the way, this happens when I first open the app. If I close and reopen, these messages do not show up. It seems to be something related to offline / cache. But I can't figure it out.
from td.
This isn't possible. For the tdlibchat
type.isChannel is always false.
from td.
You can enable TDLib logs with verbosity level 5 and check there that isChannel == false
. You can also share the log with https://t.me/tdlib_bot.
from td.
These non-channel messages have stopped appearing now. I also added a check for each TdApi.Message to see if message.isChannelPost is true and I think it worked. Closing the issue. Thank you for help!
from td.
Related Issues (20)
- A question about receiving messages HOT 2
- How many times can the login code be incorrect HOT 3
- Linux is not an operating system, Linux is kernel. HOT 3
- فهد السواط
- chatMemberStatusAdministrator not work HOT 2
- Error while trying to create a chat by `createNewSupergroupChat` HOT 1
- Website support does not respond HOT 4
- updateNewMessage returns message.id which is not unique for the chat it belongs HOT 2
- Tdlib not working on android 14. (Flutter) HOT 5
- Program Bug Bounty
- Th
- Build tdlib on Windows: cannot open include file: 'td/mtproto/mtproto_api.h': No such file or directory HOT 3
- tdlib Java example on Windows: fatal error on the latest build (f013f47) HOT 16
- "Request is empty" Error When running the Java TDLib Application HOT 5
- Firebase cloud messages current protocol will be removed this month HOT 2
- Use of deleted function when casting update_new_message to messagePhoto(trying to get caption) HOT 3
- How to destroy an object created by td_create_client_id HOT 1
- Application goes down with error: database disk image is malformed for database HOT 1
- Tonkif
- Account getting banned after successful login using phone code or qr code HOT 6
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 td.