| 307 | } |
| 308 | |
| 309 | func (u *UserRecord) PlaySound(soundId string, category string) { |
| 310 | |
| 311 | v := 100 |
| 312 | if soundConfig := audio.GetFile(soundId); soundConfig.FilePath != `` { |
| 313 | soundId = soundConfig.FilePath |
| 314 | if soundConfig.Volume > 0 && soundConfig.Volume <= 100 { |
| 315 | v = soundConfig.Volume |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | events.AddToQueue(events.MSP{ |
| 320 | UserId: u.UserId, |
| 321 | SoundType: `SOUND`, |
| 322 | SoundFile: soundId, |
| 323 | Volume: v, |
| 324 | Category: category, |
| 325 | }) |
| 326 | |
| 327 | } |
| 328 | |
| 329 | func (u *UserRecord) Command(inputTxt string, waitSeconds ...float64) { |
| 330 | |