Skip to content

Instantly share code, notes, and snippets.

@michael-fa
Created May 31, 2022 17:01
Show Gist options
  • Save michael-fa/9f189dc6fa9addfd8c1a2c3356fa9835 to your computer and use it in GitHub Desktop.
Save michael-fa/9f189dc6fa9addfd8c1a2c3356fa9835 to your computer and use it in GitHub Desktop.
#include <core>
#include <console>
#include <fixed>
#include <string>
#include <file>
#include <time>
#include <datagram>
//TelePawn Core (this would later come in an include file..)
native printc(msg[]);
native SetTimer(callback[], interval, bool:repeat);
native KillTimer(timerid);
native gettimestamp();
native Loadscript(script[]);
native Unloadscript(script[]);
native strequals(string[], compare[], ignorecase = true);
//TelePawn Telegram Functions (this would later come in an include file..)
native SendChatMessage(chatid[], message[]);
native DeleteChatMessage(chatid[], messageid);
native GetBotUserName(dest_string[]);
native GetBotFirstLastName(dest_str_first[], dest_str_last[]);
//Events (this would later come in an include file..)
forward OnInit();
forward OnUnload();
forward OnTelegramMessage(chatid[], messageid, username[], message[]);
forward OnTelegramError(errorcode, error_source[], error_message[], error[]);
forward OnConsoleInput(input[]);
main()
{
print("Example Telepawn Script!\n");
}
public OnInit()
{
printf("OnInit\n");
return 1;
}
public OnUnload()
{
return 1;
}
public OnTelegramMessage(chatid[], messageid, username[], message[])
{
return 1;
}
public OnTelegramError(errorcode, error_source[], error_message[], error[])
{
return 1;
}
public OnConsoleInput(input[])
{
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment