telebot.nim开源项目

我要开发同款
匿名用户2021年11月08日
120阅读

技术信息

开源地址
https://github.com/esl/elarm
授权协议
MIT License

作品详情

telebot.im

AsycTelegramBotAPIClietimplemeti@Nim-Lag

Notes

Fromversio1.0.0,procslikesewMessage,ewPhoto,..aregoe,usesedMessage,sedDocumetistead.Ifyoustillprefertheold/uglywaytosedstuffs,justimporttelebot/compatforbackwardcompatible

Istallatio$imbleistalltelebotUsageechobotimporttelebot,asycdispatch,loggig,optiosvarL=ewCosoleLogger(fmtStr="$levelame,[$time]")addHadler(L)costAPI_KEY=slurp("secret.key")procupdateHadler(b:Telebot,u:Update):Future[bool]{.asyc.}=ifotu.message.isSome:#returtruewillmakebotstopprocessothercallbacksreturtruevarrespose=u.message.getifrespose.text.isSome:lettext=respose.text.getdiscardawaitb.sedMessage(respose.chat.id,text,parseMode="markdow",disableNotificatio=true,replyToMessageId=respose.messageId)letbot=ewTeleBot(API_KEY)bot.oUpdate(updateHadler)bot.poll(timeout=300)sedlocalphotoimporttelebot,asycdispatch,optios,loggigcostAPI_KEY=slurp("secret.key")procupdateHadler(bot:TeleBot,update:Update):Future[bool]{.asyc.}=discardawaitbot.sedPhoto(respose.chat.id,"file:///path/to/photo.jpg")letbot=ewTeleBot(API_KEY)bot.oUpdate(updateHadler)bot.poll(timeout=300)

FormoreiformatiopleaserefertoofficialTelegramBotAPIpage

功能介绍

telebot.nim Async Telegram Bot API Client implement in @Nim-Lang Notes From version 1.0.0, procs ...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论