-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1chiSensei
committed
Apr 30, 2021
1 parent
67ccd52
commit 51d7a16
Showing
11 changed files
with
123 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist/ | ||
typings/ | ||
docs/ | ||
public/ | ||
.yarn/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ pids | |
.tmp/ | ||
dist | ||
typings | ||
docs | ||
public | ||
test/config.js | ||
|
||
# yarn v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
dist/ | ||
typings/ | ||
docs/ | ||
public/ | ||
.github/workflows | ||
.yarn/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs | ||
spec: "@yarnpkg/plugin-typescript" | ||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs | ||
spec: "@yarnpkg/plugin-interactive-tools" | ||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | ||
spec: "@yarnpkg/plugin-workspace-tools" | ||
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs | ||
spec: '@yarnpkg/plugin-typescript' | ||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs | ||
spec: '@yarnpkg/plugin-interactive-tools' | ||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | ||
spec: '@yarnpkg/plugin-workspace-tools' | ||
|
||
yarnPath: .yarn/releases/yarn-berry.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Example Bot | ||
|
||
Here's an example bot that you can use. | ||
|
||
```js | ||
const { Client } = require('dogehq'); | ||
|
||
const client = new Client(); | ||
const config = { | ||
token: 'your_token_here', | ||
refreshToken: 'your_refresh_token_here', | ||
prefix: 'your_preffered_prefix_here', | ||
}; | ||
|
||
// when the client is ready | ||
client.once('ready', () => { | ||
console.log('Ready!'); | ||
|
||
// join the top room | ||
client.rooms.first().join(); | ||
}); | ||
|
||
client.on('message', (message) => { | ||
if (!message.content.startsWith(config.prefix)) return; // if the message doesn't start with the prefix, dont respond | ||
|
||
const args = message.content.slice(config.prefix.length).trim().split(/ +/); | ||
const command = args.shift().toLowerCase(); | ||
|
||
if (command === 'ping') { | ||
message.room.send('Pong!'); | ||
} else if (command === 'pong') { | ||
message.room.send('Ping!'); | ||
} else if (command === 'food') { | ||
if (args.length === 0) return; // if the argument isnt there, dont respond | ||
message.room.send(`You like ${args[0]}? I like it too!`); | ||
} | ||
}); | ||
|
||
client.login(config.token, config.refreshToken); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Installing | ||
|
||
## Prequisites | ||
|
||
- Node.js v14 or later | ||
- A node package manager (npm, yarn, etc.) | ||
|
||
## Installation | ||
|
||
> NPM | ||
```sh | ||
npm install dogehq | ||
``` | ||
|
||
> Yarn | ||
```sh | ||
yarn add dogehq | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"groups": [ | ||
{ | ||
"title": "Getting Started", | ||
"pages": [ | ||
{ | ||
"title": "Installing", | ||
"source": "./docs/INSTALLING.md" | ||
}, | ||
{ | ||
"title": "Example Bot", | ||
"source": "./docs/EXAMPLE.md" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"$schema": "https://typedoc.org/schema.json", | ||
"out": "public", | ||
"entryPoints": ["src/index.ts"], | ||
"theme": "pages-plugin" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters