-
Notifications
You must be signed in to change notification settings - Fork 13
/
config.go
59 lines (48 loc) · 1.66 KB
/
config.go
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
// archiver - config
// 2020-10-27 21:52
// Benny <benny.think@gmail.com>
package main
import (
tb "gopkg.in/telebot.v3"
"os"
"time"
)
var token = os.Getenv("TOKEN")
var attempt = 20
var sleep = time.Second * 5
var requestCount = 0
// post, param: url
var saveUrl = "https://web.archive.org/save/"
// get, https://web.archive.org/save/status/5d3157ab-6a03-4987-9847-b0e53ee84be9?_t=1603886202734
var statusUrl = "https://web.archive.org/save/status/"
type status struct {
Status string `json:"status"`
Timestamp string `json:"timestamp"`
Duration float32 `json:"duration_sec"`
OriginalUrl string `json:"original_url"`
}
const (
Receive = "🎬 Request received..."
Processing = "⌛️ Processing..."
Updating = "🗜️ Updating archive result...%d/%d for %s"
Finish = "🎉 Archive complete"
InvalidRequest = "❌ Your request was invalid"
ArchiveNoResult = "⚠️ Archive request has been submitted successfully. But I don't know result."
ArchiveStatusTimeout = "❌ Archive status timeout"
ArchiveRequestFailed = "❌ Request to %s failed: %v"
aboutText = "Wayback Machine bot by @BennyThink \nGitHub: https://github.com/tgbot-collection/archiver"
startText = "Hi! I'm the [Internet Archive Wayback Machine bot](https://archive.org/web/).\n" +
"You can send me any url and I'll archive it for you."
)
const (
modeNormal = "normal"
modeAI = "ai"
userRole = "user"
systemRole = "system"
assistantRole = "assistant"
)
var (
OpenAIKey = os.Getenv("OPENAI_API_KEY")
selector = &tb.ReplyMarkup{}
btnPrev = selector.Data("Ask AI", "ai-init", "1")
)