Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
notaestheticallyducko committed Aug 28, 2023
1 parent 5367bcd commit 6beab1a
Show file tree
Hide file tree
Showing 19 changed files with 750 additions and 116 deletions.
84 changes: 42 additions & 42 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
"env": {
"browser": true,
"es2021": true,
"es6": true
},
"extends": ["eslint:recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "prettier"],
"rules": {
// Base rules
"no-undef": ["off"],
"camelcase": ["warn"],
"arrow-spacing": [
"error",
{
"before": true,
"after": true
}
],
"no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"vars": "all"
}
],
"no-inner-declarations": "off",
"no-var": "error",
"no-unexpected-multiline": "error",
// Prettier rules
"prettier/prettier": [
"warn",
{},
{
"usePrettierrc": true
}
]
}
"env": {
"browser": true,
"es2021": true,
"es6": true
},
"extends": ["eslint:recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "prettier"],
"rules": {
// Base rules
"no-undef": ["off"],
"camelcase": ["warn"],
"arrow-spacing": [
"error",
{
"before": true,
"after": true
}
],
"no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"vars": "all"
}
],
"no-inner-declarations": "off",
"no-var": "error",
"no-unexpected-multiline": "error",
// Prettier rules
"prettier/prettier": [
"warn",
{},
{
"usePrettierrc": true
}
]
}
}
18 changes: 9 additions & 9 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/node_modules": true
}
}
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,25 @@ Welcome to the repository for GVO - the coolest Discord bot out there! This bot

## Table of Contents

