Medchem command improvements

This commit is contained in:
2025-06-25 12:00:29 +02:00
parent a0f0918504
commit 335912ea8a
2 changed files with 136 additions and 5 deletions

View File

@ -29,13 +29,13 @@ func (m MolCommand) Execute(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
}
cid, err := fetchPubchemCID(args)
if err != nil {
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Structure not found")
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Structure not found, maybe try the superior /medchem command")
bot.Send(msg)
return
}
imgURL := fmt.Sprintf("https://pubchem.ncbi.nlm.nih.gov/image/imgsrv.fcgi?t=l&cid=%s", cid)
photo := tgbotapi.NewPhoto(update.Message.Chat.ID, tgbotapi.FileURL(imgURL))
photo.Caption = args
photo.Caption = args + "\nIf you want more info, try the /medchem command instead"
bot.Send(photo)
}