Start command update

This commit is contained in:
JustMaffie 2017-05-27 23:06:40 +02:00
parent 20f5a94cd8
commit 0394f510ff
3 changed files with 11 additions and 7 deletions

View File

@ -2,4 +2,6 @@ config = {
'bot-token': "Discord bot token",
'database-uri': "driver://username:password@host:port/database",
'command-prefix': "<@{}>".format("BOT ID HERE"),
}

View File

@ -10,9 +10,10 @@ logging.basicConfig(filename='titanbot.log',level=logging.INFO,format='%(asctime
logging.getLogger('TitanBot')
logging.getLogger('sqlalchemy')
class Titan(discord.Client):
def __init__(self):
super().__init__()
class Titan(commands.Bot):
def __init__(self, *args, **kwargs):
super().__init__(command_prefix = config['command-prefix'])
self.aiosession = aiohttp.ClientSession(loop=self.loop)
self.http.user_agent += ' TitanEmbeds-Bot'
self.database = DatabaseInterface(self)

View File

@ -374,10 +374,11 @@ def create_unauthenticated_user():
response.status_code = 403
return response
@api.route("/update_unauthenticated_user", methods=["POST"])
@rate_limiter.limit("1 per 15 minute", key_func=guild_ratelimit_key)
def update_unauthenticated_user():
# todo: update user
# @api.route("/update_unauthenticated_user", methods=["POST"])
# @rate_limiter.limit("1 per 15 minute", key_func=guild_ratelimit_key)
# def update_unauthenticated_user():
# # todo: update user
# new_name = request.form.get('new_username')
@api.route("/query_guild", methods=["GET"])
@valid_session_required(api=True)