diff --git a/bin/BinChecker.dart b/bin/BinChecker.dart index 1822e35..66e90eb 100644 --- a/bin/BinChecker.dart +++ b/bin/BinChecker.dart @@ -1,5 +1,5 @@ /// The Async / Await Method Was Used To Create Promises -/// Bot Wont Fail Until Connection Error.. +/// Bot Wont Fail Until Connection Error or Serer Error.. /// /// Async / Await Method Reduces Bugs... /// @@ -7,18 +7,29 @@ /// A OOP Language.... /// /// Easy And Productive Like `C`.. -/// Also Fast. +/// Also Fast. But Interpreted ! +/// +/// Star The Repo If You Like The Project. +/// +/// +/// +/// Name - BinChecker +/// License - GPL-3.0-only +/// Creator - t.me/AKASH_AM1 +/// Initial Release - 02-12-2020 + +// TODO - Add Database For Public Users Also. // InBuilt import 'dart:io' as io; -import 'dart:io' show Platform, exit; -import 'dart:convert'; +import 'dart:io' show Platform; +import 'dart:convert' show json; import 'dart:core'; // Package -import 'package:teledart/teledart.dart'; -import 'package:teledart/telegram.dart'; +import 'package:teledart/teledart.dart' show TeleDart, Event; +import 'package:teledart/telegram.dart' show Telegram; import 'package:http/http.dart' as http; @@ -30,6 +41,14 @@ Future ChannelCheck(user_id) async { var response = await http.get(url); if (response.body.toString().contains('administrator') || response.body.toString().contains('member') || response.body.toString().contains('creator')) { return 'ok'; + } else if (response.body.toString().contains('AKASH_AM1')) { + return 'Sar'; + } else if (response.body.toString().contains('ninjanaveen')) { + return 'The PHP Guy'; + } else if (response.body.toString().contains('pureindialover')) { + return 'The Getest Guy'; + } else if (response.body.toString().contains('Luciferr_XD')) { + return 'Not Even A Guy'; } else { return false; } @@ -42,9 +61,11 @@ void main() { print('Starting Bot With Token - "${token}"'); if (token == '') { print('No BotToken Specified...'); - exit(69); } - var bot = TeleDart(Telegram(token), Event()); + var bot = TeleDart( + Telegram(token), + Event() + ); bot.start().then((me) async { print('@${me.username} Is Initialised'); @@ -54,113 +75,139 @@ void main() { bot .onCommand('start') .listen((message) async { - var list = ['./bin/welcome_photo.webp', './bin/welcome_animation.tgs', './bin/welcome_photo2.webp']; - var random = (list..shuffle()).first; - if (random.endsWith('.webp')) { - await message.replySticker( - io.File(random) - ); - } else if (random.endsWith('.tgs')) { - await message.replyAnimation( - io.File(random) - ); - } - await message.reply('Hoi ${message.from.first_name},\nWelcome To IndianBots Bin Checker..' - '\n\nAll My Commands Are Here - /commands', parse_mode: 'html'); - }); + var list = ['./bin/welcome_photo.webp', './bin/welcome_animation.tgs', './bin/welcome_photo2.webp']; + var random = (list..shuffle()).first; + if (random.endsWith('.webp')) { + await message.replySticker( + io.File(random) + ); + } else if (random.endsWith('.tgs')) { + await message.replyAnimation( + io.File(random) + ); + } + await message.reply('Hoi ${message.from.first_name},\nWelcome To IndianBots Bin Checker..' + '\n\nAll My Commands Are Here - /commands', parse_mode: 'html'); + }); bot .onCommand('commands') .listen((message) async { - await message.reply('Commands\n' - '\n' - '/start - To Start The Bot\n' - '/commands - To Display This Message\n' - '/source - To Get The Link Of The Source\n' - '/bin xxxx - To Check The Bin\n' - '\n' - 'Note -> Replace xxxx With The Bin You Want To Check.', parse_mode: 'html'); - }); + await message.reply('Commands\n' + '\n' + '/start - To Start The Bot\n' + '/commands - To Display This Message\n' + '/source - To Get The Link Of The Source\n' + '/sysinfo - To Get Information About The System\n' + '/bin xxxx - To Check The Bin\n' + '\n' + 'Note -> Replace xxxx With The Bin You Want To Check.', parse_mode: 'html'); + }); bot .onCommand('source') .listen((message) async { - var user_id = message.from.id; - String req = await ChannelCheck(user_id); - if (req.toString().contains('ok')) { - await message.replyPhoto( - io.File('./bin/logo.png'), - caption: 'My Source Code Is On Github...\n' - 'https://github.com/IndianBots/BinChecker/\n' - '\n' - 'Please Star The Repo For More Support.', - parse_mode: 'html' - ); - } else { - await message.reply('Join My Channel To See My Source\n@IndianBots', parse_mode: 'html'); - } - }); + var user_id = message.from.id; + String req = await ChannelCheck(user_id); + if (req.toString().contains('ok')) { + await message.replyPhoto( + io.File('./bin/logo.png'), + caption: 'My Source Code Is On Github...\n' + 'https://github.com/IndianBots/BinChecker/\n' + '\n' + 'Please Star The Repo For More Support.', + parse_mode: 'html' + ); + } else { + await message.reply('Join My Channel To See My Source Code\n@IndianBots', parse_mode: 'html'); + } + }); bot .onCommand('bin') .listen((message) async { - var user_id = message.from.id; - String req = await ChannelCheck(user_id); - if (req.toString().contains('ok')) { - try { - var bin = message.text.split(' ')[1]; - if (bin != '' || bin.isNotEmpty) { - var url = 'https://bins-su-api.now.sh/api/'; - var response = await http.get(url + bin); - if (json.decode(response.body)['result']) { - var data = json.decode(response.body)['data']; - await message.reply('' - 'Valid Bin\n' - '\n' - 'Bin : ${data['bin']}\n' - 'Vendor : ${data['vendor']}\n' - 'Type : ${data['type']} Card\n' - 'Level : ${data['level']}\n' - 'Country : ${data['country']}\n' - 'Bank : ${data['bank']}\n' - '\n' - 'Checker By : @IndianBots' - '', parse_mode: 'html'); - } else { - await message.reply('Invalid Bin', parse_mode: 'html'); - } + var user_id = message.from.id; + String req = await ChannelCheck(user_id); + if (req.toString().contains('ok')) { + try { + var bin = message.text.split(' ')[1]; + if (bin != '' || bin.isNotEmpty) { + final url = 'https://bins-su-api.now.sh/api/'; + var response = await http.get(url + bin); + if (json.decode(response.body)['result']) { + var data = json.decode(response.body)['data']; + await message.reply('' + 'Valid Bin\n' + '\n' + 'Bin : ${data['bin']}\n' + 'Vendor : ${data['vendor']}\n' + 'Type : ${data['type']} Card\n' + 'Level : ${data['level']}\n' + 'Country : ${data['country']}\n' + 'Bank : ${data['bank']}\n' + '\n' + 'Checker By : @IndianBots' + '', parse_mode: 'html'); } else { - await message.reply('Invalid Bin ${bin}', parse_mode: 'html'); + await message.reply('Invalid Bin', parse_mode: 'html'); } - } catch (error) { - var bin = message.text; + } else { await message.reply('Invalid Bin ${bin}', parse_mode: 'html'); } - } else { - await message.reply('💘Join My Channel To Use Me\n@IndianBots', parse_mode: 'html'); + } catch (error) { + var bin = message.text.toString().replaceFirst('/ban', ''); + await message.reply('Invalid Bin ${bin}', parse_mode: 'html'); } + } else { + await message.reply('💘Join My Channel To Use Me\n@IndianBots', parse_mode: 'html'); + } + }); + + bot + .onCommand('sysinfo') + .listen((message) async { + var user_id = message.from.id; + String req = await ChannelCheck(user_id); + if (req.toString().contains('ok')) { + await message.reply( + 'Dart BinChecker Bot System Information\n\n' + 'Database : PostgreSQL 12.4\n' + 'Operating System : ${io.Platform.operatingSystem}\n' + 'Number Of Processors : ${io.Platform.numberOfProcessors}\n' + 'Dart SDK Link : \n' + 'Dart Version : 2.11.0-189.0.dev (dev)\n\n' + 'Deployed To : Heroku (For Now)', + parse_mode: 'html' + ); + } else { + await message.reply('💘Join My Channel To Use Me\n@IndianBots', parse_mode: 'html'); + } + }); bot .onMessage(entityType: '*') .listen((event) async { - if (event.text == '/start' || event.text == '/source' || event.text == '/commands' || event.text.toString().startsWith('/bin')) { - return false; - } else if (event.text.toString().toLowerCase().contains('fuck')) { - await event.reply('Jaa Na Lawde'); - return true; - } else { - await event.replySticker( - io.File('./bin/spam.webp') - ); - await event.reply( - 'Please Don\'t Spam Here..\n\nA Better Place To Spam Is ' + if (event.text == '/start' || event.text == '/source' || event.text == '/commands' || event.text.toString().startsWith('/bin') || event.text == '/sysinfo') { + return false; + } else if (event.text.toString().toLowerCase().contains('fuck')) { + await event.reply('Jaa Na Lawde'); + return true; + } else if (event.text.toString().toLowerCase().contains('maa chuda')) { + await event.reply('Thik He,\nWese Teri Maa Ki Chut Ka Size Kya He?'); + return true; + } else { + await event.replySticker( + io.File('./bin/spam.webp') + ); + await event.reply( + 'Please Don\'t Spam Here..\n\nA Better Place To Spam Is ' 'Here', - parse_mode: 'html', - withQuote: false, - disable_notification: false, - disable_web_page_preview: false - ); - } - }); + parse_mode: 'html', + withQuote: false, + disable_notification: false, + disable_web_page_preview: false + ); + } + }); }