async def fishy(self): """Send messages to add fishies to the configured person at a configured interval""" if self.client.shared["logging"]: utils.log("Sushii fishy farming enabled") recipients = utils.list_generator(self.config["fishyrecipients"]) channel = self.client.get_channel(self.config["channel"]) while not self.client.is_closed(): # Get a random recipient from one of the configured ones random_recipient = next(recipients) # Human typing delay delay = self.rand.randint(1, 3) # Give the random recipient fishies outbound = outbound_message.Outbound_Message( f"-fishy <@{random_recipient}>", channel, delay) await outbound.send() if self.client.shared["logging"]: utils.log(f"Gave sushii fishies to {random_recipient}") # Delay the loop if configured await asyncio.sleep( utils.get_delay(self.config["fishydelay"], self.rand))
async def rep(self): """Automate farming Sushii rep with a configured recipient and interval""" if self.client.shared["logging"]: utils.log("Sushii rep farming enabled") recipients = utils.list_generator(self.config["reprecipients"]) channel = self.client.get_channel(self.config["channel"]) while not self.client.is_closed(): # Get a random recipient from one of the configured ones random_recipient = next(recipients) # Human typing delay delay = self.rand.randint(1, 3) # Give the random recipient rep outbound = outbound_message.Outbound_Message( f"-rep <@{random_recipient}>", channel, delay) await outbound.send() if self.client.shared["logging"]: utils.log(f"Gave sushii rep to {random_recipient}") # Delay the loop if configured await asyncio.sleep( utils.get_delay(self.config["repdelay"], self.rand))
async def rep(self): """Send messages to add rep to the configured person at a configured interval""" await self.client.wait_until_ready() # If disabled in configuration, don"t proceed if not self.config["repfarming"]: return if self.client.shared["logging"]: utils.log("Sushii rep farming enabled") recipients = utils.list_generator(self.config["reprecipients"]) while not self.client.is_closed(): channel = self.client.get_channel(self.config["channel"]) # Get a random recipient from one of the configured ones random_recipient = next(recipients) # Human typing delay delay = self.rand.randint(1, 3) # Give the random recipient rep outbound = outbound_message.Outbound_Message( f"-rep <@{random_recipient}>", channel, delay) await outbound.send() if self.client.shared["logging"]: utils.log(f"Gave sushii rep to {random_recipient}") # Delay the loop if configured await asyncio.sleep( utils.get_delay(self.config["repdelay"], self.rand))
async def farm(self): """Send messages according to yaml config specifying frequency, channel, etc""" await self.client.wait_until_ready() # Don"t proceed if no channels are configured or configured to if not self.config["enabled"] or len(self.config["channels"]) == 0: return if self.client.shared["logging"]: utils.log("Message farming enabled") messages = utils.list_generator(self.config["messages"]) while not self.client.is_closed(): channels = self.config["channels"] # If configured, shuffle the channels to randomize the order we farm them if self.config["randomchannels"]: self.rand.shuffle(channels) for schannel in channels: # Create a channel object of the configured channel id channel = self.client.get_channel(schannel) # Get a random message from one of the configured ones random_message = next(messages) # If configured, get the delay before deleting the message if self.config["silent"]: silent_delay = utils.get_delay(self.config["silent"], self.rand) # Send a random message in the configured channel if self.config["silent"]: await channel.send(random_message, delete_after=silent_delay) else: await channel.send(random_message) if self.client.shared["logging"]: utils.log(f"Sent \"{random_message}\" to {schannel}") # Delay the loop if configured await asyncio.sleep( utils.get_delay(self.config["delay"], self.rand))
async def farm(self): """Automate sending messages with a configured frequency, channel, etc""" if self.client.shared["logging"]: utils.log("Message farming enabled") messages = utils.list_generator(self.config["messages"]) channels = self.config["channels"] while not self.client.is_closed(): # If configured, shuffle the channels to randomize the order we farm them if self.config["randomchannels"]: self.rand.shuffle(channels) for channel_id in channels: # Create a channel object of the configured channel id channel = self.client.get_channel(channel_id) # Get a random message from one of the configured ones random_message = next(messages) # Generate a human delay before sending the message delay = self.rand.randint(1, 3) # If configured, get the delay before deleting the message silent_delay = utils.get_delay(self.config["silent"], self.rand) # Send a random message in the configured channel outbound = outbound_message.Outbound_Message( random_message, channel, delay, silent_delay) await outbound.send() if self.client.shared["logging"]: utils.log(f"Sent \"{random_message}\" to {channel_id}") # Delay the loop if configured await asyncio.sleep( utils.get_delay(self.config["delay"], self.rand))
async def fishy(self): """Send messages to add fishies to the configured person at a configured interval""" await self.client.wait_until_ready() # If disabled in configuration, don"t proceed if not self.config["fishyfarming"]: return if self.client.shared["logging"]: utils.log("Sushii fishy farming enabled") recipients = utils.list_generator(self.config["fishyrecipients"]) while not self.client.is_closed(): channel = self.client.get_channel(self.config["channel"]) # Get a random recipient from one of the configured ones random_recipient = next(recipients) # If configured, get the delay before deleting the message if self.config["silent"]: silent_delay = utils.get_delay(self.config["silent"], self.rand) # Send a random message in the configured channel if self.config["silent"]: await channel.send(f"-fishy <@{random_recipient}>", delete_after=silent_delay) else: await channel.send(f"-fishy <@{random_recipient}>") if self.client.shared["logging"]: utils.log(f"Gave sushii fishies to {random_recipient}") # Delay the loop if configured await asyncio.sleep( utils.get_delay(self.config["fishydelay"], self.rand))