Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #24 from plastik-flasche/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
FlorianSchwarzl authored Feb 10, 2023
2 parents 93a462e + 330af10 commit 0c43c7e
Show file tree
Hide file tree
Showing 186 changed files with 3,978 additions and 2,678 deletions.
63 changes: 63 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-extra-semi": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
"prefer-const": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": false,
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-var-requires": "off",
"no-constant-condition": "warn",
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"@typescript-eslint/no-empty-function": "off",
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"warn",
"double"
],
"semi": [
"warn",
"always"
]
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ node_modules
package-lock.json
.vscode
logs/*
!**/.gitkeep
!**/.gitkeep
Times.json
40 changes: 20 additions & 20 deletions Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
## Economy

- [x] balance
- [ ] beg
- [x] beg
- [x] bet
- [x] deposit
- [x] job
- [x] level
- [x] resetBalance
- [x] resetLevel
- [ ] resetBalance
- [ ] resetLevel
- [x] search
- [x] withdraw
- [x] work

## Games

- [x] coinflip
- [x] numberGuess
- [ ] coinflip
- [ ] numberGuess

## General

- [ ] help
- [x] info
- [x] invite
- [x] inviteBot
- [x] serverInfo
- [x] userInfo
- [ ] info
- [ ] invite
- [ ] inviteBot
- [ ] serverInfo
- [ ] userInfo

## Moderation

Expand All @@ -45,15 +45,15 @@

## Music

- [x] clear-queue
- [x] loop
- [x] nowPlaying
- [x] pause
- [x] play
- [x] queue
- [ ] clear-queue
- [ ] loop
- [ ] nowPlaying
- [ ] pause
- [ ] play
- [ ] queue
COMING SOON! - [ ] remove
- [x] resume
- [x] shuffle
- [x] skip
- [x] stop
- [ ] resume
- [ ] shuffle
- [ ] skip
- [ ] stop
- [ ] troll
14 changes: 8 additions & 6 deletions Issues.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Issues

- [ ] When outputting time, format seconds to seconds, minutes, hours, days, ...
- [x] When outputting time, format seconds to seconds, minutes, hours, days, ...
- [x] When resetting balance/level the YES/NO message can be seen by everyone which would reset the balance of everyone clicking on the button
- [ ] Fix help command
- [x] Fix help command
- [x] Fix coinflip: returned nothing
- [x] Fix !numberguess:
Number was generated! The number is: NaN
You're number is false!
__returned nothing__
- [x] Fix queue: if queue is too long it could exceed the 2000 character limit imposed by discord
- [x] deferReply() will crash the bot
- [ ] beg is currently broken
- [x] beg is currently broken
- [ ] fix bet messages, kinda ugly and overcrowded imo
- [x] search returns nothing
- [ ] rewrite search so it used buttons instead of having to listen for messages sent by the user
- [x] rewrite search so it used buttons instead of having to listen for messages sent by the user
- [x] withdraw returns nothing
- [ ] can't check balance of other users
- [ ] make a leaderboard command
- [x] coinflip returns nothing
- [x] coinflip has no right to exist in the current state
- [ ] clear works only when deleting under 50 messages, else it times out
- [x] clear works only when deleting under 50 messages, else it times out
- [ ] all set-*-channel commands are broken as they don't work with slash commands
- [ ] tempban "guildInfo" is not defined
- [ ] unban doesn't work at all
Expand Down Expand Up @@ -53,6 +53,8 @@ message_reference: Unknown message
}
}
- [x] troll returns nothing
- [ ] search gives you a cooldown even when you didn't search anything
- [x] search gives you a cooldown even when you didn't search anything
- [ ] job doesn't display which level is required to get the job
- [ ] coinflip "You are victorious!"... Like WTF?! Mb think 5 secs before writing that
- [x] when adding videos via an url, the bot doesn't check if the url is valid, so the queue element could be undefined, when trying to skip and it's undefined the bot prints an error to the console and doesn't skip the song, when asked to skip again it skips to the song after the undefined one
- [x] when joining from another channel, the bot says "Leaving channel because it is empty" and leaves the channel
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,6 @@ SUS-Bot is a Bot we made for our Discord Server "Stupid Useless Server" (SUS). I

## How to use

### Self Hosting

1. Clone the Repository
2. Create the `.env` file and fill it with the following content:

```env
TOKEN= # Your Discord Bot Token
PREFIX= # The Prefix you want to use. For example: !
PORT= # Port you want your Website to run on. Example: 80 (http)
MONGODB= # Your mongodb connection string
```

