codebydante commited on
Commit
75bcc1b
·
verified ·
1 Parent(s): 4eb6b53

Upload 113 files

Browse files
Files changed (1) hide show
  1. internal/bot/workers.go +6 -1
internal/bot/workers.go CHANGED
@@ -138,7 +138,12 @@ func (w *BotWorkers) Add(token string) (err error) {
138
  _, err = mainBot.API().ChannelsEditAdmin(ctx, &tg.ChannelsEditAdminRequest{
139
  Channel: channel,
140
  UserID: targetUser,
141
- AdminRights: tg.ChatAdminRights{},
 
 
 
 
 
142
  Rank: "Worker Bot",
143
  })
144
 
 
138
  _, err = mainBot.API().ChannelsEditAdmin(ctx, &tg.ChannelsEditAdminRequest{
139
  Channel: channel,
140
  UserID: targetUser,
141
+ AdminRights: tg.ChatAdminRights{
142
+ // ¡REQUISITO DE TELEGRAM!: Para añadir un bot a un canal, DEBE tener al menos un permiso de administrador en "true".
143
+ // Si todos son "false", Telegram asume que intentas añadirlo como miembro normal (lo cual está prohibido para bots),
144
+ // y arroja el error CHAT_ADMIN_REQUIRED. Le daremos el permiso inofensivo de invitar usuarios.
145
+ InviteUsers: true,
146
+ },
147
  Rank: "Worker Bot",
148
  })
149