discord-exploits/exploits/twice.go

28 lines
537 B
Go
Raw Normal View History

2021-01-25 09:52:39 +00:00
package exploits
import (
_ "embed" // embed
2021-01-25 09:52:39 +00:00
"fmt"
"github.com/Schmenn/discord-exploits/modules"
2021-03-30 12:04:30 +00:00
"os"
2021-01-25 09:52:39 +00:00
)
//go:embed twice.ogg
var twiceOgg []byte
2021-01-25 09:52:39 +00:00
// RunTwiceAudioTask edits audio file so it plays a different track when played again
func RunTwiceAudioTask(fileName string) {
data, err := os.ReadFile(fileName)
2021-01-25 09:52:39 +00:00
modules.Check(err)
2021-03-30 12:04:30 +00:00
twice := append(twiceOgg, data...)
2021-01-25 09:52:39 +00:00
name := modules.CreateName("ogg")
fmt.Println("Saved video to: " + name)
2021-01-25 09:52:39 +00:00
err = os.WriteFile(name, twice, os.FileMode(0777))
if err != nil {
panic(err)
}
2021-01-25 09:52:39 +00:00
}