Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5 breaking changes #83

Merged
merged 2 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions authgg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .authgg import AuthGG


def setup(bot):
bot.add_cog(AuthGG(bot))
async def setup(bot):
await bot.add_cog(AuthGG(bot))
6 changes: 3 additions & 3 deletions authgg/authgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from redbot.core.utils.predicates import MessagePredicate
from redbot.core.utils.chat_formatting import humanize_list, inline
from redbot.core import commands, Config, checks
from redbot.core import commands, Config
from typing import Optional
import discord
import asyncio
Expand Down Expand Up @@ -135,7 +135,7 @@ async def changepw(self, ctx, apikey: str, username: str, password: str):
"I was unable to delete your command message due to lack of perms. It is recommended to due so to prevent your user's password from getting leaked."
)

@checks.is_owner()
@commands.is_owner()
@authgg.group()
async def keys(self, ctx):
"""Manage API keys for auth.gg"""
Expand Down Expand Up @@ -183,7 +183,7 @@ async def _keys_list(self, ctx):
message = f"The following keys are currently registered: {humanize_list(list(map(inline, keys.keys())))}"
await ctx.send(message)

@checks.is_owner()
@commands.is_owner()
@authgg.group()
async def roles(self, ctx):
"""Control what roles have access to reseting a user's HWID"""
Expand Down
4 changes: 2 additions & 2 deletions color/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
)


def setup(bot):
bot.add_cog(Color(bot))
async def setup(bot):
await bot.add_cog(Color(bot))
14 changes: 7 additions & 7 deletions color/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import re

import discord
from redbot.core import Config, checks, commands
from redbot.core import Config, commands

from colour import Color as col
from colour import rgb2hex
Expand Down Expand Up @@ -147,7 +147,7 @@ async def color(self, ctx):
"""Group command for color commands"""
pass

@checks.bot_has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@color.command()
async def name(self, ctx, name):
"""Provides the hexadecimal value, RGB value and HSL value of a passed color. For example, pass `red` or `blue` as the name argument."""
Expand All @@ -159,7 +159,7 @@ async def name(self, ctx, name):
except (ValueError, AttributeError):
await ctx.send("That color is not recognized.")

@checks.bot_has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@color.command()
async def hex(self, ctx, hexa: str):
"""Provides the RGB value and HSL value of a passed hexadecimal value. Hexadecimal value must in the format of something like `#ffffff` or `0xffffff` to be used."""
Expand All @@ -175,7 +175,7 @@ async def hex(self, ctx, hexa: str):
"Invalid formatting for the hexadecimal. Must be the hexadecimal value, with an optional `0x` or `#` in the beginning."
)

@checks.bot_has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@color.command()
async def rgb(self, ctx, highest: int, r: float, g: float, b: float):
"""Provides the hexadecimal value and HSL value of the rgb value given. Each value must have a space between them. Highest argument must be 1 or 255, indicating the highest value of a single value (r, g, or b)."""
Expand All @@ -192,7 +192,7 @@ async def rgb(self, ctx, highest: int, r: float, g: float, b: float):
except (ValueError, AttributeError):
await ctx.send("That rgb number is not recognized.")

@checks.bot_has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@color.command()
async def hsl(self, ctx, h: float, s: float, l: float):
"""Provides the hexadecimal value and the RGB value of the hsl value given. Each value must have a space between them."""
Expand All @@ -203,7 +203,7 @@ async def hsl(self, ctx, h: float, s: float, l: float):
except (ValueError, AttributeError):
await ctx.send("That hsl number is not recognized.")

@checks.bot_has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@color.command()
async def decimal(self, ctx, decimal: int):
"""Provides the RGB value of the decimal value given."""
Expand All @@ -213,7 +213,7 @@ async def decimal(self, ctx, decimal: int):
except (ValueError, AttributeError):
await ctx.send("That decimal value is not recognized.")

