aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2021-09-19 22:04:34 -0400
committerMax Isom <[email protected]>2021-09-19 22:09:09 -0400
commitfd782219eff8016a00e87f0c8e44af3a3ba74be6 (patch)
tree2de37667318794427406b45848a7bf699c9e1a6f /src/commands
parentefcdeb78c8b690bc544dac1ed0be96a6693bcff6 (diff)
downloadmuse-fd782219eff8016a00e87f0c8e44af3a3ba74be6.tar.xz
muse-fd782219eff8016a00e87f0c8e44af3a3ba74be6.zip
Move to ESM, use ytsr, implement caching
Closes #315
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/clear.ts6
-rw-r--r--src/commands/config.ts4
-rw-r--r--src/commands/disconnect.ts6
-rw-r--r--src/commands/fseek.ts8
-rw-r--r--src/commands/help.ts6
-rw-r--r--src/commands/pause.ts8
-rw-r--r--src/commands/play.ts15
-rw-r--r--src/commands/queue.ts14
-rw-r--r--src/commands/seek.ts10
-rw-r--r--src/commands/shortcuts.ts4
-rw-r--r--src/commands/shuffle.ts6
-rw-r--r--src/commands/skip.ts8
-rw-r--r--src/commands/unskip.ts6
13 files changed, 51 insertions, 50 deletions
diff --git a/src/commands/clear.ts b/src/commands/clear.ts
index f9b1853..189b8af 100644
--- a/src/commands/clear.ts
+++ b/src/commands/clear.ts
@@ -1,7 +1,7 @@
-import {Message} from 'discord.js';
-import {TYPES} from '../types';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
+import {Message} from 'discord.js';
+import {TYPES} from '../types.js';
+import PlayerManager from '../managers/player.js';
import Command from '.';
@injectable()
diff --git a/src/commands/config.ts b/src/commands/config.ts
index 7452107..6ecad6b 100644
--- a/src/commands/config.ts
+++ b/src/commands/config.ts
@@ -1,7 +1,7 @@
import {TextChannel, Message, GuildChannel} from 'discord.js';
import {injectable} from 'inversify';
-import {Settings} from '../models';
-import errorMsg from '../utils/error-msg';
+import {Settings} from '../models/index.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
@injectable()
diff --git a/src/commands/disconnect.ts b/src/commands/disconnect.ts
index 937fc2e..7280b51 100644
--- a/src/commands/disconnect.ts
+++ b/src/commands/disconnect.ts
@@ -1,8 +1,8 @@
import {Message} from 'discord.js';
-import {TYPES} from '../types';
+import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
-import errorMsg from '../utils/error-msg';
+import PlayerManager from '../managers/player.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
@injectable()
diff --git a/src/commands/fseek.ts b/src/commands/fseek.ts
index 19d9fbf..850889d 100644
--- a/src/commands/fseek.ts
+++ b/src/commands/fseek.ts
@@ -1,9 +1,9 @@
import {Message, TextChannel} from 'discord.js';
-import {TYPES} from '../types';
+import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
-import LoadingMessage from '../utils/loading-message';
-import errorMsg from '../utils/error-msg';
+import PlayerManager from '../managers/player.js';
+import LoadingMessage from '../utils/loading-message.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
@injectable()
diff --git a/src/commands/help.ts b/src/commands/help.ts
index 3c230fb..05bc565 100644
--- a/src/commands/help.ts
+++ b/src/commands/help.ts
@@ -1,9 +1,9 @@
import {Message} from 'discord.js';
import {injectable} from 'inversify';
import Command from '.';
-import {TYPES} from '../types';
-import {Settings} from '../models';
-import container from '../inversify.config';
+import {TYPES} from '../types.js';
+import {Settings} from '../models/index.js';
+import container from '../inversify.config.js';
@injectable()
export default class implements Command {
diff --git a/src/commands/pause.ts b/src/commands/pause.ts
index 0771e11..4f57e95 100644
--- a/src/commands/pause.ts
+++ b/src/commands/pause.ts
@@ -1,9 +1,9 @@
import {Message} from 'discord.js';
-import {TYPES} from '../types';
+import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
-import {STATUS} from '../services/player';
-import errorMsg from '../utils/error-msg';
+import PlayerManager from '../managers/player.js';
+import {STATUS} from '../services/player.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
@injectable()
diff --git a/src/commands/play.ts b/src/commands/play.ts
index 4886da2..7013626 100644
--- a/src/commands/play.ts
+++ b/src/commands/play.ts
@@ -1,15 +1,15 @@
import {TextChannel, Message} from 'discord.js';
import {URL} from 'url';
import {Except} from 'type-fest';
-import {TYPES} from '../types';
+import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
-import {QueuedSong, STATUS} from '../services/player';
-import PlayerManager from '../managers/player';
-import {getMostPopularVoiceChannel, getMemberVoiceChannel} from '../utils/channels';
-import LoadingMessage from '../utils/loading-message';
-import errorMsg from '../utils/error-msg';
+import {QueuedSong, STATUS} from '../services/player.js';
+import PlayerManager from '../managers/player.js';
+import {getMostPopularVoiceChannel, getMemberVoiceChannel} from '../utils/channels.js';
+import LoadingMessage from '../utils/loading-message.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
-import GetSongs from '../services/get-songs';
+import GetSongs from '../services/get-songs.js';
@injectable()
export default class implements Command {
@@ -124,6 +124,7 @@ export default class implements Command {
if (song) {
newSongs.push(song);
} else {
+ console.log(_);
await res.stop(errorMsg('that doesn\'t exist'));
return;
}
diff --git a/src/commands/queue.ts b/src/commands/queue.ts
index 0abc63c..a4bdc1e 100644
--- a/src/commands/queue.ts
+++ b/src/commands/queue.ts
@@ -1,13 +1,13 @@
import {Message, MessageEmbed} from 'discord.js';
-import {TYPES} from '../types';
+import getYouTubeID from 'get-youtube-id';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
-import {STATUS} from '../services/player';
+import {TYPES} from '../types.js';
+import PlayerManager from '../managers/player.js';
+import {STATUS} from '../services/player.js';
import Command from '.';
-import getProgressBar from '../utils/get-progress-bar';
-import errorMsg from '../utils/error-msg';
-import {prettyTime} from '../utils/time';
-import getYouTubeID from 'get-youtube-id';
+import getProgressBar from '../utils/get-progress-bar.js';
+import errorMsg from '../utils/error-msg.js';
+import {prettyTime} from '../utils/time.js';
const PAGE_SIZE = 10;
diff --git a/src/commands/seek.ts b/src/commands/seek.ts
index edbb5bd..ae064ef 100644
--- a/src/commands/seek.ts
+++ b/src/commands/seek.ts
@@ -1,11 +1,11 @@
import {Message, TextChannel} from 'discord.js';
-import {TYPES} from '../types';
+import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
-import LoadingMessage from '../utils/loading-message';
-import errorMsg from '../utils/error-msg';
+import PlayerManager from '../managers/player.js';
+import LoadingMessage from '../utils/loading-message.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
-import {parseTime} from '../utils/time';
+import {parseTime} from '../utils/time.js';
@injectable()
export default class implements Command {
diff --git a/src/commands/shortcuts.ts b/src/commands/shortcuts.ts
index 2b15812..57ed245 100644
--- a/src/commands/shortcuts.ts
+++ b/src/commands/shortcuts.ts
@@ -1,7 +1,7 @@
import {Message} from 'discord.js';
import {injectable} from 'inversify';
-import {Shortcut, Settings} from '../models';
-import errorMsg from '../utils/error-msg';
+import {Shortcut, Settings} from '../models/index.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
@injectable()
diff --git a/src/commands/shuffle.ts b/src/commands/shuffle.ts
index c9a007d..0f1d832 100644
--- a/src/commands/shuffle.ts
+++ b/src/commands/shuffle.ts
@@ -1,8 +1,8 @@
import {Message} from 'discord.js';
-import {TYPES} from '../types';
+import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
-import errorMsg from '../utils/error-msg';
+import PlayerManager from '../managers/player.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
@injectable()
diff --git a/src/commands/skip.ts b/src/commands/skip.ts
index b12729b..7330888 100644
--- a/src/commands/skip.ts
+++ b/src/commands/skip.ts
@@ -1,10 +1,10 @@
import {Message, TextChannel} from 'discord.js';
-import {TYPES} from '../types';
+import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
+import PlayerManager from '../managers/player.js';
import Command from '.';
-import LoadingMessage from '../utils/loading-message';
-import errorMsg from '../utils/error-msg';
+import LoadingMessage from '../utils/loading-message.js';
+import errorMsg from '../utils/error-msg.js';
@injectable()
export default class implements Command {
diff --git a/src/commands/unskip.ts b/src/commands/unskip.ts
index 5dba251..9444b8e 100644
--- a/src/commands/unskip.ts
+++ b/src/commands/unskip.ts
@@ -1,8 +1,8 @@
import {Message} from 'discord.js';
-import {TYPES} from '../types';
+import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
-import PlayerManager from '../managers/player';
-import errorMsg from '../utils/error-msg';
+import PlayerManager from '../managers/player.js';
+import errorMsg from '../utils/error-msg.js';
import Command from '.';
@injectable()