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

chore: upstream latest changes to dev #58

Merged
merged 10 commits into from
Dec 8, 2023
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
dist
src/config.ts
package-lock.json
json.sqlite
json.sqlite
.idea
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<h3 align=center>Unleash the full potential of your server.</h3>

<div align=center>
<img src="https://forthebadge.com/images/badges/built-with-love.svg">
<img src="https://img.shields.io/github/stars/shadowrunners/Evelyn?style=for-the-badge" />
</a>

<a href="#">
<img src="https://forthebadge.com/images/badges/contains-tasty-spaghetti-code.svg"
<img src="https://img.shields.io/discord/838499177243738172?style=for-the-badge" />
</a>

<a href="https://buymeacoffee.com/scr3ppie">
<img src="https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?style=for-the-badge"
<img src="https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?style=for-the-badge"
</a>
</div>

Expand All @@ -27,7 +27,7 @@ Evelyn is an open-source Discord Bot made as a safe alternative to bots that are
- 🎧 **Music**: `music play`, `music volume`, `music queue`, `music skip`, `music pause`, `music resume`, `music stop`, `music shuffle`, `music lyrics`.
- 📦 **Miscellaneous**: `avatar`, `anime`, `announce`, `leaderboard`, `movie`, `rank`, `remind`, `show`, `userinfo`, `serverinfo`.
- 😀 **Actions**: `actions (bite, blush, bonk, bully, cringe, cry, cuddle, handhold, highfive, hug, kill, kiss, pat poke, slap, smile, wave, yeet)`
- 📷 **Fun**: `cat`, `game (2048, 8ball, connect4, findemoji, guessthatpokemon, hangman, minesweeper, rps, snake, tictactoe, trivia, wordle, wouldyourather)`, `image (awooify, baguette, blurpify, captcha, changemymind, deepfry, kannagen, phcomment, threats, trash, trumptweet, tweet)`.
- 📷 **Fun**: `cat`, `image (awooify, baguette, blurpify, captcha, changemymind, deepfry, kannagen, phcomment, threats, trash, trumptweet, tweet)`.

