mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-13 06:20:16 +02:00
Manually created REST API manager as per the documented functions. Attempting to integrade discord-py wrapper, unsuccesful thusfar. Addresses #88
18 lines
476 B
Python
18 lines
476 B
Python
import discord
|
|
from django.conf import settings
|
|
|
|
|
|
client = discord.Client()
|
|
|
|
print('Logging in to Discord as ' + settings.DISCORD_USER_EMAIL)
|
|
client.login(settings.DISCORD_USER_EMAIL, settings.DISCORD_USER_PASSWORD)
|
|
if not client.is_logged_in:
|
|
print('Logging in to Discord failed')
|
|
raise ValueError('Supplied Discord credentials failed login')
|
|
|
|
@client.event
|
|
def on_ready():
|
|
server = client.servers[0]
|
|
user = client.user
|
|
print('Connected as ' + user.name)
|