EngiBot now pretends to type when downloading a video
This commit is contained in:
parent
186d3b3069
commit
b18f850114
1 changed files with 3 additions and 0 deletions
|
@ -66,6 +66,7 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
|
||||||
choice, err := getLargestFormat(result, 8*1024*1024)
|
choice, err := getLargestFormat(result, 8*1024*1024)
|
||||||
log.Printf("Choice: %s | Size: %fM\n", choice.FormatID, choice.FilesizeApprox/1024/1024)
|
log.Printf("Choice: %s | Size: %fM\n", choice.FormatID, choice.FilesizeApprox/1024/1024)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
session.ChannelTyping(message.ChannelID)
|
||||||
downloadResult, err := result.Download(context.Background(), choice.FormatID)
|
downloadResult, err := result.Download(context.Background(), choice.FormatID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
@ -116,6 +117,7 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
|
||||||
choice, err := getLargestYTFormat(result, 8*1024*1024)
|
choice, err := getLargestYTFormat(result, 8*1024*1024)
|
||||||
log.Printf("Choice: %s | Size: %fM\n", choice.FormatID, choice.FilesizeApprox/1024/1024)
|
log.Printf("Choice: %s | Size: %fM\n", choice.FormatID, choice.FilesizeApprox/1024/1024)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
session.ChannelTyping(message.ChannelID)
|
||||||
downloadResult, err := result.Download(context.Background(), choice.FormatID)
|
downloadResult, err := result.Download(context.Background(), choice.FormatID)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -148,6 +150,7 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
|
session.ChannelTyping(message.ChannelID)
|
||||||
downloadResult, err := result.Download(context.Background(), result.Formats()[0].FormatID) // Insta only has one possible format to download :(
|
downloadResult, err := result.Download(context.Background(), result.Formats()[0].FormatID) // Insta only has one possible format to download :(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
|
Loading…
Reference in a new issue