## Credits
> DISCLAIMER: Evelyn uses various APIs but is not endorsed nor certified by the respective teams that actively maintain these APIs.
Expand All @@ -42,8 +42,6 @@ Evelyn is powered by the following APIs:
- [waifu.pics](https://waifu.pics) - used for the actions system
- [NekoBot](https://nekobot.xyz) - used for the image system



If we used your code and forgot to add you to the credits, shoot me a message over on Discord at scrappie#5451.

To avoid confusion with our hosted version of Evelyn, you are not allowed to publicly host another instance of Evelyn under the same name and use the same avatar.
6 changes: 0 additions & 6 deletions nodemon.json

This file was deleted.

73 changes: 49 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,63 @@
"main": "dist/launch.js",
"type": "module",
"scripts": {
"start": "ts-node-esm ./src/launch.ts",
"dev": "nodemon"
"start": "tsx launch.ts",
"build": "tsup --watch",
"dev": "tsx --watch launch.ts",
"debug": "tsx --inspect --watch src/launch.ts"
},
"files": [
"dist"
],
"tsup": {
"dts": true,
"bundle": false,
"treeshake": true,
"target": "node16",
"format": [
"esm"
],
"entry": [
"src/**/*.ts",
"launch.ts"
]
},
"dependencies": {
"@colors/colors": "^1.6.0",
"@discordx/importer": "^1.2.2",
"@discordx/utilities": "^5.2.1",
"@shadowrunners/automata": "^2.4.1",
"@discordx/importer": "^1.3.0",
"@discordx/utilities": "^6.1.0",
"@sentry/browser": "^7.86.0",
"@sentry/cli": "^2.23.0",
"@sentry/node": "^7.86.0",
"@sentry/profiling-node": "^1.2.6",
"@shadowrunners/automata": "^2.4.3",
"captcha-canvas": "^3.2.1",
"cryptr": "^6.2.0",
"discord-arts": "^0.4.0",
"cryptr": "^6.3.0",
"discord-arts": "^0.5.8",
"discord-economy-super": "^1.7.6",
"discord-giveaways-super": "^1.0.0",
"discord-html-transcripts": "^3.1.5",
"discord-giveaways-super": "^1.0.9",
"discord-html-transcripts": "^3.2.0",
"discord-xp": "github:MrAugu/discord-xp",
"discord.js": "^14.12.1",
"discordx": "^11.7.6",
"genius-lyrics": "^4.4.3",
"glob": "^10.3.3",
"mongoose": "^7.4.2",
"discord.js": "^14.14.1",
"discordx": "^11.9.0",
"genius-lyrics": "^4.4.6",
"glob": "^10.3.10",
"mongoose": "^8.0.3",
"ms": "^2.1.3",
"musicard": "^1.5.2",
"node-replicate": "^2.0.0",
"superagent": "^8.0.9"
"superagent": "^8.1.2"
},
"devDependencies": {
"@types/superagent": "^4.1.18",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint": "^8.46.0",
"nodemon": "^3.0.1",
"prettier": "^3.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
"@types/ms": "^0.7.34",
"@types/superagent": "^4.1.24",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"eslint": "^8.55.0",
"prettier": "^3.1.0",
"tsup": "^8.0.1",
"tsx": "^4.6.2",
"typescript": "^5.3.3"
},
"repository": {
"type": "git",
Expand All @@ -48,4 +73,4 @@
"url": "https://github.com/shadowrunners/evelyn/issues"
},
"homepage": "https://github.com/shadowrunners/evelyn#readme"
}
}
2 changes: 1 addition & 1 deletion src/Commands/Developer/status.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChatInputCommandInteraction, EmbedBuilder } from 'discord.js';
import { Util } from '../../Utils/Utils/util.js';
import { Util } from '../../Utils/Utils/Util.js';
import { Discord, Slash, Guild } from 'discordx';
import { config } from '../../config.js';
import { Evelyn } from '../../Evelyn.js';
Expand Down
4 changes: 2 additions & 2 deletions src/Evelyn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Evelyn extends Client {
process.on('unhandledRejection', (err) => console.log(err));
process.on('unhandledException', (err) => console.log(err));
}

