Exemple #1
0
    async def __no_typesetter(self):
        if self.chapter.project.typesetter is not None:
            self.message = await self.confirm("Mention Default Typesetter")

            ts = fakesearch(self.chapter.project.typesetter.discord_id,
                            self.ctx).mention
            embed = self.completed_embed(
                self.chapter, self.ctx.author,
                fakesearch(self.chapter.project.typesetter.discord_id,
                           self.ctx), "PR", "QCTS")
            await self.channel.send(content=ts,
                                    embed=embed,
                                    allowed_mentions=self.message)

        else:
            self.message = await self.confirm("Notify Typesetter Role")
            ts = await make_mentionable(
                self.ctx.guild.get_role(int(self.bot.config["ts_id"])))
            msg = await self.channel.send(
                f"{ts}\nTypesetter required for `{self.chapter.project.title} {formatNumber(self.chapter.number)}`.\nReact below to assign yourself.",
                allowed_mentions=self.message)
            await msg.add_reaction("🙋")
            msgdb = Message(msg.id, self.bot.config["ts_id"], "🙋")
            await msg.pin()
            msgdb.chapter = self.chapter.id
            msgdb.created_on = func.now()
            self.session.add(msgdb)
Exemple #2
0
    async def _no_redrawer(self):
        """
        Called when there's no redrawer assigned, and the redraws aren't finished.
        Will ping redrawer role or default redrawer.
        @return: None
        """
        if self.chapter.project.redrawer is None:
            self.message = await self.confirm("Notify Redrawer Role")
            rd = await make_mentionable(
                self.ctx.guild.get_role(int(self.bot.config["rd_id"])))
            msg = await self.channel.send(
                f"{rd}\nRedrawer required for `{self.chapter.project.title} {formatNumber(self.chapter.number)}`. React below to assign yourself.",
                allowed_mentions=self.message)
            await msg.add_reaction("🙋")
            msgdb = Message(msg.id, self.bot.config["rd_id"], "🙋")
            await msg.pin()
            msgdb.chapter = self.chapter.id
            msgdb.created_on = func.now()
            self.session.add(msgdb)
        else:
            self.message = await self.confirm("Notify Default Redrawer")
            rd = fakesearch(self.chapter.project.redrawer.discord_id,
                            self.ctx).mention
            embed = self.completed_embed(
                self.chapter, self.ctx.author,
                fakesearch(self.chapter.project.redrawer.discord_id, self.ctx),
                "TL", "RD")
            await self.channel.send(content=f"{rd}",
                                    embed=embed,
                                    allowed_mentions=self.message)

            self.chapter.redrawer = self.chapter.project.redrawer
            self.session.commit()
Exemple #3
0
    async def __no_typesetter(self):
        if self.chapter.project.typesetter is not None:
            self.message = await self.confirm("Mention Default Typesetter")

            ts = fakesearch(self.chapter.project.typesetter.discord_id,
                            self.ctx).mention
            embed = await self.completed_embed(
                self.chapter,
                self.ctx.author,
                fakesearch(self.chapter.project.typesetter.discord_id,
                           self.ctx),
                "PR",
                "QCTS",
            )
            await self.channel.send(content=ts,
                                    embed=embed,
                                    allowed_mentions=self.message)
            self.chapter.typesetter = self.chapter.project.typesetter

        else:
            await self.confirm_and_send_embed(
                confirm_text="Notify Calendar",
                next_in_line=345802935961255936,
                finished_step="RD",
                next_step="TS",
            )
Exemple #4
0
 async def _no_typesetter(self):
     """
     Called when redraws are finished, but no typesetter is assigned.
     @return:
     """
     if self.chapter.project.typesetter is None:
         await self.confirm_and_send_embed(
             confirm_text="Notify Calendar",
             next_in_line=345802935961255936,
             finished_step="TL",
             next_step="TS",
         )
     else:
         self.message = await self.confirm("Notify Default Typesetter")
         ts = fakesearch(self.chapter.project.typesetter.discord_id,
                         self.ctx).mention
         embed = await self.completed_embed(
             self.chapter,
             self.ctx.author,
             fakesearch(self.chapter.project.typesetter.discord_id,
                        self.ctx),
             "TL",
             "TS",
         )
         await self.channel.send(content=ts,
                                 embed=embed,
                                 allowed_mentions=self.message)
         self.chapter.typesetter = self.chapter.project.typesetter
Exemple #5
0
    async def _no_redrawer(self):
        """
        Called when there's no redrawer assigned, and the redraws aren't finished.
        Will ping redrawer role or default redrawer.
        @return: None
        """
        if self.chapter.project.redrawer is None:
            await self.confirm_and_send_embed(
                confirm_text="Notify Calendar",
                next_in_line=345802935961255936,
                finished_step="TL",
                next_step="RD",
            )
        else:
            self.message = await self.confirm("Notify Default Redrawer")
            rd = fakesearch(self.chapter.project.redrawer.discord_id,
                            self.ctx).mention
            embed = await self.completed_embed(
                self.chapter,
                self.ctx.author,
                fakesearch(self.chapter.project.redrawer.discord_id, self.ctx),
                "TL",
                "RD",
            )
            await self.channel.send(content=f"{rd}",
                                    embed=embed,
                                    allowed_mentions=self.message)

            self.chapter.redrawer = self.chapter.project.redrawer
