Reduced & updated dependencies.
By default, messages larger than 2.000 characters (sent via tells) get sent via slaves, if these exist. Fixes #3
This commit is contained in:
@@ -36,8 +36,7 @@ class AccountController:
|
||||
@command(command="account", params=[], access_level="member",
|
||||
description="View your account")
|
||||
def account(self, request: command_request):
|
||||
out = self.show_account(request.sender.char_id)
|
||||
self.bot.send_mass_message(request.sender.char_id, out)
|
||||
return self.show_account(request.sender.char_id)
|
||||
|
||||
@command(command="accounts", params=[Const('online', is_optional=True)], access_level="moderator",
|
||||
description="View all accounts")
|
||||
@@ -238,6 +237,10 @@ class AccountController:
|
||||
if not mod:
|
||||
response += f" Options: {prefs}\n"
|
||||
response += f" Points: <notice>{alts[0].points}</notice>\n"
|
||||
last_seen = {}
|
||||
for x in alts:
|
||||
if x.last_seen > last_seen.get("last_seen", 0):
|
||||
last_seen = x
|
||||
access_levels = {f"Member ({alts[0].member})": self.account_service.check_member(alts[0].char_id),
|
||||
"Officer": self.account_service.check_officer(alts[0].char_id),
|
||||
"General": self.account_service.check_general(alts[0].char_id),
|
||||
@@ -252,12 +255,13 @@ class AccountController:
|
||||
perms.append(key)
|
||||
response += f" Status: {'<green>Open</green>' if alts[0].disabled == 0 else '<red>Closed</red>'}\n"
|
||||
response += f" Created at: <notice>{self.util.format_datetime(alts[0].created)}</notice>\n"
|
||||
response += f" Last seen on <notice>{last_seen.name}</notice> <highlight>{self.util.time_to_readable(time.time()-last_seen.last_seen)}</highlight> ago\n"
|
||||
response += f" Permissions: <notice>{', '.join(perms)}</notice>\n"
|
||||
if alts[0].discord_joined == 1:
|
||||
joined = '(Joined server)'
|
||||
joined = ' (Joined server)'
|
||||
else:
|
||||
joined = '(Left server)' if alts[0].discord_invite != '' else 'Never joined'
|
||||
response += f" Discord: <notice>{alts[0].discord_handle}</notice> {joined}\n\n"
|
||||
joined = ' (Left server)' if alts[0].discord_invite != '' else 'Never joined'
|
||||
response += f" Discord: <notice>{alts[0].discord_handle}</notice>{joined}\n\n"
|
||||
log_types = ['Points', 'Loot', 'Raid', 'Public', 'Admin', 'System']
|
||||
response += " Logs: ["
|
||||
for i in log_types:
|
||||
|
||||
@@ -580,6 +580,8 @@ class DiscordController:
|
||||
async def on_message(self, msg: Message):
|
||||
if msg.author.id == self.client.user.id:
|
||||
return
|
||||
if not self.setting_service.get_value("dc_relay_public"):
|
||||
return
|
||||
channel: TextChannel = msg.channel
|
||||
if channel.id == int(self.setting_service.get_value("dc_relay_public")):
|
||||
if self.setting_service.get_value('is_alliance_bot') == "0":
|
||||
|
||||
@@ -141,10 +141,7 @@ class PrivateChannelController:
|
||||
if len(banned) > 0:
|
||||
out += f'The Character <highlight>{", ".join(banned)}</highlight> is <red>banned</red>, ' \
|
||||
f'and cannot be invited.'
|
||||
if request.channel == "priv":
|
||||
return out.strip("\n")
|
||||
else:
|
||||
self.bot.send_mass_message(request.sender.char_id, out.strip("\n"))
|
||||
return out.strip("\n")
|
||||
|
||||
@command(command="kick", params=[Character("character")], access_level="moderator",
|
||||
description="Kick a character from the private channel")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import math
|
||||
|
||||
from core.buddy_service import BuddyService
|
||||
@@ -165,7 +166,7 @@ class RIAdminController:
|
||||
description="take the RI from another bot")
|
||||
def ritake(self, request, raiders: str):
|
||||
users = raiders.split(",")
|
||||
if request.sender.char_id not in eval(self.setting_service.get_value('riadmin_network')):
|
||||
if request.sender.char_id not in json.loads(self.setting_service.get_value('riadmin_network')):
|
||||
return
|
||||
for user in users:
|
||||
char = self.character_service.resolve_char_to_id(user.strip())
|
||||
@@ -277,7 +278,7 @@ class RIAdminController:
|
||||
def riadmin_create(self, _, _2, raid_instance_name, bot):
|
||||
if not bot.char_id:
|
||||
return self.getresp("global", "char_not_found", {"char": bot.name})
|
||||
if bot.char_id not in eval(self.setting_service.get_value('riadmin_network')):
|
||||
if bot.char_id not in json.loads(self.setting_service.get_value('riadmin_network')):
|
||||
return "Bot not valid: please ask an Administrator to verify it first."
|
||||
raid_instance = self.get_raid_instance(raid_instance_name)
|
||||
if raid_instance:
|
||||
|
||||
Reference in New Issue
Block a user