createinvite

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &dcommand.SummitCommand{
	Command:      "createinvite",
	Category:     dcommand.CategoryOwner,
	Description:  "Creates an invite to the specified guild",
	ArgsRequired: 1,
	Args: []*dcommand.Arg{
		{Name: "GuildID", Type: dcommand.String},
	},
	Run: util.OwnerCommand(func(data *dcommand.Data) {
		channels, _ := common.Session.GuildChannels(data.ParsedArgs[0].String())
		var channelID string
		for _, v := range channels {
			if v.Type == discordgo.ChannelTypeGuildText {
				channelID = v.ID
				break
			}
		}
		if channelID == "0" {
			functions.SendBasicMessage(data.ChannelID, "No available channels")
		}

		invite, _ := common.Session.ChannelInviteCreate(channelID, discordgo.Invite{
			MaxAge:    120,
			MaxUses:   1,
			Temporary: true,
			Unique:    true,
		})
		functions.SendBasicMessage(data.ChannelID, "discord.gg/"+invite.Code)
	}),
}

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