-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Chiissu/dev
fix a bunch of issues
- Loading branch information
Showing
14 changed files
with
100 additions
and
95 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 |
---|---|---|
@@ -1,17 +1,13 @@ | ||
<div align="center"> | ||
<p> | ||
<img src="static/banner.png" /> | ||
</p> | ||
<p> | ||
<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 | ||
Sokora is a multiplatform, multipurpose bot with the ability to add extensions to have additional features. | ||
|
||
**Please note that Sokora is currently unstable and is only usable within Discord.** | ||
Sokora is a multipurpose Discord bot that lets you manage your servers easily. | ||
**Please note that Sokora is currently unstable so it might have issues.** | ||
|
||
# Contributing | ||
While we're developing the multiplatform version of the bot, you can still [help us](CONTRIBUTING.MD) if you find any bugs. |
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 |
---|---|---|
|
@@ -37,7 +37,7 @@ export default class About { | |
{ | ||
name: "📃 • General", | ||
value: [ | ||
"Version **0.1**, *Kaishi*", | ||
"Version **0.1.1**, *Kaishi*", | ||
`**${members}** members • **${guilds.size}** guild${guilds.size == 1 ? "" : "s"} ${ | ||
!shards ? "" : `• **${shards}** shard${shards == 1 ? "" : "s"}` | ||
}` | ||
|
@@ -47,9 +47,9 @@ export default class About { | |
name: "🌌 • Entities involved", | ||
value: [ | ||
"**Founder**: Goos", | ||
"**Translator Lead**: ThatBOI", | ||
"**Developers**: Dimkauzh, Froxcey, Golem64, Koslz, MQuery, Nikkerudon, Spectrum, ThatBOI", | ||
"**Designers**: ArtyH, ZakaHaceCosas, Pjanda", | ||
"**Translator Lead**: ThatBOI", | ||
"**Translators**: Dimkauzh, flojo, Golem64, GraczNet, Nikkerudon, ZakaHaceCosas, SaFire, TrulyBlue", | ||
"**Testers**: Blaze, fishy, Trynera", | ||
"And **YOU**, for using Sokora." | ||
|
@@ -58,7 +58,7 @@ export default class About { | |
{ | ||
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)" | ||
"[GitHub](https://www.github.com/SokoraDesu) • [YouTube](https://www.youtube.com/@SokoraDesu) • [Instagram](https://instagram.com/NebulaTheBot) • [Mastodon](https://mastodon.online/@[email protected]) • [Revolt](https://rvlt.gg/28TS9aXy)" | ||
} | ||
) | ||
.setFooter({ text: `Made with ${randomise(emojis)} by the Sokora team` }) | ||
|
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 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 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,44 +1,14 @@ | ||
import { file } from "bun"; | ||
import type { AutocompleteInteraction, CommandInteraction } from "discord.js"; | ||
import { join } from "path"; | ||
import { pathToFileURL } from "url"; | ||
import { capitalize } from "../utils/capitalize"; | ||
import { Commands } from "../handlers/commands"; | ||
import { Event } from "../utils/types"; | ||
|
||
async function getCommand( | ||
interaction: CommandInteraction | AutocompleteInteraction, | ||
options: any | ||
): Promise<any> { | ||
const commandName = capitalize(interaction.commandName)!; | ||
const subcommandName = capitalize(options.getSubcommand(false)); | ||
const commandGroupName = capitalize(options.getSubcommandGroup(false)); | ||
let commandImportPath = join( | ||
join(process.cwd(), "src", "commands"), | ||
`${ | ||
subcommandName | ||
? `${commandName.toLowerCase()}/${ | ||
commandGroupName ? `${commandGroupName}/${subcommandName}` : subcommandName | ||
}` | ||
: commandName | ||
}.ts` | ||
export default (async function run(interaction) { | ||
if (!interaction.isChatInputCommand() && !interaction.isAutocomplete()) return; | ||
const command = await new Commands(interaction.client).getCommand( | ||
interaction.commandName, | ||
interaction.options | ||
); | ||
if (!command) return; | ||
|
||
if (!(await file(commandImportPath).exists())) | ||
commandImportPath = join(join(process.cwd(), "src", "commands", `${commandName}.ts`)); | ||
|
||
return new (await import(pathToFileURL(commandImportPath).toString())).default(); | ||
} | ||
|
||
export default (async function run(interaction) { | ||
if (interaction.isChatInputCommand()) { | ||
const command = await getCommand(interaction, interaction.options); | ||
if (!command) return; | ||
if (command.deferred) await interaction.deferReply(); | ||
command.run(interaction); | ||
} else if (interaction.isAutocomplete()) { | ||
const command = await getCommand(interaction, interaction.options); | ||
if (!command) return; | ||
if (!command.autocomplete) return; | ||
command.autocomplete(interaction); | ||
} | ||
if (interaction.isChatInputCommand()) command.run(interaction); | ||
if (command.autocomplete) command.autocomplete(interaction); | ||
} as Event<"interactionCreate">); |
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 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
Binary file not shown.