mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-10 04:01:37 +02:00
Add better responses
This commit is contained in:
parent
1a1bdfd674
commit
15d4e251f2
17 changed files with 103 additions and 63 deletions
3
src/utils/debug.ts
Normal file
3
src/utils/debug.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
import debug from 'debug';
|
||||
|
||||
export default debug('muse');
|
13
src/utils/error-msg.ts
Normal file
13
src/utils/error-msg.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
export default (error?: string | Error): string => {
|
||||
let str = '🚫 unknown error';
|
||||
|
||||
if (error) {
|
||||
if (typeof error === 'string') {
|
||||
str = `🚫 ${error}`;
|
||||
} else if (error instanceof Error) {
|
||||
str = `🚫 error: ${error.name}`;
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
};
|
|
@ -7,7 +7,7 @@ export default class {
|
|||
private msg!: Message;
|
||||
private isStopped = false;
|
||||
|
||||
constructor(channel: TextChannel, text: string) {
|
||||
constructor(channel: TextChannel, text = 'cows! count \'em') {
|
||||
this.channel = channel;
|
||||
this.text = text;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ export default class {
|
|||
})();
|
||||
}
|
||||
|
||||
async stop(str?: string): Promise<Message> {
|
||||
async stop(str = 'u betcha'): Promise<Message> {
|
||||
this.isStopped = true;
|
||||
|
||||
if (str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue