Compare commits

..

6 Commits

  1. 1
      .gitignore
  2. 96
      .idea/workspace.xml
  3. 3
      events/ready.js
  4. 3316
      package-lock.json
  5. 5
      package.json
  6. 75
      util/lht.js
  7. 17
      util/time.js

1
.gitignore vendored

@ -2,6 +2,7 @@ node_modules/
config.json
auth.json
test.js
gauth.json
/.idea/
api/**/*

@ -4,11 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="826c705b-a7fa-4ece-b82a-e278fca7d494" name="Changes" comment="more avatar bugs">
<change afterPath="$PROJECT_DIR$/slash/fun/nowplaying.js" afterDir="false" />
<list default="true" id="826c705b-a7fa-4ece-b82a-e278fca7d494" name="Changes" comment="bully savi">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/util/lht.js" beforeDir="false" afterPath="$PROJECT_DIR$/util/lht.js" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -19,12 +17,19 @@
<option name="RECENT_TEMPLATES">
<list>
<option value="JavaScript File" />
<option value="TypeScript File" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitHubPullRequestSearchHistory">{
&quot;lastFilter&quot;: {
&quot;state&quot;: &quot;OPEN&quot;,
&quot;assignee&quot;: &quot;WubzyGD&quot;
}
}</component>
<component name="GitSEFilterConfiguration">
<file-type-list>
<filtered-out-file-type name="LOCAL_BRANCH" />
@ -33,12 +38,21 @@
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
</file-type-list>
</component>
<component name="GithubPullRequestsUISettings">{
&quot;selectedUrlAndAccountId&quot;: {
&quot;url&quot;: &quot;https://github.com/NatsukiDev/Natsuki&quot;,
&quot;accountId&quot;: &quot;a2fe51af-f1ea-4d53-a0fa-bb9dd34a3ffc&quot;
}
}</component>
<component name="MacroExpansionManager">
<option name="directoryName" value="4aelbj7e" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 5
}</component>
<component name="ProjectId" id="1wWIAa3TuwhYwX0w4tzIs42s0ZG" />
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" />
@ -47,23 +61,22 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
<property name="NEW_TOOLWINDOW_STRIPE_DEFAULTS" value="true" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="settings.editor.selected.configurable" value="MTConfigurable" />
<property name="ts.external.directory.path" value="C:\Program Files\JetBrains\WebStorm 2021.2\plugins\JavaScriptLanguage\jsLanguageServicesImpl\external" />
<property name="ts.rename.search.for.dynamic.occurrences" value="true" />
<property name="vue.rearranger.settings.migration" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Users/wubzy/Desktop/bot/Natsuki&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;editor.breadcrumbs&quot;,
&quot;ts.external.directory.path&quot;: &quot;C:\\Users\\wubzy\\AppData\\Local\\Programs\\WebStorm\\plugins\\javascript-plugin\\jsLanguageServicesImpl\\external&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\clarkjr1836\Desktop\bot\Natsuki\util\ts" />
@ -141,6 +154,13 @@
<item itemvalue="npm.sync" />
</list>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-js-predefined-d6986cc7102b-822845ee3bb5-JavaScript-WS-243.23654.157" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
@ -177,6 +197,11 @@
<workItem from="1652646106603" duration="1287000" />
<workItem from="1655452467524" duration="126000" />
<workItem from="1660254007752" duration="1643000" />
<workItem from="1738896915425" duration="17813000" />
<workItem from="1738996919169" duration="12373000" />
<workItem from="1739479571984" duration="1608000" />
<workItem from="1740108343425" duration="3241000" />
<workItem from="1743256138504" duration="1360000" />
</task>
<task id="LOCAL-00001" summary="not even gonna explain">
<created>1640148826800</created>
@ -318,7 +343,28 @@
<option name="project" value="LOCAL" />
<updated>1647788334624</updated>
</task>
<option name="localTasksCounter" value="21" />
<task id="LOCAL-00021" summary="LHT scripting">
<created>1738924961613</created>
<option name="number" value="00021" />
<option name="presentableId" value="LOCAL-00021" />
<option name="project" value="LOCAL" />
<updated>1738924961613</updated>
</task>
<task id="LOCAL-00022" summary="internal event loop">
<created>1739137258111</created>
<option name="number" value="00022" />
<option name="presentableId" value="LOCAL-00022" />
<option name="project" value="LOCAL" />
<updated>1739137258111</updated>
</task>
<task id="LOCAL-00023" summary="bully savi">
<created>1739137274080</created>
<option name="number" value="00023" />
<option name="presentableId" value="LOCAL-00023" />
<option name="project" value="LOCAL" />
<updated>1739137274080</updated>
</task>
<option name="localTasksCounter" value="24" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -334,7 +380,6 @@
</entry>
</map>
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
@ -358,6 +403,9 @@
<MESSAGE value="marriage declining" />
<MESSAGE value="fix avatars" />
<MESSAGE value="more avatar bugs" />
<option name="LAST_COMMIT_MESSAGE" value="more avatar bugs" />
<MESSAGE value="LHT scripting" />
<MESSAGE value="internal event loop" />
<MESSAGE value="bully savi" />
<option name="LAST_COMMIT_MESSAGE" value="bully savi" />
</component>
</project>

