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

bot/greeting.go   A

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 10
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A bot.Greeting 0 4 2
A bot.*Context.RemoveGreeting 0 2 1
A bot.*Context.AddGreeting 0 2 1
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