~jbauer/python-xmpp-bot

A simple python-based XMPP bot.
Remove unnecessary variables
Fix restart command after file split
Add requirements.txt

clone

read-only
https://git.sr.ht/~jbauer/python-xmpp-bot
read/write
git@git.sr.ht:~jbauer/python-xmpp-bot

You can also use your local clone with git send-email.

#Python XMPP Bot

This is an XMPP Bot written in Python. It's currently in the "alpha" stage of development and is being actively worked on. It is currently in a working state and can be deployed to servers, but there may be breaking changes in subsequent versions so read the release notes carefully.

#Installation

There isn't really a procedure to install the bot at the moment. You will need to clone this repo, pip install xmpppy pytz (or similar), fill out the config file and rename it to botconfig.json, and then run the bot on your server. Make sure you have already created an account on your XMPP server for your bot.

#Using

The bot can be invited to an XMPP group chat the same way one would invite any other person. Once the bot is in the chat, run .tbhelp for a list of commands the bot can do.

The users who have been configured as admins in the botconfig.json file can also see additional commands by messaging the bot directly with the .tbhelp command. Admin users can run these additional commands by messaging the bot directly (they will not work from within a group chat).

#Roadmap

Here is a list of features I plan to add:

  • Implement command prefix config (i.e. .tb not hardcoded; can be configured)
  • Differentiate .tbrestart command into:
    • <prefix>restart: [ADMIN] Proper script restarting (using os.execv or something)
    • <prefix>configreload: [ADMIN] Config file reloading
    • <prefix>reconnect: [ADMIN] Simple disconnect/reconnect
  • Add more feature-full dice roller (e.g. ability to specify number of dice)
  • Add ability to add quotes to the quotes file (perhaps restrict to room owners/moderators).
  • Implement poll capabilities:
    • <prefix>pollcreate <pollName> <duration> <multipleChoice=True|False> <option1> <option2> ... <optionN>: Create a poll. The poll will only accept votes from the group chat in which it was created.
    • <prefix>polllist: List all ongoing polls for the current room.
    • <prefix>polllistall: [ADMIN] List all ongoing polls.
    • <prefix>pollend <pollName>: Prematurely end a poll.
    • <prefix>pollview <pollName>: View details about a poll running in the current room (name, remaining duration, options, number of votes, etc.)
    • <prefix>pollviewall <pollName>: [ADMIN] Like above but can see all polls.
    • <prefix>pollvote <pollName> <option1> <option2> ... <optionN>: Vote in a poll in the current room (only one option accepted if not multiple choice).
    • <prefix>pollresults <pollName>: Print the results of a poll from the current room which has ended including highlighting the winner.
    • <prefix>pollresultsall <pollName>: [ADMIN] Like above but can see all polls.
    • Maybe ranked polls with specification of method used to determine the winner?
  • Expand bot documentation:
    • Comment class functions.
    • Add to README a detailed overview of the commands available.