File tree 5 files changed +113
-36
lines changed
5 files changed +113
-36
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ private static void Main(string[] args)
25
25
CultureInfo . CurrentCulture = ci ;
26
26
CultureInfo . CurrentUICulture = ci ;
27
27
28
+ Data . ChannelPosts . LoadPostsData ( ) ;
29
+ Data . SorteioParticipantes . LoadParticipantesData ( ) ;
30
+ Data . MessagesToDelete . timerMessageToDeletesData . Elapsed += Data . MessagesToDelete . TimerMessageToDeletesData_Elapsed ;
31
+ Data . MessagesToDelete . LoadMessageToDeletesData ( ) ;
32
+ Data . MessagesToDelete . timerMessageToDeletesData . Start ( ) ;
33
+
34
+ Thread . Sleep ( 1000 ) ;
35
+
28
36
User me = botClient . GetMeAsync ( ) . Result ;
29
37
30
38
using var cts = new CancellationTokenSource ( ) ;
@@ -38,12 +46,6 @@ private static void Main(string[] args)
38
46
39
47
Console . WriteLine ( $ "Telegram Bot start listening for @{ me . Username } ") ;
40
48
41
- Data . ChannelPosts . LoadPostsData ( ) ;
42
- Data . SorteioParticipantes . LoadParticipantesData ( ) ;
43
- Data . MessagesToDelete . timerMessageToDeletesData . Elapsed += Data . MessagesToDelete . TimerMessageToDeletesData_Elapsed ;
44
- Data . MessagesToDelete . LoadMessageToDeletesData ( ) ;
45
- Data . MessagesToDelete . timerMessageToDeletesData . Start ( ) ;
46
-
47
49
while ( true )
48
50
{
49
51
Console . ReadKey ( ) ;
Original file line number Diff line number Diff line change @@ -5,10 +5,12 @@ namespace CypherBot
5
5
{
6
6
internal class Props
7
7
{
8
- public static string telegramToken { get ; set ; } = "telegram_bot_token " ;
8
+ public static string telegramToken { get ; } = "1410185496:AAEm7sjfJnIn_GUOhRc1p1m5nZfQOUgat_8 " ;
9
9
public static Int64 postChannelChatId { get ; } = - 1001399462961 ;
10
+ public static Int64 postChannelPeneiraChatId { get ; } = - 1001417096675 ;
10
11
public static string PostChannelInviteLink { get ; } = "https://t.me/CypherpunksBrasil" ;
11
- public static string OfftopicGroupInviteLink { get ; } = "https://t.me/+WromIg-zQmg4MDAx" ;
12
+ public static string OfftopicGroupInviteLink { get ; } = "https://t.me/+GMSf4a3JhZdlYmEx" ;
13
+ public static string GrupoPrincipalInviteLink { get ; } = "https://t.me/+Ti-3VBjgzwxkZmIx" ;
12
14
public static Int64 moderatorGroupChatId { get ; } = - 1001153829050 ;
13
15
public static Int64 grupoPrincipalChatId { get ; } = - 1001206367167 ;
14
16
public static string dataPostsPatch { get ; } = Directory . GetCurrentDirectory ( ) + @"/data/posts.json" ;
Original file line number Diff line number Diff line change @@ -11,15 +11,16 @@ internal class Messages
11
11
public static InlineKeyboardMarkup replyMarkupChannelRating ( Int64 chatID = 0 , int messageID = 0 )
12
12
{
13
13
string likeText = "👍" ;
14
- if ( Data . ChannelPosts . posts . ContainsKey ( chatID + ":" + messageID ) && ( Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostLikes . Count > 0 || Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostDislikes . Count > 0 ) ) { likeText += " " + Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostLikes . Count ; }
14
+ if ( Data . ChannelPosts . posts != null && Data . ChannelPosts . posts . ContainsKey ( chatID + ":" + messageID ) && ( Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostLikes . Count > 0 || Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostDislikes . Count > 0 ) ) { likeText += " " + Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostLikes . Count ; }
15
15
16
16
string dislikeText = "🚫" ;
17
- if ( Data . ChannelPosts . posts . ContainsKey ( chatID + ":" + messageID ) && ( Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostLikes . Count > 0 || Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostDislikes . Count > 0 ) ) { dislikeText += " " + Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostDislikes . Count ; }
17
+ if ( Data . ChannelPosts . posts != null && Data . ChannelPosts . posts . ContainsKey ( chatID + ":" + messageID ) && ( Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostLikes . Count > 0 || Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostDislikes . Count > 0 ) ) { dislikeText += " " + Data . ChannelPosts . posts [ chatID + ":" + messageID ] . PostDislikes . Count ; }
18
18
19
19
return new InlineKeyboardMarkup ( new [ ]
20
20
{
21
21
InlineKeyboardButton . WithCallbackData ( likeText , "ChannelPostLike" ) ,
22
- InlineKeyboardButton . WithCallbackData ( dislikeText , "ChannelPostDislike" )
22
+ InlineKeyboardButton . WithCallbackData ( dislikeText , "ChannelPostDislike" ) ,
23
+ InlineKeyboardButton . WithUrl ( "💬 comentários" , Props . GrupoPrincipalInviteLink )
23
24
} ) ;
24
25
}
25
26
}
You can’t perform that action at this time.
0 commit comments