Skip to content

Commit f8e7674

Browse files
committed
improve: button string interface
1 parent 384d8b7 commit f8e7674

File tree

5 files changed

+8
-14
lines changed

5 files changed

+8
-14
lines changed

src/buttons/Loop.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default class implements PlayerButton {
2626

2727
switch (player.loop) {
2828
case "none":
29-
await player.setLoop(RainlinkLoopMode.SONG);
29+
player.setLoop(RainlinkLoopMode.SONG);
3030

3131
setLoop247(RainlinkLoopMode.SONG);
3232

@@ -56,7 +56,7 @@ export default class implements PlayerButton {
5656
break;
5757

5858
case "queue":
59-
await player.setLoop(RainlinkLoopMode.NONE);
59+
player.setLoop(RainlinkLoopMode.NONE);
6060

6161
setLoop247(RainlinkLoopMode.NONE);
6262

src/buttons/Previous.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class implements PlayerButton {
2020
const previousIndex = player.queue.previous.length - 1;
2121

2222
if (player.queue.previous.length == 0 || previousIndex === -1)
23-
return await new ReplyInteractionService(
23+
return new ReplyInteractionService(
2424
client,
2525
message,
2626
`${client.getString(language, "button.music", "previous_notfound")}`
@@ -30,7 +30,7 @@ export default class implements PlayerButton {
3030

3131
player.data.set("endMode", "previous");
3232

33-
await new ReplyInteractionService(client, message, `${client.getString(language, "button.music", "previous_msg")}`);
33+
new ReplyInteractionService(client, message, `${client.getString(language, "button.music", "previous_msg")}`);
3434
return;
3535
}
3636
}

src/buttons/VolumeDown.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ export default class implements PlayerButton {
2323
})}`;
2424

2525
if (player.volume <= 0.1) {
26-
await new ReplyInteractionService(
27-
client,
28-
message,
29-
`${client.getString(language, "button.music", "volume_invalid")}`
30-
);
26+
new ReplyInteractionService(client, message, `${client.getString(language, "button.music", "volume_min")}`);
3127
return;
3228
}
3329

src/buttons/VolumeUp.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ export default class implements PlayerButton {
2323
})}`;
2424

2525
if (player.volume >= 100) {
26-
await new ReplyInteractionService(
27-
client,
28-
message,
29-
`${client.getString(language, "button.music", "volume_invalid")}`
30-
);
26+
new ReplyInteractionService(client, message, `${client.getString(language, "button.music", "volume_max")}`);
3127
return;
3228
}
3329

src/languages/en/button.music.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ stop_msg: "`⏹️` | Stopped the **Player**!"
1313
volup_msg: "`🔊` | Changed Volume to **%{volume}%**"
1414
voldown_msg: "`🔉` | Changed Volume to **%{volume}%**"
1515
volume_invalid: "`⚠️` | Invalid Volume. Please use a number between **1** and **100**!"
16+
volume_max: "`⚠️` | Player is already at max volume!"
17+
volume_min: "`⚠️` | Player is already at min volume!"
1618
# Clear
1719
clear_msg: "`🗑️` | Queue has been **Cleared**!"
1820
# Loop

0 commit comments

Comments
 (0)