discless

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 13 Imported by: 0

README ยถ

Discless Go

Discless is a framework that lets you create Discord bots the FaaS way, meaning that you only need to write the commands and Discless handles the rest for you.

##๐Ÿš€ Getting Started

1. Install Discless

Before creating your first function, install the Discless CLI by running

$ sudo env GOBIN=/bin go install github.com/discless/cli/cmd/discless@v0.0.2.1

Make sure you have go installed

2. Create a function and bot

First, run the new bot command and enter your bots token

$ discless new bot <bot name> <prefix>
Created bot in bot.yaml

To create a new function, run

$ discless new function <function name>
Created the function <function name>
Edit its configuration in function.yaml or edit the function in <function name>.go

This creates a configuration file for the function (function.yaml) and a golang file that looks like

package main

import (
	"github.com/bwmarrin/discordgo"
	"github.com/discless/discless/types"
)

func Handler(self *types.Self, s *discordgo.Session, m *discordgo.MessageCreate, args []string) error {
	s.ChannelMessageSend(m.ChannelID, "Pong!")
	return nil
}

You can freely edit this file.

3. Configure your bot's token

First, create a new secret for your token

$ discless new secret token NDMyMTkx...
Created secret in secret.yaml

To use the token in your bots configuration, open your bots configuration and change the following

- token: 
+ token: secret.token
4. Run the bot and deploy your function

Now you can run your bot

$ discless up bot.yaml
<bot-name> is running

To get your command up and running on the bot, run

$ discless deploy <bot name> <function configuration>.yaml
Succesfully uploaded the <function name> command

๐Ÿ“ Features

๐Ÿ” All API calls are secured by TLS
๐Ÿง  Simple and intuitive Command Line Interface
๐Ÿ’จ Fast and easy to manage Discord applications

๐Ÿ—บ๏ธ Roadmap

  • SSL encryption
  • Secret configuration
  • Deployable commands and bots
  • Support all Discord events
  • Recursive command deployment
  • Integrate databases

    More coming soon...

๐Ÿ“• License

MIT License

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL