change chanel creating to sopergroup and promoute user to adminn by command

This commit is contained in:
pasha1coil 2024-07-10 11:28:22 +03:00
parent fa24ff4de6
commit ee75ef86f5
2 changed files with 4 additions and 3 deletions

@ -180,7 +180,8 @@ func (tg *TelegramClient) CreateChannel(channelName string, botID int64) (string
// исполнение клиента текущего аккаунта и дать задачу следующему пока поймал 1 раз и не запомнил больше не получается
channel, err := activeClient.CreateNewSupergroupChat(&client.CreateNewSupergroupChatRequest{
Title: channelName,
IsChannel: true,
IsForum: true,
//IsChannel: true,
Description: "private channel",
})
if err != nil {

@ -28,7 +28,7 @@ func NewTelegramBotWorker(botToken string) (*TelegramBotWorker, error) {
// todo в канал писать нельзя надо что то придумать
func (w *TelegramBotWorker) Run() {
w.bot.Handle(telebot.OnChannelPost, func(m *telebot.Message) {
w.bot.Handle(telebot.OnText, func(m *telebot.Message) {
if m.Text == "/admin" {
fmt.Println(m.Sender.ID)
adminRights := telebot.ChatMember{