My own bot is used to test the added functionality.
parent
696aebd64c
commit
aaaa278b56
|
@ -11,6 +11,7 @@ import (
|
||||||
const (
|
const (
|
||||||
TestToken = "153667468:AAHlSHlMqSt1f_uFmVRJbm5gntu2HI4WW8I"
|
TestToken = "153667468:AAHlSHlMqSt1f_uFmVRJbm5gntu2HI4WW8I"
|
||||||
ChatID = 76918703
|
ChatID = 76918703
|
||||||
|
ChannelBot = "903278594:AAHmLoQncKOMKz2A644-cIK1Sb0VwfnOpGQ"
|
||||||
Channel = "@nightghost_test"
|
Channel = "@nightghost_test"
|
||||||
SupergroupChatID = -1001120141283
|
SupergroupChatID = -1001120141283
|
||||||
ReplyToMessageID = 35
|
ReplyToMessageID = 35
|
||||||
|
@ -155,7 +156,7 @@ func TestSendWithNewPhotoReply(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSendNewPhotoToChannel(t *testing.T) {
|
func TestSendNewPhotoToChannel(t *testing.T) {
|
||||||
bot, _ := getBot(t)
|
bot, _ := NewBotAPI(ChannelBot)
|
||||||
|
|
||||||
msg := NewPhotoUploadToChannel(Channel, "tests/image.jpg")
|
msg := NewPhotoUploadToChannel(Channel, "tests/image.jpg")
|
||||||
msg.Caption = "Test"
|
msg.Caption = "Test"
|
||||||
|
@ -168,7 +169,7 @@ func TestSendNewPhotoToChannel(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSendNewPhotoToChannelFileBytes(t *testing.T) {
|
func TestSendNewPhotoToChannelFileBytes(t *testing.T) {
|
||||||
bot, _ := getBot(t)
|
bot, _ := NewBotAPI(ChannelBot)
|
||||||
|
|
||||||
data, _ := ioutil.ReadFile("tests/image.jpg")
|
data, _ := ioutil.ReadFile("tests/image.jpg")
|
||||||
b := FileBytes{Name: "image.jpg", Bytes: data}
|
b := FileBytes{Name: "image.jpg", Bytes: data}
|
||||||
|
@ -184,7 +185,7 @@ func TestSendNewPhotoToChannelFileBytes(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSendNewPhotoToChannelFileReader(t *testing.T) {
|
func TestSendNewPhotoToChannelFileReader(t *testing.T) {
|
||||||
bot, _ := getBot(t)
|
bot, _ := NewBotAPI(ChannelBot)
|
||||||
|
|
||||||
f, _ := os.Open("tests/image.jpg")
|
f, _ := os.Open("tests/image.jpg")
|
||||||
reader := FileReader{Name: "image.jpg", Reader: f, Size: -1}
|
reader := FileReader{Name: "image.jpg", Reader: f, Size: -1}
|
||||||
|
|
Loading…
Reference in New Issue