Code Monkey home page Code Monkey logo

gogram's Introduction

GσGɾαɱ

⚒️ Under Development.

Gogram is an open-source Telegram MTProto client written in the Go programming language (also known as Golang). It provides an easy-to-use API for building applications that interact with the Telegram API.

Gogram is designed to be fast and efficient, and it has no external dependencies, making it easy to use and integrate into your projects. It also supports native entity parser, inter DC requests, and friendlier methods, which can help simplify the process of interacting with Telegram's API.

If you're looking to build a Telegram client or bot using the Go programming language, Gogram is definitely worth considering. Its open-source nature also means that you can contribute to its development and suggest new features or improvements.

What is this?

Telegram is a popular messaging application. This library is meant to make it easy for you to write Golang programs that can interact with Telegram. Think of it as a wrapper that has already done the heavy job for you, so you can focus on developing an application.

Known Bugs

  • getFullChannel fails due to flag2.0

PRs and Issues are always welcome.

GitHub issues GitHub go.mod Go version (branch & subdirectory of monorepo) GitHub commit activity

Features

Light Weight compared to other go- mtproto clients. Fast compiling and execution, All commonly used methods are made more friendly, Reliable updates handling system

Installing

go get -u github.com/amarnathcjd/gogram

Set-Up Client

client, _ := gogram.TelegramClient(gogram.ClientConfig{
     AppID: 0,
     AppHash: "",
})
client.Connect()
client.LoginBot(botToken) // client.Login(phoneNumber)
client.Idle() // start infinite polling

Doing stuff

var b = telegram.Button{}
opts := &telegram.SendOptions{
    Caption: "Game of Thrones",
    ReplyMarkup: b.Keyboard(b.Row(b.URL("Imdb", "http://imdb.com/title/tt0944947/"))),
})

fmt.Println(client.GetMe())

message, _ := client.SendMessage("username", "Hello I'm talking to you from gogram!")
message.Edit("Yep!")

album, _ := client.SendAlbum("username", []string{'file1.jpg', 'file2.jpg'})
message.GetMediaGroup()

message.ReplyMedia(url, opts)

client.DeleteMessage("username", message.ID)

message.ForwardTo(message.ChatID())
peer := client.ResolvePeer("username")
client.GetParticipant("chat", "user")

client.EditAdmin(chatID, userID, &telegram.AdminOptions{
    AdminRights: &telegram.ChatAdminRights{
        AddAdmins: true,
    },
    Rank: "Admin",
})

client.GetMessages(chatID, &telegram.SearchOptions{Limit: 1})

action, _ := client.SendAction(chat, "typing")
defer action.Cancel()

client.KickParticipant(chatID, userID)
client.EditBanned(chatID, userID, &telegram.BannedOptions{Mute: true})
client.DownloadMedia(message, "download.jpg")
client.EditTitle("me", "MyNewAmazingName")

client.UploadFile("file.txt")
p := client.GetParticipant("chat", "user")

p.CanChangeInfo()
p.GetRank()
client.InlineQuery("@pic", &telegram.InlineOptions{Query: "", Dialog: "@chat"})
client.GetChatPhotos(chatID)
client.GetDialogs()
client.GetStats("channel")
client.GetCustomEmoji("documentID")

conv, _ = client.NewConversation("username")
conv.GetResponse()

client.CreateChannel("Title")

albumHandle := client.AddAlbumHandler(func (a *telegram.Album) error {
       fmt.Println(a.GroupedID)
       a.Forward(chat_id)
       return nil
}
albumHandle.Remove()

client.SendDice("username", "🎲")

TODO

  • ✔️ Basic MTProto implementation
  • ✔️ Implement all Methods for latest layer (147)
  • ✔️ Entity Cache + Friendly Methods
  • ✔️ Add Update Handle System
  • ✔️ Make a reliable HTML Parser
  • ✔️ Friendly Methods to Handle CallbackQuery, VoiceCalls
  • 🔨 Add Flag2.0 Parser (Then update to Layer-151https://img.shields.io/github/issues/amarnathcjd/gogram)
  • 📝 Fix File handling
  • 📝 Write beautiful Docs
  • 📝 Multiple tests

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

gogram's People

Contributors

amarnathcjd avatar roseloverx avatar deepsource-autofix[bot] avatar anjanamadu avatar deepsourcebot avatar jwillp avatar dropout1337 avatar itzrexmodz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.