File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,17 +81,23 @@ const (
8181)
8282
8383func New (cfg * bridge.Config ) bridge.Bridger {
84- // Print a deprecation warning for legacy non-bot tokens (#527).
8584 token := cfg .GetString (tokenConfig )
85+ appToken := cfg .GetString (appTokenConfig )
86+ if appToken != "" && ! strings .HasPrefix (appToken , "xapp-" ) {
87+ cfg .Log .Error ("App token missing `xapp-` prefix" )
88+ }
89+ // Print a deprecation warning for legacy non-bot tokens (#527).
8690 if token != "" && ! strings .HasPrefix (token , "xoxb" ) {
8791 cfg .Log .Warn ("Non-bot token detected. It is STRONGLY recommended to use a proper bot-token instead." )
8892 cfg .Log .Warn ("Legacy tokens may be deprecated by Slack at short notice. See the Matterbridge GitHub wiki for a migration guide." )
8993 cfg .Log .Warn ("See https://github.com/42wim/matterbridge/wiki/Slack-bot-setup" )
9094 return NewLegacy (cfg )
9195 }
92- appToken := cfg .GetString (appTokenConfig )
93- if appToken != "" && ! strings .HasPrefix (appToken , "xapp-" ) {
94- cfg .Log .Error ("App token missing `xapp-` prefix" )
96+ // print warning for RTM + classic slack apps setup
97+ if strings .HasPrefix (token , "xoxb-" ) && appToken == "" {
98+ cfg .Log .Warn ("Bot token with classic Slack apps setup detected." )
99+ cfg .Log .Warn ("It is recommended to use modern Slack apps with socket mode Events API instead." )
100+ cfg .Log .Warn ("See https://github.com/matterbridge-org/matterbridge/blob/master/docs/protocols/slack/account.md" )
95101 }
96102 return newBridge (cfg )
97103}
You can’t perform that action at this time.
0 commit comments