diff options
| author | salmonik <raisersoft@proton.me> | 2026-04-19 15:43:32 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-04-19 15:43:32 +0200 |
| commit | 1dcdbe3cf03ff16b3ff2e2e6d572e0b3c72c18c0 (patch) | |
| tree | f11dc45777d8b3c8ff0e2ca16be83f85b272bd48 /cogs/voice.py | |
| parent | test: add cron tests + improve existing tests (diff) | |
| download | senator-sperma-1dcdbe3cf03ff16b3ff2e2e6d572e0b3c72c18c0.tar.gz senator-sperma-1dcdbe3cf03ff16b3ff2e2e6d572e0b3c72c18c0.zip | |
refactor: simplify cogs, reduce complexity
- Remove unused imports and dead code
- Cleaner error handling
- Reduce cognitive complexity
Diffstat (limited to '')
| -rw-r--r-- | cogs/voice.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cogs/voice.py b/cogs/voice.py index 07015cc..319bb16 100644 --- a/cogs/voice.py +++ b/cogs/voice.py | |||
| @@ -95,7 +95,7 @@ class VoiceManager: | |||
| 95 | if not voice_client: | 95 | if not voice_client: |
| 96 | return False | 96 | return False |
| 97 | 97 | ||
| 98 | if volume != 1.0: | 98 | if abs(volume - 1.0) > 1e-9: |
| 99 | audio_source = discord.PCMVolumeTransformer(audio_source) | 99 | audio_source = discord.PCMVolumeTransformer(audio_source) |
| 100 | audio_source.volume = volume | 100 | audio_source.volume = volume |
| 101 | 101 | ||
| @@ -197,4 +197,4 @@ class Voice(commands.Cog): | |||
| 197 | 197 | ||
| 198 | 198 | ||
| 199 | def setup(bot): | 199 | def setup(bot): |
| 200 | bot.add_cog(Voice(bot)) \ No newline at end of file | 200 | bot.add_cog(Voice(bot)) |
