File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package cli
33import (
44 "github.com/spf13/cobra"
55
6+ a "github.com/anish749/pigeon/internal/account"
67 "github.com/anish749/pigeon/internal/commands"
78)
89
@@ -67,6 +68,9 @@ func runDeleteSlack(cmd *cobra.Command, args []string) error {
6768 if err != nil {
6869 return err
6970 }
71+ if err := validateAccountInScope (a .New ("slack" , account )); err != nil {
72+ return err
73+ }
7074 return commands .RunDelete (commands.DeleteParams {
7175 Platform : "slack" ,
7276 Account : account ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package cli
33import (
44 "github.com/spf13/cobra"
55
6+ a "github.com/anish749/pigeon/internal/account"
67 "github.com/anish749/pigeon/internal/commands"
78)
89
@@ -100,6 +101,9 @@ func runReactSlack(cmd *cobra.Command, args []string) error {
100101 if err != nil {
101102 return err
102103 }
104+ if err := validateAccountInScope (a .New ("slack" , account )); err != nil {
105+ return err
106+ }
103107 return commands .RunReact (commands.ReactParams {
104108 Platform : "slack" ,
105109 Account : account ,
@@ -132,6 +136,9 @@ func runReactWhatsapp(cmd *cobra.Command, args []string) error {
132136 if err != nil {
133137 return err
134138 }
139+ if err := validateAccountInScope (a .New ("whatsapp" , account )); err != nil {
140+ return err
141+ }
135142 return commands .RunReact (commands.ReactParams {
136143 Platform : "whatsapp" ,
137144 Account : account ,
Original file line number Diff line number Diff line change 77
88 "github.com/spf13/cobra"
99
10+ a "github.com/anish749/pigeon/internal/account"
1011 "github.com/anish749/pigeon/internal/commands"
1112 "github.com/anish749/pigeon/internal/store/modelv1"
1213)
@@ -133,6 +134,10 @@ func runSendSlack(cmd *cobra.Command, args []string) error {
133134 return err
134135 }
135136
137+ if err := validateAccountInScope (a .New ("slack" , account )); err != nil {
138+ return err
139+ }
140+
136141 if postAt != "" {
137142 ts , err := parsePostAt (postAt )
138143 if err != nil {
@@ -174,6 +179,10 @@ func runSendWhatsapp(cmd *cobra.Command, args []string) error {
174179 return err
175180 }
176181
182+ if err := validateAccountInScope (a .New ("whatsapp" , account )); err != nil {
183+ return err
184+ }
185+
177186 return commands .RunSend (commands.SendParams {
178187 Platform : "whatsapp" ,
179188 Account : account ,
You can’t perform that action at this time.
0 commit comments