Exemple #6
0
 async def __proofreader(self):
     self.message = await self.confirm("Notify Proofreader")
     pr = fakesearch(self.chapter.proofreader.discord_id, self.ctx).mention
     embed = self.completed_embed(
         self.chapter, self.ctx.author,
         fakesearch(self.chapter.proofreader.discord_id, self.ctx), "QCTS",
         "PR")
     await self.channel.send(content=pr,
                             embed=embed,
                             allowed_mentions=self.message)
Exemple #7
0
 async def __typesetter(self):
     self.message = await self.confirm("Notify OG Typesetter")
     ts = fakesearch(self.chapter.typesetter.discord_id, self.ctx).mention
     embed = self.completed_embed(
         self.chapter, self.ctx.author,
         fakesearch(self.chapter.typesetter.discord_id, self.ctx), "PR",
         "QCTS")
     await self.channel.send(content=ts,
                             embed=embed,
                             allowed_mentions=self.message)
Exemple #8
0
 async def __no_translation(self):
     self.message = await self.confirm(
         "No Translation available. Notifies Translator.")
     tl = fakesearch(self.chapter.translator.discord_id, self.ctx).mention
     embed = self.completed_embed(
         self.chapter, self.ctx.author,
         fakesearch(self.chapter.translator.discord_id, self.ctx), "RD",
         "TL")
     await self.channel.send(content=tl,
                             embed=embed,
                             allowed_mentions=self.message)
Exemple #9
0
 async def _typesetter(self):
     """
     Called when the redraws are finished, and a typesetter is assigned to the chapter.
     Will ping typesetter.
     @return: None
     """
     self.message = await self.confirm("Notify Typesetter")
     embed = self.completed_embed(
         self.chapter, self.ctx.author,
         fakesearch(self.chapter.typesetter.discord_id, self.ctx), "TL",
         "TS")
     ts = fakesearch(self.chapter.typesetter.discord_id, self.ctx).mention
     await self.channel.send(content=f"{ts}",
                             embed=embed,
                             allowed_mentions=self.message)
Exemple #10
0
 async def __typesetter(self):
     self.message = await self.confirm("Notify Typesetter")
     embed = self.completed_embed(
         self.chapter, self.ctx.author,
         fakesearch(self.chapter.typesetter.discord_id, self.ctx), "RD",
         "TS")
     await self.channel.send(embed=embed)
Exemple #11
0
 async def _no_redraws(self):
     """
     Called when the redraws are aren't finished, but a redrawer is assigned.
     Will ping redrawer.
     @return: None
     """
     self.message = await self.confirm("Notify Redrawer")
     embed = await self.completed_embed(
         self.chapter,
         self.ctx.author,
         fakesearch(self.chapter.redrawer.discord_id, self.ctx),
         "TL",
         "RD",
     )
     rd = fakesearch(self.chapter.redrawer.discord_id, self.ctx).mention
     await self.channel.send(content=f"{rd}",
                             embed=embed,
                             allowed_mentions=self.message)
Exemple #12
0
 async def __no_translator(self):
     calendar = self.ctx.guild.get_role(453730138056556544)
     self.message = await self.confirm(
         "No Translator assigned. Notifies Calendars.")
     tl = calendar.mention
     embed = self.completed_embed(self.chapter, self.ctx.author,
                                  fakesearch(345845639663583252, self.ctx),
                                  "RD", "TL")
     await self.channel.send(content=tl,
                             embed=embed,
                             allowed_mentions=self.message)
Exemple #13
0
 async def confirm_and_send_embed(
     self,
     *,
     confirm_text: str,
     next_in_line: int,
     finished_step: str,
     next_step: str,
 ):
     self.message = await self.confirm(confirm_text)
     next = fakesearch(next_in_line, self.ctx).mention
     embed = await self.completed_embed(
         self.chapter,
         self.ctx.author,
         fakesearch(next_in_line, self.ctx),
         finished_step,
         next_step,
     )
     await self.channel.send(content=f"{next}",
                             embed=embed,
                             allowed_mentions=self.message)
Exemple #14
0
 async def _no_redraws(self):
     """
     Called when the redraws are aren't finished, but a redrawer is assigned.
     Will ping redrawer.
     @return: None
     """
     self.message = await self.confirm("Notify Redrawer")
     ts = fakesearch(self.chapter.redrawer.discord_id, self.ctx).mention
     await self.channel.send(
         f'{ts}\nThe translation `{self.chapter.project.title} {formatNumber(self.chapter.number)}` is done.\nRaws: {self.chapter.link_raw}',
         allowed_mentions=self.message)
     embed = discord.Embed(color=discord.Colour.dark_red())
     embed.title = "Notes:"
     embed.add_field(name="\u200b", value=f"```{self.chapter.notes}```")
     await self.channel.send(embed=embed)