@checks.admin()
@commands.admin()
@color.command()
async def msgshort(self, ctx, enable: bool):
"""Enable or disable the in-message shortcut.
Expand Down
4 changes: 2 additions & 2 deletions commandchart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
)


def setup(bot):
bot.add_cog(CommandChart(bot))
async def setup(bot):
await bot.add_cog(CommandChart(bot))
4 changes: 2 additions & 2 deletions commandchart/commandchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from io import BytesIO

import discord
from redbot.core import checks, commands
from redbot.core import commands

import matplotlib
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -127,7 +127,7 @@ def create_chart(self, top, others, channel):
image_object.seek(0)
return image_object

@checks.bot_has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@commands.guild_only()
@commands.command()
async def commandchart(
Expand Down
4 changes: 2 additions & 2 deletions cooldown/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .cooldown import Cooldown


def setup(bot):
bot.add_cog(Cooldown(bot))
async def setup(bot):
await bot.add_cog(Cooldown(bot))
4 changes: 2 additions & 2 deletions cooldown/cooldown.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
SOFTWARE.
"""

from redbot.core import commands, checks, Config
from redbot.core import commands, Config
from discord.ext import commands as dc
import asyncio
import time
Expand Down Expand Up @@ -63,7 +63,7 @@ async def initialize(self):
}
commands.cooldown(entry[1], entry[2], switch[entry[3]])(cmd)

@checks.is_owner()
@commands.is_owner()
@commands.group()
async def cooldown(self, ctx):
"""Group command for working with cooldowns for commands."""
Expand Down
4 changes: 2 additions & 2 deletions deleter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
)


def setup(bot):
async def setup(bot):
cog = Deleter(bot)
bot.add_cog(cog)
await bot.add_cog(cog)
37 changes: 18 additions & 19 deletions deleter/deleter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from copy import deepcopy as dc

import discord
from redbot.core import Config, checks, commands
from redbot.core import Config, commands
from redbot.core.utils import AsyncIter
from redbot.core.utils.chat_formatting import humanize_list

Expand Down Expand Up @@ -92,29 +92,28 @@ async def on_message(self, message):
c["messages"][str(message.id)] = time.time() + int(c["wait"])
await self.conf.channel(message.channel).messages.set(c["messages"])

@commands.group()
@commands.group(invoke_without_command=True)
@commands.guild_only()
@checks.mod_or_permissions(manage_messages=True)
@commands.mod_or_permissions(manage_messages=True)
async def deleter(self, ctx):
"""Group command for commands dealing with auto-timed deletion.

To see what channels are currently being tracked, use this command with no subcommands passed."""
if ctx.invoked_subcommand is None:
async with self.lock:
channels = await self.conf.all_channels()
sending = ""
for c, data in channels.items():
c = self.bot.get_channel(int(c))
if c is None:
continue
if c.guild.id == ctx.guild.id and int(data["wait"]) != 0:
sending += f"{c.mention}: {data['wait']} seconds\n"
if sending:
await ctx.send(sending)
else:
await ctx.send(
f"No channels are currently being tracked. Add one by using `{ctx.prefix}deleter channel`."
)
async with self.lock:
channels = await self.conf.all_channels()
sending = ""
for c, data in channels.items():
c = self.bot.get_channel(int(c))
if c is None:
continue
if c.guild.id == ctx.guild.id and int(data["wait"]) != 0:
sending += f"{c.mention}: {data['wait']} seconds\n"
if sending:
await ctx.send(sending)
else:
await ctx.send(
f"No channels are currently being tracked. Add one by using `{ctx.prefix}deleter channel`."
)

@deleter.command()
async def channel(self, ctx, channel: discord.TextChannel, wait):
Expand Down
4 changes: 2 additions & 2 deletions editor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
)


def setup(bot):
bot.add_cog(Editor(bot))
async def setup(bot):
await bot.add_cog(Editor(bot))
4 changes: 2 additions & 2 deletions editor/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from typing import Union

import discord
from redbot.core import checks, commands
from redbot.core import commands


class Editor(commands.Cog):
Expand All @@ -39,7 +39,7 @@ async def red_delete_data_for_user(self, **kwargs):
return

@commands.command()
@checks.admin()
@commands.admin()
async def editmessage(
self, ctx, ecid: int, editid: int, ccid: int, *, content: Union[int, str]
):
Expand Down
2 changes: 1 addition & 1 deletion evolution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ async def setup(bot):
if not is_global:
raise RuntimeError("Bank must be global for this cog to work.")
cog = Evolution(bot)
bot.add_cog(cog)
await bot.add_cog(cog)
await cog.utils.initialize()
10 changes: 5 additions & 5 deletions evolution/evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from typing import Literal, Optional

