mirror of
https://github.com/hazemKrimi/discord-bot.git
synced 2026-05-01 18:30:25 +00:00
added more small changes
This commit is contained in:
@@ -51,7 +51,7 @@ module.exports = class Play extends Command {
|
|||||||
|
|
||||||
const title = video.title;
|
const title = video.title;
|
||||||
const by = video.channel.title;
|
const by = video.channel.title;
|
||||||
const durationString = message.guild.formatDuration(video.duration);
|
const durationString = message.guild.formatDurationString(video.duration);
|
||||||
const thumbnail = video.thumbnails.high.url;
|
const thumbnail = video.thumbnails.high.url;
|
||||||
const data = {
|
const data = {
|
||||||
type: 'youtube',
|
type: 'youtube',
|
||||||
@@ -81,7 +81,7 @@ module.exports = class Play extends Command {
|
|||||||
const video = await youtube.getVideoByID(id);
|
const video = await youtube.getVideoByID(id);
|
||||||
const title = video.title;
|
const title = video.title;
|
||||||
const by = video.channel.title;
|
const by = video.channel.title;
|
||||||
const durationString = message.guild.formatDuration(video.duration);
|
const durationString = message.guild.formatDurationString(video.duration);
|
||||||
const thumbnail = video.thumbnails.high.url;
|
const thumbnail = video.thumbnails.high.url;
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
@@ -131,7 +131,7 @@ module.exports = class Play extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const durationString = durationArr ? message.guild.formatDuration({ hours: durationArr[0], minutes: durationArr[1], seconds: durationArr[2] + 1 }) : 'Live Stream';
|
const durationString = durationArr ? message.guild.formatDurationString({ hours: durationArr[0], minutes: durationArr[1], seconds: durationArr[2] + 1 }) : 'Live Stream';
|
||||||
const title = await page.evaluate(title => title.innerText.replace(/\s\|\sfacebook/i, ''), titleHandle);
|
const title = await page.evaluate(title => title.innerText.replace(/\s\|\sfacebook/i, ''), titleHandle);
|
||||||
const videoLink = await page.evaluate(meta => meta.getAttribute('content'), metaHandle);
|
const videoLink = await page.evaluate(meta => meta.getAttribute('content'), metaHandle);
|
||||||
const data = {
|
const data = {
|
||||||
@@ -163,7 +163,7 @@ module.exports = class Play extends Command {
|
|||||||
hours: new Date(Math.ceil(metaData.format.duration) * 1000).getUTCHours(),
|
hours: new Date(Math.ceil(metaData.format.duration) * 1000).getUTCHours(),
|
||||||
minutes: new Date(Math.ceil(metaData.format.duration) * 1000).getUTCMinutes(),
|
minutes: new Date(Math.ceil(metaData.format.duration) * 1000).getUTCMinutes(),
|
||||||
seconds: new Date(Math.ceil(metaData.format.duration) * 1000).getSeconds(),
|
seconds: new Date(Math.ceil(metaData.format.duration) * 1000).getSeconds(),
|
||||||
string: message.guild.formatDuration({
|
string: message.guild.formatDurationString({
|
||||||
hours: new Date(Math.ceil(metaData.format.duration) * 1000).getUTCHours(),
|
hours: new Date(Math.ceil(metaData.format.duration) * 1000).getUTCHours(),
|
||||||
minutes: new Date(Math.ceil(metaData.format.duration) * 1000).getUTCMinutes(),
|
minutes: new Date(Math.ceil(metaData.format.duration) * 1000).getUTCMinutes(),
|
||||||
seconds: new Date(Math.ceil(metaData.format.duration) * 1000).getSeconds()
|
seconds: new Date(Math.ceil(metaData.format.duration) * 1000).getSeconds()
|
||||||
@@ -200,7 +200,7 @@ module.exports = class Play extends Command {
|
|||||||
const video = await youtube.getVideoByID(videos[0].raw.id.videoId);
|
const video = await youtube.getVideoByID(videos[0].raw.id.videoId);
|
||||||
const title = video.title;
|
const title = video.title;
|
||||||
const by = video.channel.title;
|
const by = video.channel.title;
|
||||||
const durationString = message.guild.formatDuration(video.duration);
|
const durationString = message.guild.formatDurationString(video.duration);
|
||||||
const thumbnail = video.thumbnails.high.url;
|
const thumbnail = video.thumbnails.high.url;
|
||||||
const data = {
|
const data = {
|
||||||
type: 'search',
|
type: 'search',
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ module.exports = class JoinCommand extends Command {
|
|||||||
const video = await youtube.getVideoByID(videos[index - 1].raw.id.videoId);
|
const video = await youtube.getVideoByID(videos[index - 1].raw.id.videoId);
|
||||||
const title = video.title;
|
const title = video.title;
|
||||||
const by = video.channel.title;
|
const by = video.channel.title;
|
||||||
const durationString = message.guild.formatDuration(video.duration);
|
const durationString = message.guild.formatDurationString(video.duration);
|
||||||
const thumbnail = video.thumbnails.high.url;
|
const thumbnail = video.thumbnails.high.url;
|
||||||
const data = {
|
const data = {
|
||||||
type: 'search',
|
type: 'search',
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ module.exports = class Play extends Command {
|
|||||||
return await message.say({ embed });
|
return await message.say({ embed });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message.guild.music.dispatcher.emit('finish');
|
await message.guild.music.dispatcher.emit('finish');
|
||||||
const embed = new MessageEmbed().setColor('#000099').setTitle(':track_next: Skipped current track');
|
const embed = new MessageEmbed().setColor('#000099').setTitle(':track_next: Skipped current track');
|
||||||
return await message.say({ embed });
|
return await message.say({ embed });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user