Compare commits

..

No commits in common. "99c3793618d069b0699d2db27aee1c104f5eca41" and "86bf70907c028b1e54a352ef7ee41574a5a86694" have entirely different histories.

6 changed files with 18 additions and 22 deletions

View File

@ -3,11 +3,12 @@ import inspect
import time import time
import arguments import arguments
import commands
import constants import constants
import utils
from state import reloaded_modules, start_time from state import reloaded_modules, start_time
import commands
import utils
async def uptime(message): async def uptime(message):
tokens = commands.tokenize(message.content) tokens = commands.tokenize(message.content)

View File

@ -173,13 +173,6 @@ async def volume(message):
if not (args := await parser.parse_args(message, tokens)): if not (args := await parser.parse_args(message, tokens)):
return return
if not message.guild.voice_client.source:
await utils.reply(
message,
f"there is no player currently active!",
)
return
if args.volume: if args.volume:
message.guild.voice_client.source.volume = float(args.volume) / 100.0 message.guild.voice_client.source.volume = float(args.volume) / 100.0
await utils.reply( await utils.reply(
@ -187,10 +180,16 @@ async def volume(message):
f"volume set to **{args.volume}%**", f"volume set to **{args.volume}%**",
) )
else: else:
await utils.reply( if message.guild.voice_client.source:
message, await utils.reply(
f"current volume is **{int(message.guild.voice_client.source.volume * 100)}%**", message,
) f"current volume is **{int(message.guild.voice_client.source.volume * 100)}%**",
)
else:
await utils.reply(
message,
f"there is no player currently active!",
)
async def play_next(message): async def play_next(message):

View File

@ -15,7 +15,7 @@ YTDL_OPTIONS = {
"outtmpl": "%(extractor)s-%(id)s-%(title)s.%(ext)s", "outtmpl": "%(extractor)s-%(id)s-%(title)s.%(ext)s",
"quiet": True, "quiet": True,
"restrictfilenames": True, "restrictfilenames": True,
"socket_timeout": 15, "socket_timeout": 10,
"source_address": "0.0.0.0", "source_address": "0.0.0.0",
} }

View File

@ -1,6 +1,5 @@
message_handlers = {} message_handlers = {}
async def trigger_message_handlers(event_type: str, *data): async def trigger_message_handlers(event_type: str, *data):
if event_type in message_handlers: if event_type in message_handlers:
for message_handler in message_handlers[event_type]: for message_handler in message_handlers[event_type]:

View File

@ -2,12 +2,13 @@ import importlib
import inspect import inspect
import time import time
import commands
import constants import constants
import core import core
import events import events
from state import client, reloaded_modules, start_time from state import client, reloaded_modules, start_time
import commands
@client.event @client.event
async def on_ready(): async def on_ready():

View File

@ -37,8 +37,7 @@ class YTDLSource(disnake.PCMVolumeTransformer):
return cls( return cls(
disnake.FFmpegPCMAudio( disnake.FFmpegPCMAudio(
data["url"] if stream else ytdl.prepare_filename(data), data["url"] if stream else ytdl.prepare_filename(data), options="-vn"
options="-vn -reconnect 1",
), ),
data=data, data=data,
) )
@ -46,10 +45,7 @@ class YTDLSource(disnake.PCMVolumeTransformer):
def __reload_module__(): def __reload_module__():
for name, module in globals().items(): for name, module in globals().items():
if ( if inspect.ismodule(module) and name not in constants.RELOAD_BLACKLISTED_MODULES:
inspect.ismodule(module)
and name not in constants.RELOAD_BLACKLISTED_MODULES
):
importlib.reload(module) importlib.reload(module)
if "__reload_module__" in dir(module) and name not in reloaded_modules: if "__reload_module__" in dir(module) and name not in reloaded_modules:
reloaded_modules.add(name) reloaded_modules.add(name)