/**
* Loads music events.
* @param {Evelyn} client - The client object.
Expand All @@ -103,7 +103,7 @@ export class Evelyn extends Client {
/** Imports all commands and events then launches a new instance of the bot. */
public async launch() {
await importx(
`${dirname(import.meta.url)}/{events/djxManaged,commands}/**/*.{ts,js}`,
`${dirname(import.meta.url)}/{Events/djxManaged,Commands}/**/*.{ts,js}`,
);

await this.loadMusic(this);
Expand Down
4 changes: 2 additions & 2 deletions src/Events/djxManaged/Guild/guildCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { Discord, On } from 'discordx';
@Discord()
export class CreateGuildData {
@On({ event: 'guildCreate' })
async createData(guild: Guild, client: Evelyn) {
async createData([guild]: [Guild], client: Evelyn) {
const { name, memberCount, id } = guild;
const webhook = new WebhookClient({ url: client.config.debug.watcherHook });

await DB.create({ id });
await DB.create({ guildId: id });

const embed = new EmbedBuilder()
.setColor('Blurple')
Expand Down
4 changes: 2 additions & 2 deletions src/Events/djxManaged/Guild/guildDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { Discord, On } from 'discordx';
@Discord()
export class ClearGuildData {
@On({ event: 'guildDelete' })
async deleteData(guild: Guild, client: Evelyn) {
async deleteData([guild]: [Guild], client: Evelyn) {
const { iconURL, name, memberCount, id } = guild;
const webhook = new WebhookClient({ url: client.config.debug.watcherHook });

await DB.findOneAndDelete({
id,
guildId: id,
});

const embed = new EmbedBuilder()
Expand Down
4 changes: 3 additions & 1 deletion src/Events/djxManaged/Interaction/interactionCreate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isBlacklisted } from '../../../Utils/Utils/isBlacklisted.js';
import { isBlacklisted } from '../../../Utils/Helpers/isBlacklisted.js';
// import { captureException } from '@sentry/browser';
import { Discord, On, ArgsOf } from 'discordx';
import { Evelyn } from '../../../Evelyn.js';

Expand All @@ -15,6 +16,7 @@ export class OnInteraction {
}
catch (err) {
console.log(err);
// return captureException(err);
}
}
}
45 changes: 37 additions & 8 deletions src/Events/djxManaged/Logging/channelCreate.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,46 @@
import { OWLogs, validate } from '../../../Utils/Utils/OWLogs.js';
import { getAuditLog, send, validate } from '../../../Utils/Helpers/loggerUtils.js';
import { AuditLogEvent, EmbedBuilder, GuildChannel } from 'discord.js';
import { Evelyn } from '../../../Evelyn.js';
import { GuildChannel } from 'discord.js';
import { Discord, On } from 'discordx';

@Discord()
export class ChannelCreate {
@On({ event: 'channelCreate' })
export class channelCreate {
@On({ event: 'channelCreate' })
async channelCreate([channel]: [GuildChannel], client: Evelyn) {
const { guild } = channel;
if (!await validate(channel.guildId)) return;

if (!(await validate(guild))) return;
const logs = new OWLogs(guild, client);
const audit = await getAuditLog({
type: AuditLogEvent.ChannelCreate,
guild: channel.guild,
});

return await logs.channelCreate(channel);
const embed = new EmbedBuilder()
.setColor('Blurple')
.setAuthor({
name: channel.guild.name,
iconURL: channel.guild.iconURL(),
})
.setTitle('Channel Created')
.addFields(
{
name: '🔹 | Channel Name',
value: `> ${channel.name}`,
},
{
name: '🔹 | ID',
value: `> ${channel.id}`,
},
{
name: '🔹 | Created by',
value: `> ${audit.executor}`,
},
)
.setTimestamp();

return await send({
guild: channel.guildId,
client,
embed,
});
}
}
48 changes: 37 additions & 11 deletions src/Events/djxManaged/Logging/channelDelete.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
import { OWLogs, validate } from '../../../Utils/Utils/OWLogs.js';
import { getAuditLog, send, validate } from '../../../Utils/Helpers/loggerUtils.js';
import { AuditLogEvent, EmbedBuilder, GuildChannel } from 'discord.js';
import { Evelyn } from '../../../Evelyn.js';
import { APIMessage, GuildChannel } from 'discord.js';
import { Discord, On } from 'discordx';

@Discord()
export class ChannelDelete {
export class channelDelete {
@On({ event: 'channelDelete' })
async channelDelete(
[channel]: [GuildChannel],
client: Evelyn,
): Promise<APIMessage> {
const { guild } = channel;
async channelDelete([channel]: [GuildChannel], client: Evelyn) {
if (!await validate(channel.guildId)) return;

if (!(await validate(guild))) return;
const logs = new OWLogs(guild, client);
const audit = await getAuditLog({
type: AuditLogEvent.ChannelDelete,
guild: channel.guild,
});

return await logs.channelDelete(channel);
const embed = new EmbedBuilder()
.setColor('Blurple')
.setAuthor({
name: channel.guild.name,
iconURL: channel.guild.iconURL(),
})
.setTitle('Channel Deleted')
.addFields(
{
name: '🔹 | Channel Name',
value: `> ${channel.name}`,
},
{
name: '🔹 | ID',
value: `> ${channel.id}`,
},
{
name: '🔹 | Deleted by',
value: `> ${audit.executor}`,
},
)
.setTimestamp();

return await send({
guild: channel.guildId,
client,
embed,
});
}
}
Loading
Loading