Coder Social home page Coder Social logo

Comments (11)

levlam avatar levlam commented on June 28, 2024 1

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.

levlam avatar levlam commented on June 28, 2024 1

It is up to specific app when it shows or not the input field.

from td.

rufatagayev avatar rufatagayev commented on June 28, 2024

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.

rufatagayev avatar rufatagayev commented on June 28, 2024

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.

levlam avatar levlam commented on June 28, 2024

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.

rufatagayev avatar rufatagayev commented on June 28, 2024

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.

levlam avatar levlam commented on June 28, 2024

tdlibchat isn't a channel. It is a regular supergroup.

from td.

rufatagayev avatar rufatagayev commented on June 28, 2024

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.

levlam avatar levlam commented on June 28, 2024

This isn't possible. For the tdlibchat type.isChannel is always false.

from td.

levlam avatar levlam commented on June 28, 2024

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.

rufatagayev avatar rufatagayev commented on June 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.