├── LICENSE └── bot.ps1 /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2015 Hasan Ibraheem 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /bot.ps1: -------------------------------------------------------------------------------- 1 | $botkey = "" 2 | 3 | $getMeLink = "https://api.telegram.org/bot$botkey/getMe" 4 | $sendMessageLink = "https://api.telegram.org/bot$botkey/sendMessage" 5 | $forwardMessageLink = "https://api.telegram.org/bot$botkey/forwardMessage" 6 | $sendPhotoLink = "https://api.telegram.org/bot$botkey/sendPhoto" 7 | $sendAudioLink = "https://api.telegram.org/bot$botkey/sendAudio" 8 | $sendDocumentLink = "https://api.telegram.org/bot$botkey/sendDocument" 9 | $sendStickerLink = "https://api.telegram.org/bot$botkey/sendSticker" 10 | $sendVideoLink = "https://api.telegram.org/bot$botkey/sendVideo" 11 | $sendLocationLink = "https://api.telegram.org/bot$botkey/sendLocation" 12 | $sendChatActionLink = "https://api.telegram.org/bot$botkey/sendChatAction" 13 | $getUserProfilePhotosLink = "https://api.telegram.org/bot$botkey/getUserProfilePhotos" 14 | $getUpdatesLink = "https://api.telegram.org/bot$botkey/getUpdates" 15 | $setWebhookLink = "https://api.telegram.org/bot$botkey/setWebhook" 16 | 17 | $offset = 0 18 | write-host $botkey 19 | 20 | while($true) { 21 | $json = Invoke-WebRequest -Uri $getUpdatesLink -Body @{offset=$offset} | ConvertFrom-Json 22 | Write-Host $json 23 | Write-Host $json.ok 24 | $l = $json.result.length 25 | $i = 0 26 | Write-Host $json.result 27 | Write-Host $json.result.length 28 | while ($i -lt $l) { 29 | $offset = $json.result[$i].update_id + 1 30 | Write-Host "New offset: $offset" 31 | Write-Host $json.result[$i].message 32 | $i++ 33 | } 34 | Start-Sleep -s 2 35 | } 36 | --------------------------------------------------------------------------------