Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(discord): address review feedback

yh c1734547ff81c
diff --git a/modules/im/discord.py b/modules/im/discord.py
index b6b3608f1..4ced66ac8 100644
--- a/modules/im/discord.py
+++ b/modules/im/discord.py
@@ -36,8 +36,8 @@ class DiscordBot(BaseIMClient):
self._controller = None
self._on_ready: Optional[Callable] = None
- self.client.event(self._on_ready_event)
- self.client.event(self._on_message_event)
+ self.client.on_ready = self._on_ready_event
+ self.client.on_message = self._on_message_event
def set_settings_manager(self, settings_manager):
self.settings_manager = settings_manager
@@ -128,6 +128,15 @@ class DiscordBot(BaseIMClient):
def _clean_message_text(self, text: str) -> str:
return (text or "").strip()
+ def _is_allowed_guild(self, guild_id: Optional[str]) -> bool:
+ allow = set(self.config.guild_allowlist or [])
+ deny = set(self.config.guild_denylist or [])
+ if guild_id and guild_id in deny:
+ return False
+ if allow and (not guild_id or guild_id not in allow):
+ return False
+ return True
+
async def send_message(
self,
context: MessageContext,
@@ -360,6 +369,9 @@ class DiscordBot(BaseIMClient):
channel = message.channel
channel_id, thread_id = self._extract_context_ids(channel)
+ if message.guild and not self._is_allowed_guild(str(message.guild.id)):
+ return
+
# File attachments
files = None
if message.attachments:
diff --git a/ui/src/components/steps/DiscordConfig.tsx b/ui/src/components/steps/DiscordConfig.tsx
index 114f2176a..9c2034693 100644
--- a/ui/src/components/steps/DiscordConfig.tsx
+++ b/ui/src/components/steps/DiscordConfig.tsx
@@ -19,6 +19,10 @@ export const DiscordConfig: React.FC<DiscordConfigProps> = ({ data, onNext, onBa
const [guilds, setGuilds] = useState<any[]>([]);
const [selectedGuild, setSelectedGuild] = useState<string>(data.discord?.guild_allowlist?.[0] || '');
+ useEffect(() => {
+ setAuthResult(null);
+ }, [botToken]);
+
const isValid = useMemo(() => botToken.length > 0 && authResult?.ok, [botToken, authResult]);
const runAuthTest = async () => {