Skip to content

Commit

Permalink
Fix to Tinder reset time and Emotecount
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Hagberg committed Jul 21, 2020
1 parent bd9e7b3 commit 80537f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
5 changes: 0 additions & 5 deletions functions/embeds.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
const { MessageEmbed } = require("discord.js");
const { prefix } = require("../config.js");
const { timeToMidnight, msToTime } = require("./functions");

const time2mid = timeToMidnight();
const time2midHrs = msToTime(time2mid);

const TinderHelp = new MessageEmbed()
.setTitle("Tinder help page")
.addFields(
{ name: "Rolls and likes", value: "Using the main command (`" + prefix + "tinder`), costs a roll!\nIf you decide to react with a 💚, you spend 1 like.\nIf you react with a 🌟, you spend all your rolls and likes.", inline: true },
{ name: "How to marry", value: "You can only marry someone you are dating.\nMarrying is simple, type `" + prefix + "tinder marry @someone`\nThey will have to react with a ❤️, to complete the process!", inline: true },
{ name: "Check status", value: "You can check who you have liked, disliked and who you are currently dating as well as who you have married.\n`" + prefix + "tinder list`", inline: true },
{ name: "Reset", value: "Rolls and likes reset every day. Currently resets in: " + time2midHrs, inline: true },
)
.setColor("#31e387")
.setImage();
Expand Down
4 changes: 2 additions & 2 deletions functions/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function DailyResetTimer() {
}, timeToMidnight());
}
function timeToMidnight(){
var d = new Date();
const d = new Date();
return (-d + d.setHours(24,0,0,0));
}
function EmoteDBStartup(client) {
Expand Down Expand Up @@ -149,7 +149,7 @@ function countEmotes(message) {
}

function msToTime(duration) {
var milliseconds = parseInt((duration % 1000) / 100),
let milliseconds = parseInt((duration % 1000) / 100),
seconds = Math.floor((duration / 1000) % 60),
minutes = Math.floor((duration / (1000 * 60)) % 60),
hours = Math.floor((duration / (1000 * 60 * 60)) % 24);
Expand Down
9 changes: 4 additions & 5 deletions functions/tinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ const Tinder = new db.table("Tinder");
const Discord = require("discord.js");
const { timeToMidnight, msToTime } = require("./functions");

const time2mid = timeToMidnight();
const time2midHrs = msToTime(time2mid);

function tinderprofile(message) {
//...
}
Expand All @@ -26,11 +23,13 @@ function TinderDBService(user) { // This is the peak of JS
console.log("Tinder Database Service | Ran " + i + " changes.");
}
function NoLikes() {

const time2mid = timeToMidnight();
const time2midHrs = msToTime(time2mid);
return "You don't have any more likes!\nLikes and rolls reset in: " + time2midHrs;
}
function NoRolls() {

const time2mid = timeToMidnight();
const time2midHrs = msToTime(time2mid);
return "You don't have any more rolls!\nLikes and rolls reset in: " + time2midHrs;
}

Expand Down

0 comments on commit 80537f2

Please sign in to comment.