Skip to content

chuck-r/afkbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AFKBot

Copyright (C) 2013-2024 Chuck-R <github@chuck.cloud>

Purpose

Unlike other voice chat clients, Mumble does not provide a mechanism to specify an AFK channel or timeout. So, I made a bot script that takes care of this for me. Though I am releasing this script in 2015, I have been using it without problems for a couple of years now. For my uses in a moderately trafficked Mumble server, it has been very stable.

Features

  • Configurable AFK timeout
  • /afkme command allows user to put themselves in the AFK channel without waiting for the timeout.
  • When the user speaks after being moved to the AFK channel, they are immediately moved to the previous channel.

Prerequisites

  1. Python 3
  2. Mumble_pb2.py, prebuilt. If changes are made to the Mumble protocol in the future, a new Mumble_pb2.py may have to be generated. In order to build this file requires the Google Protobuffer tools located at http://code.google.com/apis/protocolbuffers/. Once installed, run protoc --python_out=. Mumble.proto while in the folder containing the afkbot.py script. Mumble.proto is available from the Mumble source or Git repository.
  3. PEM-format user certificate. By default, Mumble generates a PCKS#12 certificate that must be converted to PEM format for use by the bot script. In order to convert a PKCS#12 certificate into PEM format using OpenSSL, use the following command: openssl pkcs12 -in cert.p12 -out cert.pem -nodes

Arguments

Mumble 1.5 AFKBot

Options:
  -a, --afk-channel=
                        Channel to move to and to move users
                        into when they exceed IDLE_TIME.
                        Default: AFK
  -A, --access-tokens=
                        Comma-separated list of access tokens to send to
                        the server upon connection.
                        Default: None
  -c, --certificate=
                        PEM certificate to use when connecting to the
                        server. Note: This is a non-standard certificate
                        format that is not the same type generated by
                        Mumble. On the first run, AFKBot will generate
                        this certificate if not specified on the command
                        line or in the configuration file.
                        Default: DATA_DIR/afkbot.pem
  -C, --config=
                        Path to configuration file. This is a YAML-format
                        file that, if unspecified, will be created on first
                        start at CONFIG_DIR/afkbot.yaml
                        Default: CONFIG_DIR/afkbot.yaml
  -D, --disallow-self-signed
                        Do not allow self-signed certificates. By default,
                        Murmur certificates are self-signed.
  -i, --idle-time=
                        Minutes, after which an AFK user is moved to the
                        AFK channel. To specify seconds, suffix the number
                        with 's'. For example, to allow a 1 minute idle,
                        use the argument '60s'
                        Default: 30 minutes
  -L, --log-file=
                        File to log to
                        Default: DATA_DIR/afkbot.log
  -n, --nick=
                        Nickname of the bot
                        Default: AFKBot
  -p, --port=
                        Server port to connect to
                        Default: 64738
  -P, --password=
                        Password to use when connecting to the server
                        Default: None
  -s, --server=
                        Server hostname/IP to connect to
                        Default: localhost
  -v, --verbose
                        Verbose logging
  --version
                        Show version information

Variables:
    DATA_DIR: A platform-specific data storage location for AFKBot.
        Per-OS, the locations searched are:
            Linux/BSD:
                $HOME/.local/share/afkbot
                $HOME/.afkbot
                $HOME
                /etc/afkbot
            MacOS:
                $HOME/Library/Application Support/afkbot
                $HOME/.afkbot
                $HOME
                /Library/Application Support/afkbot
            Windows:
                %LOCALAPPDATA%\afkbot
                %USERPROFILE%\afkbot
                %USERPROFILE%
                C:\ProgramData\afkbot

    CONFIG_DIR: A platform-specific configuration storage location for
                AFKBot.
        Per-OS, the locations searched are:
            Linux/BSD:
                $HOME/.config/afkbot
                $HOME/.afkbot
                $HOME
                /etc/afkbot
            MacOS:
                $HOME/Library/Application Support/afkbot
                $HOME/.afkbot
                $HOME
                /Library/Application Support/afkbot
            Windows:
                %LOCALAPPDATA%\afkbot
                %USERPROFILE%\afkbot
                %USERPROFILE%
                C:\ProgramData\afkbot

    For CONFIG_DIR and DATA_DIR, the first available path will be used. If
    none of the paths contain AFKBot files, then AFKBot will attempt to
    create the path, starting with the first. If none of the directories
    can be created, $HOME or %USERPROFILE% will be used.

License

Copyright (c) 2013-2024, Chuck-R &lt;github&commat;chuck.cloud&gt;
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.
* Neither the name of AFKBot nor the
  names of its contributors may be used to endorse or promote products
  derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AFKBOT'S CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

AFK Bot script for Mumble

Resources

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages