-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
310 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Selfbot options | ||
TOKEN = "" # Your Discord self-bot token | ||
PREFIX = "$" # The prefix used to trigger your self-bot commands | ||
GUILD_ID = "" # The ID of the Discord server your self-bot will be running on | ||
COMMAND_CHANNEL_ID = "" # The ID of the Discord channel where your self-bot will respond to commands | ||
VIDEO_CHANNEL_ID = "" # The ID of the Discord voice/video channel where your self-bot will stream videos | ||
ADMIN_IDS = [""] # A list of Discord user IDs that are considered administrators for your self-bot (not implemented yet) | ||
VIDEOS_FOLDER = "./videos" # The local path where you store video files | ||
PREVIEW_CACHE = "/tmp/preview-cache" # The local path where your self-bot will cache video preview thumbnails | ||
|
||
# Stream options | ||
STREAM_WIDTH = "1280" # The width of the video stream in pixels | ||
STREAM_HEIGHT = "720" # The height of the video stream in pixels | ||
STREAM_FPS = "30" # The frames per second (FPS) of the video stream | ||
STREAM_BITRATE_KBPS = "1000" # The bitrate of the video stream in kilobits per second (Kbps) | ||
STREAM_MAX_BITRATE_KBPS = "2500" # The maximum bitrate of the video stream in kilobits per second (Kbps) | ||
STREAM_HARDWARE_ACCELERATION = "false" # Whether to use hardware acceleration for video decoding, set to "true" to enable, "false" to disable | ||
STREAM_VIDEO_CODEC = "H264" # The video codec to use for the stream, can be "H264" or "H265" or "VP8" | ||
|
||
# Videos server options | ||
SERVER_ENABLED = "false" # Whether to enable the built-in video server | ||
SERVER_USERNAME = "admin" # The username for the video server's admin interface | ||
SERVER_PASSWORD = "admin" # The password for the video server's admin interface | ||
SERVER_PORT = "8080" # The port number the video server will listen on | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
LICENSE | ||
node_modules/ | ||
dist/ | ||
config.json | ||
.env | ||
bun.lockb | ||
videos/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import dotenv from "dotenv" | ||
|
||
dotenv.config() | ||
|
||
export default { | ||
// Selfbot options | ||
token: process.env.TOKEN, | ||
prefix: process.env.PREFIX, | ||
guildId: process.env.GUILD_ID ? process.env.GUILD_ID : '', | ||
cmdChannelId: process.env.COMMAND_CHANNEL_ID ? process.env.COMMAND_CHANNEL_ID : '', | ||
videoChannelId: process.env.VIDEO_CHANNEL_ID ? process.env.VIDEO_CHANNEL_ID : '', | ||
previewCache: process.env.PREVIEW_CACHE ? process.env.PREVIEW_CACHE : '/tmp/preview-cache', | ||
|
||
// Stream options | ||
width: process.env.STREAM_WIDTH ? parseInt(process.env.STREAM_WIDTH) : 1280, | ||
height: process.env.STREAM_HEIGHT ? parseInt(process.env.STREAM_HEIGHT) : 720, | ||
fps: process.env.STREAM_FPS ? parseInt(process.env.STREAM_FPS) : 30, | ||
bitrateKbps: process.env.STREAM_BITRATE_KBPS ? parseInt(process.env.STREAM_BITRATE_KBPS) : 1000, | ||
maxBitrateKbps: process.env.STREAM_MAX_BITRATE_KBPS ? parseInt(process.env.STREAM_MAX_BITRATE_KBPS) : 2500, | ||
hardwareAcceleratedDecoding: process.env.STREAM_HARDWARE_ACCELERATION ? parseBoolean(process.env.STREAM_HARDWARE_ACCELERATION) : false, | ||
videoCodec: process.env.STREAM_VIDEO_CODEC === 'VP8' ? 'VP8' : 'H264', | ||
|
||
// Videos server options | ||
server_enabled: process.env.SERVER_ENABLED ? parseBoolean(process.env.SERVER_ENABLED) : false, | ||
server_username: process.env.SERVER_USERNAME ? process.env.SERVER_USERNAME : 'admin', | ||
server_password: process.env.SERVER_PASSWORD ? process.env.SERVER_PASSWORD : 'admin', | ||
server_port: parseInt(process.env.SERVER_PORT ? process.env.SERVER_PORT : '8080'), | ||
videosFolder: process.env.VIDEOS_FOLDER ? process.env.VIDEOS_FOLDER : './videos' | ||
} | ||
|
||
function parseBoolean(value: string | undefined): boolean { | ||
if (typeof value === "string") { | ||
value = value.trim().toLowerCase(); | ||
} | ||
switch (value) { | ||
case "true": | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.