Fix typing for py39

This commit is contained in:
James H
2023-04-08 00:52:45 +01:00
parent 2d5a58f996
commit 39eeedc5f9

View File

@@ -6,6 +6,8 @@ import random
import time import time
import yt_dlp import yt_dlp
from typing import Optional
from commands.command import Command from commands.command import Command
# Taken from https://github.com/Rapptz/discord.py/blob/master/examples/basic_voice.py # Taken from https://github.com/Rapptz/discord.py/blob/master/examples/basic_voice.py
@@ -32,7 +34,7 @@ ffmpeg_options = {
ytdl = yt_dlp.YoutubeDL(ytdl_format_options) ytdl = yt_dlp.YoutubeDL(ytdl_format_options)
def get_channel_connection(connections: list, channel_id: int) -> dict | None: def get_channel_connection(connections: list, channel_id: int) -> Optional[dict]:
for connection in connections: for connection in connections:
if connection['id'] == channel_id: if connection['id'] == channel_id:
return connection return connection