Skip to content

Commit

Permalink
Update discord.go
Browse files Browse the repository at this point in the history
  • Loading branch information
VioletLeporid committed Sep 28, 2023
1 parent b30d6c3 commit edf6c13
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions discord.go
Expand Up @@ -128,6 +128,8 @@ func (d *DiscordDaemon) run() {
d.inviteChannelName = invChannel
}
}
d.bot.Activity.Name = "/" + app.config.Section("discord").Key("start_command").MustString("start")
d.bot.Activity.Type = dg.ActivityTypeGame
defer d.deregisterCommands()
defer d.bot.Close()

Expand Down Expand Up @@ -339,6 +341,18 @@ func (d *DiscordDaemon) registerCommands() {
},
},
},
{
Name: "invite",
Description: "Send an invite to a discord user (admin only).",
Options: []*dg.ApplicationCommandOption{
{
Type: dg.ApplicationCommandOptionUser,
Name: "user",
Description: "User to Invite",
Required: true,
},
},
},
}
commands[1].Options[0].Choices = make([]*dg.ApplicationCommandOptionChoice, len(d.app.storage.lang.Telegram))
i := 0
Expand Down Expand Up @@ -504,6 +518,13 @@ func (d *DiscordDaemon) cmdLang(s *dg.Session, i *dg.InteractionCreate, lang str
}
}

func (d *DiscordDaemon) cmdInvite(s *dg.Session, i *dg.InteractionCreate, lang string) {
requestor := d.MustGetUser(channel.ID, i.Interaction.Member.User.ID, i.Interaction.Member.User.Discriminator, i.Interaction.Member.User.Username)
d.users[i.Interaction.Member.User.ID] = requestor
invuser := i.ApplicationCommandData().Options[0].StringValue()
// Check whether requestor is linked to the admin account
}

func (d *DiscordDaemon) messageHandler(s *dg.Session, m *dg.MessageCreate) {
if m.GuildID != "" && d.channelName != "" {
if d.channelID == "" {
Expand Down

0 comments on commit edf6c13

Please sign in to comment.