2021-01-25 09:52:39 +00:00
|
|
|
package exploits
|
|
|
|
|
|
|
|
import (
|
2021-04-05 12:24:52 +00:00
|
|
|
_ "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
|
|
|
)
|
|
|
|
|
2021-04-05 12:24:52 +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) {
|
2021-03-23 11:45:20 +00:00
|
|
|
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")
|
2021-04-05 12:24:52 +00:00
|
|
|
fmt.Println("Saved video to: " + name)
|
2021-01-25 09:52:39 +00:00
|
|
|
|
2021-03-23 11:45:20 +00:00
|
|
|
err = os.WriteFile(name, twice, os.FileMode(0777))
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2021-01-25 09:52:39 +00:00
|
|
|
}
|