-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,557 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"1012645988227358803":"Marting Ple","290249492584857603":"Dino Pel","356564352284753923":"lor"} | ||
{"290249492584857603":"Barbara Bobeta","356564352284753923":"Lorena Ivani","734406365300260944":"Ema Zidar"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const user = require("../../commands/utility/user.js"); | ||
const dataInterface = require("../../scripts/dataInterface.js"); | ||
const sheetsInterface = require("../../scripts/sheetsInterface.js"); | ||
const messageInterface = require("../../scripts/messageInterface.js"); | ||
|
||
module.exports = { | ||
prefix: "one", | ||
async execute(interaction) { | ||
|
||
const userName = dataInterface.nameById(interaction.customId.split('_', 2)[1]); | ||
|
||
const message = (await interaction.channel.messages.fetch({limit: 1, cache: false})).at(0); | ||
|
||
const timeStamp = new Date(message.createdTimestamp); | ||
const date = `${timeStamp.getDate()}.${timeStamp.getMonth()+1}.`; | ||
|
||
sheetsInterface.enterPoints(userName, date, 1) | ||
.then(() => { | ||
console.log(`Entered one point to ${userName} on ${date}`); | ||
interaction.update(messageInterface.scoreSuccessInfo(userName, date, 1)); | ||
}).catch((e) => { | ||
if( e instanceof sheetsInterface.UnknownPersonError){ | ||
console.error(`Error entering one point to ${userName} on ${date}, no user ${userName}`); | ||
interaction.update(messageInterface.noName(userName)); | ||
} | ||
else{ | ||
throw e; | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const user = require("../../commands/utility/user.js"); | ||
const dataInterface = require("../../scripts/dataInterface.js"); | ||
const sheetsInterface = require("../../scripts/sheetsInterface.js"); | ||
const messageInterface = require("../../scripts/messageInterface.js"); | ||
const { TimestampStyles } = require("discord.js"); | ||
|
||
module.exports = { | ||
prefix: "oneSolo", | ||
async execute(interaction) { | ||
|
||
const userName = dataInterface.nameById(interaction.customId.split('_', 2)[1]); | ||
|
||
const message = (await interaction.channel.messages.fetch({limit: 1, cache: false})).at(0); | ||
|
||
const timeStamp = new Date(message.createdTimestamp); | ||
const date = `${timeStamp.getDate()}.${timeStamp.getMonth()+1}.`; | ||
|
||
sheetsInterface.enterSolo(userName, date, 1) | ||
.then(() => { | ||
console.log(`Entered one solo point to ${userName} on ${date}`); | ||
interaction.update(messageInterface.scoreSuccessInfo(userName, date, 1, true)); | ||
}).catch((e) => { | ||
if( e instanceof sheetsInterface.UnknownPersonError){ | ||
console.error(`Error entering one point to ${userName} on ${date}, no user ${userName}`); | ||
interaction.update(messageInterface.noName(userName)); | ||
} | ||
else if( e instanceof sheetsInterface.SoloRideError){ | ||
console.error(`Error entering one point to ${userName} on ${date}, too many solo rides`); | ||
interaction.update(messageInterface.soloLimit(userName)); | ||
} | ||
else{ | ||
throw e; | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const user = require("../../commands/utility/user.js"); | ||
const dataInterface = require("../../scripts/dataInterface.js"); | ||
const sheetsInterface = require("../../scripts/sheetsInterface.js"); | ||
const messageInterface = require("../../scripts/messageInterface.js"); | ||
|
||
module.exports = { | ||
prefix: "two", | ||
async execute(interaction) { | ||
|
||
const userName = dataInterface.nameById(interaction.customId.split('_', 2)[1]); | ||
|
||
const message = (await interaction.channel.messages.fetch({limit: 1, cache: false})).at(0); | ||
|
||
const timeStamp = new Date(message.createdTimestamp); | ||
const date = `${timeStamp.getDate()}.${timeStamp.getMonth()+1}.`; | ||
|
||
sheetsInterface.enterPoints(userName, date, 2) | ||
.then(() => { | ||
console.log(`Entered two points to ${userName} on ${date}`); | ||
interaction.update(messageInterface.scoreSuccessInfo(userName, date, 2)); | ||
}).catch((e) => { | ||
if( e instanceof sheetsInterface.UnknownPersonError){ | ||
console.error(`Error entering two points to ${userName} on ${date}, no user ${userName}`); | ||
interaction.update(messageInterface.noName(userName)); | ||
} | ||
else{ | ||
throw e; | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const user = require("../../commands/utility/user.js"); | ||
const dataInterface = require("../../scripts/dataInterface.js"); | ||
const sheetsInterface = require("../../scripts/sheetsInterface.js"); | ||
const messageInterface = require("../../scripts/messageInterface.js"); | ||
const { TimestampStyles } = require("discord.js"); | ||
|
||
module.exports = { | ||
prefix: "twoSolo", | ||
async execute(interaction) { | ||
|
||
const userName = dataInterface.nameById(interaction.customId.split('_', 2)[1]); | ||
|
||
const message = (await interaction.channel.messages.fetch({limit: 1, cache: false})).at(0); | ||
|
||
const timeStamp = new Date(message.createdTimestamp); | ||
const date = `${timeStamp.getDate()}.${timeStamp.getMonth()+1}.`; | ||
|
||
sheetsInterface.enterSolo(userName, date, 2) | ||
.then(() => { | ||
console.log(`Entered two solo points to ${userName} on ${date}`); | ||
interaction.update(messageInterface.scoreSuccessInfo(userName, date, 2, true)); | ||
}).catch((e) => { | ||
if( e instanceof sheetsInterface.UnknownPersonError){ | ||
console.error(`Error entering two points to ${userName} on ${date}, no user ${userName}`); | ||
interaction.update(messageInterface.noName(userName)); | ||
} | ||
else if( e instanceof sheetsInterface.SoloRideError){ | ||
console.error(`Error entering two points to ${userName} on ${date}, too many solo rides`); | ||
interaction.update(messageInterface.soloLimit(userName)); | ||
} | ||
else{ | ||
throw e; | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.