Esempio n. 1
0
 async def changeLink(story: Story):
     try:
         story.addLink(linkSiteAbbr,
                       linkURL,
                       ignoreMax=isModerator(ctx.author))
     except InvalidNameException:
         fail(A.addLink.errorInvalid(story.cite(), linkSiteAbbr))
     except DuplicateException:
         fail(A.addLink.errorDup(story.cite(), linkSiteAbbr))
     except MaxLenException:
         fail(A.addLink.errorLen(len(linkURL)))
Esempio n. 2
0
 async def changeGenre(story: Story):
     for genreName in targetGenre:
         try:
             story.removeGenre(genreName)
             print(f"Removed {genreName} genre from {story.cite()}.")
         except NotFoundException:
             fail(A.removeGenre.errorNotFound(story.cite(), genreName))
Esempio n. 3
0
 async def changeGenre(story: Story):
     for genreName in newGenre:
         try:
             story.addGenre(genreName.capitalize())
             print(f"Added {genreName} genre to {story.cite()}.")
         except InvalidNameException:
             fail(A.addGenre.errorInvalid(genreName))
         except DuplicateException:
             fail(A.addGenre.errorDup(story.cite(), genreName))
Esempio n. 4
0
 async def changeCharacter(story: Story):
     try:
         story.removeCharacter(targetCharSpecies, targetCharName)
         print(
             f"Removed character with species {targetCharSpecies} and name {targetCharName} from {story.cite()}."
         )
     except NotFoundException:
         fail(
             A.removeCharacter.errorNorFound(story.cite(),
                                             targetCharSpecies,
                                             targetCharName))
Esempio n. 5
0
 async def changeCharacter(story: Story):
     try:
         story.addCharacter(newCharSpecies,
                            newCharName,
                            ignoreMax=isModerator(ctx.author))
         print(
             f"Added character with species {newCharSpecies} and name {newCharName} to {story.cite()}."
         )
     except DuplicateException:
         fail(
             A.addCharacter.errorDup(story.cite(), newCharSpecies,
                                     newCharName))
     except MaxSpeciesLenException:
         fail(A.addCharacter.errorLenSpecies(len(newCharSpecies)))
     except MaxNameLenException:
         fail(A.addCharacter.errorLenName(len(newCharName)))
Esempio n. 6
0
 async def changeLink(story: Story):
     try:
         story.removeLink(targetSiteAbbr)
     except NotFoundException:
         fail(A.removeLink.errorNotFound(story.cite(), targetSiteAbbr))
Esempio n. 7
0
 async def changeRating(story: Story):
     try:
         story.setRating(newRating)
         print(f"Set rating of {story.cite()} to {newRating}.")
     except InvalidNameException:
         fail(A.setRating.errorInvalid(story.cite(), newRating))