@@ -58,7 +58,7 @@ func Start() {
5858 newOffset , err := onEvent (chat , board , threadID , offset )
5959 if err != nil {
6060 go onAlertAdministrators (chat ,
61- "An error has occured. Subscription suspended.\n Chat: %s\n Thread: %s\n Error: %s" ,
61+ "#info \n An error has occured. Subscription suspended.\n Chat: %s\n Thread: %s\n Error: %s" ,
6262 chat .Key (), dv .FormatThreadURL (board , threadID ), err .Error ())
6363
6464 return 0 , err
@@ -95,15 +95,37 @@ func Subscribe(chat telegram.ChatRef, board string, threadID string) {
9595 err := sub .newActiveThread (board , threadID )
9696 if err != nil {
9797 go onAlertAdministrators (chat ,
98- "Subscription failed.\n Chat: %s\n Thread: %s\n Error: %s" ,
98+ "#info \n Subscription failed.\n Chat: %s\n Thread: %s\n Error: %s" ,
9999 chat .Key (), dv .FormatThreadURL (board , threadID ), err .Error ())
100100
101101 return
102102 }
103103
104- go onAlertAdministrators (chat ,
105- "Subscription OK.\n Chat: %s\n Thread: %s" ,
106- chat .Key (), dv .FormatThreadURL (board , threadID ))
104+ go func () {
105+ onAlertAdministrators (chat ,
106+ "#info\n Subscription OK.\n Chat: %s\n Thread: %s" ,
107+ chat .Key (), dv .FormatThreadURL (board , threadID ))
108+
109+ preview , err := _runtime .dvach .GetPost (board , threadID )
110+ if err != nil {
111+ return
112+ }
113+
114+ threadURL := dv .FormatThreadURL (board , threadID )
115+ text := ""
116+ if len (preview ) > 0 {
117+ text = fmt .Sprintf (
118+ "#thread %s %s" ,
119+ preview [0 ].Subject , threadURL )
120+ } else {
121+ text = fmt .Sprintf ("#thread %s" , threadURL )
122+ }
123+
124+ _runtime .bot .SendMessage (telegram.SendMessageRequest {
125+ Chat : chat ,
126+ Text : text ,
127+ }, nil , true )
128+ }()
107129}
108130
109131// Unsubscribe chat from all threads
0 commit comments