Skip to content

Commit

Permalink
✨ tweet new video
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivien Mouret committed Jun 19, 2024
1 parent 020c6ef commit 05a898e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions core/mobbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ const { Client } = require('tmi.js'),
axios = require('axios'),
fs = require('node:fs'),
path = require('node:path'),
WebSocketClient = require('websocket').client,
webSocket = new WebSocketClient(),
{ TwitterApi } = require('twitter-api-v2'),
rwClient = xApi.readWrite,
{ clientId, identity, channels, x } = require('./config.json'),
{ randomIntFromInterval, getCurrentDatetime, randomColor, downloadImagesFromUrl } = require('./utils.js'),
{ users: regular_users } = require('../resx/regular_users.json'),
Expand Down Expand Up @@ -340,9 +339,7 @@ class MobBot {
return console.log(`[${getCurrentDatetime('comm')}] Error function liveNotif() : GUID [${gD}] and/or AXIOS [${axios}]`);
};

const { client } = await dynamic('@gradio/client'),
rwClient = xApi.readWrite;

const { client } = await dynamic('@gradio/client');
let guidDot = gD,
channelTwitch = ['💻incoming', '🎦-fox-stream-🎦', 'twitch-support-🎥', 'bots'],
guid = '',
Expand Down Expand Up @@ -486,6 +483,18 @@ class MobBot {
console.log(`[${getCurrentDatetime('comm')}] VIDEONOTIFRROR Can't get video's information : `, err);
};

try {
await rwClient.v2.tweet({
text: `${title}\
\n${descp}\
\n#daftmob #youtube #pepe\
\n\nhttps://www.youtube.com/watch?v=${urI}`
});
console.log(`[${getCurrentDatetime('comm')}] YTBVIDEO Tweet ${title}`);
} catch (err) {
console.log(`[${getCurrentDatetime('comm')}] VIDEONOTIFRROR XAPI Tweet Error : `, err);
};

for (let chan in channelYoutube) {
var channelSend = client.channels.cache.find(channel => channel.name == channelYoutube[chan]);
if (channelSend.id == undefined) break;
Expand Down

0 comments on commit 05a898e

Please sign in to comment.