Merge Player and Queue services

This commit is contained in:
Max Isom 2020-03-20 20:47:04 -05:00
parent 646f030781
commit 9c91ce1a13
21 changed files with 236 additions and 255 deletions

View file

@ -60,10 +60,16 @@ export default class {
}
async stop(str = 'u betcha'): Promise<Message> {
const wasAlreadyStopped = this.isStopped;
this.isStopped = true;
if (str) {
await Promise.all([this.msg.reactions.removeAll(), this.msg.edit(str)]);
if (wasAlreadyStopped) {
await this.msg.edit(str);
} else {
await Promise.all([this.msg.reactions.removeAll(), this.msg.edit(str)]);
}
} else {
await this.msg.reactions.removeAll();
}

View file

@ -13,3 +13,5 @@ export const prettyTime = (seconds: number): string => {
return res;
};
export const parseTime = (str: string): number => str.split(':').reduce((acc, time) => (60 * acc) + parseInt(time, 10), 0);