Closed herman925 closed 1 year ago
me too
I found the line where you can edit it :
userId := strconv.FormatInt(update.Message.Chat.ID, 10)
if os.Getenv("TELEGRAM_ID") != "" && userId != os.Getenv("TELEGRAM_ID") {
msg.Text = "You are not authorized to use this bot."
bot.Send(msg)
continue
Edit this and try, but not sure about how to decompile the release package. You need to run the https://github.com/m1guelpf/chatgpt-telegram/tree/main/src URLs orderwise.
GitHubRun your own GPTChat Telegram bot, with a single command! - chatgpt-telegram/src at main · m1guelpf/chatgpt-telegram
Same question
I'd be willing to accept a PR that supports adding multiple IDs separated with commas, and parses those into an array to check against.
Actually I made it work well for multiple users and added logging logics.
By commenting these lines. And it works well
// msg.Text = "You are not authorized to use this bot."
// bot.Send(msg)
// continue
I'd be willing to accept a PR that supports adding multiple IDs separated with commas, and parses those into an array to check against.
I don't know much about Go
language but that is a hacky way.
Btw, I was looking for logging the feed
from chatgpt bot,
https://github.com/m1guelpf/chatgpt-telegram/blob/main/main.go#L90
How can I get the content in string from the object feed
? I want to record what the ChatGPT replies to users.
https://github.com/m1guelpf/chatgpt-telegram/blob/main/src/chatgpt/chatgpt.go#L73
I saw this source codes, and it will return this r <- ChatResponse{Message: res.Message.Content.Parts[0]}
, as if it's will return a pointer pointing to an address in the RAM. If I print it, it will show something "0x12345678".
GitHubRun your own GPTChat Telegram bot, with a single command! - chatgpt-telegram/main.go at main · m1guelpf/chatgpt-telegram
GitHubRun your own GPTChat Telegram bot, with a single command! - chatgpt-telegram/chatgpt.go at main · m1guelpf/chatgpt-telegram
I want to set this up for my family to use, and the current implementation seems to only allow a single user to use the chatbot