Bot::QuickSend removed

bot-api-6.1
Gleb Sinyavsky 2015-12-16 11:38:39 +03:00
parent 1a3e995b37
commit f8cc0d2aaa
3 changed files with 0 additions and 18 deletions

View File

@ -85,8 +85,6 @@ func main() {
} }
``` ```
For quickly send text message you can use BotAPI method `QuickSend(chatID, "your message")`
If you need, you may generate a self signed certficate, as this requires HTTPS / TLS. The above example tells Telegram that this is your certificate and that it should be trusted, even though it is not properly signed. If you need, you may generate a self signed certficate, as this requires HTTPS / TLS. The above example tells Telegram that this is your certificate and that it should be trusted, even though it is not properly signed.
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3560 -subj "//O=Org\CN=Test" -nodes openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3560 -subj "//O=Org\CN=Test" -nodes

6
bot.go
View File

@ -220,12 +220,6 @@ func (bot *BotAPI) Send(c Chattable) (Message, error) {
} }
} }
// QuickSend will send message to selected chat
func (bot *BotAPI) QuickSend(chatID int, message string) (Message, error) {
msg := NewMessage(chatID, message)
return bot.Send(msg)
}
func (bot *BotAPI) debugLog(context string, v url.Values, message interface{}) { func (bot *BotAPI) debugLog(context string, v url.Values, message interface{}) {
if bot.Debug { if bot.Debug {
log.Printf("%s req : %+v\n", context, v) log.Printf("%s req : %+v\n", context, v)

View File

@ -342,16 +342,6 @@ func TestSendChatConfig(t *testing.T) {
} }
} }
func TestQuickSend(t *testing.T) {
bot, _ := getBot(t)
_, err := bot.QuickSend(ChatID, "test message")
if err != nil {
t.Fail()
}
}
func TestGetUserProfilePhotos(t *testing.T) { func TestGetUserProfilePhotos(t *testing.T) {
bot, _ := getBot(t) bot, _ := getBot(t)