[FEATURE] Add AI-based /ask command (complementing #54) #56
|
@ -251,7 +251,7 @@ export default (bot: Telegraf<Context>) => {
|
||||||
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
|
|||||||
...({ reply_to_message_id })
|
...({ reply_to_message_id })
|
||||||
})
|
})
|
||||||
|
|
||||||
const fixedMsg = message.replace(/\/ask /, "")
|
const fixedMsg = message.replace(/\/ask /, "").replace(/\/think /, "")
|
||||||
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
|
|||||||
if (fixedMsg.length < 1) {
|
if (fixedMsg.length < 1) {
|
||||||
await ctx.reply(Strings.askNoMessage, {
|
await ctx.reply(Strings.askNoMessage, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
|
@ -263,7 +263,7 @@ export default (bot: Telegraf<Context>) => {
|
||||||
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
|
|||||||
logger.logPrompt(fixedMsg)
|
logger.logPrompt(fixedMsg)
|
||||||
|
|
||||||
const prompt = sanitizeForJson(
|
const prompt = sanitizeForJson(
|
||||||
`You are a helpful assistant called ${botName}.
|
`You are a plaintext-only, helpful assistant called ${botName}.
|
||||||
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
|
|||||||
Current Date/Time (UTC): ${new Date().toLocaleString()}
|
Current Date/Time (UTC): ${new Date().toLocaleString()}
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
![]() Don't use axios like this, check https://axios-http.com/docs/instance Don't use axios like this, check https://axios-http.com/docs/instance
![]() Why are you printing p1? Why are you printing p1?
![]() There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;) There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)
![]() I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read I like this idea! I will look into cleaning it up, and maybe break some things into functions so the code is easier to read
|
Don't use axios like this, check https://axios-http.com/docs/instance
Why are you printing p1?
There are too many ifs and elses, not only in this file but others too. Maybe we could separate them soon. let's try to do this in the future ;)