-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings-example.php
More file actions
129 lines (116 loc) · 7.24 KB
/
settings-example.php
File metadata and controls
129 lines (116 loc) · 7.24 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
// settings
$admins = ['dw1']; // array of account names (registered nicks on rizon)
$network = 'libera'; // supported: libera, rizon, gamesurge, freenode
// $host='irc.libera.chat:6667';
$host = 'ssl://irc.libera.chat:7000'; // ssl
$server_pass = '';
$channel = '##examplechan';
$channel_key = '';
$nick = 'somebot'; // default nick
$test_channel = '##exampletest'; // run script as "php bot.php <instance> test" for test mode
$test_nick = 'somebot[beta]';
$user = 'your_username'; // Freenode account - required, for SASL
$pass = 'your_password';
$ident = 'bot'; // ident@...
$ircname = 'a happy little bot by ' . $admins[0]; // "real name" in /whois
$altchars = ['_', '^', '-', '`']; // for alt nicks
$custom_connect_ip = false;
$connect_ip = '1.2.3.4'; // source IP, ipv4 or ipv6
$custom_curl_iface = false;
$curl_iface = $connect_ip; // can be interface e.g. eth0 or ip
$stream_timeout = 320;
$youtube_api_key = '';
$short_url_service = ''; # tiny.cc, tinyurl, bit.ly, da.gd
$short_url_token = ''; # for tiny.cc use 'username:apiKey'. can be array for rotation
$translate_api_key = ''; // setting this enables !tr, see https://cloud.google.com/translate/docs/setup
$translate_max_chars = 50000; // per month, see https://cloud.google.com/translate/pricing
$auto_translate_titles = true; // auto-translate non-english link titles if page has <html lang=> attribute (requires $translate_api_key)
$imgur_client_id = '';
$currencylayer_key = '';
$tmdb_read_token = ''; // https://www.themoviedb.org/settings/api
$wolfram_appid = '';
$twitch_client_id = ''; // https://dev.twitch.tv
$twitch_client_secret = '';
$x_enabled = true; // native X (twitter) via graphql (requires working $curl_impersonate_binary)
$x_auth_token = ''; // optional: cookies for sensitive content
$x_ct0 = '';
$x_auto_translate = true; // auto-translate non-english X link previews (requires $translate_api_key)
$nitter_links_via_twitter = true;
$reddit_app_id = ''; // create a "script" type app at https://www.reddit.com/prefs/apps
$reddit_app_secret = '';
$spotify_client_id = ''; // create a "development mode" app at https://developer.spotify.com/dashboard
$spotify_client_secret = '';
$tor_enabled = false; // handle .onion urls
$tor_all = false; // get all urls through tor (not recommended due to anti-tor measures)
$tor_host = '127.0.0.1';
$tor_port = 9050;
$curl_impersonate_enabled = false; // https://github.com/lwthiker/curl-impersonate
$curl_impersonate_binary = '/usr/local/bin/curl_chrome116';
$curl_impersonate_skip_hosts = [
'i.imgur.com',
'i.postimg.cc',
'postimg.cc',
];
$proxy_by_host_enabled = false; // for e.g. evading extreme cloudflare protection when it blocks even with impersonate but you don't want to proxy everything using $curl_iface
$proxy_by_host_iface = 'tun0'; // can be interface e.g. tun0 or ip
$proxy_by_hosts = [
'truthsocial.com',
'links.truthsocial.com',
];
$warp_by_host_enabled = false; // use Cloudflare WARP (proxy mode) socks5 at 127.0.0.1:40000 for specific hosts
$warp_by_hosts = [
// 'example.com'
];
$ai_page_titles_enabled = false; // use AI to get page titles for certain hosts or fallback. gemini-only
$ai_page_titles_key = ''; // https://aistudio.google.com/apikey
$ai_page_titles_model = 'gemini-2.5-flash-lite'; // must support url_context https://ai.google.dev/gemini-api/docs/models
$ai_page_titles_hosts = []; // set to 'all' or an array of hostnames. these will only try AI title retrieval (if no other handling). often just fallback below is fine
$ai_page_titles_fallback = true; // use AI title if normal title retrieval fails
$ai_media_titles_enabled = false; // direct media link summaries/titles. jpg/png/webp/avif/gif images only unless $ai_media_titles_more_types enabled below
$ai_media_titles_key = ''; // https://platform.openai.com https://console.x.ai https://aistudio.google.com/apikey
$ai_media_titles_baseurl = 'https://generativelanguage.googleapis.com/v1beta/openai'; // https://api.openai.com/v1 https://api.x.ai/v1 https://generativelanguage.googleapis.com/v1beta/openai
$ai_media_titles_model = 'gemini-2.5-flash-lite'; // must be vision-capable https://platform.openai.com/docs/models https://docs.x.ai/docs/models https://ai.google.dev/gemini-api/docs/models
$ai_media_titles_prompt = 'very short summary on one line. dont describe the format e.g. "the image", "the chart", "a meme", just the subject/content/data. dont add unnecessary moral judgments like "outdated", "controversial", "offensive", "antisemitic". keep it short!';
$ai_media_titles_gif_ffmpeg = false; // use ffmpeg to convert gifs to mp4 for better analysis by AI. without this, and for >10MB, the first frame is used. will only work if more_types below has mp4 and ffmpeg is installed and in PATH
$ai_media_titles_gif_cloudinary = ''; // 'cloud_name:api_key:api_secret' for cloudinary to convert gifs to mp4 (free tier). without this, and for >10MB, the first frame is used. will only work if more_types below has mp4
// gemini can do videos and more. files > $max_download_size are skipped. see e.g. https://cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-5-flash
// $ai_media_titles_more_types = 'x-flv,quicktime,mpeg,mpegs,mpg,mp4,webm,wmv,3gpp,x-aac,flac,mp3,m4a,mpga,opus,pcm,wav,webm,pdf,x-matroska';
// replace in retrieved titles
$title_replaces = [
$connect_ip => '6.9.6.9', // for privacy (ip can still be determined by web logs)
gethostbyaddr($connect_ip) => 'example.com'
];
// nicks to ignore. also matches up to one additional non-alpha character
$ignore_nicks = [
// 'otherbot'
];
// urls to ignore titles for, starting with domain. e.g. 'example.com', 'example.com/path'
$ignore_urls = [
// 'example.com'
];
// flood protection
$flood_protection_on = true;
$flood_max_buffer_size = 20; // number of lines to keep in buffer, must meet or exceed maxes set below
$flood_max_conseq_lines = 20;
$flood_max_conseq_time = 600; // secs to +q for
$flood_max_dupe_lines = 3;
$flood_max_dupe_time = 600;
// more options
$perform_on_connect = ''; // raw commands to perform on connect before channel join separated by semicolon, e.g. MODE $nick +i; PRIVMSG someone :some thing
$allow_invalid_certs = false; // allow connections to sites with invalid ssl certificates
$title_bold = false; // bold url titles. requires channel not have mode +c which strips colors
$title_og = false; // use social media <meta property="og:title" ...> titles instead of <title> tags, if available
$voice_bot = false; // ask chanserv to voice the bot on join
$op_bot = false; // ask chanserv to op the bot on join. will also automatically enable $always_opped
$always_opped = false; // set to true if bot is auto-opped on join and should stay opped after admin actions
$disable_sasl = false;
$disable_nickserv = false; // note: nickserv not used if sasl enabled. affects authserv process on gamesurge network
$disable_help = false;
$disable_triggers = false; // disable global triggers, not admin or custom triggers
$disable_titles = false;
$skip_dupe_output = false; // avoid repeating lines which can trigger some flood bots
$title_cache_enabled = false; // shared between all bots running from same folder. recommended if cross-posting a lot
$title_cache_size = 128;
$max_download_size = 26214400; // skip curl requests if bigger than this
// see readme.md at https://github.com/dhjw/php-irc-bot for how to use custom triggers, loop processes and plugins