This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
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
14 changed files
with
358 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
### 3.1.0 - 2017-09-24 | ||
* Add Friend Code commands | ||
* Add `config.js.example` | ||
* Fix `meme.js` throwing an error | ||
|
||
# 3.0.0 - 2017-09-06 | ||
* Initial release | ||
* Initial release | ||
|
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
desc: "Register your friend code", | ||
usage: '<friend code>, [Mii name]', | ||
process: (msg, flags, authorId, fcm) => { | ||
let miiName = (msg.length > 1 ? msg.splice(1).join(',').trim() : null); | ||
let user = fcm.getUser(authorId); | ||
let success = user.addFC(msg[0], miiName); | ||
fcm.addUser(user); | ||
return (success ? `Registered ${user.fc[user.fc.length - 1].fc} for ${authorId} as ${miiName}.` : `Error: could not add friend code.`); | ||
} | ||
}; |
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,21 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
desc: "Add game information to your account.", | ||
usage: '<abbreviated game>, <in-game name>, [TSV value]', | ||
process: (msg, flags, authorId, fcm) => { | ||
if (msg.length < 2) { | ||
return null; | ||
} | ||
|
||
let user = fcm.getUser(authorId); | ||
let game = msg[0].trim(); | ||
let ign = msg[1].trim(); | ||
let tsv = (msg.length > 2 ? msg[2].trim().slice(0, 4) : null); | ||
|
||
let success = user.addGame(game, ign, tsv); | ||
fcm.addUser(user); | ||
|
||
return (success ? `Registered ${user.games[user.games.length - 1].game} for ${authorId} as ${user.games[user.games.length - 1].name}.` : `Error: could not add game information.`); | ||
} | ||
}; |
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,22 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
desc: "Remove friend code.", | ||
usage: '<friend code|friend code index>', | ||
process: (msg, flags, authorId, fcm) => { | ||
if (msg[0].length === 0) { | ||
return null; | ||
} | ||
|
||
let user = fcm.getUser(authorId); | ||
let fc = msg[0].replace(/\D/g, '').slice(0, 12); | ||
if (fc.length < 12) { | ||
fc = parseInt(fc); | ||
} | ||
|
||
user.removeFC(fc); | ||
fcm.addUser(user); | ||
|
||
return "Friend code removed." | ||
} | ||
}; |
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,18 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
desc: "Remove game.", | ||
usage: '<game|game index>', | ||
process: (msg, flags, authorId, fcm) => { | ||
if (msg[0].length === 0) { | ||
return null; | ||
} | ||
let user = fcm.getUser(authorId); | ||
let game = msg[0].trim().toLowerCase(); | ||
|
||
let success = user.removeGame(game); | ||
fcm.addUser(user); | ||
|
||
return (success ? "Game entry removed." : "Error: could not remove game entry"); | ||
} | ||
}; |
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,37 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
desc: "Get friend code information of a user.", | ||
longDesc: "Retrieve friend code information of a user along with a list of the games they own. If no Discord ID is provided, your information will be displayed. Discord ID is retrievable by enabling Developer Mode via Settings → Appearance → Advanced → Developer Mode. Once Developer Mode is activated, you can right click any user and select the \"Copy ID\" function to obtain another user's Discord ID.", | ||
usage: '[Discord ID]', | ||
process: (msg, flags, authorId, fcm) => { | ||
let queryId = ((msg[0].length === 0 ? authorId : msg[0])+'').trim(); | ||
let user = fcm.getUser(queryId); | ||
|
||
let sendMsg = [ | ||
`${queryId}:` | ||
]; | ||
|
||
//FC data | ||
sendMsg.push("Friend Code info:"); | ||
if (user.fc.length === 0) { | ||
sendMsg.push(" - No friend code information found."); | ||
} else { | ||
for (let i = 0; i < user.fc.length; i++) { | ||
sendMsg.push(` - [${i}] ${user.fc[i].fc} (Mii: ${user.fc[i].mii || "No name provided"})`); | ||
} | ||
} | ||
|
||
//Game data | ||
sendMsg.push("Owned games info:"); | ||
if (user.games.length === 0) { | ||
sendMsg.push(" - No game information found."); | ||
} else { | ||
for (let i = 0; i < user.games.length; i++) { | ||
sendMsg.push(` - [${i}] ${user.games[i].game} (Name: ${user.games[i].name}) (TSV: ${user.games[i].tsv || "Not known"})`); | ||
} | ||
} | ||
|
||
return sendMsg; | ||
} | ||
}; |
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,26 @@ | ||
'use strict'; | ||
|
||
module.exports.token = ''; | ||
module.exports.admins = [130830896495329280]; | ||
|
||
module.exports.dexCommandPrefix = "//"; | ||
module.exports.botCommandPrefix = "//"; | ||
module.exports.helpCommand = "help"; | ||
module.exports.flagPrefix = "--"; | ||
module.exports.forcePM = 1500; | ||
module.exports.maxMsgLength = 1950; | ||
module.exports.maxPMs = 10; | ||
|
||
module.exports.messageOptions = { | ||
tts: false, | ||
disableEveryone: true | ||
}; | ||
|
||
module.exports.lokidb = './storage.json'; | ||
module.exports.avatar = 'avatar.png'; | ||
module.exports.defaultPresence = { | ||
'status': 'online', | ||
'game': `${module.exports.dexCommandPrefix}${module.exports.helpCommand}` | ||
}; | ||
|
||
module.exports.defaultGen = 7; |
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
Oops, something went wrong.