JSPM

  • Created
  • Published
  • Downloads 150
  • Score
    100M100P100Q79165F
  • License MIT

Telegram MTProto framework base gram.js

Package Exports

  • tgsnake

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tgsnake) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tgsnakeicon-flaticon
Hi, tgsnake is a framework developed based on gram.js
github-repo telegram-chat
telegram-channel generate-session

WARNING!

Maybe your account will be banned if you login using this framework. I don't know what caused it to happen. I am not responsible if your account is banned!

Example :

  • Installation :
yarn add tgsnake@latest
  • Simple Hello World :
const {Snake} = require("tgsnake")
// import {Snake} from "tgsnake"
const bot = new Snake({
  api_hash : "abcde", //your api hash
  api_id : 123456, // your api id
  bot_token : "123457890:abcd", // bot token. if you login using number delete this.
  logger:"none" // gramjs logger
})
/**
 * if you login as user, you must generateSession first! 
 * bot.generateSession()
 * disable bot.run() to generate session!
*/
bot.run() //snake running

bot.on("message",(ctx)=>{ //handle new message event.
  ctx.reply("Hello World") // reply with "Hello World"
  //console.log(ctx) // see json of message.
})

More example you can found in example folder or in website.

Contribution

Welcome, You can contribute to this project.

Guide

  • Fork this repo to your account.
  • Clone your fork repo using git.
git clone <your github repo url> -b "dev"

Cloning branch dev in your repo.

  • Edit and make something.
  • Pull new update from branch dev original repo (this repo).
  • Push update to your branch dev in fork repo.
  • Create pull request to branch dev original repo from branch dev frok repo.