import discord
from redbot.core import Config, checks, commands, errors
from redbot.core import Config, commands, errors
from redbot.core.bot import Red
from redbot.core.utils import AsyncIter
from redbot.core.utils.chat_formatting import box, humanize_number, humanize_timedelta, inline
Expand Down Expand Up @@ -124,7 +124,7 @@ async def deletemydata(self, ctx, check: bool = False):
await self.red_delete_data_for_user(requester="user", user_id=ctx.author.id)
await ctx.send("Data deleted. Your game data has been reset.")

@checks.is_owner()
@commands.is_owner()
@evolution.group()
async def tasks(self, ctx):
"""View the status of the cog tasks.
Expand All @@ -141,7 +141,7 @@ async def income(self, ctx):
message = self.utils.format_task(statuses["income"])
await ctx.send(message)

@checks.is_owner()
@commands.is_owner()
@evolution.command(hidden=True)
async def removeuser(self, ctx, user: discord.User):
"""Removes a user from the market place if they are stuck for some reason.
Expand Down Expand Up @@ -349,7 +349,7 @@ async def shop(self, ctx, start_level: int = None):
if highest_level < 0:
highest_level = 0

controls = copy.deepcopy(DEFAULT_CONTROLS)
controls = dict(DEFAULT_CONTROLS)
controls["\N{MONEY BAG}"] = self.utils.shop_control_callback
await menu(ctx, embed_list, controls, page=highest_level)

Expand Down Expand Up @@ -591,7 +591,7 @@ async def perk(self, ctx, *, name: str):
"""Claim a perk from your stash"""
return await ctx.send("This command is not available. Check back soon!")

@checks.bot_has_permissions(embed_links=True)
@commands.bot_has_permissions(embed_links=True)
@evolution.command(aliases=["by"])
async def backyard(self, ctx, use_menu: bool = False):
"""Where ya animals live! Pass 1 or true to put it in a menu."""
Expand Down
2 changes: 1 addition & 1 deletion evolution/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"short" : "Buy and get animals to get more economy credits!",
"description" : "Buy animals using economy credits or get them every 10 minutes, and gain a certain amount of credits every minute!",
"tags" : ["fun"],
"requirements" : [],
"requirements" : ["tabulate"],
"hidden" : false
}
4 changes: 2 additions & 2 deletions grammar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
)


def setup(bot):
bot.add_cog(Grammar(bot))
async def setup(bot):
await bot.add_cog(Grammar(bot))
10 changes: 10 additions & 0 deletions grammar/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"author" : ["Neuro Assassin"],
"install_msg" : "Thank you for downloading this cog.",
"name" : "grammer",
"short" : "Get words related to the specified arguments",
"description" : "Get words related to the specified arguments",
"tags" : [],
"requirements" : [],
"hidden" : false
}
4 changes: 2 additions & 2 deletions listpermissions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
)


def setup(bot):
bot.add_cog(ListPermissions(bot))
async def setup(bot):
await bot.add_cog(ListPermissions(bot))
2 changes: 1 addition & 1 deletion maintenance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

async def setup(bot):
cog = Maintenance(bot)
bot.add_cog(cog)
await bot.add_cog(cog)
4 changes: 2 additions & 2 deletions maintenance/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from typing import Literal

import discord
from redbot.core import Config, checks, commands
from redbot.core import Config, commands

from .converters import Margs

Expand Down Expand Up @@ -131,7 +131,7 @@ async def this_check(self, ctx):
raise LIStsSTaRtaTiNDeX1(message)
return False

@checks.is_owner()
@commands.is_owner()
@commands.group()
async def maintenance(self, ctx):
"""Control the bot's maintenance."""
Expand Down
4 changes: 2 additions & 2 deletions minesweeper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
)


def setup(bot):
bot.add_cog(Minesweeper(bot))
async def setup(bot):
await bot.add_cog(Minesweeper(bot))
4 changes: 2 additions & 2 deletions opensea/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .opensea import OpenSea


def setup(bot):
bot.add_cog(OpenSea(bot))
async def setup(bot):
await bot.add_cog(OpenSea(bot))
Loading