Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sticker support #164

Merged
merged 3 commits into from
Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<h1 id="koishi"><a href="https://koishi.js.org/" target="_blank">Koishi</a></h1>

[![Codecov](https://img.shields.io/codecov/c/github/koishijs/koishi?style=flat-square)](https://codecov.io/gh/koishijs/koishi)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/koishijs/koishi.svg?style=flat-square)](https://lgtm.com/projects/g/koishijs/koishi/context:javascript)
[![npm](https://img.shields.io/npm/v/koishi?style=flat-square)](https://www.npmjs.com/package/koishi)
[![GitHub](https://img.shields.io/github/license/koishijs/koishi?style=flat-square)](https://github.com/koishijs/koishi/blob/master/LICENSE)

Expand Down
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}]`
shigma marked this conversation as resolved.
Show resolved Hide resolved
}
for (const entity of message.entities || []) {
if (entity.type === 'mention') {
const name = msg.substr(entity.offset, entity.length)
Expand Down