mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 18:20:27 +00:00
🐛 fix gif panic
This commit is contained in:
@@ -34,6 +34,9 @@ func dlblock(name string) string {
|
||||
}
|
||||
|
||||
func dlrange(prefix string, end int) *[]chan *string {
|
||||
if file.IsNotExist(datapath + `materials/` + prefix) {
|
||||
_ = os.MkdirAll(datapath+`materials/`+prefix, 0755)
|
||||
}
|
||||
c := make([]chan *string, end)
|
||||
for i := range c {
|
||||
c[i] = make(chan *string)
|
||||
|
||||
@@ -21,7 +21,11 @@ var (
|
||||
)
|
||||
|
||||
func init() { // 插件主体
|
||||
os.RemoveAll(datapath) // 清除缓存图片
|
||||
_ = os.RemoveAll(datapath) // 清除缓存图片
|
||||
err := os.MkdirAll(datapath, 0755)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
rand.Seed(time.Now().UnixNano()) // 设置种子
|
||||
control.Register("gif", &control.Options{
|
||||
DisableOnDefault: false,
|
||||
|
||||
Reference in New Issue
Block a user