Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require("express");
- const app = express();
- const moment = require('moment')
- app.listen(() => console.log("Server started"));
- app.use('/ping', (req, res) => {
- res.send(new Date());
- });
- let category = 'ايدي الغاتيغوري الي تتسوئ فيها الرومات'
- const Discord = require("discord.js");
- const client = new Discord.Client();
- const TempChannels = require("discord-temp-channels");
- const tempChannels = new TempChannels(client);
- const db = require("quick.db");
- client.on("ready", () => {
- if (!db.get("temp-channels")) db.set("temp-channels", []);
- db.get("temp-channels").forEach((channelData) => {
- tempChannels.registerChannel(channelData.channelID, channelData.options);
- });
- });
- client.on("message", (message) => {
- if(message.content.startsWith("!set")){
- if(!message.member.hasPermission('MANAGE_CHANNELS')) return;
- if(!message.member.voice.channel) return message.channel.send('join a vc first!')
- if(tempChannels.channels.some((channel) => channel.channelID === message.member.voice.channel.id)){
- return message.channel.send("Your voice channel is already a main voice channel");
- }
- const options = {
- childCategory: category,
- childAutoDeleteIfEmpty: true,
- childBitrate: 64000,
- childFormat: (member, count) => `${member.user.username}`
- };
- tempChannels.registerChannel(message.member.voice.channel.id, options);
- db.push("temp-channels", {
- channelID: message.member.voice.channel.id,
- options: options
- });
- message.channel.send("Your voice is now a main voice channel!");
- }
- });
- client.login(process.env.token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement