Cleanup part 2 and Beta 20 requirements
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
from discord.ext import commands
|
||||
from .away import Away
|
||||
|
||||
|
||||
def setup(bot: commands.Bot):
|
||||
n = Away(bot)
|
||||
bot.add_cog(n)
|
||||
def setup(bot):
|
||||
bot.add_cog(Away(bot))
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
from redbot.core import Config
|
||||
from redbot.core.bot import Red
|
||||
from redbot.core import Config, commands, checks
|
||||
|
||||
|
||||
class Away:
|
||||
@@ -11,7 +8,7 @@ class Away:
|
||||
default_global_settings = {"ign_servers": []}
|
||||
default_user_settings = {"MESSAGE": False}
|
||||
|
||||
def __init__(self, bot: Red):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self._away = Config.get_conf(self, 8423491260, force_registration=True)
|
||||
|
||||
@@ -78,7 +75,7 @@ class Away:
|
||||
await ctx.send(msg)
|
||||
|
||||
@commands.command(name="toggleaway")
|
||||
@commands.has_permissions(administrator=True)
|
||||
@checks.admin_or_permissions(administrator=True)
|
||||
async def _ignore(self, ctx):
|
||||
"""Toggle away messages on the whole server."""
|
||||
guild = ctx.message.guild
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from .blurplefy import Blurplefy
|
||||
from discord.ext import commands
|
||||
|
||||
|
||||
def setup(bot: commands.Bot):
|
||||
def setup(bot):
|
||||
bot.add_cog(Blurplefy(bot))
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
# pip install pillow
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands.cooldowns import BucketType
|
||||
from PIL import Image, ImageEnhance, ImageSequence
|
||||
from io import BytesIO
|
||||
import aiohttp
|
||||
@@ -14,7 +12,7 @@ import datetime
|
||||
import io
|
||||
import math
|
||||
from resizeimage import resizeimage
|
||||
from redbot.core import Config, checks
|
||||
from redbot.core import Config, commands, checks
|
||||
|
||||
blurple = (114, 137, 218)
|
||||
blurplehex = 0x7289da
|
||||
@@ -24,6 +22,7 @@ white = (255, 255, 255)
|
||||
|
||||
class Blurplefy:
|
||||
def __init__(self, bot):
|
||||
"""Blurplefy images and check content of images."""
|
||||
self.bot = bot
|
||||
self.config = Config.get_conf(self, 2778931480, force_registration=True)
|
||||
|
||||
@@ -100,7 +99,7 @@ class Blurplefy:
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.command()
|
||||
@commands.cooldown(rate=1, per=30, type=BucketType.user)
|
||||
@commands.cooldown(rate=1, per=30, type=commands.BucketType.user)
|
||||
async def blurple(self, ctx, user: discord.Member = None):
|
||||
"""Check a user or uploaded image for blurple content."""
|
||||
picture = None
|
||||
@@ -209,7 +208,7 @@ class Blurplefy:
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.command()
|
||||
@commands.cooldown(rate=1, per=30, type=BucketType.user)
|
||||
@commands.cooldown(rate=1, per=30, type=commands.BucketType.user)
|
||||
async def blurplefy(self, ctx, user: discord.Member = None):
|
||||
"""Blurplefy a user or uploaded image."""
|
||||
picture = None
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from discord.ext import commands
|
||||
from .chatchart import Chatchart
|
||||
|
||||
|
||||
def setup(bot: commands.Bot):
|
||||
n = Chatchart(bot)
|
||||
bot.add_cog(n)
|
||||
def setup(bot):
|
||||
bot.add_cog(Chatchart(bot))
|
||||
|
||||
@@ -13,7 +13,7 @@ matplotlib.use("agg")
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
plt.switch_backend("agg")
|
||||
from discord.ext import commands
|
||||
from redbot.core import commands
|
||||
|
||||
|
||||
class Chatchart:
|
||||
|
||||
@@ -379,7 +379,7 @@ class Dungeon:
|
||||
except discord.Forbidden:
|
||||
if announce_channel:
|
||||
return await channel_object.send(
|
||||
f"I couldn't DM {user} to let them know they've been banned, they've blocked me."
|
||||
f"I couldn't DM {member} ({member.id}) to let them know they've been banned, they've blocked me."
|
||||
)
|
||||
else:
|
||||
print(perm_msg)
|
||||
@@ -391,7 +391,7 @@ class Dungeon:
|
||||
except discord.Forbidden:
|
||||
if announce_channel:
|
||||
return await channel_object.send(
|
||||
"I tried to auto-ban someone ({member}, {member.id}) but I don't have ban permissions."
|
||||
f"I tried to auto-ban someone ({member}, {member.id}) but I don't have ban permissions."
|
||||
)
|
||||
else:
|
||||
print(perm_msg)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"manage_channels",
|
||||
"manage_roles"
|
||||
],
|
||||
"short": "",
|
||||
"short": "Specialized raid protection.",
|
||||
"tags": [
|
||||
"dungeon",
|
||||
"autoban"
|
||||
|
||||
@@ -4,6 +4,7 @@ from redbot.core import commands
|
||||
|
||||
|
||||
class Inspirobot:
|
||||
"""Posts images generated by https://inspirobot.me"""
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.session = aiohttp.ClientSession()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from discord.ext import commands
|
||||
from .partycrash import PartyCrash
|
||||
|
||||
|
||||
def setup(bot: commands.Bot):
|
||||
def setup(bot):
|
||||
bot.add_cog(PartyCrash(bot))
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from discord.ext import commands
|
||||
from redbot.core import commands
|
||||
|
||||
|
||||
class Pingtime:
|
||||
"""🏓"""
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from discord.ext import commands
|
||||
from .retrosign import Retrosign
|
||||
|
||||
|
||||
def setup(bot: commands.Bot):
|
||||
n = Retrosign(bot)
|
||||
bot.add_cog(n)
|
||||
def setup(bot):
|
||||
bot.add_cog(Retrosign(bot))
|
||||
|
||||
@@ -12,6 +12,7 @@ import re
|
||||
|
||||
|
||||
class Retrosign:
|
||||
"""Make an 80s retro sign. Originally by Anismash"""
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.session = aiohttp.ClientSession()
|
||||
|
||||
@@ -35,6 +35,7 @@ class RndStatus:
|
||||
@commands.guild_only()
|
||||
@checks.is_owner()
|
||||
async def rndstatus(self, ctx):
|
||||
"""Rndstatus group commands."""
|
||||
pass
|
||||
|
||||
@rndstatus.command(name="set")
|
||||
@@ -63,7 +64,7 @@ class RndStatus:
|
||||
if not botstats == False:
|
||||
await self.bot.change_presence(activity=None)
|
||||
|
||||
@rndstatus.command(pass_context=True)
|
||||
@rndstatus.command()
|
||||
async def delay(self, ctx, seconds: int):
|
||||
"""Sets interval of random status switch.
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from discord.ext import commands
|
||||
from .seen import Seen
|
||||
|
||||
|
||||
def setup(bot: commands.Bot):
|
||||
n = Seen(bot)
|
||||
bot.add_cog(n)
|
||||
def setup(bot):
|
||||
bot.add_cog(Seen(bot))
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import asyncio
|
||||
import discord
|
||||
import time
|
||||
from discord.ext import commands
|
||||
from datetime import datetime
|
||||
from redbot.core import Config
|
||||
|
||||
from redbot.core import Config, commands
|
||||
|
||||
class Seen:
|
||||
"""Shows last time a user was seen in chat"""
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.config = Config.get_conf(self, 2784481001, force_registration=True)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from discord.ext import commands
|
||||
from .wolfram import Wolfram
|
||||
|
||||
|
||||
def setup(bot: commands.Bot):
|
||||
n = Wolfram(bot)
|
||||
bot.add_cog(n)
|
||||
def setup(bot):
|
||||
bot.add_cog(Wolfram(bot))
|
||||
|
||||
Reference in New Issue
Block a user