-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsocials.gs
More file actions
31 lines (25 loc) · 1.17 KB
/
Copy pathsocials.gs
File metadata and controls
31 lines (25 loc) · 1.17 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
const DRIVE_GIF_FOLDER_ID = '1DgzVx8aL6PgPm0-Np9gQMPywUEBVBxuA';
const CREW_LOOKUP_ID = '19itGq86BRQTVehKhtRFKwK8gZqjsUQ_bG5cuVmem9HU';
function sendCrewTweet() {
const crew = getCrewLookupStringFromActiveSpreadsheet_();
const emoji = lookupEmojiForCrew_(crew);
const message = `${emoji}🏴☠️🤙\n${crew} call starts now!\ndiscord.pizzadao.xyz`;
const mediaId = uploadRandomGifFromCrewSubfolder_(DRIVE_GIF_FOLDER_ID, crew);
const url = 'https://api.twitter.com/2/tweets';
const payload = JSON.stringify({ text: message, media: { media_ids: [mediaId] } });
const authHeader = buildOAuth1Header_('POST', url, {});
const res = UrlFetchApp.fetch(url, {
method: 'post',
contentType: 'application/json',
headers: { Authorization: authHeader },
payload: payload,
muteHttpExceptions: true
});
const json = JSON.parse(res.getContentText());
return `https://x.com/i/web/status/${json.data.id}`;
}
function startDiscordEvent() {
const url = 'https://pizzadao-discord-bot-production-b713.up.railway.app/start-event-by-id';
const apiKey = PropertiesService.getScriptProperties().getProperty('BOT_API_KEY');
// ... rest of event lookup logic ...
}