Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/danneu/telegram-chatgpt-bot
/ functions
Functions
86 in github.com/danneu/telegram-chatgpt-bot
⨍
Functions
86
◇
Types & classes
23
↓ 30 callers
Method
sendMessage
( chatId: number, text: string, replyToMessageId?: number, silent = false,
telegram.ts:88
↓ 21 callers
Method
get
(bytes: Uint8Array)
tokenizer/bpe.ts:21
↓ 16 callers
Method
from
(texts: string[])
tokenizer/bpe.ts:8
↓ 16 callers
Method
request
( method: string, params: Record<string, any> = {}, )
telegram.ts:21
↓ 12 callers
Method
indicateTyping
(chatId: number)
telegram.ts:151
↓ 7 callers
Method
set
(bytes: Uint8Array, rank: number)
tokenizer/bpe.ts:16
↓ 6 callers
Method
keys
()
tokenizer/bpe.ts:26
↓ 5 callers
Function
canManageModel
(userId: number)
index.ts:1231
↓ 5 callers
Function
one
(pool: pg.Pool, stmt: string, params: any[])
db.ts:18
↓ 4 callers
Function
countTokens
(text: string)
tokenizer/index.ts:22
↓ 4 callers
Method
editMessageReplyMarkup
( chatId: number, messageId: number, inlineKeyboard: Record<string, any>, )
telegram.ts:247
↓ 3 callers
Method
answerCallbackQuery
( callbackQueryId: string, text: string, )
telegram.ts:114
↓ 3 callers
Function
bytePairEncode
(piece: Uint8Array, ranks: RankMap)
tokenizer/bpe.ts:71
↓ 2 callers
Method
_getTlRegex
()
tokenizer/bpe.ts:127
↓ 2 callers
Function
bytePairMerge
(piece: Uint8Array, ranks: RankMap)
tokenizer/bpe.ts:39
↓ 2 callers
Function
completeAndSendAnswer
( chat: db.Chat, messageId: number, userText: string, )
index.ts:539
↓ 2 callers
Method
editMessageText
( chatId: number, messageId: number, text: string, )
telegram.ts:233
↓ 2 callers
Function
formatDate
(date: Date)
openai.ts:301
↓ 2 callers
Function
handleCommand
( userId: number, chat: db.Chat, messageId: number, command: Command, )
index.ts:682
↓ 2 callers
Function
inlineKeyboardForModelSelect
( model: db.Model, )
index.ts:222
↓ 2 callers
Method
isStatus
(status: number)
openai.ts:257
↓ 2 callers
Function
parseCommand
(input: string)
index.ts:666
↓ 1 callers
Method
_decodeNative
(tokens: number[])
tokenizer/bpe.ts:135
↓ 1 callers
Method
_encodeNative
( text: string, allowedSpecial: Set<string>, )
tokenizer/bpe.ts:161
↓ 1 callers
Method
_encodeOrdinaryNative
(text: string)
tokenizer/bpe.ts:145
↓ 1 callers
Method
_getTlSpecialRegex
()
tokenizer/bpe.ts:131
↓ 1 callers
Method
deleteMessage
(chatId: number, messageId: number)
telegram.ts:159
↓ 1 callers
Method
encodeOrdinary
(text: string)
tokenizer/bpe.ts:211
↓ 1 callers
Method
getFile
(fileId: string)
telegram.ts:174
↓ 1 callers
Method
getFileUrl
(fileId: string)
telegram.ts:180
↓ 1 callers
Method
getMe
()
telegram.ts:59
↓ 1 callers
Method
getWebhookInfo
()
telegram.ts:75
↓ 1 callers
Function
handleCallbackQuery
( chat: db.Chat, userId: number, messageId: number, callbackQueryId: string, callbackData:
index.ts:256
↓ 1 callers
Function
handleWebhookUpdate
(update: t.Update)
index.ts:994
↓ 1 callers
Function
initializeBot
()
index.ts:31
↓ 1 callers
Method
inverted
()
tokenizer/bpe.ts:30
↓ 1 callers
Function
prettyVoice
(code: string)
pretty-voice.ts:162
↓ 1 callers
Function
processUserMessage
( user: db.User, chat: db.Chat, message: t.Message, )
index.ts:415
↓ 1 callers
Method
sendVoice
( chatId: number, messageId: number, caption: string, readable: Readable,
telegram.ts:187
↓ 1 callers
Method
setMyCommands
( commands: Array<{ command: string; description: string }>, )
telegram.ts:66
↓ 1 callers
Method
setWebhook
({ url }: { url: string })
telegram.ts:80
↓ 1 callers
Function
streamTokensToTelegram
( chatId: number, initMessageId: number, // TODO: Chunks don't actually represent tokens. Rename.
index.ts:1138
↓ 1 callers
Function
stringChunksOf
(length: number, text: string)
telegram.ts:265
↓ 1 callers
Function
transcribeOggStream
(input: Readable)
index.ts:109
Method
_read
(size: number)
tts.ts:101
Function
bytePairSplit
(piece: Uint8Array, ranks: RankMap)
tokenizer/bpe.ts:80
Function
changeVoice
( chatId: number, voiceCode: string, )
db.ts:114
Function
chunksOf
(chunkSize: number, arr: T[])
util.ts:7
Function
clearPrompts
(userId: number)
db.ts:23
Method
constructor
(readonly status: Status)
openai.ts:238
Method
constructor
(message: string, readonly status: number)
telegram.ts:8
Method
constructor
(token: string)
telegram.ts:16
Method
constructor
(pullStream: sdk.PullAudioOutputStream)
tts.ts:96
Method
constructor
( encoder: RankMap, specialTokensEncoder: Map<string, number>, regex: RegExp, )
tokenizer/bpe.ts:96
Function
dalleGenerateImages
( prompt: string, count: number, )
openai.ts:263
Method
decodeBytes
(tokens: number[])
tokenizer/bpe.ts:246
Method
decodeSingleTokenBytes
(token: number)
tokenizer/bpe.ts:250
Function
detectLanguage
(text: string)
openai.ts:135
Function
editLoop
()
index.ts:1167
Method
encode
(text: string, allowedSpecial: Set<string>)
tokenizer/bpe.ts:215
Method
encodeSinglePiece
(piece: Uint8Array)
tokenizer/bpe.ts:238
Method
encodeSingleToken
(piece: Uint8Array)
tokenizer/bpe.ts:226
Method
encodeWithUnstable
( text: string, allowedSpecial: Set<string>, )
tokenizer/bpe.ts:219
Function
getMonthUsage
()
openai.ts:300
Function
getPrevPrompt
(chatId: Chat['id'])
db.ts:33
Function
handleGroupMessage
( userId: number, chat: db.Chat, message: t.Message, )
index.ts:980
Function
insertAnswer
({ userId, chatId, prompt, messageId, answer, promptTokens, answerTokens, gptE
db.ts:146
Function
isModel
(m: string)
db.ts:314
Function
listHistory
( chatId: number, systemPrompt: string, userPrompt: string, )
db.ts:222
Method
sendMessageChain
( chatId: number, text: string, replyToMessageId: number, // If true, not even
telegram.ts:126
Function
setMasterPrompt
( chatId: number, masterPrompt: string | null, )
db.ts:83
Function
setModel
(chatId: number, model: Model)
db.ts:192
Function
setTemperature
( chatId: number, temperature: number, )
db.ts:203
Function
setTtsElapsed
( promptId: number, elapsed: number, )
db.ts:130
Function
setVoiceResponse
( chatId: number, isEnabled: boolean, )
db.ts:69
Function
splitTake
(limit: number, text: string)
util.ts:18
Function
streamChatCompletions
( messages: db.Message[], model: 'gpt-3.5-turbo' | 'gpt-4', temperature: number, )
openai.ts:31
Function
streamTextCompletions
( prompt: string, temperature: number, )
openai.ts:186
Function
synthesize
( // messageId: number, text: string, voice: string, )
tts.ts:5
Function
textCompletion
( prompt: string, temperature: number, )
openai.ts:167
Method
tokenByteValues
()
tokenizer/bpe.ts:259
Function
transcribeAudio
( mp3Stream: Readable, )
openai.ts:21
Function
upsertChat
( id: number, type: string, uname: string | undefined, )
db.ts:97
Function
upsertUser
( id: number, uname: string, lang: string | undefined, )
db.ts:48
Function
validateStatus
(status)
openai.ts:45
Function
voiceFromLanguageCode
(code: string)
voice.ts:44