General Clean Code
This commit is contained in:
@@ -22,20 +22,17 @@ from function import (
|
||||
from datetime import datetime
|
||||
from views import PlaylistView, InboxView, HelpView
|
||||
|
||||
|
||||
def assign_playlistId(existed: list) -> str:
|
||||
for i in range(200, 210):
|
||||
if str(i) not in existed:
|
||||
return str(i)
|
||||
|
||||
|
||||
async def check_playlist_perms(userid: int, authorid: int, dId: str) -> dict:
|
||||
playlist = await get_playlist(authorid, 'playlist', dId)
|
||||
if not playlist or userid not in playlist['perms']['read']:
|
||||
return {}
|
||||
return playlist
|
||||
|
||||
|
||||
async def check_playlist(ctx: commands.Context, name: str = None, full: bool = False, share: bool = True) -> dict:
|
||||
user = await get_playlist(ctx.author.id, 'playlist')
|
||||
if not user:
|
||||
@@ -56,7 +53,6 @@ async def check_playlist(ctx: commands.Context, name: str = None, full: bool = F
|
||||
return {'playlist': playlist, 'position': index, 'id': data}
|
||||
return {'playlist': None, 'position': None, 'id': None}
|
||||
|
||||
|
||||
async def search_playlist(url: str, requester: discord.Member, timeNeed=True):
|
||||
try:
|
||||
tracks = await voicelink.NodePool.get_node().get_tracks(url, requester=requester)
|
||||
|
||||
Reference in New Issue
Block a user