@ -110,6 +110,9 @@ module.exports = async client => {
await botData.save();
}
await require('../util/time')(client);
await require('../util/lht')(client);
console.log(`${chalk.gray('\n[INFO]')} >> ${chalk.white(`This is restart #${botData.restarts}.`)}`);
let cms = new Date().getTime();

3316
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -8,14 +8,19 @@
"@discordjs/builders": "^0.12.0",
"@discordjs/rest": "^0.1.0-canary.0",
"@discordjs/voice": "^0.6.0",
"axios": "^1.7.9",
"canvas": "^2.9.0",
"chalk": "^4.1.0",
"cheerio": "^1.0.0",
"cron": "^1.8.2",
"dblapi.js": "^2.4.1",
"discord-api-types": "^0.22.0",
"discord.js": "^13.5.0",
"dreidels": "^0.5.2",
"fuzzysort": "^1.1.4",
"google-auth-library": "^9.15.1",
"google-spreadsheet": "^4.1.4",
"googleapis": "^144.0.0",
"gradient-string": "^2.0.0",
"lastfm": "^0.9.0",
"manyitems": "^1.0.2",

@ -0,0 +1,75 @@
const path = require('path');
const Discord = require('discord.js');
const axios = require("axios");
const cheerio = require('cheerio');
const {GoogleSpreadsheet} = require('google-spreadsheet');
const {google} = require('googleapis');
const {JWT} = require("google-auth-library");
const auth = require('../gauth.json');
module.exports = async client => { try {
const LH = await client.guilds.fetch('359107239056769044');
const UPDATES = await LH.channels.fetch('1337297601208516699');
let doc = new GoogleSpreadsheet('1JRQ3B4v56Hz1oi8NkGPH0ImAWrrMZXifetb24LMCN1s', new JWT({email: auth.client_email, key: auth.private_key, scopes: ['https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive.file']}));
await doc.loadInfo();
let sheet = doc.sheetsByIndex[0];
let rows = await sheet.getRows({limit: 500});
let raws = {};
rows.forEach(row => raws[row.get("NAME")] = {link: row.get("LINK RAW"), released: row.get("RELEASED"), raw: row.get("RAW")});
const compareRaws = async () => {
rows = await sheet.getRows({limit: 500});
for (let row of rows) {
if (row.get("RAW") !== raws[row.get("NAME")].raw) {
const {data} = await axios.get(row.get("LINK RAW"));
const $ = cheerio.load(data);
let img = '';
try {img = $('div.col-md-4 > div.text-center > img.thumbnail').attr('src');} catch {} //deviously easy web scrape
let embed = new Discord.MessageEmbed()
.setAuthor({name: "New Raw Posted"})
.setTitle(row.get("NAME")) //TODO IMAGES
.setDescription(`A new raw has been released for *${row.get("NAME")}*.\n\n*time to get to work~*`)
.addField("Old", `**${raws[row.get("NAME")].raw}**`, true)
.addField("New", `**${row.get("RAW")}**`, true)
.addField("Last LH Release", `**${row.get("RELEASED")}**`)
.setURL(row.get("LINK RAW"))
.setFooter({text: "Natsuki", iconURL: client.user.avatarURL()})
.setTimestamp()
if (img && typeof img === 'string' && img.startsWith('https')) {
/*const colors = await prominent(img, {amount: 3, format: 'hex'});*/
embed.setImage(img)
/*.setColor(colors[Math.floor(Math.random() * colors.length)])*/;
} /*else {*/embed.setColor('dc134c');/*}*/
UPDATES.send({
content: (row.get("ROLE") && row.get("ROLE").match(/\d+/g)) ? `<@&${row.get("ROLE")}>` : "I don't know what role to ping for this series!",
embeds: [embed]
}).catch(() => {});
}
raws[row.get("NAME")] = {link: row.get("LINK RAW"), released: row.get("RELEASED"), raw: row.get("RAW")};
}
};
//client.misc.timeTracker.on('minute', compareRaws);
client.misc.timeTracker.on('bullySavi', () => {
const bullies = [
"Ohhhhhh Saviiiii you busy? No? Wanna fix that? (it's LHT time)", "LHT time~~", "u translating rn qt? i smell slacker. stinky",
"You already know why I'm here lol", "Are you ignoring these DMs yet?", "Time to translate some Farming Life :3", "It's ~~your worst nightmare~~Natsuki here~ you ready to do ~~slavery~~TL work?",
"hi i was told im supposed to bully u, dont shoot the messenger", "FBI open up! (i've run out of creative ways to tell you to do your job)", "TL time lol",
"ベリグットツランスレエタタイム", "knock knock, it's your TL work at the door, it wants child support", "bully bully bully bully bully time do your worky worky worky worky work time",
"if you leave LHT i'll leave with you slavery sucks ||just kidding time to do your job (it's unpaid)||", "\\> be you\n\\> be a TL\n\\> realize it's 10am\n\\>ihatemyjob.png", "hi"
];
client.users.fetch('204496174491631616').then(
u => u.send(bullies[Math.floor(Math.random() * bullies.length)])
.catch(() => client.users.fetch(client.developers[0]).then(w => w.send("I couldn't DM Savi!!")))
)
});
} catch {}};

@ -0,0 +1,17 @@
const moment = require('moment');
require('moment-precise-range-plugin');
const EventEmitter = require('node:events');
module.exports = client => {
client.misc.timeTracker = new EventEmitter();
setInterval(() => {
const time = moment();
if (time.hour() === 8 && time.minute() === 0) {client.misc.timeTracker.emit('bullySavi');}
client.misc.timeTracker.emit('minute', time);
}, 60000);
};
Loading…
Cancel
Save