Skip to content

Commit

Permalink
add ava contribute
Browse files Browse the repository at this point in the history
  • Loading branch information
circa10a committed Jul 25, 2023
1 parent 2015b39 commit e533e87
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 51 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ npm start
- `catfact` - `ava catfact` gives random fact about cats.
- `coffee` - `ava coffee` gives you a random brand of coffee from wikipedia to try.
- `compliment` - `ava compliment @user1234` will tag the receiving users and deliver a random kind compliment.
- `contribute` - `ava contribute` will reply with the project source URL for contributions.
- `emoji` - `ava emoji something something` gives back the first small image result from a google search.
- `floridaman` - `ava floridaman` gives you back a random reddit post title from `/r/FloridaMan`.
- `fuck` - `ava fuck <person/thing>` gives back a personalized "Fuck You" from https://foaas.com.
Expand Down
24 changes: 24 additions & 0 deletions commands/contribute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Events } from 'discord.js';
import { messageForAva, splitArgs, getFileName } from '../lib/utils/utils.js';

const command = getFileName(import.meta.url);

const projectURL = 'https://github.com/circa10a/ava';

export default {
commandName: command,
name: Events.MessageCreate,
once: false,
execute(message) {
// Ensure message is intended for ava
if (!messageForAva(message)) {
return;
}
const args = splitArgs(message);
const userCmd = args[1];

if (userCmd == command) {
message.reply(projectURL);
}
},
};
99 changes: 53 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dependencies": {
"8ball": "^1.0.6",
"chrono-node": "^2.6.3",
"chrono-node": "^2.6.4",
"dammit": "^0.5.1",
"discord.js": "^14.11.0",
"html-entities": "^2.3.6",
"html-entities": "^2.4.0",
"image-search-engine": "^1.2.1",
"lowdb": "^6.0.1",
"node-fetch": "^3.3.1",
Expand All @@ -16,16 +16,16 @@
"unofficial-amazon-search": "^2.0.8",
"usetube": "^2.2.7",
"wikijs": "^6.4.1",
"winston": "^3.9.0"
"winston": "^3.10.0"
},
"name": "ava",
"version": "1.0.0",
"description": "OSS Ava discord bot",
"main": "./index.js",
"type": "module",
"devDependencies": {
"eslint": "^8.43.0",
"eslint-plugin-unused-imports": "^2.0.0"
"eslint": "^8.45.0",
"eslint-plugin-unused-imports": "^3.0.0"
},
"scripts": {
"lint": "eslint .",
Expand Down

0 comments on commit e533e87

Please sign in to comment.