Skip to content

This is a library that runs a telegram bot in kagsa language

Notifications You must be signed in to change notification settings

Ali-Adnan219/kagsa-Bot-Telegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kagsa-Bot-Telegram

community links library

Telegram

To install kagsa

pip install kagsa==1.1.0

to run a bot

kagsa bot.kg

Example

include "bots.kgl"
var token='5689364691:AAE-m5YBGMQ7QltUKxdS80JfFUNPjmOjVtE'



//send data
func PostDataBot(method,data){
    var sendmsg = bots.sendData(token,method,data)
    return sendmsg
}



func GetAllMsg(result){
var message=result.get("message")
var text= message.get("text")
var chat_id= message.get("chat")
var id=chat_id.get("id")

if text=="/start"{

var data=dict(chat_id=id,text="hi")
var method ="sendMessage"
PostDataBot(method,data)}

if text=="/help"{
var data=dict(chat_id=id,text="how l can help you")
var method ="sendMessage"
PostDataBot(method,data)}

//end func
}



while true {
var result =bots.polling(token)
if length(toStr(result)) > 8 {
GetAllMsg(result)}
//end while
}

About

This is a library that runs a telegram bot in kagsa language

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages