Skip to content

Commit

Permalink
pushed undefined error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GenericallyNamed committed Jan 14, 2023
1 parent a5dd553 commit e11fced
Show file tree
Hide file tree
Showing 4 changed files with 289 additions and 1 deletion.
4 changes: 4 additions & 0 deletions events/interactionCreate/rps.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { isUndefined } = require("lodash");
const { mongoClient, gameId } = require("../..");
const { reactionRoleMessage } = require("../..");
const wait = require('node:timers/promises').setTimeout;
Expand All @@ -8,6 +9,9 @@ function getRandomSelection() {

module.exports = async (interaction, user) => {
//console.log("Event triggered");
if(isUndefined(interaction.customId)) {
return;
}
const data = JSON.parse(interaction.customId);
if (interaction.isButton() && data.game_id == gameId.roshambo) {
let db = await mongoClient.db('botCasino');
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,5 @@ client.on('ready', c => {
});
client.channels.cache.get(roleMessage.channel).messages.fetch(roleMessage.message);
});

// Log in to Discord with your client's token
client.login(token);
233 changes: 233 additions & 0 deletions out/linecounter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
{
"extension": "linecounter",
"version": "0.2.7",
"workspace": "/home/alex/dev/abot",
"linecount": [
{
"version": "0.2.7",
"counttime": "2023-01-13 23:54:04",
"filesum": 32,
"codesum": 3058,
"commentsum": 149,
"blanksum": 66,
"statistics": {
"": {
"code": 4,
"comment": 0,
"blank": 0
},
".js": {
"code": 1066,
"comment": 148,
"blank": 56
},
".md": {
"code": 35,
"comment": 1,
"blank": 10
},
".json": {
"code": 1953,
"comment": 0,
"blank": 0
}
},
"filelist": [
{
"blank": 0,
"code": 4,
"comment": 0,
"filename": ".gitignore"
},
{
"blank": 1,
"code": 53,
"comment": 5,
"filename": "commands/casino/bonus.js"
},
{
"blank": 1,
"code": 31,
"comment": 3,
"filename": "commands/casino/coins.js"
},
{
"blank": 2,
"code": 70,
"comment": 9,
"filename": "commands/casino/games/coinflip.js"
},
{
"blank": 10,
"code": 122,
"comment": 7,
"filename": "commands/casino/games/dice.js"
},
{
"blank": 3,
"code": 82,
"comment": 9,
"filename": "commands/casino/games/roshambo.js"
},
{
"blank": 2,
"code": 90,
"comment": 2,
"filename": "commands/casino/getJob.js"
},
{
"blank": 1,
"code": 57,
"comment": 2,
"filename": "commands/casino/work.js"
},
{
"blank": 1,
"code": 11,
"comment": 2,
"filename": "commands/coursenotes.js"
},
{
"blank": 1,
"code": 45,
"comment": 3,
"filename": "commands/create.js"
},
{
"blank": 1,
"code": 9,
"comment": 2,
"filename": "commands/gpr.js"
},
{
"blank": 5,
"code": 72,
"comment": 8,
"filename": "commands/help.js"
},
{
"blank": 1,
"code": 29,
"comment": 0,
"filename": "commands/invite.js"
},
{
"blank": 1,
"code": 16,
"comment": 8,
"filename": "commands/joinCasino.js"
},
{
"blank": 1,
"code": 27,
"comment": 8,
"filename": "commands/leaveCasino.js"
},
{
"blank": 1,
"code": 30,
"comment": 9,
"filename": "commands/piazza.js"
},
{
"blank": 1,
"code": 11,
"comment": 8,
"filename": "commands/ping.js"
},
{
"blank": 1,
"code": 42,
"comment": 4,
"filename": "commands/react.js"
},
{
"blank": 1,
"code": 42,
"comment": 4,
"filename": "commands/reply.js"
},
{
"blank": 1,
"code": 33,
"comment": 0,
"filename": "commands/send.js"
},
{
"blank": 1,
"code": 11,
"comment": 2,
"filename": "commands/sourcecode.js"
},
{
"blank": 7,
"code": 17,
"comment": 6,
"filename": "db.js"
},
{
"blank": 1,
"code": 8,
"comment": 33,
"filename": "events/interactionCreate/coinflip.js"
},
{
"blank": 2,
"code": 59,
"comment": 5,
"filename": "events/interactionCreate/rps.js"
},
{
"blank": 0,
"code": 15,
"comment": 0,
"filename": "events/messageCreate/soon.js"
},
{
"blank": 1,
"code": 18,
"comment": 2,
"filename": "events/messageReactionAdd/roles.js"
},
{
"blank": 8,
"code": 66,
"comment": 7,
"filename": "index.js"
},
{
"filename": "meta/background-crop.png",
"isbinaryfile": true,
"blank": 0,
"code": 0,
"comment": 0
},
{
"filename": "meta/background.png",
"isbinaryfile": true,
"blank": 0,
"code": 0,
"comment": 0
},
{
"blank": 0,
"code": 1897,
"comment": 0,
"filename": "package-lock.json"
},
{
"blank": 0,
"code": 56,
"comment": 0,
"filename": "package.json"
},
{
"blank": 10,
"code": 35,
"comment": 1,
"filename": "README.md"
}
]
}
]
}
52 changes: 52 additions & 0 deletions out/linecounter.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
===============================================================================
EXTENSION NAME : linecounter
EXTENSION VERSION : 0.2.7
-------------------------------------------------------------------------------
count time : 2023-01-13 23:54:04
count workspace : /home/alex/dev/abot
total files : 32
total code lines : 3058
total comment lines : 149
total blank lines : 66

statistics
| extension| total code| total comment| total blank|percent|
-------------------------------------------------------------------------
| | 4| 0| 0| 0.13|
| .js| 1066| 148| 56| 35|
| .md| 35| 1| 10| 1.1|
| .json| 1953| 0| 0| 64|
-------------------------------------------------------------------------
.gitignore, code is 4, comment is 0, blank is 0.
commands/casino/bonus.js, code is 53, comment is 5, blank is 1.
commands/casino/coins.js, code is 31, comment is 3, blank is 1.
commands/casino/games/coinflip.js, code is 70, comment is 9, blank is 2.
commands/casino/games/dice.js, code is 122, comment is 7, blank is 10.
commands/casino/games/roshambo.js, code is 82, comment is 9, blank is 3.
commands/casino/getJob.js, code is 90, comment is 2, blank is 2.
commands/casino/work.js, code is 57, comment is 2, blank is 1.
commands/coursenotes.js, code is 11, comment is 2, blank is 1.
commands/create.js, code is 45, comment is 3, blank is 1.
commands/gpr.js, code is 9, comment is 2, blank is 1.
commands/help.js, code is 72, comment is 8, blank is 5.
commands/invite.js, code is 29, comment is 0, blank is 1.
commands/joinCasino.js, code is 16, comment is 8, blank is 1.
commands/leaveCasino.js, code is 27, comment is 8, blank is 1.
commands/piazza.js, code is 30, comment is 9, blank is 1.
commands/ping.js, code is 11, comment is 8, blank is 1.
commands/react.js, code is 42, comment is 4, blank is 1.
commands/reply.js, code is 42, comment is 4, blank is 1.
commands/send.js, code is 33, comment is 0, blank is 1.
commands/sourcecode.js, code is 11, comment is 2, blank is 1.
db.js, code is 17, comment is 6, blank is 7.
events/interactionCreate/coinflip.js, code is 8, comment is 33, blank is 1.
events/interactionCreate/rps.js, code is 59, comment is 5, blank is 2.
events/messageCreate/soon.js, code is 15, comment is 0, blank is 0.
events/messageReactionAdd/roles.js, code is 18, comment is 2, blank is 1.
index.js, code is 66, comment is 7, blank is 8.
meta/background-crop.png, it is a binary file.
meta/background.png, it is a binary file.
package-lock.json, code is 1897, comment is 0, blank is 0.
package.json, code is 56, comment is 0, blank is 0.
README.md, code is 35, comment is 1, blank is 10.
===============================================================================

0 comments on commit e11fced

Please sign in to comment.