Cogboard fixes (#37)

* Unneeded requirements

* Typo and While True

* Empty requirements

* audio tag

* Correct description, `audioset notify` alert, unneeded lavaplayer line

* unneeded requirements

* extra slash

* Add CPU / RAM / Disk warning

* Unneeded requirements

* Proper coglint requirements

* Default for `"Hi {}, I'm Dad"` set to enabled

* unneeded requirements

* Add list command, fix no_pm to guild_only

* Remove some comments and rename variable

* Fix to bugs

* unneeded requirements

* unneeded requirements

* remove pass_context legacy code

* More accurate instructions

* fix custom emojis

* less comments

* Unneeded requirements

* Unneeded requirements

* proper description

* Fix description wrap

* Unneeded requirements

* Unneeded requirements

* Missing await

* Info updates

* `await ctx.embed_requested`

* no requirements necessary

* markdown

* missing help

* Auto_help handles it

* Leaverset channel description

* Embeds and optional nicknames

* text clarification

* test alternative path

* Gotta upload the fixes

* more fix

* another test

* Steal skyrim

* Undo skyrim test

* Forgot await

* Use .json files, proper init to use files, move cooldown to seed
pull/41/head
bobloy 6 years ago committed by GitHub
parent 9ead7017fb
commit f130c3e67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -140,7 +140,7 @@ class AnnounceDaily(Cog):
@_ad.command()
async def listimg(self, ctx: commands.Context):
"""
List all registered announcement immages
List all registered announcement images
"""
images = await self.config.images()
for page in pagify("\n".join(images)):
@ -192,7 +192,7 @@ class AnnounceDaily(Cog):
await self.config.time.set({"hour": h, "minute": m, "second": s})
await ctx.send(
"Announcements time has been set to {}::{}::{} every day\n"
"Announcement time has been set to {}::{}::{} every day\n"
"**Changes will apply after next scheduled announcement or reload**".format(h, m, s)
)
@ -229,7 +229,7 @@ class AnnounceDaily(Cog):
await channel.send(choice)
async def check_day(self):
while self is self.bot.get_cog("AnnounceDaily"):
while True:
tomorrow = datetime.now() + timedelta(days=1)
time = await self.config.time()
h, m, s = time["hour"], time["minute"], time["second"]

@ -10,7 +10,6 @@
"description": "Send daily announcements to all servers at a specified times",
"hidden": true,
"install_msg": "Thank you for installing AnnounceDaily! Get started with `[p]load announcedaily` and `[p]help AnnounceDaily`",
"requirements": [],
"short": "Send daily announcements",
"tags": [
"bobloy"

@ -17,8 +17,8 @@ from .audiosession import AudioSession
class AudioTrivia(Trivia):
"""
Custom commands
Creates commands used to display text and adjust roles
Upgrade to the Trivia cog that enables audio trivia
Replaces the Trivia cog
"""
def __init__(self, bot: Red):
@ -90,10 +90,16 @@ class AudioTrivia(Trivia):
return
status = await self.audio.config.status()
notify = await self.audio.config.notify()
if status:
await ctx.send(
"I recommend disabling audio status with `{}audioset status`".format(ctx.prefix)
"It is recommended to disable audio status with `{}audioset status`".format(ctx.prefix)
)
if notify:
await ctx.send(
"It is recommended to disable audio notify with `{}audioset notify`".format(ctx.prefix)
)
if not self.audio._player_check(ctx):
@ -110,7 +116,6 @@ class AudioTrivia(Trivia):
lavaplayer = lavalink.get_player(ctx.guild.id)
lavaplayer.store("channel", ctx.channel.id) # What's this for? I dunno
lavaplayer.store("guild", ctx.guild.id)
await self.audio._data_check(ctx)

@ -10,11 +10,11 @@
"description": "Start an Audio Trivia game",
"hidden": false,
"install_msg": "Thank you for installing Audio trivia!\n You **MUST** unload trivia to use this (`[p]unload trivia`)\n Then you can get started with `[p]load audiotrivia` and `[p]help AudioTrivia`",
"requirements": [],
"short": "Start an Audio Trivia game",
"tags": [
"fox",
"bobloy",
"games"
"games",
"audio"
]
}

@ -116,7 +116,7 @@ class CCRole(Cog):
# Selfrole
await ctx.send(
"Is this a targeted command?(yes//no)\nNo will make this a selfrole command"
"Is this a targeted command?(yes/no)\nNo will make this a selfrole command"
)
try:

@ -10,7 +10,6 @@
"description": "[Incomplete] Creates custom commands to adjust roles and send custom messages",
"hidden": false,
"install_msg": "Thank you for installing Custom Commands w/ Roles. Get started with `[p]load ccrole` and `[p]help CCRole`",
"requirements": [],
"short": "[Incomplete] Creates commands that adjust roles",
"tags": [
"fox",

@ -152,6 +152,10 @@ class Chatter(Cog):
Trains the bot based on language in this guild
"""
await ctx.send("Warning: The cog may use significant RAM or CPU if trained on large data sets.\n"
"Additionally, large sets will use more disk space to save the trained data.\n\n"
"If you experience issues, clear your trained data and train again on a smaller scope.")
conversation = await self._get_conversation(ctx, channel)
if not conversation:

@ -10,7 +10,7 @@
"description": "Lint python code posted in chat",
"hidden": true,
"install_msg": "Thank you for installing CogLint! Get started with `[p]load coglint` and `[p]help CogLint`",
"requirements": [],
"requirements": ["pylint"],
"short": "Python cog linter",
"tags": [
"bobloy",

@ -28,7 +28,7 @@ class Dad(Cog):
self.bot = bot
self.config = Config.get_conf(self, identifier=6897100, force_registration=True)
default_guild = {"enabled": False, "nickname": False, "cooldown": 240}
default_guild = {"enabled": True, "nickname": False, "cooldown": 240}
self.config.register_guild(**default_guild)

@ -10,7 +10,6 @@
"description": "Tell dad jokes and give out bad nicknames",
"hidden": true,
"install_msg": "Thank you for installing Dad. Get started with `[p]load dad`, then `[p]help Dad`",
"requirements": [],
"short": "Dad joke bot",
"tags": [
"bobloy",

@ -19,7 +19,8 @@ class ExclusiveRole(Cog):
self.config.register_guild(**default_guild)
@commands.group(no_pm=True, aliases=["exclusiverole"])
@commands.guild_only()
@commands.group(aliases=["exclusiverole"])
async def exclusive(self, ctx):
"""Base command for managing exclusive roles"""
@ -54,6 +55,21 @@ class ExclusiveRole(Cog):
await ctx.send("Exclusive role removed")
@exclusive.command(name="list")
@checks.mod_or_permissions(administrator=True)
async def exclusive_list(self, ctx):
"""List current exclusive roles"""
role_list = await self.config.guild(ctx.guild).role_list()
guild: discord.Guild = ctx.guild
role_list = [guild.get_role(role_id) for role_id in role_list]
out = "**Exclusive roles**\n\n"
for role in role_list:
out += "{}\n".format(role)
await ctx.send(out)
async def check_guild(self, guild: discord.Guild):
role_set = set(await self.config.guild(guild).role_list())
for member in guild.members:

@ -10,7 +10,6 @@
"description": "Assign roles to be exclusive, preventing other roles from being added",
"hidden": false,
"install_msg": "Thank you for installing ExclusiveRole. Get started with `[p]load exclusiverole` and `[p]help ExclusiveRole`",
"requirements": [],
"short": "Set roles to be exclusive",
"tags": [
"fox",

@ -72,25 +72,22 @@ class Flag(Cog):
"""Flag a member"""
guild = ctx.guild
await self._check_flags(guild)
# clashroyale = self.bot.get_cog('clashroyale')
# if clashroyale is None:
# await ctx.send("Requires clashroyale cog installed")
# return
flag = self._flag_template()
expiredate = date.today()
expiredate += timedelta(days=await self.config.guild(guild).days())
expire_date = date.today() + timedelta(days=await self.config.guild(guild).days())
flag["reason"] = reason
flag["expireyear"] = expiredate.year
flag["expiremonth"] = expiredate.month
flag["expireday"] = expiredate.day
flag["expireyear"] = expire_date.year
flag["expiremonth"] = expire_date.month
flag["expireday"] = expire_date.day
# flags = await self.config.guild(guild).flags.get_raw(str(member.id), default=[])
# flags.append(flag)
# await self.config.guild(guild).flags.set_raw(str(member.id), value=flags)
async with self.config.guild(guild).flags() as flags:
if str(member.id) not in flags:
flags[str(member.id)] = []
flags[str(member.id)].append(flag)
outembed = await self._list_flags(member)
@ -98,7 +95,10 @@ class Flag(Cog):
if outembed:
await ctx.send(embed=outembed)
if await self.config.guild(guild).dm():
await member.send(embed=outembed)
try:
await member.send(embed=outembed)
except discord.Forbidden:
await ctx.send("DM-ing user failed")
else:
await ctx.send("This member has no flags.. somehow..")

@ -10,7 +10,6 @@
"description": "Add expiring flags on members to track warnings or incidents",
"hidden": false,
"install_msg": "Thank you for installing Flag! Get started with `[p]load flag` and `[p]help Flag`",
"requirements": [],
"short": "Add expiring flags to members",
"tags": [
"bobloy",

@ -10,7 +10,6 @@
"description": "Mentions roles that are unmentionable",
"hidden": false,
"install_msg": "Thank you for installing ForceMention! Get started with `[p]load forcemention`, then `[p]forcemention`",
"requirements": [],
"short": "Mention unmentionables",
"tags": [
"bobloy",

@ -137,21 +137,25 @@ class Hangman(Cog):
HANGMAN""",
)
@commands.group(aliases=["sethang"], pass_context=True)
@commands.group(aliases=["sethang"])
@checks.mod_or_permissions(administrator=True)
async def hangset(self, ctx):
"""Adjust hangman settings"""
if ctx.invoked_subcommand is None:
pass
@hangset.command(pass_context=True)
@hangset.command()
async def face(self, ctx: commands.Context, theface):
"""Set the face of the hangman"""
message = ctx.message
# Borrowing FlapJack's emoji validation
# (https://github.com/flapjax/FlapJack-Cogs/blob/master/smartreact/smartreact.py)
if theface[:2] == "<:":
theface = [r for r in self.bot.emojis if r.id == theface.split(":")[2][:-1]][0]
theface = self.bot.get_emoji(int(theface.split(":")[2][:-1]))
if theface is None:
await ctx.send("I could not find that emoji")
return
try:
# Use the face as reaction to see if it's valid (THANKS FLAPJACK <3)
@ -160,11 +164,11 @@ class Hangman(Cog):
await ctx.send("That's not an emoji I recognize.")
return
await self.config.guild(ctx.guild).theface.set(theface)
await self.config.guild(ctx.guild).theface.set(str(theface))
await self._update_hanglist()
await ctx.send("Face has been updated!")
@hangset.command(pass_context=True)
@hangset.command()
async def toggleemoji(self, ctx: commands.Context):
"""Toggles whether to automatically react with the alphabet"""
@ -172,7 +176,7 @@ class Hangman(Cog):
await self.config.guild(ctx.guild).emojis.set(not current)
await ctx.send("Emoji Letter reactions have been set to {}".format(not current))
@commands.command(aliases=["hang"], pass_context=True)
@commands.command(aliases=["hang"])
async def hangman(self, ctx, guess: str = None):
"""Play a game of hangman against the bot!"""
if guess is None:
@ -339,11 +343,14 @@ class Hangman(Cog):
await message.add_reaction(self.navigate[0])
def _make_say(self, guild):
async def _make_say(self, guild):
c_say = "Guess this: " + str(self._hideanswer(guild)) + "\n"
c_say += "Used Letters: " + str(self._guesslist(guild)) + "\n"
c_say += self.hanglist[guild][self.the_data[guild]["hangman"]] + "\n"
c_say += self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z"
if await self.config.guild(guild).emojis():
c_say += "{} for A-M, {} for N-Z".format(self.navigate[0], self.navigate[-1])
else:
c_say += "React with {} - {} to guess".format(self.letters[0], self.letters[-1])
return c_say
@ -351,7 +358,7 @@ class Hangman(Cog):
if message.guild not in self.hanglist:
await self._update_hanglist()
c_say = self._make_say(message.guild)
c_say = await self._make_say(message.guild)
await message.edit(content=c_say)
self.the_data[message.guild]["trackmessage"] = message.id
@ -363,7 +370,7 @@ class Hangman(Cog):
if channel.guild not in self.hanglist:
await self._update_hanglist()
c_say = self._make_say(channel.guild)
c_say = await self._make_say(channel.guild)
message = await channel.send(c_say)

@ -10,7 +10,6 @@
"description": "Create a channel with updating server info",
"hidden": false,
"install_msg": "Thank you for installing InfoChannel. Get started with `[p]load infochannel`, then `[p]help InfoChannel`",
"requirements": [],
"short": "Updating server info channel",
"tags": [
"bobloy",

@ -10,7 +10,6 @@
"description": "Keeps track of when people leave the server, and posts a message notifying",
"hidden": false,
"install_msg": "Thank you for installing Leaver. Get started with `[p]load leaver`, then `[p]help Leaver`",
"requirements": [],
"short": "Send message on leave",
"tags": [
"bobloy",

@ -1,6 +1,7 @@
import discord
from redbot.core import Config, checks, commands
from redbot.core.bot import Red
from redbot.core.commands import Context
from typing import Any
@ -12,7 +13,7 @@ class Leaver(Cog):
Creates a goodbye message when people leave
"""
def __init__(self, bot):
def __init__(self, bot: Red):
self.bot = bot
self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True)
default_guild = {"channel": ""}
@ -28,6 +29,7 @@ class Leaver(Cog):
@leaverset.command()
async def channel(self, ctx: Context):
"""Choose the channel to send leave messages to"""
guild = ctx.guild
await self.config.guild(guild).channel.set(ctx.channel.id)
await ctx.send("Channel set to " + ctx.channel.name)
@ -38,6 +40,10 @@ class Leaver(Cog):
if channel != "":
channel = guild.get_channel(channel)
await channel.send(str(member) + "(*" + str(member.nick) + "*) has left the server!")
out = "{}{} has left the server".format(member, member.nick if member.nick is not None else "")
if await self.bot.embed_requested(channel, member):
await channel.send(embed=discord.Embed(description=out, color=self.bot.color))
else:
await channel.send(out)
else:
pass

@ -1,5 +1,9 @@
from redbot.core import data_manager
from .planttycoon import PlantTycoon
def setup(bot):
bot.add_cog(PlantTycoon(bot))
tycoon = PlantTycoon(bot)
data_manager.load_bundled_data(tycoon, __file__)
bot.add_cog(tycoon)

@ -379,7 +379,7 @@
"rarity": "rare",
"image": "http://i.imgur.com/hoh17hp.jpg",
"health": 100,
"degradation": 1,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400
@ -391,7 +391,7 @@
"rarity": "rare",
"image": "http://i.imgur.com/lhSjfQY.jpg",
"health": 100,
"degradation": 1,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400
@ -403,7 +403,7 @@
"rarity": "rare",
"image": "http://i.imgur.com/Dhw9ync.jpg",
"health": 100,
"degradation": 1,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400
@ -415,7 +415,7 @@
"rarity": "rare",
"image": "http://i.imgur.com/h4fJo2R.jpg",
"health": 100,
"degradation": 1,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400
@ -427,7 +427,7 @@
"rarity": "rare",
"image": "http://i.imgur.com/NoSdxXh.jpg",
"health": 100,
"degradation": 1,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400
@ -439,7 +439,7 @@
"rarity": "rare",
"image": "http://i.imgur.com/4ArSekX.jpg",
"health": 100,
"degradation": 1,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400
@ -451,43 +451,19 @@
"rarity": "super-rare",
"image": "http://i.imgur.com/ASZXr7C.png",
"health": 100,
"degradation": 1,
"threshold": 110,
"badge": "Odd-pod",
"reward": 3600
},
{
"name": "tba",
"article": "a",
"time": 9000,
"rarity": "super-rare",
"image": "tba",
"health": 100,
"degradation": 1.5,
"degradation": 2,
"threshold": 110,
"badge": "Odd-pod",
"reward": 3600
},
{
"name": "Pirahna Plant",
"name": "Piranha Plant",
"article": "a",
"time": 9000,
"rarity": "super-rare",
"image": "http://i.imgur.com/c03i9W7.jpg",
"health": 100,
"degradation": 1.5,
"threshold": 110,
"badge": "Odd-pod",
"reward": 3600
},
{
"name": "tba",
"article": "a",
"time": 9000,
"rarity": "super-rare",
"image": "tba",
"health": 100,
"degradation": 1.5,
"degradation": 2,
"threshold": 110,
"badge": "Odd-pod",
"reward": 3600
@ -499,19 +475,19 @@
"rarity": "super-rare",
"image": "https://i.imgur.com/Vo4v2Ry.png",
"health": 100,
"degradation": 1.5,
"degradation": 2,
"threshold": 110,
"badge": "Odd-pod",
"reward": 3600
},
{
"name": "tba",
"name": "Eldergleam Tree",
"article": "a",
"time": 10800,
"rarity": "epic",
"image": "tba",
"image": "https://i.imgur.com/pnZYKZc.jpg",
"health": 100,
"degradation": 2,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400
@ -523,7 +499,7 @@
"rarity": "epic",
"image": "http://i.imgur.com/sizf7hE.png",
"health": 100,
"degradation": 2,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400
@ -535,7 +511,7 @@
"rarity": "epic",
"image": "http://i.imgur.com/9f5QzaW.jpg",
"health": 100,
"degradation": 2,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400
@ -547,7 +523,7 @@
"rarity": "epic",
"image": "https://i.imgur.com/ExqLLHO.png",
"health": 100,
"degradation": 2,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400
@ -559,7 +535,7 @@
"rarity": "epic",
"image": "https://i.imgur.com/tv2B72j.png",
"health": 100,
"degradation": 2,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400
@ -571,7 +547,7 @@
"rarity": "legendary",
"image": "http://i.imgur.com/MIJQDLL.jpg",
"health": 100,
"degradation": 3,
"degradation": 8,
"threshold": 110,
"badge": "Nobel Peas Prize",
"reward": 10800
@ -583,7 +559,7 @@
"rarity": "legendary",
"image": "http://i.imgur.com/cFSmaHH.png",
"health": 100,
"degradation": 3,
"degradation": 8,
"threshold": 110,
"badge": "Nobel Peas Prize",
"reward": 10800
@ -595,7 +571,7 @@
"rarity": "legendary",
"image": "http://i.imgur.com/Ibwm2xY.jpg",
"health": 100,
"degradation": 3,
"degradation": 8,
"threshold": 110,
"badge": "Nobel Peas Prize",
"reward": 10800

@ -1,13 +1,15 @@
import asyncio
import collections
import datetime
import json
import time
from random import choice
from typing import Any
import discord
from redbot.core import commands, Config, bank
from redbot.core.bot import Red
from typing import Any
from redbot.core.data_manager import bundled_data_path
Cog: Any = getattr(commands, "Cog", object)
@ -98,739 +100,9 @@ class PlantTycoon(Cog):
self.config.register_user(**default_user)
self.plants = {
"plants": [
{
"name": "Poppy",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/S4hjyUX.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Dandelion",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/emqnQP2.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Daisy",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/lcFq4AB.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Chrysanthemum",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/5jLtqWL.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Pansy",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/f7TgD1b.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Lavender",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/g3OmOSK.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Lily",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/0hzy7lO.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Petunia",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/rJm8ISv.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Sunflower",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/AzgzQK9.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Daffodil",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/pnCCRsH.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Clover",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/jNTgirw.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Tulip",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/kodIFjE.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Rose",
"article": "a",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/sdTNiOH.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Aster",
"article": "an",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/1tN04Hl.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Aloe Vera",
"article": "an",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/WFAYIpx.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Orchid",
"article": "an",
"time": 3600,
"rarity": "common",
"image": "http://i.imgur.com/IQrQYDC.jpg",
"health": 100,
"degradation": 0.625,
"threshold": 110,
"badge": "Flower Power",
"reward": 600,
},
{
"name": "Dragon Fruit Plant",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/pfngpDS.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Mango Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/ybR78Oc.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Lychee Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/w9LkfhX.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Durian Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/jh249fz.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Fig Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/YkhnpEV.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Jack Fruit Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/2D79TlA.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Prickly Pear Plant",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/GrcGAGj.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Pineapple Plant",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/VopYQtr.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Citron Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/zh7Dr23.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Cherimoya Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/H62gQK6.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Mangosteen Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/McNnMqa.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Guava Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/iy8WgPt.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Orange Tree",
"article": "an",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/lwjEJTm.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Apple Tree",
"article": "an",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/QI3UTR3.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Sapodilla Tree",
"article": "a",
"time": 5400,
"rarity": "uncommon",
"image": "http://i.imgur.com/6BvO5Fu.jpg",
"health": 100,
"degradation": 0.75,
"threshold": 110,
"badge": "Fruit Brute",
"reward": 1200,
},
{
"name": "Franklin Tree",
"article": "a",
"time": 7200,
"rarity": "rare",
"image": "http://i.imgur.com/hoh17hp.jpg",
"health": 100,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400,
},
{
"name": "Parrot's Beak",
"article": "a",
"time": 7200,
"rarity": "rare",
"image": "http://i.imgur.com/lhSjfQY.jpg",
"health": 100,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400,
},
{
"name": "Koki'o",
"article": "a",
"time": 7200,
"rarity": "rare",
"image": "http://i.imgur.com/Dhw9ync.jpg",
"health": 100,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400,
},
{
"name": "Jade Vine",
"article": "a",
"time": 7200,
"rarity": "rare",
"image": "http://i.imgur.com/h4fJo2R.jpg",
"health": 100,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400,
},
{
"name": "Venus Fly Trap",
"article": "a",
"time": 7200,
"rarity": "rare",
"image": "http://i.imgur.com/NoSdxXh.jpg",
"health": 100,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400,
},
{
"name": "Chocolate Cosmos",
"article": "a",
"time": 7200,
"rarity": "rare",
"image": "http://i.imgur.com/4ArSekX.jpg",
"health": 100,
"degradation": 1.5,
"threshold": 110,
"badge": "Sporadic",
"reward": 2400,
},
{
"name": "Pizza Plant",
"article": "a",
"time": 9000,
"rarity": "super-rare",
"image": "http://i.imgur.com/ASZXr7C.png",
"health": 100,
"degradation": 2,
"threshold": 110,
"badge": "Odd-pod",
"reward": 3600,
},
# {
# "name": "tba",
# "article": "a",
# "time": 9000,
# "rarity": "super-rare",
# "image": "tba",
# "health": 100,
# "degradation": 1.5,
# "threshold": 110,
# "badge": "Odd-pod",
# "reward": 3600
# },
{
"name": "Piranha Plant",
"article": "a",
"time": 9000,
"rarity": "super-rare",
"image": "http://i.imgur.com/c03i9W7.jpg",
"health": 100,
"degradation": 2,
"threshold": 110,
"badge": "Odd-pod",
"reward": 3600,
},
# {
# "name": "tba",
# "article": "a",
# "time": 9000,
# "rarity": "super-rare",
# "image": "tba",
# "health": 100,
# "degradation": 1.5,
# "threshold": 110,
# "badge": "Odd-pod",
# "reward": 3600
# },
{
"name": "Peashooter",
"article": "a",
"time": 9000,
"rarity": "super-rare",
"image": "https://i.imgur.com/Vo4v2Ry.png",
"health": 100,
"degradation": 2,
"threshold": 110,
"badge": "Odd-pod",
"reward": 3600,
},
{
"name": "Eldergleam Tree",
"article": "a",
"time": 10800,
"rarity": "epic",
"image": "https://i.imgur.com/pnZYKZc.jpg",
"health": 100,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400,
},
{
"name": "Pikmin",
"article": "a",
"time": 10800,
"rarity": "epic",
"image": "http://i.imgur.com/sizf7hE.png",
"health": 100,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400,
},
{
"name": "Flora Colossus",
"article": "a",
"time": 10800,
"rarity": "epic",
"image": "http://i.imgur.com/9f5QzaW.jpg",
"health": 100,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400,
},
{
"name": "Plantera Bulb",
"article": "a",
"time": 10800,
"rarity": "epic",
"image": "https://i.imgur.com/ExqLLHO.png",
"health": 100,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400,
},
{
"name": "Chorus Tree",
"article": "an",
"time": 10800,
"rarity": "epic",
"image": "https://i.imgur.com/tv2B72j.png",
"health": 100,
"degradation": 2.5,
"threshold": 110,
"badge": "Greenfingers",
"reward": 5400,
},
{
"name": "Money Tree",
"article": "a",
"time": 35400,
"rarity": "legendary",
"image": "http://i.imgur.com/MIJQDLL.jpg",
"health": 100,
"degradation": 8,
"threshold": 110,
"badge": "Nobel Peas Prize",
"reward": 10800,
},
{
"name": "Truffula Tree",
"article": "a",
"time": 35400,
"rarity": "legendary",
"image": "http://i.imgur.com/cFSmaHH.png",
"health": 100,
"degradation": 8,
"threshold": 110,
"badge": "Nobel Peas Prize",
"reward": 10800,
},
{
"name": "Whomping Willow",
"article": "a",
"time": 35400,
"rarity": "legendary",
"image": "http://i.imgur.com/Ibwm2xY.jpg",
"health": 100,
"degradation": 8,
"threshold": 110,
"badge": "Nobel Peas Prize",
"reward": 10800,
},
],
"event": {
"January": {
"name": "Tanabata Tree",
"article": "a",
"time": 70800,
"rarity": "event",
"image": "http://i.imgur.com/FD38JJj.jpg",
"health": 100,
"degradation": 9,
"threshold": 110,
"badge": "Annualsary",
"reward": 21600,
},
"February": {
"name": "Chocolate Rose",
"article": "a",
"time": 70800,
"rarity": "event",
"image": "http://i.imgur.com/Sqg6pcG.jpg",
"health": 100,
"degradation": 9,
"threshold": 110,
"badge": "Annualsary",
"reward": 21600,
},
"March": {
"name": "Shamrock",
"article": "a",
"time": 70800,
"rarity": "event",
"image": "http://i.imgur.com/kVig04M.jpg",
"health": 100,
"degradation": 9,
"threshold": 110,
"badge": "Annualsary",
"reward": 21600,
},
"April": {
"name": "Easter Egg Eggplant",
"article": "an",
"time": 70800,
"rarity": "event",
"image": "http://i.imgur.com/5jltGQa.jpg",
"health": 100,
"degradation": 9,
"threshold": 110,
"badge": "Annualsary",
"reward": 21600,
},
"October": {
"name": "Jack O' Lantern",
"article": "a",
"time": 70800,
"rarity": "event",
"image": "http://i.imgur.com/efApsxG.jpg",
"health": 100,
"degradation": 9,
"threshold": 110,
"badge": "Annualsary",
"reward": 21600,
},
"November": {
"name": "Mayflower",
"article": "a",
"time": 70800,
"rarity": "event",
"image": "http://i.imgur.com/nntNtoL.jpg",
"health": 100,
"degradation": 9,
"threshold": 110,
"badge": "Annualsary",
"reward": 21600,
},
"December": {
"name": "Holly",
"article": "a",
"time": 70800,
"rarity": "event",
"image": "http://i.imgur.com/maDLmJC.jpg",
"health": 100,
"degradation": 9,
"threshold": 110,
"badge": "Annualsary",
"reward": 21600,
},
},
}
self.plants = None
self.products = {
"water": {
"cost": 5,
"health": 10,
"damage": 45,
"modifier": 0,
"category": "water",
"uses": 1,
},
"manure": {
"cost": 20,
"health": 20,
"damage": 55,
"modifier": -0.035,
"category": "fertilizer",
"uses": 1,
},
"vermicompost": {
"cost": 35,
"health": 30,
"damage": 60,
"modifier": -0.5,
"category": "fertilizer",
"uses": 1,
},
"nitrates": {
"cost": 70,
"health": 60,
"damage": 75,
"modifier": -0.08,
"category": "fertilizer",
"uses": 1,
},
"pruner": {
"cost": 500,
"health": 40,
"damage": 90,
"modifier": -0.065,
"category": "tool",
"uses": 10,
},
}
self.products = None
self.defaults = {
"points": {
@ -881,10 +153,19 @@ class PlantTycoon(Cog):
# self.bank = bot.get_cog('Economy').bank
async def _load_plants_products(self):
plant_path = bundled_data_path(self) / "plants.json"
product_path = bundled_data_path(self) / "products.json"
with plant_path.open() as json_data:
self.plants = json.load(json_data)
with product_path.open() as json_data:
self.products = json.load(json_data)
async def _gardener(self, user: discord.User) -> Gardener:
#
# This function returns an individual gardener namedtuple
# This function returns a Gardener object for the user
#
g = Gardener(user, self.config)
@ -896,6 +177,8 @@ class PlantTycoon(Cog):
#
# Calculating the rate of degradation per check_completion() cycle.
#
if self.products is None:
await self._load_plants_products()
modifiers = sum(
[
@ -938,7 +221,8 @@ class PlantTycoon(Cog):
#
# The function to add health
#
if self.products is None:
await self._load_plants_products()
product = product.lower()
product_category = product_category.lower()
if product in self.products and self.products[product]["category"] == product_category:
@ -1020,9 +304,12 @@ class PlantTycoon(Cog):
)
await ctx.send(embed=em)
@commands.cooldown(1, 60 * 10, commands.BucketType.user)
@_gardening.command(name="seed")
async def _seed(self, ctx: commands.Context):
"""Plant a seed inside the earth."""
if self.plants is None:
await self._load_plants_products()
author = ctx.author
# server = context.message.server
# if author.id not in self.gardeners:
@ -1157,6 +444,8 @@ class PlantTycoon(Cog):
@_gardening.command(name="plants")
async def _plants(self, ctx):
"""Look at the list of the available plants."""
if self.plants is None:
await self._load_plants_products()
tick = ""
tock = ""
tick_tock = 0
@ -1173,15 +462,18 @@ class PlantTycoon(Cog):
await ctx.send(embed=em)
@_gardening.command(name="plant")
async def _plant(self, ctx: commands.Context, *plant):
async def _plant(self, ctx: commands.Context, *, plantname):
"""Look at the details of a plant."""
plant = " ".join(plant)
if self.plants is None:
await self._load_plants_products()
t = False
plant = None
for p in self.plants["plants"]:
if p["name"].lower() == plant.lower():
if p["name"].lower() == plantname.lower():
plant = p
t = True
break
if t:
em = discord.Embed(
title="Plant statistics of {}".format(plant["name"]), color=discord.Color.green()
@ -1231,6 +523,9 @@ class PlantTycoon(Cog):
@_gardening.command(name="buy")
async def _buy(self, ctx, product=None, amount: int = 1):
"""Buy gardening supplies."""
if self.products is None:
await self._load_plants_products()
author = ctx.author
if product is None:
em = discord.Embed(
@ -1297,7 +592,6 @@ class PlantTycoon(Cog):
em = discord.Embed(description=message, color=discord.Color.green())
await ctx.send(embed=em)
@commands.cooldown(1, 60 * 10, commands.BucketType.user)
@commands.command(name="shovel")
async def _shovel(self, ctx: commands.Context):
"""Shovel your plant out."""

@ -14,7 +14,7 @@ Cog: Any = getattr(commands, "Cog", object)
class QRInvite(Cog):
"""
V3 Cog Template
Create custom QR codes for server invites
"""
def __init__(self, bot: Red):

@ -1,10 +1,22 @@
{
"author" : ["Bobloy"],
"bot_version" : [3,0,0],
"description" : "Cog to prevent reactions on specific messages from certain users",
"hidden" : true,
"install_msg" : "Thank you for installing ReactRestrict.",
"requirements" : [],
"short" : "[Incomplete] Prevent reactions",
"tags" : ["react", "reaction", "restrict", "tools", "utils", "bobloy"]
"author": [
"Bobloy"
],
"bot_version": [
3,
0,
0
],
"description": "Cog to prevent reactions on specific messages from certain users",
"hidden": true,
"install_msg": "Thank you for installing ReactRestrict.",
"short": "[Incomplete] Prevent reactions",
"tags": [
"react",
"reaction",
"restrict",
"tools",
"utils",
"bobloy"
]
}

@ -206,8 +206,7 @@ class ReactRestrict(Cog):
@reactrestrict.command()
async def add(self, ctx: commands.Context, message_id: int, *, role: discord.Role):
"""
Adds a reaction|role combination to a registered message, don't use
quotes for the role name.
Adds a reaction|role combination to a registered message, don't use quotes for the role name.
"""
message = await self._get_message(ctx, message_id)
if message is None:

@ -11,7 +11,6 @@
"description": "Apply for a job at the recycling plant! Sort out the garbage!",
"hidden": false,
"install_msg": "Thank you for installing RecyclingPlant. Start recycling today with `[p]load recyclingplant`, then `[p]recyclingplant`",
"requirements": [],
"short": "Apply for a job at the recycling plant!",
"tags": [
"bobloy",

@ -1,12 +1,11 @@
import asyncio
import json
import random
from redbot.core import bank
from redbot.core import commands
from redbot.core.data_manager import cog_data_path
from typing import Any
from redbot.core import bank, commands
from redbot.core.data_manager import bundled_data_path
Cog: Any = getattr(commands, "Cog", object)
@ -15,15 +14,19 @@ class RecyclingPlant(Cog):
def __init__(self, bot):
self.bot = bot
self.path = str(cog_data_path(self)).replace("\\", "/")
self.junk_path = self.path + "/bundled_data/junk.json"
self.junk = None
with open(self.junk_path) as json_data:
def load_junk(self):
junk_path = bundled_data_path(self) / "junk.json"
with junk_path.open() as json_data:
self.junk = json.load(json_data)
@commands.command(aliases=["recycle"])
async def recyclingplant(self, ctx: commands.Context):
"""Apply for a job at the recycling plant!"""
if self.junk is None:
self.load_junk()
x = 0
reward = 0
await ctx.send(
@ -81,9 +84,9 @@ class RecyclingPlant(Cog):
)
else:
if reward > 0:
bank.deposit_credits(ctx.author, reward)
await bank.deposit_credits(ctx.author, reward)
await ctx.send(
"{} been given **{} {}s** for your services.".format(
ctx.author.display_name, reward, bank.get_currency_name(ctx.guild)
ctx.author.display_name, reward, await bank.get_currency_name(ctx.guild)
)
)

@ -10,7 +10,7 @@
],
"description": "Play Rock Papers Scissor Lizard Spock by Sam Kass in Discord!",
"hidden": false,
"install_msg": "Thank you for installing RPSLP. Get started with `[p]load rpsls`, then `[p]rpsls`",
"install_msg": "Thank you for installing RPSLS. Get started with `[p]load rpsls`, then `[p]rpsls`",
"requirements": [],
"short": "Play Rock Papers Scissor Lizard Spock in Discord!",
"tags": [

@ -9,7 +9,7 @@
],
"description": "Convert any website into text and post it in chat",
"hidden": true,
"install_msg": "Thank you for installing SayUrl! Get started with `[p]load forcemention`, then `[p]help SayUrl",
"install_msg": "Thank you for installing SayUrl! Get started with `[p]load sayurl`, then `[p]help SayUrl",
"requirements": ["html2text"],
"short": "Convert URL to text",
"tags": [

@ -28,7 +28,7 @@ class SCP(Cog):
msg = "You must specify a number between 1 and 4999."
c = discord.Color.red()
if ctx.embed_requested():
if await ctx.embed_requested():
await ctx.send(embed=discord.Embed(description=msg, color=c))
else:
await ctx.maybe_send_embed(msg)
@ -94,7 +94,7 @@ class SCP(Cog):
em = discord.Embed(title=ttl, description=msg, color=c)
if ctx.embed_requested():
if await ctx.embed_requested():
await ctx.send(embed=em)
else:
await ctx.maybe_send_embed(msg)
@ -118,7 +118,7 @@ class SCP(Cog):
em = discord.Embed(title=ttl, description=msg, color=c)
if ctx.embed_requested():
if await ctx.embed_requested():
await ctx.send(embed=em)
else:
await ctx.maybe_send_embed(msg)

@ -9,8 +9,7 @@
],
"description": "Apply roles based on the # of days on server",
"hidden": false,
"install_msg": "Thank you for installing timerole.\nGet started with `[p]load timerole`. Configure with [p]timerole",
"requirements": [],
"install_msg": "Thank you for installing timerole.\nGet started with `[p]load timerole`. Configure with `[p]timerole`",
"short": "Apply roles after # of days",
"tags": [
"bobloy",

@ -41,6 +41,11 @@ class Werewolf(Cog):
@commands.command()
async def buildgame(self, ctx: commands.Context):
"""
Create game codes to run custom games.
Pick the roles or randomized roles you want to include in a game
"""
gb = GameBuilder()
code = await gb.build_game(ctx)
@ -92,7 +97,7 @@ class Werewolf(Cog):
@commands.guild_only()
@wwset.command(name="category")
async def wwset_category(self, ctx: commands.Context, category_id=None):
async def wwset_category(self, ctx: commands.Context, category_id: int=None):
"""
Assign the channel category
"""
@ -294,7 +299,7 @@ class Werewolf(Cog):
Find custom roles by name, alignment, category, or ID
"""
if ctx.invoked_subcommand is None or ctx.invoked_subcommand == self.ww_search:
await ctx.send_help()
pass
@ww_search.command(name="name")
async def ww_search_name(self, ctx: commands.Context, *, name):

Loading…
Cancel
Save