-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
125 changed files
with
3,305 additions
and
3,748 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,26 @@ | ||
name: Build Sokora | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install packages and build | ||
run: npm install && npx tsc -b ./ | ||
|
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
node_modules/ | ||
.env | ||
.env | ||
.DS_Store | ||
data.db |
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,7 @@ | ||
{ | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"arrowParens": "avoid", | ||
"trailingComma": "none", | ||
"printWidth": 100 | ||
} |
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 |
---|---|---|
@@ -1,19 +1,17 @@ | ||
<div align="center"> | ||
<p> | ||
<img src="static/banner.svg" /> | ||
<img src="static/banner.png" /> | ||
</p> | ||
<p> | ||
<a href="https://discord.gg/7RdABJhQss"><img src="https://img.shields.io/discord/903852579837059113?color=5865F2&logo=discord&logoColor=white" /></a> | ||
<a href="https://discord.gg/c6C25P4BuY"><img src="https://img.shields.io/discord/903852579837059113?color=5865F2&logo=discord&logoColor=white" /></a> | ||
<a href="https://ptb.discord.com/api/oauth2/authorize?client_id=873918300726394960&permissions=8&scope=bot%20applications.commands"><img src="https://img.shields.io/badge/bot-Invite%20the%20bot%20here!-blue" /></a> | ||
</p> | ||
</div> | ||
|
||
# About | ||
Nebula is a multiplatform, multipurpose bot with the ability to add extensions to have additional features. | ||
Sokora is a multiplatform, multipurpose bot with the ability to add extensions to have additional features. | ||
|
||
**Please note that Nebula is currently in an alpha preview state and only usable within Discord with limited functionality.** | ||
**Please note that Sokora is currently unstable and is only usable within Discord.** | ||
|
||
# Contributing | ||
While we're developing the multiplatform version of the bot, you can still [help us](CONTRIBUTING.MD) if you find any bugs. | ||
|
||
Only bug fixes are accepted, **no new features!** |
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,50 @@ | ||
import * as fs from "fs"; | ||
import { createInterface } from "readline"; | ||
|
||
const readHiddenInput = async (prompt: string): Promise<string> => { | ||
console.log(prompt); | ||
|
||
return new Promise(resolve => { | ||
const rl = createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
|
||
const stdin = process.stdin; | ||
if (stdin.isTTY) stdin.setRawMode(true); | ||
|
||
stdin.on("data", data => { | ||
if (data.toString() === "\n" || data.toString() === "\r") { | ||
if (stdin.isTTY) stdin.setRawMode(false); | ||
process.stdout.moveCursor(0, -1); | ||
process.stdout.clearLine(1); | ||
rl.close(); | ||
} | ||
}); | ||
|
||
rl.question("", input => { | ||
resolve(input); | ||
}); | ||
}); | ||
}; | ||
|
||
const replaceTokenInEnv = (token: string) => { | ||
try { | ||
const envContent = fs.readFileSync(".env", "utf-8"); | ||
const updatedContent = envContent.replace("YOURTOKEN", token); | ||
fs.writeFileSync(".env", updatedContent, "utf-8"); | ||
console.log("You're good to go, happy coding!"); | ||
} catch (error) { | ||
console.error("Error updating .env file:", error); | ||
} | ||
}; | ||
|
||
const main = async () => { | ||
fs.copyFileSync("example.env", ".env"); | ||
const token = await readHiddenInput( | ||
"Paste your token below: (you can get one from https://discord.com/developers/applications)" | ||
); | ||
replaceTokenInEnv(token); | ||
}; | ||
|
||
main().catch(console.error); |
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 |
---|---|---|
@@ -1,7 +1 @@ | ||
TOKEN="YOURTOKEN" # The bot token found in the Discord Developer portal | ||
|
||
MYSQL_HOST="localhost" # Name of the host | ||
MYSQL_PORT="1234" | ||
MYSQL_USERNAME="username" # Username USED BY YOUR DATABASE | ||
MYSQL_DATABASE="nebula_stable" | ||
MYSQL_PASSWORD="Password123" | ||
TOKEN="YOURTOKEN" |
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 |
---|---|---|
@@ -1,27 +1,26 @@ | ||
{ | ||
"name": "nebula", | ||
"description": "Welcome to Nebula, the multipurpose, multiplatform bot.", | ||
"name": "sokora", | ||
"description": "Welcome to Sokora, a multipurpose Discord bot that lets you manage your servers easily.", | ||
"contributors": [ | ||
"The Nebula team", | ||
"The Sokora team", | ||
"The GitHub contributors" | ||
], | ||
"version": "0.1.0", | ||
"main": "./src/index.ts", | ||
"type": "module", | ||
"scripts": { | ||
"setup": "bun i && bun run cli/setup.ts", | ||
"start": "bun ./src/index.ts" | ||
}, | ||
"dependencies": { | ||
"discord.js": "^14.14.1", | ||
"discord.js": "^14.16.3", | ||
"ms": "^2.1.3", | ||
"mysql2": "^3.6.3", | ||
"node-vibrant": "^3.2.1-alpha.1", | ||
"quick.db": "^9.1.7", | ||
"sharp": "v0.33.0-alpha.11" | ||
"sharp": "^0.33.5" | ||
}, | ||
"devDependencies": { | ||
"bun-types": "0.8.1", | ||
"typescript": "^5.2.2" | ||
}, | ||
"trustedDependencies": ["sharp"] | ||
"@types/ms": "^0.7.34", | ||
"bun-types": "^1.1.33", | ||
"typescript": "^5.6.3" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,26 +1,28 @@ | ||
import { Client, ActivityType } from "discord.js"; | ||
import Commands from "./handlers/commands.js"; | ||
import Events from "./handlers/events.js"; | ||
import { ActivityType, Client } from "discord.js"; | ||
import { Commands } from "./handlers/commands"; | ||
import { Events } from "./handlers/events"; | ||
import { rescheduleUnbans } from "./utils/unbanScheduler"; | ||
|
||
const client = new Client({ | ||
presence: { | ||
activities: [{ name: "with /settings!", type: ActivityType.Playing }] | ||
activities: [{ name: "your feedback!", type: ActivityType.Listening }] | ||
}, | ||
intents: [ | ||
"Guilds", | ||
"GuildMembers", | ||
"GuildMessages", | ||
"GuildEmojisAndStickers", | ||
"GuildPresences", | ||
"GuildBans", | ||
"MessageContent" | ||
] | ||
}); | ||
|
||
client.on("ready", async () => { | ||
new Events(client); | ||
console.log("Starting all commands."); | ||
await new Events(client).loadEvents(); | ||
await new Commands(client).registerCommands(); | ||
console.log("γ‘γΌγ£γοΌ"); | ||
rescheduleUnbans(client); | ||
}); | ||
|
||
client.login(process.env.TOKEN); |
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,78 @@ | ||
import { | ||
ActionRowBuilder, | ||
ButtonBuilder, | ||
ButtonStyle, | ||
EmbedBuilder, | ||
SlashCommandBuilder, | ||
type ChatInputCommandInteraction | ||
} from "discord.js"; | ||
import { genColor } from "../utils/colorGen"; | ||
import { imageColor } from "../utils/imageColor"; | ||
import { randomise } from "../utils/randomise"; | ||
|
||
export default class About { | ||
data: SlashCommandBuilder; | ||
constructor() { | ||
this.data = new SlashCommandBuilder() | ||
.setName("about") | ||
.setDescription("Shows information about Sokora."); | ||
} | ||
|
||
async run(interaction: ChatInputCommandInteraction) { | ||
const client = interaction.client; | ||
const user = client.user; | ||
const guilds = client.guilds.cache; | ||
const members = guilds.map(guild => guild.memberCount).reduce((a, b) => a + b); | ||
const shards = client.shard?.count; | ||
const avatar = user.displayAvatarURL(); | ||
let emojis = ["π", "π", "π", "π", "π", "π", "π", "π"]; | ||
if (Math.round(Math.random() * 100) <= 5) emojis = ["β¨οΈ", "π»", "π₯οΈ"]; | ||
|
||
const embed = new EmbedBuilder() | ||
.setAuthor({ name: "β’ About Sokora", iconURL: avatar }) | ||
.setDescription( | ||
"Sokora is a multipurpose Discord bot that lets you manage your servers easily." | ||
) | ||
.setFields( | ||
{ | ||
name: "π β’ General", | ||
value: [ | ||
"Version **0.1**, *Kaishi*", | ||
`**${members}** members β’ **${guilds.size}** guild${guilds.size == 1 ? "" : "s"} ${ | ||
!shards ? "" : `β’ **${shards}** shard${shards == 1 ? "" : "s"}` | ||
}` | ||
].join("\n") | ||
}, | ||
{ | ||
name: "π β’ Entities involved", | ||
value: [ | ||
"**Founder**: Goos", | ||
"**Translator Lead**: ThatBOI", | ||
"**Developers**: Dimkauzh, Froxcey, Golem64, Koslz, MQuery, Nikkerudon, Spectrum, ThatBOI", | ||
"**Designers**: ArtyH, ZakaHaceCosas, Pjanda", | ||
"**Translators**: Dimkauzh, flojo, Golem64, GraczNet, Nikkerudon, ZakaHaceCosas, SaFire, TrulyBlue", | ||
"**Testers**: Blaze, fishy, Trynera", | ||
"And **YOU**, for using Sokora." | ||
].join("\n") | ||
}, | ||
{ | ||
name: "π β’ Links", | ||
value: | ||
"[GitHub](https://www.github.com/NebulaTheBot) β’ [YouTube](https://www.youtube.com/@NebulaTheBot) β’ [Instagram](https://instagram.com/NebulaTheBot) β’ [Mastodon](https://mastodon.online/@[email protected]) β’ [Guilded](https://guilded.gg/Nebula) β’ [Revolt](https://rvlt.gg/28TS9aXy)" | ||
} | ||
) | ||
.setFooter({ text: `Made with ${randomise(emojis)} by the Sokora team` }) | ||
.setThumbnail(avatar) | ||
.setColor(user.hexAccentColor ?? (await imageColor(undefined, avatar)) ?? genColor(270)); | ||
|
||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents( | ||
new ButtonBuilder() | ||
.setLabel("β’ Donate") | ||
.setURL("https://paypal.me/SokoraTheBot") | ||
.setEmoji("β") | ||
.setStyle(ButtonStyle.Link) | ||
); | ||
|
||
await interaction.reply({ embeds: [embed], components: [row] }); | ||
} | ||
} |
Oops, something went wrong.