1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-01 12:34:28 +00:00
Commit graph

46 commits

Author SHA1 Message Date
diamondburned 9df396bb7f Bot: Fixed unable to call Plumbed method by command 2020-12-18 15:00:21 -08:00
diamondburned 29582d6131 Bot: Allow both plumbed and normal commands
This commit changes the existing Plumb behavior to allow normal commands
to coexist along a plumbed command. This change allows certain behaviors
that would otherwise require manually switching on arguments.

An example use case of this change would be having a default behavior
when a subcommand call doesn't have a command name. For example, given
this code:

    func (b *Banana) Setup(sub *bot.Subcommand) { sub.SetPlumb(b.Help) }

    func (b *Banana) Green(*gateway.MessageCreateEvent) {}
    func (b *Banana) Help(*gateway.MessageCreateEvent)  {}

The subcommand "banana" could have its own help when it's called as
"!banana", while "!banana green" would trigger another handler.
2020-11-30 14:26:53 -08:00
diamondburned afc87adbae Bot: Refactored accordingly to State's new Store API 2020-11-29 17:19:59 -08:00
diamondburned 42724e0b91 Bot: Fixed CustomParser trim not using aliases and plumbs 2020-11-14 22:27:55 -08:00
diamondburned ee9d6b0d4d Bot: clearer subcommand not found error 2020-11-14 22:11:10 -08:00
diamondburned 0932e2903b Bot: Fixed CustomParser arguments still having subcommand 2020-11-14 21:05:31 -08:00
diamondburned 273fcf1418 Bot: Added subcommand aliases and better setup API
This commit adds subcommand aliases as well as additional code in
HelpGenerate to cover for both subcommand and command aliases.

A breaking change is that {,Must}RegisterSubcommandCustom methods are
now replaced with normal {,Must}RegisterSubcommand methods. This is
because they now use variadic strings, which could take 0, 1 or more
arguments.

This commit also allows AddMiddleware and similar methods to be given a
method directly:

    sub.Plumb(cmds.PlumbedHandler)
    sub.AddMiddleware(cmds.PlumbedHandler, cmds.plumbMiddleware)

