sms2tg – Forward SMS to Telegram

Features

Forward SMS messages received from a CDMA module to Telegram, and much more.

  • Forward incoming SMS instantly to your Telegram
  • Forward incoming call notification to your Telegram
  • Send SMS via Telegram Bot commands
  • Auto-reply incoming call with prerecorded audio
  • Local SQLite database for SMS backup

Requirements

  • Python 3
  • Telegram bot token

Supported Devices

  • SIM2000C (tested)
  • other CDMA modules (not tested)

Installation

pip3 install -r requirements.txt
cp data.db.sample data.db
cp config.json.sample config.json

and edit config.json according to your own configuration.

Run

python3 main.py

TODO

  • DTMF support
  • Autoreply on incoming SMS
  • Multiple device support
  • Forward SMS to Mail, Slack, IRC, etc.
  • GSM module support

GitHub

https://github.com/mbyzhang/sms2tg

Agar 推荐配置

// Ogar configurations file
// Lines starting with slashes are comment lines

// [Server]
// serverGamemode: 0 = FFA, 1 = Teams, 2 = Experimental, 10 = Tournament, 11 = Hunger Games
// serverBots: Amount of player bots to spawn (Experimental)
// serverViewBase: Base view distance of players. Warning: high values may cause lag
// serverStatsPort: Port for the stats server. Having a negative number will disable the stats server.
// serverStatsUpdate: Amount of seconds per update for server stats
// serverLogLevel: Logging level of the server. 0 = No logs, 1 = Logs the console, 2 = Logs console and ip connections
serverMaxConnections = 64
serverPort = 96
serverGamemode = 2
serverBots = 0
serverViewBaseX = 1024
serverViewBaseY = 592
serverStatsPort = 88
serverStatsUpdate = 60
serverLogLevel = 1

// [Border]
// Border values of the map (Vanilla values are left/top = 0, right/bottom = 11180.3398875)
borderLeft = 0
borderRight = 12000
borderTop = 0
borderBottom = 12000

// [Spawn]
// Each interval is 1 tick (50 ms)
spawnInterval = 20
foodSpawnAmount = 10
foodStartAmount = 400
foodMaxAmount = 2000
foodMass = 10
virusMinAmount = 40
virusMaxAmount = 200
virusStartMass = 200
virusFeedAmount = 7

// [Ejected Mass]
// ejectMass: Mass of ejected cells
// ejectMassLoss: Mass lost when ejecting cells
// ejectSpeed: Base speed of ejected cells
// ejectSpawnPlayer: Chance for a player to spawn from ejected mass
ejectMass = 12
ejectMassLoss = 16
ejectSpeed = 160
ejectSpawnPlayer = 50

// [Player]
// playerRecombineTime: Base amount of ticks before a cell is allowed to recombine (1 tick = 1000 milliseconds)
// playerMassDecayRate: Amount of mass lost per tick (Multiplier) (1 tick = 1000 milliseconds)
// playerMinMassDecay: Minimum mass for decay to occur
// playerDisconnectTime: The amount of seconds it takes for a player cell to be removed after disconnection (If set to -1, cells are never removed)
playerStartMass = 100
playerMaxMass = 225000
playerMinMassEject = 32
playerMinMassSplit = 36
playerMaxCells = 512
playerRecombineTime = 1
playerMassDecayRate = .002
playerMinMassDecay = 9
playerMaxNickLength = 15
playerDisconnectTime = 60

// [Gamemode]
// Custom gamemode settings
// tourneyTimeLimit: Time limit of the game, in minutes.
// tourneyAutoFill: If set to a value higher than 0, the tournament match will automatically fill up with bots after value seconds
// tourneyAutoFillPlayers: The timer for filling the server with bots will not count down unless there is this amount of real players
tourneyMaxPlayers = 12
tourneyPrepTime = 10
tourneyEndTime = 30
tourneyTimeLimit = 20
tourneyAutoFill = 0
tourneyAutoFillPlayers = 1

Re: 不靠谱的Twitter

@stneng

不靠谱的Twitter手机版的密码竟然是明文显示的,Then我密码被同桌看到了。。。。。。

2333333那个同桌就是我

这件事告诉我们有事没事不要尝试用手机版的页面访问一些网站 && 在输入密码的第一个字符时检查是否靠谱……

 

 

XJ 的 Computer Room

杭州市学军中学信息机房的电脑性能还是不错的……

然并卵,空调的功率太小。。。同学们都热死啦……

我想飞到楼上人少的地方享受专用的空调。。。

@stneng