Added Chyron Command

This commit is contained in:
Alex Orid 2021-04-09 17:57:54 -04:00
parent 974385242f
commit 2f03daafa7
2 changed files with 66 additions and 28 deletions

View File

@ -8,6 +8,36 @@ class Chyron_Module():
self.chyron_computedString = ""
self.chyron_items:list = []
def main(self, rightNow_ = "Chill Stream"):
self.addItem(
"RightNow",
"► Now: ",
rightNow_)
self.addItem(
"WeekDays",
"► Weekdays: ",
"Daily Stream @ 12pm Noon EST")
self.addItem(
"FriSat",
"► Friday & Saturday: ",
"FFxiv (Express Delivery Raid Team) @ 7pm EST")
self.addItem(
"Commands",
"► Commands: ",
"!animal, !climateclock, !discord, !lights, !page, !roll")
self.addItem(
"Website",
"► Want to read about my various projects? visit: ",
"TheCuriousNerd.com")
self.addItem(
"Follow",
"",
"► If you like what you see, hit that follow button to see more!")
self.addItem(
"Discord",
"► Want to join our discord? type \" !d \" in chat to get the link or visit: ",
"discord.io/thecuriousnerd")
def chyron_stringUpdater(self):
newString = ""
for c in self.chyron_items:
@ -68,34 +98,7 @@ class ChyronItem():
if __name__ == "__main__":
testModule = Chyron_Module()
testModule.addItem(
"RightNow",
"Now: ",
"Coding Stream")
testModule.addItem(
"WeekDays",
"► Weekdays: ",
"Daily Stream @ 12pm Noon EST")
testModule.addItem(
"FriSat",
"► Friday & Saturday: ",
"FFxiv (Express Delivery Raid Team) @ 7pm EST")
testModule.addItem(
"Commands",
"► Commands: ",
"!animal, !climateclock, !discord, !lights, !page, !roll")
testModule.addItem(
"Website",
"► Want to read about my various projects? visit: ",
"TheCuriousNerd.com")
testModule.addItem(
"Follow",
"",
"► If you like what you see, hit that follow button to see more!")
testModule.addItem(
"Discord",
"► Want to join our discord? type \" !d \" in chat to get the link or visit: ",
"discord.io/thecuriousnerd")
testModule.main()
testModule.chyron_stringUpdater()
test = testModule.chyron_computedString + "<<<|"

View File

@ -0,0 +1,35 @@
from abc import ABCMeta
import chyron_module
from commands.command_base import AbstractCommand
import random
import utilities_script as utilities
class CommandRoll(AbstractCommand, metaclass=ABCMeta):
"""
this is the roll command.
"""
command = "chyron"
def __init__(self):
super().__init__(CommandRoll.command, n_args=5, command_type=AbstractCommand.CommandType.Praxis)
def do_command(self, bot, user_message):
tempBool = True
if tempBool == True:
tempParsedMessage = user_message.message.split(" ")
i = len(tempParsedMessage)
if i > 1:
if "update" in tempParsedMessage[1]:
chyron = chyron_module.Chyron_Module()
if i > 2:
chyron.main(tempParsedMessage[2])
else:
chyron.main()
chyron.updateChyronFile()
returnMessage = "@" + user_message.user + " updated the chyron!"
bot.return_message(returnMessage)