mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-06-30 23:11:20 +02:00
bbsinfo
This commit is contained in:
@@ -34,6 +34,7 @@ Any messages that are over 160 characters are chunked into 160 message bytes to
|
||||
- `bbsread` read a message example use: `bbsread #1`
|
||||
- `bbspost` post a message to public board or send a DM example use: `bbspost $subject #message, or bbspost @nodeNumber #message or bbspost @nodeShortName #message`
|
||||
- `bbsdelete` delete a message example use: `bbsdelete #4`
|
||||
- `bbsinfo` Stats on BBS delivery and messages (sysop)
|
||||
- Other functions
|
||||
- `whereami` returns the address of location of sender if known
|
||||
- `whoami` returns some details of the node asking
|
||||
|
||||
@@ -47,6 +47,7 @@ def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_n
|
||||
"bbspost": lambda: handle_bbspost(message, message_from_id, deviceID),
|
||||
"bbsread": lambda: handle_bbsread(message),
|
||||
"bbsdelete": lambda: handle_bbsdelete(message, message_from_id),
|
||||
"bbsinfo": lambda: get_bbs_stats(),
|
||||
"messages": lambda: handle_messages(message, deviceID, channel_number, msg_history, publicChannel, isDM),
|
||||
"cmd": lambda: help_message,
|
||||
"history": lambda: handle_history(message, message_from_id, deviceID, isDM),
|
||||
|
||||
+6
-1
@@ -4,7 +4,7 @@
|
||||
import pickle # pip install pickle
|
||||
from modules.log import *
|
||||
|
||||
trap_list_bbs = ("bbslist", "bbspost", "bbsread", "bbsdelete", "bbshelp")
|
||||
trap_list_bbs = ("bbslist", "bbspost", "bbsread", "bbsdelete", "bbshelp", "bbsinfo")
|
||||
|
||||
# global message list, later we will use a pickle on disk
|
||||
bbs_messages = []
|
||||
@@ -130,6 +130,11 @@ def bbs_post_dm(toNode, message, fromNode):
|
||||
save_bbsdm()
|
||||
return "BBS DM Posted for node " + str(toNode)
|
||||
|
||||
def get_bbs_stats():
|
||||
global bbs_messages, bbs_dm
|
||||
# Return some stats on the bbs pending messages and total posted messages
|
||||
return f"📡{bbsdb} has {len(bbs_messages)} messages. Direct Mail Messages waiting: {(len(bbs_dm) - 1)}"
|
||||
|
||||
def bbs_check_dm(toNode):
|
||||
global bbs_dm
|
||||
# Check for any messages for toNode
|
||||
|
||||
Reference in New Issue
Block a user