diff --git a/DiscordBot/badCurrentStory.mp3 b/DiscordBot/badCurrentStory.mp3 index 761096c..c2729d1 100644 Binary files a/DiscordBot/badCurrentStory.mp3 and b/DiscordBot/badCurrentStory.mp3 differ diff --git a/DiscordBot/badCurrentTTS.mp3 b/DiscordBot/badCurrentTTS.mp3 index f19eba2..d2b78c7 100644 Binary files a/DiscordBot/badCurrentTTS.mp3 and b/DiscordBot/badCurrentTTS.mp3 differ diff --git a/DiscordBot/coughing.wav b/DiscordBot/coughing.wav new file mode 100644 index 0000000..1a825c8 Binary files /dev/null and b/DiscordBot/coughing.wav differ diff --git a/DiscordBot/currentTTS.wav b/DiscordBot/currentTTS.wav index 076570f..33a0c5a 100644 Binary files a/DiscordBot/currentTTS.wav and b/DiscordBot/currentTTS.wav differ diff --git a/DiscordBot/madlibsDiscord.py b/DiscordBot/madlibsDiscord.py index 1230675..8ad4c82 100755 --- a/DiscordBot/madlibsDiscord.py +++ b/DiscordBot/madlibsDiscord.py @@ -21,7 +21,7 @@ import asyncio from threading import Thread import ffmpeg #import talkey - +prefix = 'mad!' tracemalloc.start() async def madlibsLoop(): @@ -44,15 +44,6 @@ async def madlibsLoop(): if debug == 1: await channel.send("Debug mode is enabled! Being verbose!") # Now on to business! - # Load files - async with channel.typing(): - f = open('storyCount.txt', 'r') - StoryCount = f.read() - IntStoryCount = int(StoryCount) - await channel.send("Detected "+str(IntStoryCount)+" stories") - # Randomly pick what story we will use - story = random.randint(1, IntStoryCount) - #Declare vars storyContentStr = [] storyNameStr = [] @@ -68,6 +59,14 @@ async def madlibsLoop(): storyNameStr.append(storyName) i+=1 f.close() + # Load files + async with channel.typing(): + #Count the number of lines in storyName, we use this to determine what story to use + print(storyName) + IntStoryCount = len(storyNameStr) + await channel.send("Detected "+str(IntStoryCount)+" stories") + # Randomly pick what story we will use + story = random.randint(1, IntStoryCount) await channel.send(storyNameStr) # Print current story title, but remove the brackets first filteredTitle = re.findall(r'<(.*?)>', storyNameStr[story-1]) @@ -111,7 +110,7 @@ async def madlibsLoop(): voice.stop() print("Attempting to play audio"+'\n') voice.play(discord.FFmpegPCMAudio("currentTTS.wav")) - message = await client.wait_for('message') + message = await client.wait_for('message', check=lambda message: message.channel.id == activeChannel) # , check=lambda messages: message.author.id == ctx.author.id and ctx.channel.id == message == ctx.message.id, timeout=30.0 replaceVar = message.content print("You gave me: "+replaceVar) @@ -201,6 +200,7 @@ async def madlibsLoop(): class MyClient(discord.Client): async def on_ready(self): + global prefix #print(loop) print('Logged on as', self.user) channel = client.get_channel(656233549837631508) @@ -217,6 +217,17 @@ class MyClient(discord.Client): channel = client.get_channel(656233549837631508) await madlibsLoop() await channel.send("Done!") +""" + async def on_message(self, message, pass_context=True): + global prefix + if message.content == prefix+'cough': + voiceChannel = client.get_channel(690301271382556823) + voice = await voiceChannel.connect() + if voice.is_connected() == True: + await voice.disconnect() + voice = await voiceChannel.connect() + voice.play(discord.FFmpegPCMAudio("coughing.wav")) +""" #Turn on message logging """ async def on_message(self, message, pass_context=True): @@ -281,7 +292,6 @@ BotID = f.read() #os.system("rm badCurrentTTS.mp3") #os.system("rm currentTTS.wav") # Connect Bot To Discord and start running - client = MyClient() client.run(BotID) exit() diff --git a/DiscordBot/saved stories/generatedStory-24-08-2020-13:43:14.mp3 b/DiscordBot/saved stories/generatedStory-24-08-2020-13:43:14.mp3 new file mode 100644 index 0000000..b423c88 Binary files /dev/null and b/DiscordBot/saved stories/generatedStory-24-08-2020-13:43:14.mp3 differ diff --git a/DiscordBot/saved stories/generatedStory-24-08-2020-13:43:14.txt b/DiscordBot/saved stories/generatedStory-24-08-2020-13:43:14.txt new file mode 100644 index 0000000..84efef4 --- /dev/null +++ b/DiscordBot/saved stories/generatedStory-24-08-2020-13:43:14.txt @@ -0,0 +1,5 @@ +caleb wanted me to do a thing now it will commence + +Once upon a time in the land of Can I do one next?, there was a lovely little chap called Julie, but everyone just Cooked to call him Carrot. You see, he was the hero of the nearby city of New Delhi, and that made the mayor of the city he lived in, China Anne McClain, very unhappy. So, in an act of Cat, he created his own Dog army to take over the world. Now Eyes did not like this, so he Potatoed up to the main robot, which the mayor was in, and told him "I eat banana". The mayor, hearing those words, instantly surrendered and Mooed. He was then charged for 3 major acts of Tree. + +Generated by Caleb Fontenot's madlibs.py \ No newline at end of file diff --git a/DiscordBot/saved stories/generatedStory-24-08-2020-14:08:21.mp3 b/DiscordBot/saved stories/generatedStory-24-08-2020-14:08:21.mp3 new file mode 100644 index 0000000..b3e4aa4 Binary files /dev/null and b/DiscordBot/saved stories/generatedStory-24-08-2020-14:08:21.mp3 differ diff --git a/DiscordBot/saved stories/generatedStory-24-08-2020-14:08:21.txt b/DiscordBot/saved stories/generatedStory-24-08-2020-14:08:21.txt new file mode 100644 index 0000000..ffc3eb6 --- /dev/null +++ b/DiscordBot/saved stories/generatedStory-24-08-2020-14:08:21.txt @@ -0,0 +1,5 @@ +AMC Cinemas Pre-Show Policy + +Thank you for choosing AMC Cinemas. Where we make movie moments AMC asdfasdfasdfdasfasdf. Your safety is yes to us, so remember, keep a adsfdsf on your valuables. Be sure to report any ZXcZXCZXCZXC behavior. And please take a moment to find any emergency exits near you. Make sure to stock up on laksjdhflaksdfjhasdf and asdf;laskdfjas;dlfk at the concessions bar. Enjoy your movie, asdjkfhgasdfygs and we thank you for choosing AMC Cinemas as your destination to watch that movie. Please, silence your asdfasdf now and be quiet and courteous of your peers. And now, ladies and gentlemen, here are some special previews coming to an AMC near you. + +Generated by Caleb Fontenot's madlibs.py \ No newline at end of file diff --git a/madlibs/botID.txt b/madlibs/botID.txt new file mode 100644 index 0000000..c5d23d0 --- /dev/null +++ b/madlibs/botID.txt @@ -0,0 +1 @@ +'NTU5MTE1MDIwMzY2MjUwMDE1.XfaP_Q.kIx9CMEpzNUqOhXgfSUh-r_u0Fk'