Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot replys to user no problem, but when i want it to send announchment to channel or group. nothing happens #1194

Open
BjarniLeifs opened this issue Apr 23, 2024 · 0 comments

Comments

@BjarniLeifs
Copy link

I have a code, that if i interact with the bot, it will answer, no problem.
Now, What i am currently trying to do is to send message to the channels the bot is on, without interact with him.

        switch (extension) {
            case 'gif':
                if (mediaStream) await bot.sendAnimation(chatId, mediaStream, options as SendAnimationOptions);
                break;
            case 'mp4':
                if (mediaStream) await bot.sendVideo(chatId, mediaStream, options as SendVideoOptions);
                break;
            case 'jpg':
            case 'png':
                if (mediaStream) await bot.sendPhoto(chatId, mediaStream, options as SendPhotoOptions);
                break;
            case 'normalpost':
                await bot.sendMessage(chatId, captionWithCount, options as SendMessageOptions);
                break;
            default:
                console.error('Unsupported media type or no media provided');
                return;
        }

This usecase sends message to a user when user say something like example "hi" it interacts with some case of message that is finally sent with this.

However when I use a botton that say "announchment to channel" with image for example. it does not send to that channel
I have database that is holding on to my channels they are with it -100**** and he just does not send the post to it.

Can anyone help me out here?
Is there something different between user and groups?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant