-
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.
using the commands settings for channel locking, disabled etc added eddb plugin and stubs for the simplest commands. general fixes refs #21
- Loading branch information
1 parent
89ee9dd
commit e0bc415
Showing
9 changed files
with
105 additions
and
4 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 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 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package eddb | ||
|
||
// Plugin EDDB plugin instance | ||
type Plugin struct { | ||
} |
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,77 @@ | ||
package eddb | ||
|
||
import ( | ||
"bytes" | ||
"github.com/dmportella/qilbot/bot" | ||
) | ||
|
||
const ( | ||
name = "Qilbot EDDB plugin" | ||
description = "A collection of tools and commands for EDDB." | ||
) | ||
|
||
// NewPlugin creates a new instance of WOW Plugin. | ||
func NewPlugin(qilbot *bot.Qilbot) (plugin *Plugin) { | ||
plugin = &Plugin{} | ||
|
||
commodities := bot.QilbotCommand{ | ||
Command: "commodities", | ||
Template: "commodities **item name**", | ||
Description: "Search the database for commodity information.", | ||
Execute: func(ctx *bot.QilbotCommandContext) { | ||
plugin.underConstructionCommand(ctx) | ||
}, | ||
} | ||
|
||
stations := bot.QilbotCommand{ | ||
Command: "stations", | ||
Template: "stations **system name**", | ||
Description: "Returns the stations available in specified system.", | ||
Execute: func(ctx *bot.QilbotCommandContext) { | ||
plugin.underConstructionCommand(ctx) | ||
}, | ||
} | ||
|
||
modules := bot.QilbotCommand{ | ||
Command: "modules", | ||
Template: "modules **module name**", | ||
Description: "Returns the information about specified module.", | ||
Execute: func(ctx *bot.QilbotCommandContext) { | ||
plugin.underConstructionCommand(ctx) | ||
}, | ||
} | ||
|
||
bodies := bot.QilbotCommand{ | ||
Command: "bodies", | ||
Template: "bodies **body name**", | ||
Description: "Returns the information about specified stellar body.", | ||
Execute: func(ctx *bot.QilbotCommandContext) { | ||
plugin.underConstructionCommand(ctx) | ||
}, | ||
} | ||
|
||
qilbot.AddCommand(&commodities) | ||
qilbot.AddCommand(&stations) | ||
qilbot.AddCommand(&modules) | ||
qilbot.AddCommand(&bodies) | ||
|
||
return | ||
} | ||
|
||
// Name returns the name of the plugin | ||
func (plugin *Plugin) Name() string { | ||
return name | ||
} | ||
|
||
// Description returns the description of the plugin | ||
func (plugin *Plugin) Description() string { | ||
return description | ||
} | ||
|
||
func (plugin *Plugin) underConstructionCommand(ctx *bot.QilbotCommandContext) { | ||
var buffer bytes.Buffer | ||
|
||
buffer.WriteString("this command is currently under construction") | ||
|
||
ctx.RespondToUser(buffer.String()) | ||
} |
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