-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: implement class-based structure with hybrid command support #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
125ab77
refactor: implement class-based structure with hybrid command support
fhyrox 08de20e
use fast-glob to see files
vrdons 9c9dfe1
test: Add simple arox client tests
vrdons 08f37f0
refactor event and command handling
vrdons 84cc5d9
fix minor issues
vrdons 92fa856
use builder-like handler
vrdons 05db04e
move changelog.md to changelog branch
vrdons bffcd89
bump @arox/framework to 0.1.0
vrdons d91d2ca
Fix issues, update logger
vrdons 758b9e7
Fix small mistakes :3
vrdons 9c16165
fix wrong commands be listed
vrdons File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,6 +1,10 @@ | ||
| # Our | ||
| env.sh | ||
|
|
||
| # Build extra | ||
| dist | ||
|
|
||
|
|
||
| # Logs | ||
| logs | ||
| *.log | ||
|
|
||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -13,5 +13,5 @@ | |
| "type": "commonjs" | ||
| }, | ||
| "sourceMaps": false, | ||
| "minify": true | ||
| "minify": false | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 @@ | ||
| const { EventBuilder } = require("../../../dist"); | ||
|
|
||
| new EventBuilder("clientReady", false, (context) => { | ||
| context.logger.log("Client connected!"); | ||
| context.logger.warn(`Current user: ${context.client.user.username}`); | ||
| context.logger.warn(`Current prefix: ${context.client.prefix ?? "none"}`); | ||
| }); | ||
This file contains hidden or 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,34 @@ | ||
| const arox = require("../../dist/index"); | ||
|
|
||
| const client = new arox.Client({ | ||
| intents: 37376, | ||
| prefix: { enabled: true, prefix: "a!" }, | ||
| logger: { | ||
| depth: 0, | ||
| }, | ||
| autoRegisterCommands: false, | ||
| }); | ||
|
|
||
| arox.setClient(client); | ||
| const command = new arox.CommandBuilder({ | ||
| name: "arox", | ||
| description: "Arox test command", | ||
| slash: true, | ||
| prefix: true, | ||
| }); | ||
| arox.clearClient(); | ||
|
|
||
| command | ||
| .onMessage(function (ctx) { | ||
| const { message } = ctx; | ||
| void message.reply("Çalışıyom ulan şurda rahat bırak beni"); | ||
| }) | ||
| .onInteraction(function (ctx) { | ||
| const { interaction } = ctx; | ||
| void interaction.reply("Çalışıyom ulan şurda rahat bırak beni"); | ||
| }); | ||
vrdons marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| async function init() { | ||
| await client.login(process.env.BOT_TOKEN); | ||
| } | ||
| void init(); | ||
vrdons marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.