2222 "stage_announce_template" : str
2323}
2424
25- class TempCtx ():
26- def __init__ (self , author : Member , channel : VoiceChannel ) -> None :
27- self .author = author
28- self .channel = channel
29- self .guild = channel .guild
30-
3125class SystemMethod :
3226 def __init__ (self , function : callable , * , credit : int = 1 ):
3327 self .function : callable = function
@@ -44,9 +38,9 @@ def require_permission(only_admin: bool = False):
4438 def decorator (func ) -> callable :
4539 async def wrapper (player : Player , member : Member , dict : Dict ) -> Optional [Dict ]:
4640 if only_admin and not member .guild_permissions .manage_guild :
47- return error_msg ("Only the admins may use this funciton !" , user_id = member .id )
41+ return error_msg ("Only the admins may use this function !" , user_id = member .id )
4842 if not player .is_privileged (member ):
49- return error_msg ("Only the DJ or admins may use this funciton !" , user_id = member .id )
43+ return error_msg ("Only the DJ or admins may use this function !" , user_id = member .id )
5044 return await func (player , member , dict )
5145 return wrapper
5246 return decorator
@@ -67,7 +61,7 @@ async def connect_channel(member: Member, bot: commands.Bot) -> Player:
6761 channel = member .voice .channel
6862 try :
6963 settings = await func .get_settings (channel .guild .id )
70- player : Player = await channel .connect (cls = Player (bot , channel , TempCtx (member , channel ), settings ))
64+ player : Player = await channel .connect (cls = Player (bot , channel , func . TempCtx (member , channel ), settings ))
7165 await player .send_ws ({"op" : "createPlayer" , "memberIds" : [str (member .id ) for member in channel .members ]})
7266 return player
7367 except :
@@ -438,13 +432,13 @@ async def updatePlaylist(bot: commands.Bot, data: Dict) -> Dict:
438432 "userId" : str (user_id )
439433 }
440434
441- assgined_playlist_id = _assign_playlist_id (list (playlist .keys ()))
435+ assigned_playlist_id = _assign_playlist_id (list (playlist .keys ()))
442436 data = {'uri' : playlist_url , 'perms' : {'read' : []}, 'name' : name , 'type' : 'link' } if playlist_url else {'tracks' : [], 'perms' : {'read' : [], 'write' : [], 'remove' : []}, 'name' : name , 'type' : 'playlist' }
443- await func .update_user (user_id , {"$set" : {f"playlist.{ assgined_playlist_id } " : data }})
437+ await func .update_user (user_id , {"$set" : {f"playlist.{ assigned_playlist_id } " : data }})
444438 return {
445439 "op" : "updatePlaylist" ,
446440 "status" : "created" ,
447- "playlistId" : assgined_playlist_id ,
441+ "playlistId" : assigned_playlist_id ,
448442 "msg" : f"You have created '{ name } ' playlist." ,
449443 "userId" : str (user_id ),
450444 "data" : data
@@ -579,7 +573,7 @@ async def updatePlaylist(bot: commands.Bot, data: Dict) -> Dict:
579573 if refer_id not in share_playlists :
580574 return error_msg ("The shared playlist couldn’t be found. It’s possible that the user has already deleted it." , user_id = user_id )
581575
582- assgined_playlist_id = _assign_playlist_id (list (user .get ("playlist" , []).keys ()))
576+ assigned_playlist_id = _assign_playlist_id (list (user .get ("playlist" , []).keys ()))
583577 playlist_name = f"Share{ time .strftime ('%M%S' , time .gmtime (int (mail ['time' ])))} "
584578 share_playlist = share_playlists .get (refer_id )
585579 share_playlist .update ({
@@ -588,7 +582,7 @@ async def updatePlaylist(bot: commands.Bot, data: Dict) -> Dict:
588582 })
589583 await func .update_user (mail ['sender' ], {"$push" : {f"playlist.{ mail ['referId' ]} .perms.read" : user_id }})
590584 await func .update_user (user_id , {"$set" : {
591- f'playlist.{ assgined_playlist_id } ' : {
585+ f'playlist.{ assigned_playlist_id } ' : {
592586 'user' : mail ['sender' ], 'referId' : mail ['referId' ],
593587 'name' : playlist_name ,
594588 'type' : 'share'
@@ -597,7 +591,7 @@ async def updatePlaylist(bot: commands.Bot, data: Dict) -> Dict:
597591 }})
598592
599593 payload .update ({
600- "playlistId" : assgined_playlist_id ,
594+ "playlistId" : assigned_playlist_id ,
601595 "msg" : f"You have created '{ playlist_name } ' playlist." ,
602596 "data" : share_playlist ,
603597 })
0 commit comments