mirror of
https://github.com/uhIgnacio/EmoteManager.git
synced 2024-08-15 02:23:13 +00:00
s/emoji/emotes/
This commit is contained in:
parent
3b488ab787
commit
b2bab91d36
2 changed files with 11 additions and 11 deletions
|
@ -23,7 +23,7 @@ from discord.ext import commands
|
||||||
import utils
|
import utils
|
||||||
from utils import errors
|
from utils import errors
|
||||||
|
|
||||||
class Emoji:
|
class Emotes:
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.http = aiohttp.ClientSession(loop=self.bot.loop, read_timeout=30, headers={
|
self.http = aiohttp.ClientSession(loop=self.bot.loop, read_timeout=30, headers={
|
||||||
|
@ -209,4 +209,4 @@ class Emoji:
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(Emoji(bot))
|
bot.add_cog(Emotes(bot))
|
||||||
|
|
|
@ -4,37 +4,37 @@
|
||||||
from discord.ext.commands import CommandError
|
from discord.ext.commands import CommandError
|
||||||
|
|
||||||
|
|
||||||
class EmojiManagerError(CommandError):
|
class EmoteManagerError(CommandError):
|
||||||
"""Generic error with the bot. This can be used to catch all bot errors."""
|
"""Generic error with the bot. This can be used to catch all bot errors."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class HTTPException(EmojiManagerError):
|
class HTTPException(EmoteManagerError):
|
||||||
"""The server did not respond with an OK status code."""
|
"""The server did not respond with an OK status code."""
|
||||||
def __init__(self, status):
|
def __init__(self, status):
|
||||||
super().__init__(f'URL error: server returned error code {status}')
|
super().__init__(f'URL error: server returned error code {status}')
|
||||||
|
|
||||||
|
|
||||||
class EmojiNotFoundError(EmojiManagerError):
|
class EmoteNotFoundError(EmoteManagerError):
|
||||||
"""An emoji with that name was not found"""
|
"""An emote with that name was not found"""
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
super().__init__(f'An emoji called `{name}` does not exist in this server.')
|
super().__init__(f'An emote called `{name}` does not exist in this server.')
|
||||||
|
|
||||||
|
|
||||||
class InvalidImageError(EmojiManagerError):
|
class InvalidImageError(EmoteManagerError):
|
||||||
"""The image is not a GIF, PNG, or JPG"""
|
"""The image is not a GIF, PNG, or JPG"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__('The image supplied was not a GIF, PNG, or JPG.')
|
super().__init__('The image supplied was not a GIF, PNG, or JPG.')
|
||||||
|
|
||||||
|
|
||||||
class NoMoreSlotsError(EmojiManagerError):
|
class NoMoreSlotsError(EmoteManagerError):
|
||||||
"""Raised in case all slots of a particular type (static/animated) are full"""
|
"""Raised in case all slots of a particular type (static/animated) are full"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__('No more backend slots available.')
|
super().__init__('No more backend slots available.')
|
||||||
|
|
||||||
|
|
||||||
class PermissionDeniedError(EmojiManagerError):
|
class PermissionDeniedError(EmoteManagerError):
|
||||||
"""Raised when a user tries to modify an emoji without the Manage Emojis permission"""
|
"""Raised when a user tries to modify an emote without the Manage Emojis permission"""
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
super().__init__(f"You're not authorized to modify `{name}`.")
|
super().__init__(f"You're not authorized to modify `{name}`.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue