more generous daily windows

master
Kit Kasune 3 years ago
parent cdd51b5727
commit a23f709451
  1. 30
      .idea/workspace.xml
  2. 6
      commands/leveling/daily.js
  3. 2
      package.json

@ -4,8 +4,7 @@
<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="way more stable char commands"> <list default="true" id="826c705b-a7fa-4ece-b82a-e278fca7d494" name="Changes" comment="SCM package scripts">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" 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" />
@ -66,7 +65,7 @@
<command value="git pull origin master" /> <command value="git pull origin master" />
</option> </option>
</component> </component>
<component name="RunManager" selected="Node.js.bot.js"> <component name="RunManager" selected="npm.dev:pretty">
<configuration name="bot.js (1)" type="NodeJSConfigurationType" temporary="true" nameIsGenerated="true" path-to-js-file="$PROJECT_DIR$/../Natsukiv13/bot.js" working-dir="$PROJECT_DIR$/../Natsukiv13"> <configuration name="bot.js (1)" type="NodeJSConfigurationType" temporary="true" nameIsGenerated="true" path-to-js-file="$PROJECT_DIR$/../Natsukiv13/bot.js" working-dir="$PROJECT_DIR$/../Natsukiv13">
<method v="2" /> <method v="2" />
</configuration> </configuration>
@ -83,8 +82,19 @@
<envs /> <envs />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="dev:pretty" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="dev:pretty" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="npm.dev:pretty" />
<item itemvalue="Node.js.bot.js" /> <item itemvalue="Node.js.bot.js" />
<item itemvalue="npm.dev" /> <item itemvalue="npm.dev" />
<item itemvalue="Node.js.bot.js (1)" /> <item itemvalue="Node.js.bot.js (1)" />
@ -110,7 +120,7 @@
<workItem from="1641840125341" duration="1415000" /> <workItem from="1641840125341" duration="1415000" />
<workItem from="1642537991410" duration="3454000" /> <workItem from="1642537991410" duration="3454000" />
<workItem from="1642638383959" duration="700000" /> <workItem from="1642638383959" duration="700000" />
<workItem from="1642707112676" duration="378000" /> <workItem from="1642707112676" duration="519000" />
</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>
@ -168,7 +178,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1642560099716</updated> <updated>1642560099716</updated>
</task> </task>
<option name="localTasksCounter" value="9" /> <task id="LOCAL-00009" summary="SCM package scripts">
<created>1642707545761</created>
<option name="number" value="00009" />
<option name="presentableId" value="LOCAL-00009" />
<option name="project" value="LOCAL" />
<updated>1642707545761</updated>
</task>
<option name="localTasksCounter" value="10" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -196,6 +213,7 @@
<MESSAGE value="anime char overload prevention" /> <MESSAGE value="anime char overload prevention" />
<MESSAGE value="start on 0th page for anime paginations" /> <MESSAGE value="start on 0th page for anime paginations" />
<MESSAGE value="way more stable char commands" /> <MESSAGE value="way more stable char commands" />
<option name="LAST_COMMIT_MESSAGE" value="way more stable char commands" /> <MESSAGE value="SCM package scripts" />
<option name="LAST_COMMIT_MESSAGE" value="SCM package scripts" />
</component> </component>
</project> </project>

@ -20,16 +20,16 @@ module.exports = {
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let tm = await Monners.findOne({uid: message.author.id}) || new Monners({uid: message.author.id}); let tm = await Monners.findOne({uid: message.author.id}) || new Monners({uid: message.author.id});
if (!client.misc.cache.monners[message.author.id]) {client.misc.cache.monners[message.author.id] = tm.currency;} if (!client.misc.cache.monners[message.author.id]) {client.misc.cache.monners[message.author.id] = tm.currency;}
if (tm.daily && tm.daily.last && ((new Date().getTime() - tm.daily.last) < (1000 * 60 * 60 * 24))) { if (tm.daily && tm.daily.last && ((new Date().getTime() - tm.daily.last) < (1000 * 60 * 60 * 22))) {
return message.channel.send({embeds: [new Discord.MessageEmbed() return message.channel.send({embeds: [new Discord.MessageEmbed()
.setAuthor({iconURL: message.guild ? message.member.displayAvatarURL() : message.author.iconURL(), name: message.guild ? message.member.displayName : message.author.username}) .setAuthor({iconURL: message.guild ? message.member.displayAvatarURL() : message.author.iconURL(), name: message.guild ? message.member.displayName : message.author.username})
.setDescription(`Your daily is not available yet! You can claim your next daily in **${moment.preciseDiff(new Date().getTime(), tm.daily.last + (1000 * 60 * 60 * 24))}**`) .setDescription(`Your daily is not available yet! You can claim your next daily in **${moment.preciseDiff(new Date().getTime(), tm.daily.last + (1000 * 60 * 60 * 22))}**`)
.setColor('c92a45') .setColor('c92a45')
]}); ]});
} }
if (!tm.daily || !Object.keys(tm.daily).length) {tm.daily = {total: 0, last: new Date().getTime(), streak: 0};} if (!tm.daily || !Object.keys(tm.daily).length) {tm.daily = {total: 0, last: new Date().getTime(), streak: 0};}
let streakIncrease = false; let streakIncrease = false;
if (new Date().getTime() - tm.daily.last < (1000 * 60 * 60 * 36)) { if (new Date().getTime() - tm.daily.last < (1000 * 60 * 60 * 47)) {
streakIncrease = true; streakIncrease = true;
tm.daily.streak++ tm.daily.streak++
} else {tm.daily.streak = 1;} } else {tm.daily.streak = 1;}

@ -32,8 +32,10 @@
}, },
"scripts": { "scripts": {
"start": "node bot.js", "start": "node bot.js",
"start:pretty": "node bot.js -g -s",
"swin": "run", "swin": "run",
"dev": "node bot.js -dev", "dev": "node bot.js -dev",
"dev:pretty": "node bot.js -dev -g -s",
"presync": "git pull origin master", "presync": "git pull origin master",
"sync": "git push origin master", "sync": "git push origin master",
"postsync": "git push wubzy master" "postsync": "git push wubzy master"

Loading…
Cancel
Save