Browse Source

message id in handle/download log

Drn 2 years ago
parent
commit
2b98ca0290
2 changed files with 4 additions and 3 deletions
  1. 1 1
      downloads.go
  2. 3 2
      handlers.go

+ 1 - 1
downloads.go

@@ -1025,7 +1025,7 @@ func (download downloadRequestStruct) tryDownload() (downloadStatusStruct, int64
 			log.Println(lg("Download", "", dlColor,
 				logPrefix+"SAVED %s sent %sin %s\n\t\t\t\t\t\t%s",
 				strings.ToUpper(contentTypeFound), msgTimestamp,
-				color.HiYellowString("\"%s / %s\" (%s)", sourceName, sourceChannelName, download.Message.ChannelID),
+				color.HiYellowString("\"%s / %s\" (%s, %s)", sourceName, sourceChannelName, download.Message.ChannelID, download.Message.ID),
 				color.GreenString("> %s to \"%s%s\"\t\t%s", domain, download.Path, download.Filename,
 					color.WhiteString("(%s, %s, %0.1f %s)",
 						filesize, shortenTime(durafmt.ParseShort(time.Since(download.StartTime)).String()), speed/time.Since(download.StartTime).Seconds(), speedlabel))))

+ 3 - 2
handlers.go

@@ -80,8 +80,9 @@ func handleMessage(m *discordgo.Message, edited bool, history bool) (int64, int6
 			)
 			content := m.Content
 			if len(m.Attachments) > 0 {
-				content += fmt.Sprintf("\t[%d attachments]", len(m.Attachments))
+				content += fmt.Sprintf(" \t[%d attachments]", len(m.Attachments))
 			}
+			content += fmt.Sprintf(" \t<%s>", m.ID)
 
 			if !history || config.MessageOutputHistory {
 				addOut := ""
@@ -317,7 +318,7 @@ func handleMessage(m *discordgo.Message, edited bool, history bool) (int64, int6
 				continue
 			}
 			if config.Debug && (!history || config.MessageOutputHistory) {
-				log.Println(lg("Debug", "Message", color.CyanString, "FOUND FILE: "+file.Link))
+				log.Println(lg("Debug", "Message", color.CyanString, "FOUND FILE: "+file.Link+fmt.Sprintf(" \t<%s>", m.ID)))
 			}
 			status, filesize := downloadRequestStruct{
 				InputURL:   file.Link,