Passed
Push — master ( 5d908c...87bfc6 )
by Viktor
01:59
created

bot.*Context.RemoveGreeting   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package bot
2
3
import "github.com/bwmarrin/discordgo"
4
5
func Greeting(discord *discordgo.Session, event *discordgo.GuildMemberAdd, guild *GuildData, conf *Config) {
0 ignored issues
show
introduced by
exported function Greeting should have comment or be unexported
Loading history...
6
	if guild.Greeting != "" {
7
		NewEmbed(conf.GetLocaleLang("", guild.Language))
8
		_, _ = discord.ChannelMessageSend(event.User.ID, guild.Greeting)
9
	}
10
}
11
12
func (ctx *Context) AddGreeting(text string) {
0 ignored issues
show
introduced by
exported method Context.AddGreeting should have comment or be unexported
Loading history...
13
	ctx.Guilds.Guilds[ctx.Guild.ID].Greeting = text
14
}
15
16
func (ctx *Context) RemoveGreeting() {
0 ignored issues
show
introduced by
exported method Context.RemoveGreeting should have comment or be unexported
Loading history...
17
	ctx.Guilds.Guilds[ctx.Guild.ID].Greeting = ""
18
}
19