givip / telegrammer Goto Github PK
View Code? Open in Web Editor NEWTelegram Bot - written with Swift 5.2 / NIO, supports Linux, macOS
License: MIT License
Telegram Bot - written with Swift 5.2 / NIO, supports Linux, macOS
License: MIT License
After an arbitrary number of incoming connections of the web hook, i get a timeout for get updates. Is there an option to reconnect?
[2019-01-14T13:17:07.558Z] [INFO] [BotClient.swift:45 respond(endpoint:body:headers:)] Sending request:
POST https://api.telegram.org:443/bot729517131:AAFH1wdt6_rnVxXFyNmY_jsLLzUmCtJ-P8w/getUpdates HTTP/1.1
Content-Type: application/json
content-length: 14
{"timeout":20}
[2019-01-14T13:17:07.573Z] [INFO] [BotClient.swift:68 send(request:)] Creating new HTTP Client
[2019-01-14T13:17:07.574Z] [INFO] [BotClient.swift:78 send(request:)] Sending request to vapor HTTPClient
[2019-01-14T13:17:27.601Z] [INFO] [BotClient.swift:82 send(request:)] Decoding response from HTTPClient
[2019-01-14T13:17:27.601Z] [VERBOSE] [Bot.swift:59 wrap]
Received response
Code: 0
Status OK: true
Description: Empty
Result: [
]
Filters updates by searching for an occurence of pattern in the message text.
After first request HTTPClient crashes, because state of parsing body process in not changes.
Workaround is on PR now vapor/http#277
Processes callbacks from queue with specified throughput limits. Creates a separate thread to process callbacks with delays.
Need clean and beautiful README.md
Setup CI with circleci.com
Filters messages to only allow those which are from users with a certain language code.
Note: According to telegrams documentation, every single user does not have the language_code attribute.
swift package generate-xcodeproj
return error after update to 0.5.4 version.
Console log:
error: multiple products named 'Logging' in: Console, swift-log
error: multiple targets named 'Logging' in: Console, swift-log
Swift version:
Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
Target: x86_64-apple-darwin18.2.0
Attempt to send request with Binary file fails because complex nested types like InlineKeyboardMarkup
or MaskPosition
aren't MultipartPartConvertible
A handler to hold a conversation with a single user by managing four collections of other handlers. Note that neither posts in Telegram Channels, nor group interactions with multiple users are managed by instances of this class.
Implement 'remove' handler method
When using a combined filter in a telegrammer-vapor-middleware based app like so (here a 'not'):
let answerHandler = MessageHandler(filters: !Filters.command,
callback: answerResponse)
dispatcher.add(handler: answerHandler,to: HandlerGroup.answers)
it results in the following crash on an incoming update:
Not only for the logical not (!), but same result for other logical operations (like and: &&, or: ||)
Without logical operations it works like expected.
Hello!
First I want to thank you for your amazing library, I find it extremely convenient to work with.
Now back to my issue. I can't build my project if I use the function below
self.dispatcher.remove(handler: handler, from: group)
I get the error
Error:(76, 60) extra argument 'from' in call
I can't understand what's wrong with it. group
variable is correct and has type HandlerGroup
. I'm using Swift 4.1. Does your project successfully build using the line like this?
Thank you!
This issue is linked with #6, because main requirement for apps is binding to some port listening, else it throws boot timeout error r10
First of all, great repo BTW. Thanks for this 🎉
I noticed that the code is expecting the pem
certificate's path.
if let publicCert = bot.settings.webhooksPublicCert {
guard let fileHandle = FileHandle(forReadingAtPath: publicCert) else {
let errorDescription = "Public key '\(publicCert)' was specified for HTTPS server, but wasn't found"
log.error(errorDescription.logMessage)
throw CoreError(identifier: "FileIO", reason: errorDescription)
}
cert = InputFile(data: fileHandle.readDataToEndOfFile(), filename: publicCert)
}
Since I'm deploying the bot with Dokku, I don't have too much control on the file system (everything running on containers). I was thinking about an option of getting the certficate's content on another environment variable. What do you think?
Every time the underlying bot is sending a request - just the standby web hook logic - it increases the memory footprint.
Implements callback processing with proper delays to avoid hitting Telegram’s message limits.
Vapor 4 is in the making (v4.0.0-alpha.3.2) and will leverage new features in Swift 5.1. I think it would be a good idea to start working on a new Vapor template as well as updating the library to use Swift 5.1 and its new features.
Hi! I wanted to update generated files, but the script crashed on the line below
Telegrammer/API/generate_wrappers.rb
Line 178 in 612ce3e
./generate_wrappers.rb:178:in `fetch_description': undefined local variable or method `continue' for main:Object (NameError)
I'm not sure what continue
is, but it does not seem to be part of ruby :)
As far as I can tell, commenting out this line does not break anything. Will it be safe to remove it?
I've set up a project with Telegrammer and Vapor. I've installed the postgresql driver and registered FluentPostgreSQLProvider
, but I'm not sure how to get a database connection in my bot class.
If I have a model called User
and I want to query all users, I'd write the following code: User.query(on: conn).all()
, where conn
is an object that conforms to DatabaseConnectable
. I'm not sure where/how I can access this object in my bot class.
This class allows you to periodically perform tasks with the bot.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.