repeat static method
Implementation
static Future<String> repeat(CommandContext ctx) async {
final manager = ctx.client.getPlayerManager(ctx.guildId);
if (manager == null) {
return '❌ No player active!';
}
if (ctx.args.isEmpty) {
final mode = manager.getRepeatMode();
return '🔁 Repeat mode: **${mode.name}**';
}
final modeStr = ctx.args[0].toLowerCase();
final mode = switch (modeStr) {
'off' || 'none' => RepeatMode.off,
'track' || 'song' => RepeatMode.track,
'queue' || 'all' => RepeatMode.queue,
_ => null,
};
if (mode == null) {
return '❌ Invalid repeat mode! Use: off, track, or queue';
}
manager.setRepeatMode(mode);
return '🔁 Repeat mode set to: **${mode.name}**';
}