-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbott.js
71 lines (36 loc) · 1.32 KB
/
bott.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const TelegramBot = require('node-telegram-bot-api');
const octokit = require('./octokit');
// Create a new Telegram bot instance
const bot = new TelegramBot('6229590445:AAGs8G4T_S8D3ojEBMNDef3kJ5E4HqSjj_I', {
polling: true,
});
// Define the search query
const searchQuery = 'tornadocash notes backup';
// Define the search options
const searchOptions = {
q: searchQuery,
sort: 'updated',
order: 'desc',
};
// Define the search interval
const searchInterval = 1 * 60 * 60 * 1000; // 1 hour in milliseconds
// Search for matching repositories every searchInterval milliseconds
setInterval(async () => {
try {
// Perform the search query
const searchResults = await octokit.search.repos(searchOptions);
// Extract the relevant information from the search results
const matchingRepos = searchResults.data.items.map((repo) => ({
name: repo.name,
url: repo.html_url,
description: repo.description,
}));
// Send a message for each matching repository
matchingRepos.forEach((repo) => {
const message = `Found a matching repository!\nName: ${repo.name}\nDescription: ${repo.description}\nURL: ${repo.url}`;
bot.sendMessage('5563994815', message);
});
} catch (error) {
console.error('Error performing search:', error);
}
}, searchInterval);