-
Notifications
You must be signed in to change notification settings - Fork 2
/
TelegramServiceLeech.cs
160 lines (140 loc) · 6.19 KB
/
TelegramServiceLeech.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
using Leecher.Scripts;
using Leecher.Scripts.Films;
using Leecher.Scripts.Uploaders;
using MSC;
using MSC_Leecher.Scripts;
using NetTelegramBotApi;
using NetTelegramBotApi.Requests;
using NetTelegramBotApi.Types;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Leecher
{
public class TelegramServiceLeech
{
public string Token;
public MSC.Logger log = new MSC.Logger();
public bool stat;
public async void Run()
{
var MainMenu = new ReplyKeyboardMarkup();
MainMenu.Keyboard = new KeyboardButton[][]
{
new KeyboardButton[]
{
new KeyboardButton("About Us👍"),
},
new KeyboardButton[]
{
new KeyboardButton("Supported Site for leeching?")
}
};
TelegramBot Bot = null;
try {
Bot = new TelegramBot(Token);
await Bot.MakeRequestAsync(new GetMe());
log.AddMessage(string.Format("Bot connected."), Log.Type.OutPut);
}
catch { log.AddMessage("Can't connect the bot!", Log.Type.Error); return; }
long Offset = 0;
while (stat)
{
var Update = await Bot.MakeRequestAsync(new GetUpdates() { Offset = Offset });
foreach (var Up in Update)
{
try
{
List<Item> items = new List<Item>();
Offset = Up.UpdateId + 1;
var Message = Up.Message.Text;
string neh = "";
if (Message != "")
{
log.AddMessage(string.Format("Telegram Service: Text: {0} Username: {1} ChatID: {2}", Message, Up.Message.From.Username, Up.Message.From.Id), MSC.Log.Type.Infomation);
if (Message == "About Us👍")
{
neh += @"
💢Bot By : Rextor
💢MSC By : Rextor
💢Scryipts By : Rextor && Reza-HNA
💢Account By : SkyFall
➖➖➖➖➖➖➖➖➖➖
Powered By MSC | @VIPLeechBot";
var msg = new SendMessage(Up.Message.Chat.Id, neh) { ReplyMarkup = MainMenu };
await Bot.MakeRequestAsync(msg);
}
if (Message == "/start")
{
neh = @"♨️با سلام خدمت کاربر گرامی
به ربات وی ای پی لیچر (VIP Leecher) خوش امدید
با استفاده از این ربات میتوانید از سایت های زیر بدون محدودیت دانلود کنید با سرعت زیاد 😃";
neh += @"
➖➖➖➖➖➖➖➖➖➖
Powered By MSC | @VIPLeechBot";
var msg = new SendMessage(Up.Message.Chat.Id, neh) { ReplyMarkup = MainMenu };
await Bot.MakeRequestAsync(msg);
}
if (Message == "Supported Site for leeching?")
{
SiteDetecter.TypeSite[] list = Enum.GetValues(typeof(SiteDetecter.TypeSite)).Cast<SiteDetecter.TypeSite>().ToArray();
Array.Sort<SiteDetecter.TypeSite>(list);
List<string> lfw = new List<string>();
foreach (SiteDetecter.TypeSite item in list)
lfw.Add(item.ToString());
ArrayList q = new ArrayList();
foreach (object o in lfw)
q.Add(o);
q.Sort();
lfw.Clear();
foreach (object o in q)
lfw.Add(o.ToString());
neh += @"💢Supported Site for leeching :
";
foreach (string gw in lfw)
neh += @"
💢" + gw;
neh += @"
➖➖➖➖➖➖➖➖➖➖
Powered By MSC | @VIPLeechBot";
var msg = new SendMessage(Up.Message.Chat.Id, neh) { ReplyMarkup = MainMenu };
await Bot.MakeRequestAsync(msg);
}
else
{
Leecher.Scripts.SiteDetecter.TypeSite typesite = Scripts.SiteDetecter.GetTypeSite(Message);
neh = typesite.ToString() + @" Detected!
Please wait...";
var msg = new SendMessage(Up.Message.Chat.Id, neh) { ReplyMarkup = MainMenu };
await Bot.MakeRequestAsync(msg);
string url = Message;
items = Core.GetList(url, "", typesite);
neh = @"🚀Links:
";
foreach (Item i in items)
{
neh += @"
➖➖➖➖➖➖➖➖➖➖
📌" + i.Info + @"
📂" + i.Link;
}
neh += @"
➖➖➖➖➖➖➖➖➖➖
Powered By MSC | @VIPLeechBot";
if (items.Count != 0)
{
var msg1 = new SendMessage(Up.Message.Chat.Id, neh) { ReplyMarkup = MainMenu };
await Bot.MakeRequestAsync(msg1);
}
}
}
}
catch(Exception ex) { log.AddMessage(ex.Message, Log.Type.Error); }
}
}
}
}
}