chore: 优化自动禁用代码

This commit is contained in:
CalciumIon
2024-08-03 17:32:28 +08:00
parent 421d34b3b7
commit a1284e4a58
5 changed files with 23 additions and 14 deletions
+7
View File
@@ -61,6 +61,13 @@ func (channel *Channel) SetOtherInfo(otherInfo map[string]interface{}) {
channel.OtherInfo = string(otherInfoBytes)
}
func (channel *Channel) GetAutoBan() bool {
if channel.AutoBan == nil {
return false
}
return *channel.AutoBan == 1
}
func (channel *Channel) Save() error {
return DB.Save(channel).Error
}