updates
This commit is contained in:
@@ -7,9 +7,9 @@ export class YtInfo extends CallbackCommand {
|
|||||||
text: string;
|
text: string;
|
||||||
|
|
||||||
async execute(query: CallbackQuery): Promise<void> {
|
async execute(query: CallbackQuery): Promise<void> {
|
||||||
const videoUrl = query.data.split(" ")[1];
|
const videoId = query.data.split(" ")[1];
|
||||||
if (!videoUrl) return;
|
if (!videoId) return;
|
||||||
|
|
||||||
await processYouTubeLink(query.message, videoUrl);
|
await processYouTubeLink(query.message, null, videoId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-4
@@ -1247,10 +1247,10 @@ function getFirstLink(msg: Message): string | null {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function processYouTubeLink(msg: Message, url: string): Promise<boolean> {
|
export async function processYouTubeLink(msg: Message, url?: string, id?: string): Promise<boolean> {
|
||||||
if (!url) return false;
|
if (!url && !id) return false;
|
||||||
try {
|
try {
|
||||||
const videoId = getYouTubeVideoId(url);
|
const videoId = id || getYouTubeVideoId(url);
|
||||||
const yt = commands.find(e => e instanceof YouTubeDownload);
|
const yt = commands.find(e => e instanceof YouTubeDownload);
|
||||||
|
|
||||||
if (await checkRequirements(yt, msg)) {
|
if (await checkRequirements(yt, msg)) {
|
||||||
@@ -1309,7 +1309,7 @@ export async function processYouTubeLink(msg: Message, url: string): Promise<boo
|
|||||||
text: Environment.errorText,
|
text: Environment.errorText,
|
||||||
reply_markup: {
|
reply_markup: {
|
||||||
inline_keyboard: [[
|
inline_keyboard: [[
|
||||||
TryAgain.withData("/ytinfo " + url).asButton()
|
TryAgain.withData("/ytinfo " + videoId).asButton()
|
||||||
]]
|
]]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user