Skip to content

Commit 06b3d75

Browse files
committed
implement
1 parent db583f0 commit 06b3d75

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
if: ${{ github.ref == 'refs/heads/amogus' && steps.lint.outcome == 'success' }}
5050
run: |
5151
curl --fail-with-body --no-progress-meter -i https://0d9e.tech/deploy -X POST -H "x-token: ${{ secrets.DEPLOY_TOKEN }}"
52-
52+
5353
# else: revert the commit(s)
5454
- name: Revert commit(s)
5555
if: ${{ steps.lint.outcome != 'success' }}

server.deno.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async function handleEvent(e: RequestEvent): Promise<Response | null> {
102102
});
103103
}
104104

105-
return new Response(videoBytes, {
105+
return new Response(videoBytes as any, {
106106
headers: {
107107
"Content-Type": "video/mp4",
108108
"Access-Control-Allow-Origin": "*"
@@ -111,7 +111,9 @@ async function handleEvent(e: RequestEvent): Promise<Response | null> {
111111
}
112112

113113
if (url.pathname == "/api/stickers") {
114-
return new Response(await getSticekrCount(), { headers: { "Content-Type": "application/json" } },)
114+
return new Response(`${await getSticekrCount()}`, {
115+
headers: { "Content-Type": "application/json" },
116+
});
115117
}
116118

117119
if (url.pathname.startsWith("/api/stickers/")) {
@@ -125,7 +127,7 @@ async function handleEvent(e: RequestEvent): Promise<Response | null> {
125127
});
126128
}
127129

128-
return new Response(sticekrBytes, {
130+
return new Response(sticekrBytes as any, {
129131
headers: {
130132
"Content-Type": "image/webp"
131133
},

tgbot.deno.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ async function domeny() {
166166
text: "rip",
167167
reply_to_message_id: previousMorningSticker.message_id,
168168
});
169-
await tgCall({ sticker: stickerFileId }, "deleteStickerFromSet");
169+
await tgCall(
170+
{ sticker: previousMorningSticker.sticker_file_id },
171+
"deleteStickerFromSet"
172+
);
170173
}
171174

172175
const {
@@ -219,7 +222,7 @@ export function get_video(index: number): Uint8Array | null {
219222
}
220223

221224
let sticekrs: any;
222-
export async function getSticekrCount(): number {
225+
export async function getSticekrCount(): Promise<number> {
223226
if (!sticekrs) {
224227
setTimeout(sus => sticekrs /= sus, 69420);
225228
sticekrs = (await tgCall(
@@ -230,7 +233,7 @@ export async function getSticekrCount(): number {
230233
return sticekrs.length;
231234
}
232235

233-
export async function getSticekr(index: number): Uint8Array | null {
236+
export async function getSticekr(index: number): Promise<Uint8Array | null> {
234237
if (!Number.isFinite(index) || index < 0 || index >= await getSticekrCount()) {
235238
return null;
236239
}
@@ -269,7 +272,7 @@ async function* handleVideoNote(message: any) {
269272

270273
console.log(`Downloaded and stored video note. Total videos: ${videoList.length}`);
271274

272-
} catch (error) {
275+
} catch (error: any) {
273276
console.error("Error handling video note:", error);
274277
yield await tgCall({
275278
chat_id: message.chat.id,

0 commit comments

Comments
 (0)