package config import ( "context" "git.anhgelus.world/anhgelus/les-copaings-bot/common" ) type XpRole struct { XP uint RoleID uint64 GuildID uint64 } func (xp XpRole) Save(ctx context.Context) error { _, err := common.GetDB(ctx).ExecContext( ctx, `INSERT INTO xp_roles (xp, role, guild_id) VALUES (?, ?, ?)`, xp.XP, xp.RoleID, xp.GuildID, ) return err } func (xp XpRole) Delete(ctx context.Context) error { _, err := common.GetDB(ctx).ExecContext( ctx, `DELETE FROM xp_roles WHERE xp = ? AND role = ? AND guild_id = ?`, xp.XP, xp.RoleID, xp.GuildID, ) return err }