npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-apps-script-telegram-bot-library

v1.1.3

Published

you can use this library to develop your tgbot on google apps script

Downloads

32

Readme

Google Apps Script Telegram Bot Library

一個 TGbot lib
讓你可以在 Google Apps Script 上輕鬆寫 Telegram bot
或者你也可以 npm install 後在 local 端開發

Imgur Imgur

npm install

npm i google-apps-script-telegram-bot-library

Google Apps Script Library install

打開 gs 編輯頁面
-> "資源"
-> "程式庫"
-> 將 1XyHWbpiDtyHFEcZ0AOlsJp8DL99ax2R9HvehtjYg3vlLK4DDbiPyZ9eI 貼上輸入框
-> "新增"
-> 選擇最後版本(記得阿 不然儲存不了)
-> "儲存"~

Open Script Editor.
-> Resource
-> Library
-> Paste Script ID 1XyHWbpiDtyHFEcZ0AOlsJp8DL99ax2R9HvehtjYg3vlLK4DDbiPyZ9eI to box
-> Add library
-> select lastest version and save

Run on NodeJs

const tgbot = require('google-apps-script-telegram-bot-library')
var bot = new tgbot.tgbot("<botToken>")
var result = bot.sendMessage({"chat_id":"123","text":"030"})
console.log(result);

Run on Google Apps Script

var tgbot = new TGbot.tgbot("<botToken>");
var result = tgbot.sendMessage({"chat_id":"123","text":"030"})
console.log(result);

Unit test

所有method皆測試過可用,除了以下名單沒測

未測試名單(not use unit test)

| 名稱name | 原因reason | | :-----------------------------------------------------------------------: | :---------------: | | setChatStickerSet | 因為人數未達100人 | | deleteChatStickerSet | 因為人數未達100人 | | Telegram Passport | 作者不知道原理:( | | Games | 作者不會寫遊戲:( |

Additional method

這個 library 還有一些特有的 method 可以用

getPath

獲取檔案的下載路徑

| Parameters | type | Required | Description | | :--------: | :----: | :------: | :-------------------------------: | | file_id | string | Yes | File identifier to get info about |

getFileDownloadUrl

獲取檔案的下載連結

| Parameters | type | Required | Description | | :--------: | :----: | :------: | :---------------------------: | | Path | string | Yes | getPath回傳的結果 |