Skip to content

Commit

Permalink
add sticker support
Browse files Browse the repository at this point in the history
  • Loading branch information
Anillc committed Mar 19, 2021
1 parent fba4aa9 commit 29dcaa9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/adapter-telegram/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export default class HttpServer extends Adapter<'telegram'> {
const { data } = await axios.get(endpoint + '/bot' + token + `/getFile?file_id=${fid}`)
msg += ` [CQ:image,file=${fid},url=${endpoint}/file/bot${token}/${data.result.file_path}]`
}
if (message.sticker) {
const fid = message.sticker.fileId
const { data } = await axios.get(endpoint + '/bot' + token + `/getFile?file_id=${fid}`)
msg += ` [CQ:image,file=${fid},url=${endpoint}/file/bot${token}/${data.result.file_path}]`
}
for (const entity of message.entities || []) {
if (entity.type === 'mention') {
const name = msg.substr(entity.offset, entity.length)
Expand Down

0 comments on commit 29dcaa9

Please sign in to comment.