Skip to content

Commit

Permalink
fetch correct index value, fixes : `index out of range [2] with lengt…
Browse files Browse the repository at this point in the history
…h 2`
  • Loading branch information
TAMILVIP007 authored Nov 21, 2024
1 parent 44b1d03 commit a2872a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion telegram/channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c *Client) JoinChannel(Channel any) error {
switch p := Channel.(type) {
case string:
if TG_JOIN_RE.MatchString(p) {
_, err := c.MessagesImportChatInvite(TG_JOIN_RE.FindStringSubmatch(p)[2])
_, err := c.MessagesImportChatInvite(TG_JOIN_RE.FindStringSubmatch(p)[1])
if err != nil {
return err
}
Expand Down

0 comments on commit a2872a9

Please sign in to comment.