Skip to content

Commit 85b10ec

Browse files
committed
chore: add an option to disable the bot font and remove .env in readme
1 parent b027b07 commit 85b10ec

3 files changed

Lines changed: 5 additions & 44 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ PROJECT_THRESHOLD_MEMORY=1024
77
PROJECT_MAX_MEMORY=2048 # 2GB
88
PROJECT_AUTO_DOWNLOAD_MEDIA=true
99
PROJECT_MAX_DOWNLOAD_MEDIA=25 # 25MB
10+
PROJECT_ENABLE_BOT_FONT=true
11+
1012
NODE_ENV=development
1113

1214
P_QUEUE_CONCURRENCY_COUNT=2

README.md

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -69,49 +69,6 @@ Canis supports multiple AI providers out of the box:
6969
```sh
7070
cp .env.example .env
7171
```
72-
Then configure the following:
73-
| Variable | Required | Description | Default / Example |
74-
| ----------------------------- | -------- | -------------------------------------------------- | ------------------------------------------- |
75-
| `PROJECT_CANIS_ALIAS` || Your bot's name | `Canis` |
76-
| `PROJECT_AUTO_RESTART` || Auto-reboot the bot on memory leaks or high usage | `false` |
77-
| `PROJECT_THRESHOLD_MEMORY` || Memory (MB) threshold to consider restarting | `1024` |
78-
| `PROJECT_MAX_MEMORY` || Max memory (MB) before forceful restart | `2048` (2GB) |
79-
| `PROJECT_AUTO_DOWNLOAD_MEDIA` || Whether the bot auto-downloads media | `true` |
80-
| `PROJECT_MAX_DOWNLOAD_MEDIA` || Max size of downloadable media (MB) | `25` |
81-
| `P_QUEUE_CONCURRENCY_COUNT` || Concurrency level for processing queue | `2` |
82-
| `PHISHTANK_ENABLE` || Enable PhishTank integration | `true` |
83-
| `PHISHTANK_UPDATE_HOUR` || Hour to run daily update (UTC) | `3` |
84-
| `PHISHTANK_AUTO_UPDATE` || Automatically update PhishTank data | `true` |
85-
| `SENTRY_DNS` || Sentry DSN for error tracking | |
86-
| `NODE_ENV` || Environment | `development` |
87-
| `COMMAND_PREFIX` || The command prefix used by the bot | `!` |
88-
| `COMMAND_PREFIX_LESS` || Allow commands without prefix | `true` |
89-
| `PORT` || Port for running the server | `3000` |
90-
| `PUPPETEER_EXEC_PATH` || Path to Chrome/Edge/Brave/Firefox for Puppeteer | `/opt/google/chrome/google-chrome` |
91-
| `AUTO_RELOAD` || Reload command files automatically when edited | `false` |
92-
| `DATABASE_URL` || MySQL database connection URL | `mysql://root@127.0.0.1:3306/project_canis` |
93-
| `REDIS_URL` || Redis connection URL | `redis://127.0.0.1:6379` |
94-
| `AI_PROVIDER` || Preferred AI provider (`groq`, `openrouter`, etc.) | `groq` |
95-
| `OPEN_ROUTER_API_KEY` || API key for OpenRouter | |
96-
| `OPEN_ROUTER_MODEL` || OpenRouter model to use | `moonshotai/kimi-k2:free` |
97-
| `GROQ_API_KEY` || API key for Groq | |
98-
| `GROQ_MODEL` || Groq model to use | `meta-llama/llama-4-scout-17b-16e-instruct` |
99-
| `GEMINI_API_KEY` || API key for Gemini | |
100-
| `GEMINI_MODEL` || Gemini model to use | `gemini-2.0-flash-001` |
101-
| `OPENAI_API_KEY` || API key for OpenAI | |
102-
| `OPENAI_MODEL` || OpenAI model to use | `gpt-4o` |
103-
| `OLLAMA_MODEL` || Model to use with Ollama | `llama3.1` |
104-
| `ALLOW_QUERY_CACHING` || Whether to cache AI responses | `true` |
105-
| `QUERY_CACHING_COUNT` || Number of cached queries | `1000` |
106-
| `QUERY_CACHING_TTL` || Time (seconds) to cache queries | `3600` |
107-
| `EXEC_SHELL` || Shell used to run commands | `/bin/bash` |
108-
| `WAKATIME_API_KEY` || Wakatime API key (for usage analytics) | |
109-
| `AXIOS_MAX_RETRY` || Number of retries Axios should attempt on failure | `3` |
110-
| `AXIOS_USER_AGENT` || User-Agent string used by Axios requests | `Canis/11.0.0` |
111-
| `AXIOS_TIMEOUT` || Axios request timeout in milliseconds | `30000` |
112-
| `AXIOS_ORIGIN` || Optional origin header for Axios | |
113-
| `AXIOS_HOST` || Optional host header for Axios | |
114-
11572

11673
4. **Run Migration**
11774

src/components/events/message.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import * as Sentry from "@sentry/node";
2626

2727
const commandPrefix: string = process.env.COMMAND_PREFIX || "!";
2828
const commandPrefixLess: boolean = process.env.COMMAND_PREFIX_LESS === "true";
29+
const enableBotFont: boolean = process.env.PROJECT_ENABLE_BOT_FONT === "true";
2930

3031
export default async function (msg: Message, type: string): Promise<void> {
3132
try {
@@ -210,7 +211,8 @@ export default async function (msg: Message, type: string): Promise<void> {
210211
chatId?: string,
211212
options?: MessageSendOptions,
212213
): Promise<Message> => {
213-
let messageBody = typeof content === "string" ? Font(content) : content;
214+
let messageBody =
215+
typeof content === "string" && enableBotFont ? Font(content) : content;
214216
const latency = Date.now() - receivedAt;
215217
const latencySec = (latency / 1000).toFixed(2);
216218
log.info("Reply", lid, `${key} ${latencySec}s`);

0 commit comments

Comments
 (0)