Medchem command improvements
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user