Add embed info for play and search command

This commit is contained in:
2022-02-27 19:42:05 +07:00
parent b274332cc9
commit c26cdbe7f3
2 changed files with 28 additions and 6 deletions
+14 -3
View File
@@ -6,6 +6,19 @@ import DiscordMusicPlayer, { ValidTracks } from "../../providers/DiscordMusicPla
import { joinVoiceChannelProcedure } from "./Join"; import { joinVoiceChannelProcedure } from "./Join";
const EMBEDS = { const EMBEDS = {
PLAY_INFO: (data: Message | Interaction) => {
return makeInfoEmbed ({
title: 'Play',
description: `Play a song`,
fields: [
{
name: 'Arguments',
value: '``Search query or Link``'
}
],
user: (data instanceof Interaction) ? data.user : data.author
});
},
YOUTUBE_ONLY: (data: Message | Interaction) => { YOUTUBE_ONLY: (data: Message | Interaction) => {
return makeErrorEmbed({ return makeErrorEmbed({
title: `Only youtube.com link is supported for now`, title: `Only youtube.com link is supported for now`,
@@ -128,9 +141,7 @@ export default class Play {
if (data === null || !data.guildId || data.member === null || data.guild === null) return; if (data === null || !data.guildId || data.member === null || data.guild === null) return;
if (args.length === 0) { if (args.length === 0) {
// TODO: Show info return await sendMessageOrInteractionResponse(data, { embeds: [EMBEDS.PLAY_INFO(data)] });
//return await sendMessageOrInteractionResponse(data, { embeds: [EMBEDS.MSINFO(data)] });
return;
} }
query = args.join(' '); query = args.join(' ');
+14 -3
View File
@@ -7,6 +7,19 @@ import Prisma from "../../providers/Prisma";
import { joinVoiceChannelProcedure } from "./Join"; import { joinVoiceChannelProcedure } from "./Join";
const EMBEDS = { const EMBEDS = {
SEARCH_INFO: (data: Message | Interaction) => {
return makeInfoEmbed ({
title: 'Search',
description: `Search for a song`,
fields: [
{
name: 'Arguments',
value: '``Search query``'
}
],
user: (data instanceof Interaction) ? data.user : data.author
});
},
SEARCH_RESULT: (data: Message | Interaction, result: ValidTracks[]) => { SEARCH_RESULT: (data: Message | Interaction, result: ValidTracks[]) => {
return makeInfoEmbed({ return makeInfoEmbed({
title: `Search result`, title: `Search result`,
@@ -97,9 +110,7 @@ export default class Search {
if (data === null || !data.guildId || data.member === null || data.guild === null) return; if (data === null || !data.guildId || data.member === null || data.guild === null) return;
if (args.length === 0) { if (args.length === 0) {
// TODO: Show info return await sendMessageOrInteractionResponse(data, { embeds: [EMBEDS.SEARCH_INFO(data)] });
//return await sendMessageOrInteractionResponse(data, { embeds: [EMBEDS.MSINFO(data)] });
return;
} }
query = args.join(' '); query = args.join(' ');