
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
aifordiscord-translator
Advanced tools
A Discord bot package for real-time message translation using Google Translate
npm install aifordiscord-translator
# or
yarn add aifordiscord-translator
// ES Modules
import AITranslator from 'aifordiscord-translator';
import { TranslatorConfig } from 'aifordiscord-translator/types';
// CommonJS
// const { default: AITranslator, TranslatorConfig } = require('aifordiscord-translator');
const config: TranslatorConfig = {
provider: 'google', // 'google' | 'deepl'
apiKey: process.env.TRANSLATE_API_KEY,
databaseUrl: process.env.MONGODB_URI,
options: {
defaultLanguage: 'en',
cacheTtl: 3600, // 1 hour cache
rateLimit: 100 // 100 req/minute
}
};
const translator = new AITranslator(config);
translator.start(process.env.DISCORD_TOKEN);
interface TranslatorConfig {
// Required
provider: 'google' | 'deepl';
apiKey: string;
databaseUrl: string;
// Optional
options?: {
defaultLanguage?: string; // Default: 'en'
cacheTtl?: number; // Cache duration in seconds
rateLimit?: number; // Requests per minute
autoDetect?: boolean; // Auto-detect language
dmSupport?: boolean; // Enable DM translations
hybridMode?: boolean; // Fallback to secondary provider
};
// Advanced
redisUrl?: string; // For distributed caching
sentryDsn?: string; // Error tracking
logLevel?: 'debug' | 'info' | 'warn' | 'error';
}
/*
const SUPPORTED_LANGUAGES = { 'en': 'English', 'es': 'Spanish', 'fr': 'French', 'de': 'German', 'it': 'Italian', 'pt': 'Portuguese', 'ru': 'Russian', 'ja': 'Japanese', 'zh': 'Chinese', 'ar': 'Arabic', // ... 100+ languages supported };
// 1. Hybrid Mode (Fallback Providers)
const hybridConfig: TranslatorConfig = {
provider: 'google',
secondaryProvider: 'deepl', // Fallback if primary fails
// ...
};
// 2. Redis Caching
const redisConfig: TranslatorConfig = {
// ...
redisUrl: 'redis://localhost:6379'
};
// 3. Error Tracking
const monitoredConfig: TranslatorConfig = {
// ...
sentryDsn: 'your_sentry_dsn'
};
┌──────────────┬───────────┬────────────┐
│ Provider │ Avg Speed │ Success % │
├──────────────┼───────────┼────────────┤
│ Google │ 142ms │ 99.8% │
│ DeepL │ 189ms │ 99.5% │
│ Hybrid │ 156ms │ 99.9% │
└──────────────┴───────────┴────────────┘
git clone https://github.com/aifordiscord/aifordiscord-translator.git cd aifordiscord-translator npm install
cp .env.example .env
npm run dev # Development mode npm start # Production
/*
MIT © 2023 aifordiscord
FAQs
A Discord bot package for real-time message translation using Google Translate
We found that aifordiscord-translator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.