Skip to content

simeonschaub/Telegrambot.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegrambot.jl

A Julia Telegram Bot Api wapper check out telegram bot api api (mostly built around commands with text).

Build Status
Build Status

Installation

The package is registered in METADATA.jl and can be installed with Pkg.add, or in REPL by pressing ] add Telegrambot.

julia> Pkg.add("Telegrambot")

Basic Usage

For guide on telegram bot creation and api, check this out.

NOTICE: Due to the way botfather present you key, don't forget to add "bot", I shall add a warning and try to be smart.

using Telegrambot
botApi = "bot<your_api_key>"

welcomeMsg(incoming::AbstractString) = "Welcome to my awesome bot"

echo(incoming::AbstractString) = incoming

txtCmds = Dict()
txtCmds["repeat_msg"] = echo #this will respond to '/repeat_msg <any thing>'
txtCmds["start"] = welcomeMsg # this will respond to '/start'

inlineOpts = Dict() #Title, result pair
inlineOpts["Make Uppercase"] = uppercase #this will generate an pop-up named Make Uppercase and upon tapping return uppercase(<user_input>)

#uppercase is a function that takes a string and return the uppercase version of that string

startBot(botApi; textHandle = txtCmds, inlineQueryHandle=inlineOpts)

To-Do

  • Add Inline query respond
  • Add function to quote reply to a message
  • Add function to reply with a file/image
  • Add function to serve as a IRC-Tg bot

About

A simple telegram bot wrapper for handling text command reply.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 100.0%