reverse

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &commands.YAGCommand{
	CmdCategory:  commands.CategoryFun,
	Name:         "Reverse",
	Aliases:      []string{"r", "rev"},
	Description:  "Reverses the text given",
	RunInDM:      true,
	RequiredArgs: 1,
	Arguments: []*dcmd.ArgDef{
		&dcmd.ArgDef{Name: "What", Type: dcmd.String},
	},
	RunFunc: func(data *dcmd.Data) (interface{}, error) {
		toFlip := data.Args[0].Str()

		out := ""
		for _, r := range toFlip {
			out = string(r) + out
		}

		cop := *data.Msg
		cop.Content = out

		if data.CS.Type == discordgo.ChannelTypeGuildText {

			if automod_legacy.CheckMessageForBadInvites(out, data.CS.Guild.ID) {
				return data.Msg.Author.Mention() + " tried to use the reverse command to send a invite to another server :(", nil
			}

			if automod_legacy.CheckMessage(&cop) {
				return "", nil
			}

			out = automod_legacy.LinkRegex.ReplaceAllString(out, "")
		}

		return ":upside_down: " + out, nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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