Compare commits

..

1 Commits

Author SHA1 Message Date
jack77213 0ad6adb5b3 init 2020-08-02 16:13:29 +08:00
5 changed files with 7 additions and 16 deletions

View File

@ -13,21 +13,17 @@ a3tg.pbo: $(ARMASRC)
liba3tg.so: $(GOSRC)
cd extension && GOARCH=386 CGO_ENABLED=1 go build $(LDFLAGS) -o ../liba3tg.so -buildmode=c-shared .
liba3tg_x64.so: $(GOSRC)
cd extension && GOARCH=amd64 CGO_ENABLED=1 go build $(LDFLAGS) -o ../liba3tg_x64.so -buildmode=c-shared .
liba3tg.dll: $(GOSRC)
cd extension && GOOS=windows GOARCH=386 CC=i686-w64-mingw32-cc CGO_ENABLED=1 go build $(LDFLAGS) -o ../liba3tg.dll -buildmode=c-shared .
liba3tg_x64.dll: $(GOSRC)
cd extension && GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-cc CGO_ENABLED=1 go build $(LDFLAGS) -o ../liba3tg_x64.dll -buildmode=c-shared .
build: liba3tg.so liba3tg_x64.so liba3tg.dll liba3tg_x64.dll a3tg.pbo
build: liba3tg.so liba3tg.dll liba3tg_x64.dll a3tg.pbo
clean:
-rm a3tg.pbo
-rm ./liba3tg.so
-rm ./liba3tg_x64.so
-rm ./liba3tg.dll
-rm ./liba3tg_x64.dll
-rm ./liba3tg.h

View File

@ -14,7 +14,7 @@ if (!isServer) exitWith {};
params ["_name", "_function", "_data"];
if (_name isEqualTo "a3tg") then
{
(format ["[TG] %1: %2", _function, _data]) remoteExecCall ["systemChat", -2, true];
(format ["[TG] %2: %3", _function, _data]) remoteExecCall ["systemChat", -2, true];
};
}];

View File

@ -1,5 +1,4 @@
params ["_name", "_message"];
if ( !((_message select [0, 1]) isEqualTo "#") ) then {
"liba3tg" callExtension ["chat", [_name, _message]];
};
"liba3tg" callExtension ["chat", [_name, _message]];

View File

@ -12,11 +12,7 @@ package main
}
#if __x86_64__
#ifdef __MINGW32__
static inline unsigned long long min(unsigned long long a, unsigned long long b) { return a < b ? a : b; }
#else
static inline unsigned long min(unsigned long a, unsigned long b) { return a < b ? a : b; }
#endif
static inline unsigned long long min(unsigned long long a, unsigned long long b) { return a < b ? a : b; }
#else
static inline unsigned int min(unsigned int a, unsigned int b) { return a < b ? a : b; }
#endif
@ -91,6 +87,6 @@ func handleArgs(function string, argc C.int, argv []string) {
return
}
go sendToTelegram(argv[0], argv[1])
sendToTelegram(argv[0], argv[1])
//log.Println(argc, argv[0], argv[1])
}

View File

@ -21,7 +21,7 @@ func botInit() {
log.Println(err)
}
bot, err = tgbotapi.NewBotAPI(botAPIKey)
bot, err = tgbotapi.NewBotAPIWithAPIEndpoint(botAPIKey, "https://tgproxy.hijack.workers.dev/bot%s/%s")
if err != nil {
log.Println(err)
} else {