Skip to content

Instantly share code, notes, and snippets.

@blackdev1l
Created January 26, 2016 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackdev1l/2e7ee6d43dc7cbbc1fe4 to your computer and use it in GitHub Desktop.
Save blackdev1l/2e7ee6d43dc7cbbc1fe4 to your computer and use it in GitHub Desktop.
tars merda
package main
import (
"bufio"
"fmt"
"net/http"
"os"
)
const APIURL = "https://api.telegram.org/bot"
var (
token string
chat string
)
func send(s string) {
http.Get(APIURL + token + "/sendMessage?chat_id=" + chat + "&text=" + "!unset " + s)
}
func main() {
token = os.Args[1]
chat = os.Args[2]
file, _ := os.Open("sets.txt")
scanner := bufio.NewScanner(file)
for scanner.Scan() {
fmt.Println("unsetting " + scanner.Text())
send(scanner.Text())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment