start of meshtastic code
This commit is contained in:
parent
995bb08a0a
commit
3e98baddda
2 changed files with 28 additions and 1 deletions
26
cogs/meshtastic.py
Normal file
26
cogs/meshtastic.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import logging
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import meshtastic
|
||||
import meshtastic.serial_interface
|
||||
|
||||
class Meshtastic(commands.Cog):
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.logger = logging.getLogger("bot")
|
||||
self.interface = meshtastic.serial_interface.SerialInterface()
|
||||
|
||||
@commands.command(
|
||||
description="Meshtastic",
|
||||
help="Ask the magic ball a question.",
|
||||
brief="Ask the magic ball a question.",
|
||||
aliases=["mesh"]
|
||||
)
|
||||
async def mesh(self, ctx, *args):
|
||||
message = " ".join(args)
|
||||
self.interface.sendText(message)
|
||||
self.logger.info(f"Meshtastic command called by {ctx.author.name}")
|
||||
|
||||
async def setup(bot):
|
||||
await bot.add_cog(Meshtastic(bot))
|
||||
|
|
@ -9,4 +9,5 @@ psutil
|
|||
aiofiles
|
||||
inky
|
||||
wakeonlan
|
||||
beautifulsoup4
|
||||
beautifulsoup4
|
||||
meshtastic
|
||||
Loading…
Add table
Add a link
Reference in a new issue