feat: Convert all app files to JS

This commit is contained in:
Faruk AYDIN
2024-01-05 17:44:21 +01:00
parent b95478b635
commit 43dba351c3
1030 changed files with 5114 additions and 6436 deletions

View File

@@ -0,0 +1,4 @@
import listChannels from './list-channels/index.js';
import listVoiceChannels from './list-voice-channels/index.js';
export default [listChannels, listVoiceChannels];

View File

@@ -1,4 +0,0 @@
import listChannels from './list-channels';
import listVoiceChannels from './list-voice-channels';
export default [listChannels, listVoiceChannels];

View File

@@ -1,14 +1,9 @@
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
export default {
name: 'List channels',
key: 'listChannels',
async run($: IGlobalVariable) {
const channels: {
data: IJSONObject[];
error: IJSONObject | null;
} = {
async run($) {
const channels = {
data: [],
error: null,
};
@@ -18,11 +13,11 @@ export default {
);
channels.data = response.data
.filter((channel: IJSONObject) => {
.filter((channel) => {
// filter in text channels and announcement channels only
return channel.type === 0 || channel.type === 5;
})
.map((channel: IJSONObject) => {
.map((channel) => {
return {
value: channel.id,
name: channel.name,

View File

@@ -1,14 +1,9 @@
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
export default {
name: 'List voice channels',
key: 'listVoiceChannels',
async run($: IGlobalVariable) {
const channels: {
data: IJSONObject[];
error: IJSONObject | null;
} = {
async run($) {
const channels = {
data: [],
error: null,
};
@@ -18,11 +13,11 @@ export default {
);
channels.data = response.data
.filter((channel: IJSONObject) => {
.filter((channel) => {
// filter in voice and stage channels only
return channel.type === 2 || channel.type === 13;
})
.map((channel: IJSONObject) => {
.map((channel) => {
return {
value: channel.id,
name: channel.name,