Discord TTS Channel
This commit is contained in:
parent
a57ac29e72
commit
8f2ae75dc8
@ -34,6 +34,7 @@ class Discord_Module(discord.Client):
|
|||||||
self.commands = command_loader.load_commands_new(AbstractCommand.CommandType.DISCORD)
|
self.commands = command_loader.load_commands_new(AbstractCommand.CommandType.DISCORD)
|
||||||
|
|
||||||
self.tts_enabled: bool = False
|
self.tts_enabled: bool = False
|
||||||
|
self.selected_ttsChannels:list = []
|
||||||
|
|
||||||
async def startup(self):
|
async def startup(self):
|
||||||
await self.start(self.discordCredential.token)
|
await self.start(self.discordCredential.token)
|
||||||
@ -49,24 +50,36 @@ class Discord_Module(discord.Client):
|
|||||||
async def on_message(self, message: discord.Message):
|
async def on_message(self, message: discord.Message):
|
||||||
print("{" + message.guild.name + "}[ " + str(message.channel) + " ](" + message.author.display_name + ")> ")
|
print("{" + message.guild.name + "}[ " + str(message.channel) + " ](" + message.author.display_name + ")> ")
|
||||||
print(message.content)
|
print(message.content)
|
||||||
|
#print(message.channel.id)
|
||||||
#Message ID
|
#Message ID
|
||||||
#print(str(message.id))
|
#print(str(message.id))
|
||||||
#Channel ID
|
|
||||||
#print(str(message.channel.id))
|
#print(str(message.channel.id))
|
||||||
if message.content == "//testing":
|
if message.content == "//testing":
|
||||||
await message.channel.send('test response')
|
await message.channel.send('test response')
|
||||||
#test = self.get_channel(431129571308339210)
|
#test = self.get_channel(431129571308339210)
|
||||||
#await test.send("testerino")
|
#await test.send("testerino")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if not await self.isSenderBot(message):
|
if not await self.isSenderBot(message):
|
||||||
|
# This will check for the praxis_bot-tts channel and will TTS stuff from there.
|
||||||
|
await self.eval_triggeredEvents(message)
|
||||||
|
|
||||||
if self.cooldownModule.isCooldownActive("discordRateLimit") == False:
|
if self.cooldownModule.isCooldownActive("discordRateLimit") == False:
|
||||||
await self.eval_commands(message)
|
await self.eval_commands(message)
|
||||||
|
#await self.tts_message(message)
|
||||||
|
|
||||||
|
|
||||||
|
async def eval_triggeredEvents(self, message: discord.Message):
|
||||||
|
|
||||||
|
# This will check for the selected channels and will TTS stuff from there.
|
||||||
|
for channel in self.selected_ttsChannels:
|
||||||
|
if channel == message.channel.id:
|
||||||
await self.tts_message(message)
|
await self.tts_message(message)
|
||||||
|
|
||||||
|
|
||||||
|
async def eval_automaticEvents(self, message: discord.Message):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
async def eval_commands(self, message: discord.Message):
|
async def eval_commands(self, message: discord.Message):
|
||||||
# containsURL: bool = self.contains_url(message)
|
# containsURL: bool = self.contains_url(message)
|
||||||
try:
|
try:
|
||||||
|
|||||||
2
main.py
2
main.py
@ -32,6 +32,8 @@ def discord_module_init(dbCert, discordCert):
|
|||||||
discord_connection.dbCredential = dbCert
|
discord_connection.dbCredential = dbCert
|
||||||
discord_connection.discordCredential = discordCert
|
discord_connection.discordCredential = discordCert
|
||||||
|
|
||||||
|
discord_connection.selected_ttsChannels.append(431129571308339210)
|
||||||
|
|
||||||
discord_connection.main()
|
discord_connection.main()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user