-
Notifications
You must be signed in to change notification settings - Fork 1
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
18 changed files
with
138 additions
and
138 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
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,8 +1,8 @@ | ||
# Harmony | ||
# Harmonix | ||
|
||
Create Discord Bot with ease and simplicity. | ||
|
||
## License | ||
|
||
Published under the [MIT](https://github.com/harmony-ts/harmony/blob/main/LICENSE) license. | ||
Published under the [MIT](https://github.com/harmonix-js/core/blob/main/LICENSE) license. | ||
Made by [@nethriis](https://github.com/nethriis) 💙 |
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,10 +1,10 @@ | ||
#!/usr/bin/env node | ||
|
||
import { createHarmony } from '../dist/index.mjs' | ||
import { createHarmonix } from '../dist/index.mjs' | ||
import 'dotenv/config' | ||
|
||
const initHarmony = async () => { | ||
await createHarmony({ rootDir: './playground' }, { cwd: './playground' }) | ||
const initHarmonix = async () => { | ||
await createHarmonix({ rootDir: './playground' }, { cwd: './playground' }) | ||
} | ||
|
||
initHarmony() | ||
initHarmonix() |
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,6 @@ | ||
import { defineHarmonixConfig } from '../src' | ||
|
||
export default defineHarmonixConfig({ | ||
defaultPrefix: 'h!', | ||
clientId: '929023549656662047' | ||
}) |
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
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,45 @@ | ||
import type { LoadConfigOptions } from 'c12' | ||
import { loadOptions } from './options' | ||
import { scanCommands, scanEvents } from './scan' | ||
import { resolveHarmonixCommand } from './commands' | ||
import { resolveHarmonixEvent } from './events' | ||
import { | ||
initCient, | ||
registerCommands, | ||
registerEvents, | ||
registerSlashCommands | ||
} from './discord' | ||
import type { Harmonix, HarmonixConfig, HarmonixOptions } from './types' | ||
|
||
export const createHarmonix = async ( | ||
config: HarmonixConfig = {}, | ||
opts: LoadConfigOptions = {} | ||
) => { | ||
const options = await loadOptions(config, opts) | ||
const harmonix: Harmonix = { | ||
options: options as HarmonixOptions | ||
} | ||
|
||
const scannedCommands = await scanCommands(harmonix) | ||
const _commands = [...(harmonix.options.commands || []), ...scannedCommands] | ||
const commands = _commands.map((cmd) => | ||
resolveHarmonixCommand(cmd, harmonix.options) | ||
) | ||
|
||
const scannedEvents = await scanEvents(harmonix) | ||
const _events = [...(harmonix.options.events || []), ...scannedEvents] | ||
const events = _events.map((evt) => resolveHarmonixEvent(evt, harmonix.options)) | ||
|
||
harmonix.client = initCient(harmonix.options) | ||
registerCommands( | ||
harmonix, | ||
commands.filter((cmd) => !cmd.options.slash) | ||
) | ||
await registerSlashCommands( | ||
harmonix, | ||
commands.filter((cmd) => cmd.options.slash) | ||
) | ||
registerEvents(harmonix, events) | ||
|
||
return harmonix | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from './events' | ||
export * from './commands' | ||
export * from './options' | ||
export * from './harmony' | ||
export * from './harmonix' | ||
export * from './scan' |
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.