1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00

Merge branch 'master' into metrics

This commit is contained in:
io 2021-07-11 03:03:50 +00:00
commit cce4a23c35
13 changed files with 25 additions and 143 deletions

16
bot.py
View file

@ -1,19 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import base64 import base64
import logging import logging

View file

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import asyncio import asyncio
import cgi import cgi
@ -441,7 +429,8 @@ class Emotes(commands.Cog):
return await validate(self.http.get(url)) return await validate(self.http.get(url))
async def create_emote_from_bytes(self, context, name, image_data: bytes, *, reason=None): async def create_emote_from_bytes(self, context, name, image_data: bytes, *, reason=None):
image_data = await utils.image.resize_in_subprocess(image_data) if len(image_data) > 256 * 1024:
image_data = await utils.image.resize_in_subprocess(image_data)
if reason is None: if reason is None:
reason = 'Created by ' + utils.format_user(context.author) reason = 'Created by ' + utils.format_user(context.author)
return await self.emote_client.create(guild=context.guild, name=name, image=image_data, reason=reason) return await self.emote_client.create(guild=context.guild, name=name, image=image_data, reason=reason)

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import contextlib import contextlib

View file

@ -1,4 +1,4 @@
© 20182020 lambda#0987 © lambda#0987 <lambda@lambda.dance>
Emote Manager is free software: you can redistribute it and/or modify Emote Manager is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python3 # © lambda#0987 <lambda@lambda.dance>
# SPDX-License-Identifier: AGPL-3.0-or-later
from .misc import * from .misc import *
from . import archive from . import archive

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import asyncio import asyncio
import collections import collections

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import functools import functools
from discord.ext.commands import BadArgument from discord.ext.commands import BadArgument

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import re import re

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import utils import utils
import asyncio import asyncio

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import asyncio import asyncio
import base64 import base64

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
"""various utilities for use within the bot""" """various utilities for use within the bot"""

View file

@ -1,17 +1,5 @@
# © 20182020 io mintz <io@mintz.cc> # © lambda#0987 <lambda@lambda.dance>
# # SPDX-License-Identifier: AGPL-3.0-or-later
# Emote Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Emote Manager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Emote Manager. If not, see <https://www.gnu.org/licenses/>.
import asyncio import asyncio
import contextlib import contextlib