mirror of
https://github.com/wassname/pi-telegram.git
synced 2026-06-27 16:46:21 +08:00
skip [telegram] prefix for ! commands so pi handles them natively as shell
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -65,7 +65,8 @@ export function buildTelegramTurnPrompt(options: {
|
|||||||
files: DownloadedTelegramTurnFileLike[];
|
files: DownloadedTelegramTurnFileLike[];
|
||||||
historyTurns?: Pick<PendingTelegramTurn, "historyText">[];
|
historyTurns?: Pick<PendingTelegramTurn, "historyText">[];
|
||||||
}): string {
|
}): string {
|
||||||
let prompt = options.telegramPrefix;
|
// Let pi handle `!` shell commands natively - don't prepend [telegram] prefix
|
||||||
|
let prompt = options.rawText.trimStart().startsWith("!") ? "" : options.telegramPrefix;
|
||||||
if ((options.historyTurns?.length ?? 0) > 0) {
|
if ((options.historyTurns?.length ?? 0) > 0) {
|
||||||
prompt +=
|
prompt +=
|
||||||
"\n\nEarlier Telegram messages arrived after an aborted turn. Treat them as prior user messages, in order:";
|
"\n\nEarlier Telegram messages arrived after an aborted turn. Treat them as prior user messages, in order:";
|
||||||
|
|||||||
Reference in New Issue
Block a user