Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zaraz sam to zrobię #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/database.sqlite
/node_modules
/.idea
/.vs
/.vs
.env
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\bot.js"
}
]
}
34 changes: 34 additions & 0 deletions commands/score.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
name: "score",
description: "wyświrtla/updateuje tablice wyników",
aliases: [],
usage: 'score [twój wynik] | score',
category: 'fun',
execute(client, message) {
const Keyv = require('keyv')
const keyv = new Keyv(client.config.pathToDatabase);

const args = message.content.split(/ +/);

function sortByValueAndIndex(data) {

}

if (args[1]) {
keyv.delete(message.author.id)
keyv.set(message.author.id, args[1])
let prevScore = keyv.get(message.author.id)
if (prevScore) {
message.channel.send("Jest")
} else {
message.channel.send("Nie ma")
}
message.channel.send(`${prevScore}`)
message.channel.send(`<@${message.author.id}> pobił rekord z `);

} else {

}

}
}
1 change: 1 addition & 0 deletions events/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = (client, message) => {
if (message.author.bot) return;
if (message.content === "mucha") message.channel.send("rucha karalucha")
if (message.content === "america") message.channel.send("FUCK YEAH!!!");
if (message.content.split(' ')[0] === "score") client.commands.get("score").execute(client, message);
if (message.content.indexOf(client.config.prefix) !== 0) return;

const args = message.content.slice(client.config.prefix.length).split(/ +/);
Expand Down