initial telegram bot

This commit is contained in:
Dylan Knutson
2025-07-31 03:33:44 +00:00
parent d899413d7c
commit 83ae4ebd45
7 changed files with 471 additions and 1 deletions

View File

@@ -0,0 +1,54 @@
# typed: strict
# Shim for telegram-bot-ruby to provide proper typing for Client.run method
module Telegram
module Bot
class Client
sig do
params(
args: T.untyped,
blk: T.proc.params(bot: Telegram::Bot::Client).void,
).void
end
def self.run(*args, &blk)
end
# Override the api method to properly type the return value
sig { returns(Telegram::Bot::Api) }
def api
end
end
class Api
# Define commonly used API methods
sig do
params(
chat_id: T.untyped,
text: String,
reply_to_message_id: T.untyped,
).returns(Telegram::Bot::Types::Message)
end
def send_message(chat_id:, text:, reply_to_message_id: nil)
end
sig do
params(
chat_id: T.untyped,
message_id: T.untyped,
text: String,
parse_mode: T.nilable(String),
).returns(Telegram::Bot::Types::Message)
end
def edit_message_text(chat_id:, message_id:, text:, parse_mode: nil)
end
sig { params(file_id: String).returns(Telegram::Bot::Types::File) }
def get_file(file_id:)
end
sig { returns(Telegram::Bot::Types::User) }
def get_me
end
end
end
end