Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexedia committed Oct 10, 2024
1 parent 012b2d3 commit 50ed6e9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/src/builders/sound.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SoundBuilder {
SoundBuilder({required this.data, required this.format});

SoundBuilder.mp3(this.data) : format = 'mpeg';

SoundBuilder.ogg(this.data) : format = 'ogg';

static Future<SoundBuilder> fromFile(File file, {String? format}) async {
Expand Down
7 changes: 5 additions & 2 deletions lib/src/http/managers/soundboard_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ class GuildSoundboardManager extends SoundboardManager {
/// Send a soundboard sound to a voice channel the user is connected to. [soundId] is the id of the soundboard sound to play,
/// while [sourceGuildId] is the id of the guild the soundboard sound is from. (Required to play sounds from different servers.)
Future<void> sendSoundboardSound(Snowflake channelId, {required Snowflake soundId, Snowflake? sourceGuildId}) async {
final route = HttpRoute()..channels(id: channelId.toString())..sendSoundboardSound();
final route = HttpRoute()
..channels(id: channelId.toString())
..sendSoundboardSound();

final request = BasicRequest(route, method: 'POST', body: jsonEncode({'sound_id': soundId.toString(), 'source_guild_id': (sourceGuildId ?? guildId).toString()}));
final request =
BasicRequest(route, method: 'POST', body: jsonEncode({'sound_id': soundId.toString(), 'source_guild_id': (sourceGuildId ?? guildId).toString()}));

await client.httpHandler.executeSafe(request);
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/builders/sound_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ void main() {
expect(builder.buildDataString(), equals('data:audio/mp3;base64,AAAA////'));
});
});
}
}
13 changes: 6 additions & 7 deletions test/unit/http/managers/soundboard_manager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,12 @@ void main() {
additionalParsingTests: [],
additionalEndpointTests: [
EndpointTest<GuildSoundboardManager, void, void>(
name: 'send-soundboard-sound',
source: null,
urlMatcher: '/channels/0/send-soundboard-sound',
execute: (manager) => manager.sendSoundboardSound(Snowflake.zero, soundId: Snowflake.zero),
check: (_) {},
method: 'post'
),
name: 'send-soundboard-sound',
source: null,
urlMatcher: '/channels/0/send-soundboard-sound',
execute: (manager) => manager.sendSoundboardSound(Snowflake.zero, soundId: Snowflake.zero),
check: (_) {},
method: 'post'),
],
createBuilder: SoundboardSoundBuilder(
name: 'cool',
Expand Down

0 comments on commit 50ed6e9

Please sign in to comment.