Compare commits
No commits in common. "7a0022cb595b2b13d1c04ceab0442c37a308e51a" and "c1a80f5497c2b865a78c7a1fe4e323cb6eb9e343" have entirely different histories.
7a0022cb59
...
c1a80f5497
@ -1,8 +0,0 @@
|
|||||||
.git
|
|
||||||
__pycache__/
|
|
||||||
*.pyc
|
|
||||||
.env
|
|
||||||
settings.conf
|
|
||||||
data.json
|
|
||||||
data.json.bak
|
|
||||||
example/
|
|
@ -30,10 +30,6 @@ class DataManager:
|
|||||||
'user_cards': [],
|
'user_cards': [],
|
||||||
'pirates_list_posts': [],
|
'pirates_list_posts': [],
|
||||||
'spicepay_prefs': [],
|
'spicepay_prefs': [],
|
||||||
'nick_verified': [],
|
|
||||||
'nick_claim_pending': [],
|
|
||||||
'nick_reviews': [],
|
|
||||||
'rr_msg_channels': [],
|
|
||||||
}
|
}
|
||||||
self._save(default)
|
self._save(default)
|
||||||
return default
|
return default
|
||||||
|
@ -15,7 +15,7 @@ services:
|
|||||||
# Persist your JSON data here
|
# Persist your JSON data here
|
||||||
- shaiwatcher-data:/app/data
|
- shaiwatcher-data:/app/data
|
||||||
# Bind your server-side settings.conf into the container
|
# Bind your server-side settings.conf into the container
|
||||||
- /opt/shaiwatcher/settings.conf:/app/settings.conf:ro
|
- /opt/shaiwatcher/settings.conf:/app/settings.conf
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
shaiwatcher-data:
|
shaiwatcher-data:
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
# Accept/approve emoji set used across the bot.
|
|
||||||
# Works for both unicode and custom server emoji.
|
|
||||||
|
|
||||||
# Unicode emoji that should count as "accept"
|
|
||||||
ACCEPT_UNICODE = {"✅", "🫡", "❤️"}
|
|
||||||
|
|
||||||
# Custom emoji short names that should count as "accept"
|
|
||||||
# Add names (not the <:name:id> literal) for any server emoji you want.
|
|
||||||
ACCEPT_CUSTOM_NAMES = {"diverOK"}
|
|
||||||
|
|
||||||
def is_accept(emoji) -> bool:
|
|
||||||
"""
|
|
||||||
Return True if the given emoji should count as an 'accept' reaction.
|
|
||||||
Compatible with Reaction.emoji and RawReactionActionEvent.emoji.
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
# unicode path
|
|
||||||
if str(emoji) in ACCEPT_UNICODE:
|
|
||||||
return True
|
|
||||||
# custom emoji path (has a .name)
|
|
||||||
name = getattr(emoji, "name", None)
|
|
||||||
return name in ACCEPT_CUSTOM_NAMES
|
|
||||||
except Exception:
|
|
||||||
return False
|
|
@ -6,7 +6,6 @@ from discord.ext import commands
|
|||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
from mod_perms import is_moderator_userid
|
from mod_perms import is_moderator_userid
|
||||||
from modules.common.emoji_accept import is_accept
|
|
||||||
|
|
||||||
CHECK = '✅' # approved/verified
|
CHECK = '✅' # approved/verified
|
||||||
CROSS = '❌' # reject / no
|
CROSS = '❌' # reject / no
|
||||||
@ -173,7 +172,7 @@ class NickNudgeCog(commands.Cog):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
|
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
|
||||||
# 1) Handle DM nudge confirmations (user reacts ✅ in DM)
|
# 1) Handle DM nudge confirmations (user reacts ✅ in DM)
|
||||||
if payload.guild_id is None and is_accept(payload.emoji) and payload.user_id != self.bot.user.id:
|
if payload.guild_id is None and str(payload.emoji) in ACCEPT and payload.user_id != self.bot.user.id:
|
||||||
entry = next((m for m in self.bot.data_manager.get('nick_dm_map') if m['message_id'] == payload.message_id), None)
|
entry = next((m for m in self.bot.data_manager.get('nick_dm_map') if m['message_id'] == payload.message_id), None)
|
||||||
if not entry:
|
if not entry:
|
||||||
return
|
return
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from modules.common.emoji_accept import is_accept
|
|
||||||
|
|
||||||
CHECKMARK = '✅'
|
CHECKMARK = '✅'
|
||||||
ACCEPT = {CHECKMARK, '🫡'}
|
ACCEPT = {CHECKMARK, '🫡'}
|
||||||
@ -111,7 +110,7 @@ class ReactionRoleCog(commands.Cog):
|
|||||||
# ---- listeners ----
|
# ---- listeners ----
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
|
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
|
||||||
if not payload.guild_id or not is_accept(payload.emoji):
|
if str(payload.emoji) not in ACCEPT or not payload.guild_id:
|
||||||
return
|
return
|
||||||
guild = self.bot.get_guild(payload.guild_id)
|
guild = self.bot.get_guild(payload.guild_id)
|
||||||
member = await self._get_member(guild, payload.user_id)
|
member = await self._get_member(guild, payload.user_id)
|
||||||
@ -158,7 +157,7 @@ class ReactionRoleCog(commands.Cog):
|
|||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_raw_reaction_remove(self, payload: discord.RawReactionActionEvent):
|
async def on_raw_reaction_remove(self, payload: discord.RawReactionActionEvent):
|
||||||
if not payload.guild_id or not is_accept(payload.emoji):
|
if str(payload.emoji) not in ACCEPT or not payload.guild_id:
|
||||||
return
|
return
|
||||||
guild = self.bot.get_guild(payload.guild_id)
|
guild = self.bot.get_guild(payload.guild_id)
|
||||||
member = await self._get_member(guild, payload.user_id)
|
member = await self._get_member(guild, payload.user_id)
|
||||||
|
@ -3,7 +3,6 @@ import time
|
|||||||
from typing import Optional, Set, Tuple
|
from typing import Optional, Set, Tuple
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from modules.common.emoji_accept import is_accept
|
|
||||||
|
|
||||||
CHECK = '✅' # verified
|
CHECK = '✅' # verified
|
||||||
CROSS = '❌' # not done
|
CROSS = '❌' # not done
|
||||||
@ -271,7 +270,7 @@ class UserCardsCog(commands.Cog):
|
|||||||
if not message:
|
if not message:
|
||||||
return ids
|
return ids
|
||||||
for rxn in message.reactions:
|
for rxn in message.reactions:
|
||||||
if is_accept(rxn.emoji):
|
if str(rxn.emoji) in ACCEPT: # <-- was == CHECK
|
||||||
async for u in rxn.users(limit=None):
|
async for u in rxn.users(limit=None):
|
||||||
if not u.bot:
|
if not u.bot:
|
||||||
ids.add(u.id)
|
ids.add(u.id)
|
||||||
|
Loading…
Reference in New Issue
Block a user