- [Introduction](#introduction)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Introduction](#introduction)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## Introduction

GVO is a Discord bot built using [Discord.js](https://discord.js.org/), designed to make your server interactions more engaging and entertaining. It's developed with a focus on simplicity, customization, and of course, awesomeness.
GVO is a Discord bot built using [Discord.js](https://discord.js.org/), designed to make your server interactions more engaging and entertaining. It's developed with a focus on simplicity, customization, and of course, good vibes!

## Features

- **Random Quotes**: Spice up the conversation with random quotes on daily basis.
- **Social Media**: Get notified when your favorite streamer goes live!
- **Polls**: Conduct polls among your server members to gather opinions quickly.
- **Moderation Tools**: Keep your server in check with built-in auto-moderation.
- **And More!**: Explore the bot to discover even more awesome features.
- **Random Quotes**: Spice up the conversation with random quotes on daily basis.
- **Social Media**: Get notified when your favorite streamer goes live!
- **Polls**: Conduct polls among your server members to gather opinions quickly.
- **Moderation Tools**: Keep your server in check with built-in auto-moderation.
- **Multiple Languages**: Get the in your server in the language that fits your server
- **And More!**: Explore the bot to discover even more awesome features.

## Installation

Expand All @@ -52,7 +53,7 @@ If you want to host the bot yourself, follow these steps:

Once GVO is in your server, you can use various commands to unleash its awesomeness:

- `/help`: Display the list of available commands and how to use them.
- `/help`: Display the list of available commands and how to use them.

## Contributing

Expand Down
21 changes: 21 additions & 0 deletions locales/en-US/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"command": {
"error": "Oh no! An error occurred. Please try again or contact us through our server.",
"cooldown": "Please wait, you are on a cooldown for `{{commandName}}`. You can use it again <t:{{expiredTimestamp}}:R>."
},
"help": {
"author": "{{bot_username}} | Help",
"field1": {
"name": "Plans for GVO",
"value": "> We have a lot of plans for **{{bot_username}}** (GVO). These include a variety of modules, such as automatic quotes, channel statistics, welcome & goodbye system, and many more exciting features!"
},
"field2": {
"name": "Bot Statistics",
"value": "> **Guilds:** `{{guildCount}}`\n> **Users:** `{{userCount}}`"
},
"field3": {
"name": "Links",
"value": "> [Invite GVO]({{inviteLink}}) and [Join our Support Server]({{discordLink}})\n> Don't forget to visit our [Ko-fi Page]({{kofiLink}}) for more!"
}
}
}
109 changes: 58 additions & 51 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,60 @@
{
"name": "gvo-bot",
"version": "1.0.0",
"description": "",
"main": "/dist/index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"homepage": "https://gvobot.app",
"bugs": {
"url": "https://github.com/gvobot/bot/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/gvobot/bot"
},
"keywords": [
"goodvibesonly",
"good-vibes-only",
"discord-bot",
"discordjs",
"discord-js",
"discord"
],
"author": "duckodas",
"license": "MIT",
"devDependencies": {
"@types/i18next": "^13.0.0",
"@types/i18next-node-fs-backend": "^2.1.2",
"@types/node": "^20.4.8",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.1",
"prisma": "^5.1.1",
"typescript": "^5.1.6"
},
"dependencies": {
"@prisma/client": "^5.1.1",
"discord-hybrid-sharding": "^2.1.3",
"discord.js": "^14.12.1",
"dotenv": "^16.3.1",
"i18next": "^23.4.2",
"i18next-node-fs-backend": "^2.1.3",
"node-cron": "^3.0.2",
"node-fetch": "^3.3.2",
"sappquotes": "^3.0.1"
}
"name": "gvo-bot",
"version": "1.0.0",
"description": "GVO comes with enjoyment. It takes the best parts of discord tools and adds its own version.",
"main": "dist/sharding.js",
"type": "module",
"scripts": {
"start": "node dist/sharding.js",
"build": "npx tsc",
"dev": "npx tsc && node dist/sharding.js",
"watch": "npx tsc -w",
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
"format": "prettier --write '*/**/*.{js,jsx,ts,tsx}'",
"typesafe-i18n": "typesafe-i18n"
},
"homepage": "https://gvobot.app",
"bugs": {
"url": "https://github.com/gvobot/bot/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/gvobot/bot"
},
"keywords": [
"goodvibesonly",
"good-vibes-only",
"discord-bot",
"discordjs",
"discord-js",
"discord"
],
"author": "duckodas",
"license": "MIT",
"devDependencies": {
"@types/i18next": "^13.0.0",
"@types/i18next-node-fs-backend": "^2.1.2",
"@types/node": "^20.4.8",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.1",
"prisma": "^5.1.1",
"typescript": "^5.1.6"
},
"dependencies": {
"@prisma/client": "^5.1.1",
"discord-hybrid-sharding": "^2.1.3",
"discord.js": "^14.12.1",
"dotenv": "^16.3.1",
"i18next": "^23.4.2",
"i18next-node-fs-backend": "^2.1.3",
"node-cron": "^3.0.2",
"node-fetch": "^3.3.2",
"sappquotes": "^3.0.1",
"winston": "^3.10.0"
}
}
13 changes: 13 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}

model Guild {
id String @id @map("_id")
language String @default("en-US")
}
47 changes: 47 additions & 0 deletions src/commands/utility/help.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { DiscordClient } from '../../main.js';
import { CommandInterface } from '../../types/index';
import { ChatInputCommandInteraction, EmbedBuilder, PermissionFlagsBits, SlashCommandBuilder } from 'discord.js';
import { getGuilds, getUsers } from '../../helpers/discord.js';
import { t } from '../../helpers/i18n.js';

const command: CommandInterface = {
data: new SlashCommandBuilder()
.setName('help')
.setNSFW(false)
.setDescription('Get information about our bot')
.setDefaultMemberPermissions(PermissionFlagsBits.SendMessages)
.setDMPermission(false),
execute: async (interaction: ChatInputCommandInteraction, client: DiscordClient) => {
const Embed = new EmbedBuilder()
.setAuthor({
name: t('help.author', { bot_username: client.user?.username }),
iconURL: client.user?.displayAvatarURL(),
})
.setColor(client.config.colors.theme)
.addFields(
{
name: t('help.field1.name'),
value: t('help.field1.value', { bot_username: client.user?.username }),
},
{
name: t('help.field2.name'),
value: t('help.field2.value', {
guildCount: await getGuilds(client),
userCount: await getUsers(client),
}),
},
{
name: t('help.field3.name'),
value: t('help.field3.value', {
inviteLink: client.config.bot.invite,
discordLink: client.config.bot.discord,
kofiLink: client.config.links.kofi,
}),
},
)
.setFooter({ text: `Support my work by donating @ ko-fi.com/DuckoDas` });

interaction.reply({ embeds: [Embed] });
},
};
export default command;
30 changes: 30 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ConfigInterface } from './types/index';
import { ColorResolvable } from 'discord.js';
import 'dotenv/config';

export const config: ConfigInterface = {
bot: {
token: `${process.env.DISCORD_TOKEN}`,
invite: 'https://gvobot.app/invite',
discord: 'https://gvobot.app/discord',
},
links: {
website: 'https://gvobot.app/',
kofi: 'https://gvobot.app/kofi',
github: 'https://gvobot.app/github',
blog: 'https://gvobot.app/blog',
},
guilds: [
{ name: "Good Vibes Only - Test Server", id: '1113542893840367687' },
{ name: 'Good Vibes Only', id: '1126979648249659422' },
],
colors: {
theme: '#fee300' as ColorResolvable,
green: '#00E09E' as ColorResolvable,
red: '#FF434E' as ColorResolvable,
},
emojis: {
success: '😊',
error: '😥',
},
};
Loading

0 comments on commit 6beab1a

Please sign in to comment.