3. Open CMD
4. Navigate to the Repository
5. Install the Dependencies with `npm i`
6. Run the Bot with `node .`
7. Enjoy

### Invite the Bot

Disclaimer! The Bot is currently under heavy development so it might not be online all the time.
Expand All @@ -35,6 +17,24 @@ P.S. If you want to invite the Bot to your Server, you need to have the `Manage

P.P.S. The prefix for the hosted Version is `!`

### Self Hosting

1. Clone the Repository
2. Create the `.env` file and fill it with the following content:

```env
TOKEN= # Your Discord Bot Token
PREFIX= # The Prefix you want to use. For example: !
PORT= # Port you want your Website to run on. Example: 80 (http)
MONGODB= # Your mongodb connection string
```
3. Open CMD
4. Navigate to the Repository
5. Install the Dependencies with `npm i`
6. Run the Bot with `node .`
7. Enjoy
## Commands
- [ ] means work in progress!
Expand Down
10 changes: 0 additions & 10 deletions buttons/economy/resetBalance.js

This file was deleted.

12 changes: 12 additions & 0 deletions buttons/economy/resetBalance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component } from "../../types/command";

import userList from "../../schemas/user";

module.exports = {
run(_client, _interaction, _args, _guildData, userData) {
userData.economy.wallet = 0;
userData.economy.bank = 0;
userList.findByIdAndUpdate(userData._id, { economy: userData.economy }, (_err: Error, _data: unknown) => { });
return { content: "Your balance has been reset!", disableOriginal: true };
}
} as Component;
9 changes: 0 additions & 9 deletions buttons/economy/resetLevel.js

This file was deleted.

11 changes: 11 additions & 0 deletions buttons/economy/resetLevel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component } from "../../types/command";

import userList from "../../schemas/user";

module.exports = {
run(_client, _interaction, _args, _guildData, userData) {
userData.level.xp = 0;
userList.findByIdAndUpdate(userData._id, { level: userData.level }, (_err: Error, _data: unknown) => { });
return { content: "Your level has been reset!", disableOriginal: true };
}
} as Component;
20 changes: 20 additions & 0 deletions buttons/economy/search.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Component } from "../../types/command";

import userList from "../../schemas/user";
import { Random } from "sussy-util";

module.exports = {
name: "search",
commandOptions: {
cooldown: 60
},
async run(_client, _interaction, args, _guildData, userData) {
const amount = Random.randomInt(900, 1600);
const current = userData.economy;
current.wallet += amount;
userList.findByIdAndUpdate(userData._id, { economy: current }, (_err: Error, _data: unknown) => { });
userData.level.xp += 2;
userList.findByIdAndUpdate(userData._id, { level: userData.level }, (_err: Error, _data: unknown) => { });
return { content: `You found ${amount} gold in the ${args[0]}.`, disableOriginal: true, success: ["command:search", this] };
}
} as Component;
26 changes: 0 additions & 26 deletions buttons/general/support.js

This file was deleted.

28 changes: 28 additions & 0 deletions buttons/general/support.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Component } from "../../types/command";

import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";

module.exports = {
run(_client, _interaction) {
const choice = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setLabel("GitHub")
.setStyle(ButtonStyle.Link)
.setURL("https://github.com/plastik-flasche/SUS-Bot"),
new ButtonBuilder()
.setLabel("Patreon")
.setStyle(ButtonStyle.Link)
.setURL("https://patreon.com/stupid-useless-patreon"),
new ButtonBuilder()
.setLabel("PayPal")
.setStyle(ButtonStyle.Link)
.setURL("https://paypal.me/stupiduselesspaypal"),
// new ButtonBuilder()
// .setLabel("Crypto")
// .setStyle("LINK")
// .setURL("")
);
return { content: "If you can code, help us out on our Github, if not, maybe buy us some more processing power!", components: [choice] };
}
} as Component;
12 changes: 0 additions & 12 deletions buttons/music/play_pause.js

This file was deleted.

16 changes: 16 additions & 0 deletions buttons/music/play_pause.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Component } from "../../types/command";

module.exports = {
commandOptions: {
connectedToSameVC: true
},
run(client, interaction) {
let returnValue = client.player.pause(interaction);
if (returnValue !== "The track is already paused") {
return returnValue;
} else {
returnValue = client.player.resume(interaction);
}
return returnValue;
}
} as Component;
9 changes: 0 additions & 9 deletions commands/economy/balance.js

This file was deleted.

Loading

0 comments on commit 0c43c7e

Please sign in to comment.