79
801. **Create a Slack App**:
81 - Go to [Slack API Apps](https://api.slack.com/apps) → Create New App → From scratch
82 - Name your app and select your workspace
83 - Click "Create App"
32};
33
34// Types for Slack API
35type SlackMessage = {
36 blocks: any[];
219
220 // Get PR details
221 const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}`;
222
223 let response;
241 return await response.json();
242 } catch (jsonError) {
243 throw new Error(`Failed to parse GitHub API response: ${jsonError.message}`);
244 }
245}
246
247// Merge a PR via GitHub API
248async function mergePR(repo: string, prNumber: number) {
249 const token = Deno.env.get("GITHUB_TOKEN");
282
283 // Proceed with merge
284 const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}/merge`;
285
286 const response = await fetch(url, {
137
138 try {
139 const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}`;
140
141 const response = await fetch(url, {
166 }
167 } catch (error) {
168 console.error("Exception during API call:", error);
169 return { success: false, message: error.message };
170 }
162 }
163
164 const url = `https://api.github.com/repos/${repo}/issues/${issueNumber}`;
165
166 const response = await fetch(url, {
195
196 try {
197 const url = `https://api.github.com/repos/${repo}/issues/${prNumber}/labels`;
198
199 const response = await fetch(url, {
99
100 try {
101 const url = `https://api.github.com/repos/${repo}/issues/${prNumber}/assignees`;
102
103 const response = await fetch(url, {
132 }
133 } catch (error) {
134 console.error("Exception during API call:", error);
135 return { success: false, message: error.message };
136 }
79
801. **Create a Slack App**:
81 - Go to [Slack API Apps](https://api.slack.com/apps) → Create New App → From scratch
82 - Name your app and select your workspace
83 - Click "Create App"
2import querystring from "npm:querystring";
3
4const NOW_PLAYING_ENDPOINT = "https://api.spotify.com/v1/me/player/currently-playing";
5const TOKEN_ENDPOINT = "https://accounts.spotify.com/api/token";
6
7const client_id = Deno.env.get("spotify_client_id");
4export default async function handleCron(interval) {
5 const following = await fetchCookie(
6 "https://www.instagram.com/api/v1/friendships/375942300/following/?query=miguelse10",
7 {
8 method: "GET",
2import querystring from "npm:querystring";
3
4const NOW_PLAYING_ENDPOINT = "https://api.spotify.com/v1/me/player/currently-playing";
5const TOKEN_ENDPOINT = "https://accounts.spotify.com/api/token";
6
7const client_id = Deno.env.get("client_id");
11 try {
12 const botToken = process.env.TELEGRAM_BOT_TOKEN;
13 const response = await fetch(`https://api.telegram.org/bot${botToken}/setWebhook`, {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },
37 const botToken = process.env.TELEGRAM_BOT_TOKEN;
38
39 const response = await fetch(`https://api.telegram.org/bot${botToken}/getWebhookInfo`);
40 const result = await response.json();
41 return result;