Compare commits
2 Commits
a167a7eba4
...
c04322ccd7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c04322ccd7 | ||
|
|
b2b1d87949 |
@ -18,5 +18,5 @@ class CommandTTS(AbstractCommand, metaclass=ABCMeta):
|
|||||||
bot.tts_enabled = True
|
bot.tts_enabled = True
|
||||||
elif args[1] == "stop":
|
elif args[1] == "stop":
|
||||||
if twitch_message.sender.lower() == twitch_message.channel:
|
if twitch_message.sender.lower() == twitch_message.channel:
|
||||||
bot.send_message("tts activated on #%s" % twitch_message.channel)
|
bot.send_message("tts deactivated on #%s" % twitch_message.channel)
|
||||||
bot.tts_enabled = False
|
bot.tts_enabled = False
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import re
|
|||||||
|
|
||||||
from discord import message
|
from discord import message
|
||||||
from discord.client import Client
|
from discord.client import Client
|
||||||
|
import asyncio
|
||||||
|
|
||||||
import config as config
|
import config as config
|
||||||
import db
|
import db
|
||||||
@ -22,6 +23,7 @@ from cooldowns import Cooldown_Module
|
|||||||
class Discord_Module(discord.Client):
|
class Discord_Module(discord.Client):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
self.loop = asyncio.get_event_loop()
|
||||||
self.dbCredential: credentials.DB_Credential
|
self.dbCredential: credentials.DB_Credential
|
||||||
self.discordCredential: credentials.Discord_Credential
|
self.discordCredential: credentials.Discord_Credential
|
||||||
|
|
||||||
@ -32,8 +34,13 @@ class Discord_Module(discord.Client):
|
|||||||
|
|
||||||
self.tts_enabled: bool = False
|
self.tts_enabled: bool = False
|
||||||
|
|
||||||
|
async def startup(self):
|
||||||
|
await self.start(self.discordCredential.token)
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
self.run(self.discordCredential.token)
|
print("starting loop")
|
||||||
|
self.loop.create_task(self.startup())
|
||||||
|
self.loop.run_forever()
|
||||||
|
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
print('Logged on as', self.user)
|
print('Logged on as', self.user)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user