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

[adminutils] membersteal #47

Open
wants to merge 36 commits into
base: V3
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
66a0ddf
membersteal
Sep 8, 2020
566f990
Update adminutils/adminutils.py
phenom4n4n Sep 11, 2020
84e65f1
Update adminutils/adminutils.py
phenom4n4n Sep 11, 2020
35f2854
Update adminutils/adminutils.py
phenom4n4n Sep 11, 2020
41ca0e3
Update adminutils/adminutils.py
phenom4n4n Sep 11, 2020
671921a
steal
Sep 12, 2020
14becd7
Merge branch 'emoji_steal' of https://github.com/phenom4n4n/Fixator10…
Sep 12, 2020
d42a9c7
emoji stealin'
Sep 12, 2020
8927d33
newline
Sep 12, 2020
5c0d490
oops
Sep 12, 2020
a1fde58
Update adminutils/adminutils.py
phenom4n4n Sep 12, 2020
f75250b
Update adminutils/adminutils.py
phenom4n4n Sep 12, 2020
966b89f
emoji import
Sep 12, 2020
670dd32
Merge branch 'V3' into emoji_steal
fixator10 Sep 12, 2020
cc2e0da
updates
Sep 13, 2020
2bcd500
Merge branch 'emoji_steal' of https://github.com/phenom4n4n/Fixator10…
Sep 13, 2020
54e2e98
try except else
Sep 13, 2020
e5997ce
Merge branch 'V3' into emoji_steal
fixator10 Sep 13, 2020
65a9b34
black
Sep 13, 2020
b2415bb
Merge branch 'emoji_steal' of https://github.com/phenom4n4n/Fixator10…
Sep 13, 2020
e1afcd5
Merge branch 'V3' into emoji_steal
fixator10 Sep 16, 2020
df83bc1
Merge branch 'V3' into emoji_steal
fixator10 Sep 16, 2020
2906731
Merge branch 'V3' into emoji_steal
fixator10 Sep 17, 2020
0f389df
name
Sep 20, 2020
fc5080e
Merge branch 'V3' into emoji_steal
fixator10 Oct 10, 2020
6968133
Merge branch 'V3' into emoji_steal
fixator10 Oct 10, 2020
ef8774f
Update adminutils/adminutils.py
phenom4n4n Oct 10, 2020
390fb4c
roles message
Oct 10, 2020
8069ffa
Merge branch 'emoji_steal' of https://github.com/phenom4n4n/Fixator10…
Oct 10, 2020
9d7f6ad
.
Oct 10, 2020
e5c136f
add support of original emoji name on import from message
fixator10 Oct 10, 2020
c2763e6
Update adminutils/adminutils.py
phenom4n4n Oct 10, 2020
9f07078
Update adminutils/adminutils.py
phenom4n4n Oct 10, 2020
fe2b411
Update adminutils/adminutils.py
phenom4n4n Oct 10, 2020
f0eeb16
Merge branch 'V3' into emoji_steal
fixator10 Nov 7, 2020
88bcd45
Merge branch 'V3' into emoji_steal
fixator10 Dec 23, 2020
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
47 changes: 46 additions & 1 deletion adminutils/adminutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async def emoji_add(self, ctx, name: str, url: str, *roles: discord.Role):
await ctx.tick()

@emoji.command(name="message", aliases=["steal"])
fixator10 marked this conversation as resolved.
Show resolved Hide resolved
async def emote_steal(self, ctx, name: str, message_id: discord.Message, *roles: discord.Role):
async def message_steal(self, ctx, name: str, message_id: discord.Message, *roles: discord.Role):
phenom4n4n marked this conversation as resolved.
Show resolved Hide resolved
"""
Add an emoji from a specified message
Use double quotes if role name has spaces
Expand Down Expand Up @@ -234,6 +234,51 @@ async def emote_steal(self, ctx, name: str, message_id: discord.Message, *roles:
except discord.HTTPException as e:
await ctx.send(chat.error(_("An error occurred on adding an emoji: {}").format(e)))

@emoji.command(name="member", aliases=["user"])
async def member_steal(self, ctx, name: str, member: discord.Member, *roles: discord.Role):
phenom4n4n marked this conversation as resolved.
Show resolved Hide resolved
"""
Add an emoji from a specified member's status
Use double quotes if role name has spaces

Examples:
`[p]emoji member Example @PhenoM4n4n`
`[p]emoji message RoleBased 462364255128256513 EmojiRole`
phenom4n4n marked this conversation as resolved.
Show resolved Hide resolved
"""
emoji = None
if member.activity:
if member.activity.emoji:
if member.activity.emoji.is_custom_emoji():
phenom4n4n marked this conversation as resolved.
Show resolved Hide resolved
emoji = member.activity.emoji
if not emoji:
await ctx.send(chat.error(_("This user does not have a custom emoji in their status.")))
return
async with self.session.get(str(emoji.url)) as r:
data = await r.read()
try:
await ctx.guild.create_custom_emoji(
name=name,
image=data,
roles=roles,
reason=get_audit_reason(
ctx.author,
_("Restricted to roles: {}").format(
", ".join([f"{role.name}" for role in roles])
)
if roles
else None,
),
)
await ctx.tick()
except discord.InvalidArgument:
await ctx.send(
_(
"This image type is not supported anymore or Discord returned incorrect data. Try again later."
)
)
return
except discord.HTTPException as e:
await ctx.send(chat.error(_("An error occurred on adding an emoji: {}").format(e)))

@emoji.command(name="rename")
async def emoji_rename(self, ctx, emoji: discord.Emoji, name: str, *roles: discord.Role):
"""Rename emoji and restrict to certain roles
Expand Down