303
304 def create_embed(self, status: str):
305 # If a new song is being played, it will simply display how long the song is
306 # But if the command now is being executed, it will show how long the song has been played 307 if self.paused:
308 self.pause_duration += time.time() - self.pause_time
309 self.pause_time = time.time()
289
290 # starttime stores when does the song start
291 # pause_duration stores how long does the song being paused, updates when the song resumes
292 # pause_time stores when does the song paused, used for calculating the pause_duration 293 def __init__(self, source, isFile=False, isDirectLink=False):
294 self.source = source
295 self.requester = source.requester
288 __slots__ = ('source', 'requester', 'starttime', 'pause_time', 'pause_duration', 'paused', 'isFile', 'isDirectLink', 'time_invoke_seek')
289
290 # starttime stores when does the song start
291 # pause_duration stores how long does the song being paused, updates when the song resumes 292 # pause_time stores when does the song paused, used for calculating the pause_duration
293 def __init__(self, source, isFile=False, isDirectLink=False):
294 self.source = source
240 return await self.respond(ctx.ctx, loc["not_found"].format(webpage_url))
241 # requester for saving the user who plays this song, shown in command now
242 info["requester"] = requester
243 # If seeking, ask ffmpeg to start from a specific position, else simply return the object 244 if seek is not None:
245 seek_option = FFMPEG_OPTIONS.copy()
246 seek_option['before_options'] += " -ss " + self.parse_duration_raw(seek)
208 if data is None:
209 return await self.respond(ctx.ctx, loc["not_found"].format(search))
210
211 # process_info retrieves the first entry of the returned data, but the data could be the entry itself 212 if 'entries' not in data:
213 process_info = data
214 else:
Docstring line lengths are recommended to be no greater than 79 characters.