This change closes issue #146.
2020-11-12 19:02:52 -08:00
diamondburned 75df94d9f4 *: Migrated Go Modules to v2 2020-10-28 15:39:59 -07:00
diamondburned 3db68bcb0e Bot: Allow hanging quotes if command has a custom parser 2020-08-11 13:44:32 -07:00
Maximilian von Lindern 1585797b52 *: Linting and typo fixes (#134)
* Linting and typo fixes

* Linting and typo fixes

* revert comma fix
2020-07-29 16:58:33 -07:00
Maximilian von Lindern 78c36f13cd Discord: Rename Snowflake and Timestamp Valid methods (#128)
* Discord: rename Snowflake.Valid() to IsValid()

* Discord: rename Timestamp.Valid() to IsValid()
2020-07-29 16:58:33 -07:00
ks129 75fe1bd03a Implement command aliases
- Add alias parsing to `Context.findCommand`.
- Add new function to `Subcommand`: `AddAliases` that add new alias(es) to command.
- Added `Aliases` property to `MethodContext`
2020-05-24 23:08:55 -07:00
mavolin 41ce1f389e
make all error messages lowercase 2020-05-16 23:14:49 +02:00
diamondburned 795a69ca7d Bot: Added EditableCommands 2020-05-14 18:52:15 -07:00
diamondburned 729979088c Bot: Added more tests and the Help API 2020-05-14 14:04:18 -07:00
diamondburned (Forefront) 67430c6d7a Bot: Added Plumb support, fixed tests
Merged

Merged
2020-05-14 13:59:17 -07:00
diamondburned (Forefront) 964e8cdf13 Bot: Partially implemented middlewares 2020-05-14 13:59:17 -07:00
diamondburned (Forefront) 85c1326526 Bot: Added ArgsParser for each Context instead of global 2020-05-05 23:23:52 -07:00
diamondburned (Forefront) 7dbdc78d67 Bot: Added package infer for getting IDs from unknown structs 2020-05-05 23:15:25 -07:00
diamondburned (Forefront) 25ecbb0ca5 Bot: Fixed RawArguments, added more tests for that 2020-05-03 23:48:12 -07:00
diamondburned (Forefront) 90bf9d74e3 Bot: Fixed bug where RawArguments still have the command 2020-05-03 22:57:44 -07:00
diamondburned (Forefront) 4a14c4d059 Bot: Allow variadic functions to have empty trailing arguments 2020-05-03 21:22:19 -07:00
diamondburned (Forefront) b122aa6561 Bot: Added trailing manual parser support 2020-05-03 18:33:24 -07:00
diamondburned (Forefront) 3b903dce68 Bot: Added variadic arguments support 2020-05-03 15:59:10 -07:00
diamondburned (Forefront) aa53661b60 Bot: Prettier help formatting 2020-04-09 23:10:21 -07:00
diamondburned (Forefront) 70ace8e5e4 Bot: Added AllowBot 2020-04-09 21:46:21 -07:00
diamondburned (Forefront) cc530ce7a2 Bot: Allow func(T), added more documentation, minor fixes 2020-04-09 13:49:12 -07:00
diamondburned (Forefront) 09ae9fbb07 Bot: Added a Prefixer API which breaks the old Prefix string API 2020-04-06 13:27:33 -07:00
diamondburned (Forefront) 3770927a48 Bot: trivial fixes 2020-01-28 16:01:39 -08:00
diamondburned (Forefront) 1c25ccbf8e Bot: added data return types 2020-01-26 01:06:54 -08:00
diamondburned (Forefront) 9e5a88713a Improved the command parser's error 2020-01-25 23:17:18 -08:00
diamondburned (Forefront) afe1b4621f Bot: parser changed to a slimmed down version 2020-01-25 22:15:39 -08:00
diamondburned (Forefront) 0751f45bdb Bot: changed to a better command parser 2020-01-25 21:58:06 -08:00
diamondburned (Forefront) 9d3528190f Bot: added Plumb flag, methods no longer need arguments be pointers 2020-01-25 21:43:42 -08:00
diamondburned (Forefront) 9f24ff3c9f Fixed bug where MessageCreate handlers aren't called 2020-01-25 18:03:09 -08:00
diamondburned (Forefront) 95b6a1c0c9 ManualParser commands can now have no arguments 2020-01-25 17:54:04 -08:00
diamondburned (Forefront) 0304ffaeb0 Bot: added the Hidden nameflag 2020-01-25 14:30:15 -08:00
diamondburned (Forefront) 9d5164be65 Fixed subcommand bug where argv[0] is invalid 2020-01-25 14:15:42 -08:00
diamondburned (Forefront) 39e6188787 Bot: simplified Arguments of a CommandContext 2020-01-25 14:07:49 -08:00
diamondburned (Forefront) b45c0489bb Fixed bug where MessageCreate middlewares are called for other events 2020-01-24 18:56:08 -08:00
diamondburned (Forefront) 7f2b663dba Fixed bot typo bug 2020-01-24 18:51:17 -08:00
diamondburned 367f445ee9 Fixed bugs in the bot package
Bugs include: Events not being called, inconsistent subcommand casing
2020-01-24 08:08:12 -08:00
diamondburned aadcbd0767
Added middleware features into package bot. (#3)
* Middleware nameflag
* Completed M-Middleware feature
* Changed Namer/Descriptor API to CanSetup API
2020-01-23 19:17:03 -08:00
diamondburned (Forefront) 09d8c5bc43 Added GuildOnly into bot handler 2020-01-22 23:20:24 -08:00
diamondburned (Forefront) 7e73f00eb9 Fixed bug where ParseContent interface methods won't return a proper error 2020-01-20 20:25:47 -08:00
diamondburned (Forefront) 28228a60f5 Ported rfrouter over 2020-01-18 22:06:00 -08:00