Ejemplo n.º 1
0
 def __init__(self, bot, **kwargs):
     OngoingReactionMenu.__init__(self, bot, **kwargs)
     # Setup
     defaults = {"suer": None, "suee": None, "reason": ""}
     self.innocentlist = []
     self.guiltylist = []
     DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
Ejemplo n.º 2
0
async def on_raw_reaction_remove(bot, payload):
    # Reaction menus
    ids = OngoingReactionMenu.get_ids_by_mid(bot, payload.message_id)
    if ids is not None:
        for x in ids:
            asyncio.ensure_future(
                OngoingReactionMenu.get_by_id(bot, x).inputtest(payload, "r"))
Ejemplo n.º 3
0
 def __init__(self, bot, **kwargs):
     OngoingReactionMenu.__init__(self, bot, **kwargs)
     # Setup
     defaults = {
         "pages": ["­"],
     }
     DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
     self.pageindex = 0
Ejemplo n.º 4
0
 def __init__(self,bot,**kwargs):
     OngoingReactionMenu.__init__(self,bot,**kwargs)
     # Setup
     defaults = {
         "collectors": set()
     }
     self.obamasilver = utility.get_emoji(bot, ":obamasilverpile:349449386692050944")
     DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
Ejemplo n.º 5
0
 def __init__(self, bot, **kwargs):
     OngoingReactionMenu.__init__(self, bot, **kwargs)
     # Setup
     defaults = {
         "differentchannel":
         self.bot.epicord.get_channel(488516474735034389)
         if self.context.message.guild.id == self.bot.epicord.id else None
     }
     self.userids = [self.context.message.author.id]
     self.personpicked = None
     self.bot.sdailylast[self.context.message.guild.id][str(
         self.context.message.author.id)] = str(datetime.utcnow().date())
     basics.save(self.bot, "sdailylast")
     DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
Ejemplo n.º 6
0
    def __init__(self, bot, **kwargs):
        OngoingReactionMenu.__init__(self, bot, **kwargs)

        async def default(self, payload):
            pass

        defaults = {
            "anyscript": default,
            "singlescript": default,
            "doublescript": default,
            "timeoutscript": default,
            "startscript": default,
            "emoji": utility.get_emoji(bot, "628461134999191568"),
            "currentreactors": set(),
            "messagecount": 0,
        }
        self.userids = [self.context.message.author.id]
        DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
Ejemplo n.º 7
0
    def __init__(self, bot, **kwargs):
        OngoingReactionMenu.__init__(self, bot, **kwargs)

        async def default(self, payload):
            pass

        async def defaultnopayload(self):
            pass

        defaults = {
            "anyscript": default,
            "singlescript": default,
            "doublescript": default,
            "timeoutscript": default,
            "startscript": defaultnopayload
        }
        self.userids = [self.context.message.author.id]
        DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
Ejemplo n.º 8
0
    def __init__(self, bot, **kwargs):
        OngoingReactionMenu.__init__(self, bot, **kwargs)
        # Setup
        defaults = {
            "emoji": "<a:rolling:393641477068029953>",
            "q": "­",
            "lit": False
        }
        DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
        self.pageindex = 0

        self.words = "**" + self.q + "**"
        self.names = ""
        self.idlist = []  # For achievements
        self.idlistnoremove = []  # For achievements
        self.header = "\nPetition started by " + self.context.message.author.mention + ".\n\n"
        self.signtut = f"Hit {self.emoji} to sign.\n"
        self.footer = "Total signatures: "
        self.poweredup = False
Ejemplo n.º 9
0
    def __init__(self, bot, **kwargs):
        OngoingReactionMenu.__init__(self, bot, **kwargs)

        # Setup
        if random.randint(1, 100) == 1:
            btn_yes = utility.get_emoji(bot, "<:upstinky:288858540888686602>")
            btn_no = utility.get_emoji(bot, "<:downstinky:288858539332599808>")
        else:
            btn_yes = utility.get_emoji(bot, "<:bn_yes:331164192864206848>")
            btn_no = utility.get_emoji(bot, "<:bn_no:331164190284972034>")

        async def default(self):
            pass

        async def defaultno(self):
            self.message = 'THEN DIE'

        defaults = {
            "message": "Hit YES to confirm. Hit NO to uh, die.",
            "yesscript": default,
            "noscipt": defaultno,
            "timeoutscript": default,
            "btn_yes": btn_yes,
            "btn_no": btn_no,
            "cost": 0
        }
        self.userids = [self.context.message.author.id]
        DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])

        # Remove if broke
        ots = ot.otedit(self.bot,
                        self.context.message.author,
                        0,
                        False,
                        channel=self.context.message.channel)
        if ots < self.cost:
            self.message = f"You need {ccc.pluralstr('Obama Token', self.cost)} to do this, but you only have {ots}."
            asyncio.ensure_future(self.end())
            return
Ejemplo n.º 10
0
    async def end(self):
        asyncio.ensure_future(OngoingReactionMenu.end(self))

        i = ""
        g = ""
        ip = 0  # Innocent Points
        gp = 0
        for x in self.innocentlist:
            i += f"    <@{x}>\n"
            ip += 1
        for x in self.guiltylist:
            g += f"    <@{x}>\n"
            gp += 1
        p = gp - ip  # Actual guilty points

        if p > 0:  # Guilty
            self.bot.suepoints[self.context.guild.id][
                self.suer.id]["suerwin"] += p
            self.bot.suepoints[self.context.guild.id][
                self.suee.id]["sueelose"] += p
        elif p < 0:  # Innocent
            self.bot.suepoints[self.context.guild.id][
                self.suer.id]["suerlose"] += abs(p)
            self.bot.suepoints[self.context.guild.id][
                self.suee.id]["sueewin"] += abs(p)
        basics.save(self.bot, "suepoints")

        await talking.say(
            self.context,
            f"""The results of {self.suer.mention} attempting to sue {self.suee.mention} are in!
**Reason:** {self.reason}

Innocent:
{i}­
Guilty:
{g}­""")
Ejemplo n.º 11
0
 def __init__(self, bot, **kwargs):
     OngoingReactionMenu.__init__(self, bot, **kwargs)
     DictSavable.__init__(self, {}, kwargs, exclude=["validfor"])
Ejemplo n.º 12
0
 def __init__(self, bot, **kwargs):
     OngoingReactionMenu.__init__(self, bot, **kwargs)
     # Setup
     defaults = {"disrespectcount": {}, "delayed": False}
     DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
Ejemplo n.º 13
0
 def __init__(self, bot, **kwargs):
     OngoingReactionMenu.__init__(self, bot, **kwargs)
     # Setup
     defaults = {"sl": []}
     DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])
     self.step = 0
Ejemplo n.º 14
0
 def remove_reaction_menu(self):
     OngoingReactionMenu.remove_reaction_menu(self)
     self.remove_input_menu()
Ejemplo n.º 15
0
 def __init__(self, bot, **kwargs):
     self.guildid = kwargs["context"].message.guild.id
     self.channelid = kwargs["context"].message.channel.id
     OngoingReactionMenu.__init__(self, bot, **kwargs)
     self.btn_write = utility.get_emoji(bot, "<:bn_xat:331164192793165824>")
Ejemplo n.º 16
0
 def __init__(self, bot, **kwargs):
     OngoingReactionMenu.__init__(self, bot, **kwargs)
     # Setup
     defaults = {"rerolls": 0, "message": "", "rerolllist": [], "q": ""}
     DictSavable.__init__(self, defaults, kwargs, exclude=["validfor"])