feat: Convert all app files to JS
This commit is contained in:
4
packages/backend/src/apps/discord/dynamic-data/index.js
Normal file
4
packages/backend/src/apps/discord/dynamic-data/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import listChannels from './list-channels/index.js';
|
||||
import listVoiceChannels from './list-voice-channels/index.js';
|
||||
|
||||
export default [listChannels, listVoiceChannels];
|
@@ -1,4 +0,0 @@
|
||||
import listChannels from './list-channels';
|
||||
import listVoiceChannels from './list-voice-channels';
|
||||
|
||||
export default [listChannels, listVoiceChannels];
|
@@ -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,
|
@@ -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,
|
Reference in New Issue
Block a user