This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
554 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
SET CGO_LDFLAGS=-Wl,--kill-at | ||
SET CGO_LDFLAGS_ALLOW=-Wl,--kill-at | ||
SET CGO_ENABLED=1 | ||
SET GOOS=windows | ||
SET GOARCH=386 | ||
go build -ldflags "-s -w" -buildmode=c-shared -o fortune-ÔËÊÆ.XQ.dll | ||
go build -ldflags="-s -w -extldflags '-static' -O4" -buildmode=c-shared -o fortune-ÔËÊÆ.XQ.dll | ||
pause |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package fortune | ||
|
||
import ( | ||
"fmt" | ||
|
||
"yaya/core" | ||
) | ||
|
||
func sendPicture(botID int64, type_ int64, groupID int64, userID int64, path string) { | ||
core.SendMsgEX_V2( | ||
botID, | ||
type_, | ||
groupID, | ||
userID, | ||
fmt.Sprintf("[pic=%s]", path), | ||
0, | ||
false, | ||
"", | ||
) | ||
} | ||
|
||
func sendMessage(botID int64, type_ int64, groupID int64, userID int64, message string) { | ||
core.SendMsgEX_V2( | ||
botID, | ||
type_, | ||
groupID, | ||
userID, | ||
message, | ||
0, | ||
false, | ||
"", | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package fortune | ||
|
||
import ( | ||
"yaya/core" | ||
) | ||
|
||
func init() { | ||
core.Create = XQCreate | ||
core.Event = XQEvent | ||
core.DestroyPlugin = XQDestroyPlugin | ||
core.SetUp = XQSetUp | ||
} | ||
|
||
func XQCreate(version string) string { | ||
return AppInfoJson | ||
} | ||
|
||
func XQEvent(selfID int64, mseeageType int64, subType int64, groupID int64, userID int64, noticID int64, message string, messageNum int64, messageID int64, rawMessage []byte, time int64, ret int64) int64 { | ||
switch mseeageType { | ||
case 12001: | ||
go ProtectRun(func() { onStart() }, "onStart()") | ||
// 消息事件 | ||
// 0:临时会话 1:好友会话 4:群临时会话 7:好友验证会话 | ||
case 0, 1, 4, 5, 7: | ||
go ProtectRun(func() { onPrivateMessage(selfID, mseeageType, groupID, userID, message) }, "onPrivateMessage()") | ||
// 2:群聊信息 | ||
case 2, 3: | ||
go ProtectRun(func() { onGroupMessage(selfID, mseeageType, groupID, userID, message) }, "onGroupMessage()") | ||
default: | ||
// | ||
} | ||
return 0 | ||
} | ||
|
||
func XQDestroyPlugin() int64 { | ||
return 0 | ||
} | ||
|
||
func XQSetUp() int64 { | ||
return 0 | ||
} | ||
|
||
func onPrivateMessage(botID int64, type_ int64, groupID int64, userID int64, message string) { | ||
switch message { | ||
case "ft -v", "ft -version": | ||
sendMessage(botID, type_, groupID, userID, "Fortune-运势 Version 1.0.6 BY Kanri") | ||
case "ft -r", "ft -reload": | ||
Conf = Load(AppPath + "config.yml") | ||
if Conf != nil { | ||
sendMessage(botID, type_, groupID, userID, "Setting is already reload!") | ||
} else { | ||
sendMessage(botID, type_, groupID, userID, "Setting ERROR!") | ||
} | ||
case "ft -c", "ft -core": | ||
sendMessage(botID, type_, groupID, userID, "OneBot-YaYa Version 1.1.3 Beta BY Kanri Using only core") | ||
default: | ||
} | ||
} | ||
|
||
func onGroupMessage(botID int64, type_ int64, groupID int64, userID int64, message string) { | ||
App(botID, type_, groupID, userID, message) | ||
switch message { | ||
case "ft -v", "ft -version": | ||
sendMessage(botID, type_, groupID, userID, "Fortune-运势 Version 1.0.6 BY Kanri") | ||
case "ft -r", "ft -reload": | ||
Conf = Load(AppPath + "config.yml") | ||
if Conf != nil { | ||
sendMessage(botID, type_, groupID, userID, "Setting is already reload!") | ||
} else { | ||
sendMessage(botID, type_, groupID, userID, "Setting ERROR!") | ||
} | ||
case "ft -c", "ft -core": | ||
sendMessage(botID, type_, groupID, userID, "OneBot-YaYa Version 1.1.3 Beta BY Kanri Using only core") | ||
default: | ||
} | ||
|
||
} |
Oops, something went wrong.