Skip to content

Commit 34e2f53

Browse files
Domin0demi-mott
andauthored
Implementation of the Lunch Buddy feature (#167)
* update: checking if perms work * Chron job set for every minute, basic embed added and structure for the locations and sub locations created * Updated README * Implemented area voting system * Ran linting and prettier for current changes * Appending location poll for given area, and vote counting for both area and locations * Implemented functional voting system for area and location, creating thread upon completion of set * Used await and cleaned up a bit of code, thread now adds all voters not only the ones who voted for the winning area * Lint fix * Removed promises and adjusted placement of vote function calls * Adjusted thread users, append location vote pings * Linting fixes * Locations Update * Adds "any" option and append additional vote info * Appended code for live run timing * Update to use config file * Allow disabling of feature without editing code and disable * Minor adjustment to readme and npm commands * Appended clarifying comment regarding edge case of only any votes --------- Co-authored-by: mi-mott <[email protected]>
1 parent 35f1f3b commit 34e2f53

9 files changed

+1003
-39
lines changed

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,11 @@
88
- `DISCORD_TOKEN` with the token of the bot
99
- `APP_ID` with the ID of the bot application
1010
- Install dependencies with `npm install`
11-
- Register slash commands with `node deploy-commands.js`
11+
- Register slash commands with `npm run deploy` or `node deploy-commands.js`
12+
- Ensure a PostgreSQL database is setup according to "config/database.yml"
1213
- Start the bot with `node index.js`
14+
15+
## Running the bot with Nodemon
16+
17+
- Nodemon has been installed, this addition allows for continuous integration with and hot reloads the bot upon saving.
18+
- Run the bot with Nodemon using `npm run server`

Diff for: config/database.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ user: user
66
dbname: bot
77
password: pass
88
host: 0.0.0.0
9-
port: 40041
9+
port: 40041

Diff for: config/lunch_buddy.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"voteOriginId": "959995388289495050",
3+
"threadDestinationId": "959995388289495050",
4+
"interactionTimeout": 360000,
5+
"cronString": ""
6+
}

Diff for: data/createvc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"users": [],
33
"channels": []
4-
}
4+
}

Diff for: data/lunch_buddy_locations.js

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
const locations = [
2+
{
3+
value: "Upper Campus Food Court",
4+
sub: [
5+
{
6+
name: "Tropical Green Pho",
7+
},
8+
{
9+
name: "Pho House",
10+
},
11+
{
12+
name: "Classic Kebab",
13+
},
14+
{
15+
name: "Chinese Takeaway",
16+
},
17+
{
18+
name: "Tori Sushi",
19+
},
20+
{
21+
name: "Gradu-eat",
22+
},
23+
{
24+
name: "The Little Marionette Cafe",
25+
},
26+
{
27+
name: "Lhaksa Delight",
28+
},
29+
{
30+
name: "Bioscience building Cafe (XS Espresso)",
31+
},
32+
],
33+
},
34+
{
35+
value: "Subway Zone",
36+
sub: [
37+
{
38+
name: "Subway",
39+
},
40+
{
41+
name: "Boost",
42+
},
43+
{
44+
name: "Southern Wok",
45+
},
46+
{
47+
name: "Cafe Brioso",
48+
},
49+
{
50+
name: "Penny Lane",
51+
},
52+
],
53+
},
54+
{
55+
value: "Quadrangle Food Court",
56+
sub: [
57+
{
58+
name: "Soul Origin",
59+
},
60+
{
61+
name: "PappaRich",
62+
},
63+
{
64+
name: "Nene Chicken",
65+
},
66+
{
67+
name: "Plume Cafe",
68+
},
69+
],
70+
},
71+
{
72+
value: "Lower Campus",
73+
sub: [
74+
{
75+
name: "Stellinis Pasta Bar",
76+
},
77+
{
78+
name: "Guzman Y Gomez",
79+
},
80+
{
81+
name: "Mamak Village",
82+
},
83+
{
84+
name: "Yallah Eats Kebab and Shawarma",
85+
},
86+
{
87+
name: "Sharetea",
88+
},
89+
{
90+
name: "Maze Coffee & Food",
91+
},
92+
{
93+
name: "Campus Village Cafe",
94+
},
95+
{
96+
name: "Home Ground Kiosk",
97+
},
98+
],
99+
},
100+
{
101+
value: "J17 Ainsworth",
102+
sub: [
103+
{
104+
name: "Coffee on Campus Cafe",
105+
},
106+
],
107+
},
108+
{
109+
value: "Other Options",
110+
sub: [
111+
{
112+
name: "Sport",
113+
},
114+
{
115+
name: "On Campus Study",
116+
},
117+
],
118+
},
119+
];
120+
121+
exports.locations = locations;

0 commit comments

Comments
 (0)