Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Sep 14, 2021
1 parent 117d496 commit cdd1b80
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 46 deletions.
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ In case you want to (not recommend)

- For next time, you can simply ```npm start``` to run bot. The previous command is for install and build process

- To Stop Bot and Logout *properly*, Type `logout` in the Bot Console

## 🌿 Prerequisites

- Linux (Sorry Windows User)
Expand Down Expand Up @@ -77,25 +79,7 @@ In case you want to (not recommend)

User Manual [Here](./docs/user_manual.md)

## 💬 Local Quotes

To add more quotes on top of ASQ, create a file "morequotes.json" in data folder

```
{
"วาทกรรมสลิ่ม": [ Array of Your Custom Local Quotes Here ]
}
```

You can also add more keywords, songs or Facebooks to JSON files in data folder!

### Keywords adding guideline

Keywords must be all lowercase (if english alphabet exists) and no space in it.

The reason is the bot process sentences by ignoring spaces and turning all english alphabet into lowercase, for example

`Sinovac, sInOvAc, S I N O V A C` will all equivalent to "sinovac"
Advanced Usage (for Owner) [Here](./docs/advanced.md)

### Trained by People

Expand Down
45 changes: 45 additions & 0 deletions docs/advanced.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Advanced Usage

## Local Quotes " morequotes.json

To add more quotes on top of ASQ, create a file "morequotes.json" in data folder

```
{
"วาทกรรมสลิ่ม": [ Array of Your Custom Local Quotes Here ]
}
```

You can also add more keywords, songs or Facebooks to JSON files in data folder!

## Keywords adding : keywords.json

Keywords must be all lowercase (if english alphabet exists) and no space in it.

The reason is the bot process sentences by ignoring spaces and turning all english alphabet into lowercase, for example

`Sinovac, sInOvAc, S I N O V A C` will all equivalent to "sinovac"

## Others in data

Please look at the schema and add your own in same theme as it

## config/bot_settings.json

- Copy bot_settings.template.json to bot_settings.json

- Edit properties you would like to

- See src/template/BotSettings.template.ts for more info

## Salim Shell

- Do #!salim disable to disable all bot's activity on that channel ~~including sending data to Thai Government~~

- Do #!salim enable again to remove that

- Do #!salim sudo to execute Console Command without Console

## Console

- Please look at source code (src/console/Console.ts) for more details
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "salim-bot",
"version": "2.1.418",
"version": "2.1.420",
"description": "This bot is Salim. Whenever you trigger it, It become mad.",
"type": "module",
"main": "dist/bot.js",
Expand Down
27 changes: 1 addition & 26 deletions src/console/SalimShell.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// * SalimShell.ts : Shell But Salim

import { DMChannel, NewsChannel, TextChannel, Message, VoiceChannel } from "discord.js";
import { DMChannel, NewsChannel, TextChannel, Message } from "discord.js";

import * as fs from "fs/promises";

Expand Down Expand Up @@ -70,19 +70,6 @@ export default class SalimShell {
}
break;
}
case "tievoice":
{
if (!msg.member?.voice.channel) {
msg.reply("จะให้ฉันไปคุยกับผีหรอ");
return;
}

const traceback = await SalimShell.tieVoiceChannel(msg.member.voice.channel);
if (traceback) {
msg.reply(traceback);
}
break;
}
case "sudo":
{
if (!BotSettings.settings.owner.includes(msg.author.id)) {
Expand Down Expand Up @@ -147,18 +134,6 @@ export default class SalimShell {
}
}

private static async tieVoiceChannel(channel: VoiceChannel): Promise<string> {
if (SalimShell.shellConfig.config.tiedVoice == channel.id) {

return "Already Tied to this Channel";
}

SalimShell.shellConfig.config.tiedVoice = channel.id;
SalimShell.saveConfig();
Logger.log(`[Salim Shell] Tied to ${channel.name}`);
return "";
}

private static async saveConfig(): Promise<void> {
await fs.writeFile(configFilePath, JSON.stringify(SalimShell.shellConfig, null, 4));
Logger.log("Save Config Success", "SUCCESS");
Expand Down

0 comments on commit cdd1b80

Please sign in to comment.