Skip to content

Commit

Permalink
directory restructure yay
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-moomoo committed Jan 5, 2025
1 parent bcc413f commit 40c285b
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ PSE_ID= # Google Programmable Search Engine ID (Google 搜尋功能用)
PSE_KEY= # Google Programmable Search Engine API Key (Google 搜尋功能用)
```

6. `node .`
6. `npm start`

# 使用

Expand Down
6 changes: 0 additions & 6 deletions index.js

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "cow-ai",
"version": "1.1.0",
"description": "",
"main": "index.js",
"main": "src/index.js",
"scripts": {
"start": "node src/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
Expand Down
4 changes: 2 additions & 2 deletions functions.js → src/functions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require("dotenv").config();
const jokes = require("./jokes");
const jokes = require("./utils/jokes");
const fetch = require("node-fetch");
const xml = require("xml-js");
const TaiwanEarthquake = require("./taiwanearthquake");
const TaiwanEarthquake = require("./utils/taiwanearthquake");
const moment = require("moment-timezone");
const fs = require("fs");
const download = require("download");
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require("dotenv").config();
require("./platforms/gemini");
if (process.env.ENABLE_DISCORD == "true") require("./platforms/discord");
if (process.env.ENABLE_TELEGRAM == "true") require("./platforms/telegram");
if (process.env.ENABLE_LINE == "true") require("./platforms/line");
if (process.env.ENABLE_IRC == "true") require("./platforms/irc");
4 changes: 2 additions & 2 deletions discord.js → src/platforms/discord.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var savedMsg = new JsonDB(new Config("savedMessages", true, true));
const { WebSocket } = require("ws");
const { websocketData } = require("websocket-iterator");
const fetch = require("node-fetch");
const supportedMime = require("./cow").supportedMime;
const supportedMime = require("./../utils/cow").supportedMime;

client.on("ready", () => {
console.log("[Discord] Bot ready", client.user.tag);
Expand All @@ -26,7 +26,7 @@ client.on("ready", () => {
type: 4,
name: "custom",
state: `🐮 @${client.user.tag} | 牛牛 v${
require("./package.json").version
require("../../package.json").version
}`,
},
],
Expand Down
2 changes: 1 addition & 1 deletion gemini.js → src/platforms/gemini.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require("dotenv").config();
const { GoogleGenerativeAI } = require("@google/generative-ai");
const cow = require("./cow");
const cow = require("./../utils/cow");
const { WebSocketServer } = require("ws");
const { createServer } = require("http");
const u = require("url");
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cow.js → src/utils/cow.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ module.exports = {
],
},
],
functions: require("./functions"),
functions: require("../functions"),
utils: {
toolCallFix: (input) => {
var returns = [];
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 40c285b

Please sign in to comment.