- Create your bot with botfather
- Make you bot an admin of your channel
Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path
https://web.telegram.org/k/#-9999999999999
| import request from "request"; | |
| import puppeteer from "puppeteer"; | |
| const API_URL = "https://slack.com/api/files.upload"; | |
| const SLACK_API_TOKEN = process.env.SLACK_API_TOKEN as string; | |
| const CHANNEL = "general"; | |
| (async () => { | |
| const url = "http://neverssl.com" | |
| const browser = await puppeteer.launch(); |
| libraryGroupId=yuana.id | |
| libraryArtifactId=anu | |
| libraryVersion=1.0.0 |
| var syncDep; | |
| function getLottery() { | |
| return new Promise((resolve, reject) =>{ | |
| if (syncDep === undefined) { //check of we already have this data...if not THEN go get | |
| setTimeout(function() { | |
| syncDep = [1,22,34,56,5]; | |
| resolve(syncDep); | |
| }, 2000); | |
| } else { |
| upload(files) { | |
| const config = { | |
| onUploadProgress: function(progressEvent) { | |
| var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total) | |
| console.log(percentCompleted) | |
| } | |
| } | |
| let data = new FormData() | |
| data.append('file', files[0]) |
First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type Test struct { | |
| Name string | |
| } |
| var start = new Date(); | |
| var hrstart = process.hrtime(); | |
| setTimeout(function (argument) { | |
| // execution time simulated with setTimeout function | |
| var end = new Date() - start, | |
| hrend = process.hrtime(hrstart); | |
| console.info("Execution time: %dms", end); | |
| console.info("Execution time (hr): %ds %dms", hrend[0], hrend[1]/1000000); |