@@ -65,7 +65,7 @@ func fnAccept(ce *commands.Event) {
6565 ce .Reply ("Login not found" )
6666 } else if ! login .Client .IsLoggedIn () {
6767 ce .Reply ("Not logged in" )
68- } else if err = login .Client .(* WhatsAppClient ).Client .JoinGroupWithInvite (meta .JID , meta .Inviter , meta .Code , meta .Expiration ); err != nil {
68+ } else if err = login .Client .(* WhatsAppClient ).Client .JoinGroupWithInvite (ce . Ctx , meta .JID , meta .Inviter , meta .Code , meta .Expiration ); err != nil {
6969 ce .Log .Err (err ).Msg ("Failed to accept group invite" )
7070 ce .Reply ("Failed to accept group invite: %v" , err )
7171 } else {
@@ -189,7 +189,7 @@ func fnInviteLink(ce *commands.Event) {
189189 ce .Reply ("Can't get invite link to private chat" )
190190 } else if portalJID .IsBroadcastList () {
191191 ce .Reply ("Can't get invite link to broadcast list" )
192- } else if link , err := wa .Client .GetGroupInviteLink (portalJID , reset ); err != nil {
192+ } else if link , err := wa .Client .GetGroupInviteLink (ce . Ctx , portalJID , reset ); err != nil {
193193 ce .Reply ("Failed to get invite link: %v" , err )
194194 } else {
195195 ce .Reply (link )
@@ -219,14 +219,14 @@ func fnResolveLink(ce *commands.Event) {
219219 }
220220 wa := login .Client .(* WhatsAppClient )
221221 if strings .HasPrefix (ce .Args [0 ], whatsmeow .InviteLinkPrefix ) {
222- group , err := wa .Client .GetGroupInfoFromLink (ce .Args [0 ])
222+ group , err := wa .Client .GetGroupInfoFromLink (ce .Ctx , ce . Args [0 ])
223223 if err != nil {
224224 ce .Reply ("Failed to get group info: %v" , err )
225225 return
226226 }
227227 ce .Reply ("That invite link points at %s (`%s`)" , group .Name , group .JID )
228228 } else if strings .HasPrefix (ce .Args [0 ], whatsmeow .BusinessMessageLinkPrefix ) || strings .HasPrefix (ce .Args [0 ], whatsmeow .BusinessMessageLinkDirectPrefix ) {
229- target , err := wa .Client .ResolveBusinessMessageLink (ce .Args [0 ])
229+ target , err := wa .Client .ResolveBusinessMessageLink (ce .Ctx , ce . Args [0 ])
230230 if err != nil {
231231 ce .Reply ("Failed to get business info: %v" , err )
232232 return
@@ -241,7 +241,7 @@ func fnResolveLink(ce *commands.Event) {
241241 }
242242 ce .Reply ("That link points at %s (+%s).%s" , target .PushName , target .JID .User , message )
243243 } else if strings .HasPrefix (ce .Args [0 ], whatsmeow .ContactQRLinkPrefix ) || strings .HasPrefix (ce .Args [0 ], whatsmeow .ContactQRLinkDirectPrefix ) {
244- target , err := wa .Client .ResolveContactQRLink (ce .Args [0 ])
244+ target , err := wa .Client .ResolveContactQRLink (ce .Ctx , ce . Args [0 ])
245245 if err != nil {
246246 ce .Reply ("Failed to get contact info: %v" , err )
247247 return
@@ -280,20 +280,20 @@ func fnJoin(ce *commands.Event) {
280280 wa := login .Client .(* WhatsAppClient )
281281
282282 if strings .HasPrefix (ce .Args [0 ], whatsmeow .InviteLinkPrefix ) {
283- jid , err := wa .Client .JoinGroupWithLink (ce .Args [0 ])
283+ jid , err := wa .Client .JoinGroupWithLink (ce .Ctx , ce . Args [0 ])
284284 if err != nil {
285285 ce .Reply ("Failed to join group: %v" , err )
286286 return
287287 }
288288 ce .Log .Debug ().Stringer ("group_jid" , jid ).Msg ("User successfully joined WhatsApp group with link" )
289289 ce .Reply ("Successfully joined group `%s`, the portal should be created momentarily" , jid )
290290 } else if strings .HasPrefix (ce .Args [0 ], whatsmeow .NewsletterLinkPrefix ) {
291- info , err := wa .Client .GetNewsletterInfoWithInvite (ce .Args [0 ])
291+ info , err := wa .Client .GetNewsletterInfoWithInvite (ce .Ctx , ce . Args [0 ])
292292 if err != nil {
293293 ce .Reply ("Failed to get channel info: %v" , err )
294294 return
295295 }
296- err = wa .Client .FollowNewsletter (info .ID )
296+ err = wa .Client .FollowNewsletter (ce . Ctx , info .ID )
297297 if err != nil {
298298 ce .Reply ("Failed to follow channel: %v" , err )
299299 return
0 commit comments