internal event loop

master
Kit Kasune 2 months ago
parent 04ad2f6c58
commit 7aa4f80379
  1. 45
      .idea/workspace.xml
  2. 1
      events/ready.js
  3. 17
      util/time.js

@ -4,13 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="826c705b-a7fa-4ece-b82a-e278fca7d494" name="Changes" comment="more avatar bugs"> <list default="true" id="826c705b-a7fa-4ece-b82a-e278fca7d494" name="Changes" comment="LHT scripting">
<change afterPath="$PROJECT_DIR$/util/lht.js" afterDir="false" /> <change afterPath="$PROJECT_DIR$/util/time.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/events/ready.js" beforeDir="false" afterPath="$PROJECT_DIR$/events/ready.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/events/ready.js" beforeDir="false" afterPath="$PROJECT_DIR$/events/ready.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/util/lht.js" beforeDir="false" afterPath="$PROJECT_DIR$/util/lht.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -49,18 +47,18 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"WebServerToolWindowFactoryState": "false", &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"settings.editor.selected.configurable": "terminal", &quot;settings.editor.selected.configurable&quot;: &quot;terminal&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\clarkjr1836\Desktop\bot\Natsuki\util\ts" /> <recent name="C:\Users\clarkjr1836\Desktop\bot\Natsuki\util\ts" />
@ -174,7 +172,8 @@
<workItem from="1652646106603" duration="1287000" /> <workItem from="1652646106603" duration="1287000" />
<workItem from="1655452467524" duration="126000" /> <workItem from="1655452467524" duration="126000" />
<workItem from="1660254007752" duration="1643000" /> <workItem from="1660254007752" duration="1643000" />
<workItem from="1738896915425" duration="15805000" /> <workItem from="1738896915425" duration="17813000" />
<workItem from="1738996919169" duration="6160000" />
</task> </task>
<task id="LOCAL-00001" summary="not even gonna explain"> <task id="LOCAL-00001" summary="not even gonna explain">
<created>1640148826800</created> <created>1640148826800</created>
@ -316,7 +315,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1647788334624</updated> <updated>1647788334624</updated>
</task> </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>
<option name="localTasksCounter" value="22" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -355,6 +361,7 @@
<MESSAGE value="marriage declining" /> <MESSAGE value="marriage declining" />
<MESSAGE value="fix avatars" /> <MESSAGE value="fix avatars" />
<MESSAGE value="more avatar bugs" /> <MESSAGE value="more avatar bugs" />
<option name="LAST_COMMIT_MESSAGE" value="more avatar bugs" /> <MESSAGE value="LHT scripting" />
<option name="LAST_COMMIT_MESSAGE" value="LHT scripting" />
</component> </component>
</project> </project>

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

@ -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() === 20 && time.minute() === 0) {client.misc.timeTracker.emit('bullySavi');}
client.misc.timeTracker.emit('minute', time);
}, 60000);
};
Loading…
Cancel
Save