GithubHelp home page GithubHelp logo

metalfiiish / ts-gw2-verifybot Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 7.0 48 KB

A python bot that will sit in a Teamspeak3 channel and take commands. It's main purpose was to verify server players for Guild Wars 2 and automatically authenticate and give them the proper Group for permissions to speak/etc in Teamspeak.

License: MIT License

Python 100.00%

ts-gw2-verifybot's Introduction

# This script is intended to be used as an automatic form of Teamspeak authentication for Guild Wars 2.

# How it works:
Using the ts3 module, the bot logs into the teamspeak server by IP via the serverquery account. See teamspeak documentation on this account, password would have been generated on server creation.

Bot will sit in any specificed channel (defined in the bot.conf)and wait for commands to be sent. Currently the commands are limited, but the framework is there add custom ones yourself.

The guild wars authentication uses the API keys from user's accounts. It also requires at least 1 character on said account to be level 80 ( level is configurable in bot.conf).


# REQUIREMENTS in 'requirements.txt'

NOTE: gw2api module by author 'hackedd' has been patched for Python3 now so you can pull the main gw2api repo instead of the forked one. 


Please modify the bot.conf variables as needed.

ts-gw2-verifybot's People

Contributors

metalfiiish avatar ogrady avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ts-gw2-verifybot's Issues

Connection Timing Out Regularly

I have now for a while tried to battle the timeouts on the bot.

BOT now idle, waiting for requests.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ts3bot/.local/lib/python3.6/site-packages/ts3/query.py", line 528, in recv
    b"\n\r", timeout=poll_intervall)
  File "/usr/lib/python3.6/telnetlib.py", line 327, in read_until
    return self.read_very_lazy()
  File "/usr/lib/python3.6/telnetlib.py", line 403, in read_very_lazy
    raise EOFError('telnet connection closed')
EOFError: telnet connection closed

which unfortunately has this follow-up exception that prevents self-healing:

It appears the BOT has lost connection to teamspeak. Trying to restart connection in 30 seconds....
Connecting to Teamspeak server...
Loaded User Database...
BOT loaded into server (377) as botgart (33). Nickname 'Botgart'
Traceback (most recent call last):
  File "TS3Bot.py", line 378, in <module>
    ts3conn.clientupdate(client_nickname=BOT.nickname)
  File "/home/ts3bot/.local/lib/python3.6/site-packages/ts3/commands.py", line 1583, in clientupdate
    return self._return_proxy("clientupdate", cparams, uparams, options)
  File "/home/ts3bot/.local/lib/python3.6/site-packages/ts3/query.py", line 655, in _return_proxy
    self, command, common_parameters, unique_parameters, options)
  File "/home/ts3bot/.local/lib/python3.6/site-packages/ts3/query.py", line 632, in send
    return self.wait_for_resp(query_id, timeout)
  File "/home/ts3bot/.local/lib/python3.6/site-packages/ts3/query.py", line 461, in wait_for_resp
    raise TS3QueryError(resp)
ts3.query.TS3QueryError: error id 513: nickname is already in use

It happens with:

  • Local bot to localhost TS-Server
  • Local bot to remote TS-Server
  • Bot on remote server to another remote TS-Server

I have already tried changing the keepalive value in https://github.com/metalfiiish/ts-gw2-verifyBot/blob/master/TS3Bot.py#L364 to no avail.

I realise that this seems to be a problem with the underlying library, but I just wanted to check if there is perhaps a known solution to this.

-

Edit: wrong repo. Pls delete

AttributeError: 'TS3Connection' object has no attribute 'keepalive'

How to fix that? pip3 install keepalive not existing?

python3 TS3Bot.py
Initializing script....
Connecting to Teamspeak server...
Traceback (most recent call last):
File "TS3Bot.py", line 359, in
ts3conn.keepalive(interval=250)
AttributeError: 'TS3Connection' object has no attribute 'keepalive'

Remove Account Name from registration

Users currently need to give the bot their Account Name and their API-Key upon registration. Shockingly, a good lot of people don't know their own account name or fail to write it down correctly, resulting in staff having to guide users through the registration process in excruciating detail only to find out that user TCWarrior.5463 is actually TCWarrior.5436.

Since having acquired an API-Key gives you easy access to the account name through websites like https://mygw2.wvwintel.com/, having to enter the account name doesn't serve as additional security feature to prevent stolen keys from being used in a malicious way either.

I therefore suggest dropping the prompt for the account name altogether to improve usability for users and reduce support time for staff.

Unresponsive Bot

After a few days, the bot seems to become unresponsive and stops answering verifyme requests (I can see it is still connected). I have been unsuccessful in getting it to log any errors. So far, restarting the script occasionally has been the only solution.

Query acct

Is it possible to use a query acct that server admins can create from rented instance?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.