Skip to content

Commit

Permalink
Merge pull request #167 from TAMILVIP007/patch-6
Browse files Browse the repository at this point in the history
fetch correct index value, fixes : index out of range [2] with length 2
  • Loading branch information
AmarnathCJD authored Nov 21, 2024
2 parents 44b1d03 + a2872a9 commit 3acc088
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 3acc088

Please sign in to comment.