mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-09 21:50:53 +00:00
Replace any types to more strict types
This commit is contained in:
@ -1,20 +1,19 @@
|
||||
import { ActionRowBuilder, StringSelectMenuBuilder } from "discord.js";
|
||||
import { ActionRowBuilder, SelectMenuComponentOptionData, StringSelectMenuBuilder } from "discord.js";
|
||||
import RadioClient from "../../Client";
|
||||
import { station } from "../classes/Stations";
|
||||
|
||||
export default function listStations(client: RadioClient, interaction: any){
|
||||
let stations: any = new Array();
|
||||
let options: any = new Array();
|
||||
|
||||
if(!client.stations) return;
|
||||
|
||||
stations = client.stations.forEach((station: { name?: any; owner?: any; label?: any; description?: any; value?: any; }) => {
|
||||
let options : SelectMenuComponentOptionData[] = new Array();
|
||||
|
||||
client.stations.forEach((station: station) => {
|
||||
if(station.name == "GrooveFM") return;
|
||||
station = {
|
||||
options.push({
|
||||
label: station.name,
|
||||
description: station.owner,
|
||||
value: station.name
|
||||
};
|
||||
options.push(station);
|
||||
});
|
||||
});
|
||||
|
||||
const menu = new ActionRowBuilder()
|
||||
@ -25,9 +24,6 @@ export default function listStations(client: RadioClient, interaction: any){
|
||||
.addOptions(options)
|
||||
);
|
||||
|
||||
stations = null;
|
||||
options = null;
|
||||
|
||||
return interaction.reply({
|
||||
content: '**Select station:**',
|
||||
components: [menu],
|
||||
|
@ -1,8 +1,11 @@
|
||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ColorResolvable, EmbedBuilder } from "discord.js";
|
||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction, ColorResolvable, EmbedBuilder, Guild, StringSelectMenuInteraction } from "discord.js";
|
||||
import RadioClient from "../../Client";
|
||||
import { station } from "../classes/Stations";
|
||||
|
||||
export default async function play(client: RadioClient, interaction: any, guild: any, station: any) {
|
||||
export default async function play(client: RadioClient, interaction: ChatInputCommandInteraction | StringSelectMenuInteraction | null, guild: Guild | null, station: station) {
|
||||
if(!guild) return;
|
||||
let message: any = {};
|
||||
|
||||
const radio = client.radio?.get(guild.id);
|
||||
const audioPlayer = client.streamer?.listen(station);
|
||||
radio.connection.subscribe(audioPlayer);
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Guild } from "discord.js";
|
||||
import RadioClient from "../../Client";
|
||||
|
||||
export default function saveState(client: RadioClient, guild: any, radio: any){
|
||||
export default function saveState(client: RadioClient, guild: Guild, radio: any){
|
||||
if(!client.datastore) return;
|
||||
client.datastore.checkEntry(guild.id);
|
||||
|
||||
|
Reference in New Issue
Block a user