async def setup(self, ctx): add_guild(ctx.guild.id) prefix = get_prefix(self, ctx.message) log_channel_id, verified_role_id, captcha_level, security_activated = check_guild_setup( ctx.guild.id) log_emoji = "✅ " if log_channel_id is not None else "❌ " verified_emoji = "✅ " if verified_role_id is not None else "❌ " captcha_emoji = "✅ " if captcha_level is not None else "❌ " activated_emoji = "✅ " if security_activated is not None else "❌ " embed = discord.Embed( title="Sharbull Security Botへようこそ!", description="Sharbullの初期セットアップではいくつかの手順を実行する必要があります。\n\n" + "**1.** " + log_emoji + "`" + prefix + "set_log_channel` ログを投稿するテキストチャネルでこのコマンドを実行してください。\n\n" + "**2.** " + verified_emoji + "`" + prefix + "set_verified_role @a_role` ユーザーがボットによって承認されたときに付与されるロールを" "@a_role に置き換えて実行してください。\n\n" + "**3.** チャネルのアクセス許可を編集して、確認済みユーザーのみにアクセスを制限します。\n\n" + "**4.** " + captcha_emoji + "``" + prefix + "set_captcha_level <level (1, 2, or 3)>`` キャプチャポリシーを設定するには(詳細については、 ``" + prefix + "help security``\n" + " > Level `1` : キャプチャ認証なし\n" + " > Level `2` : 疑わしいユーザーのみの認証(推奨)\n" + " > Level `3` : すべての人のための認証\n" + "⚠️ 注意 : 認証ができなくなるため、ユーザーはサーバーからのダイレクトメッセージを許可する必要があります。\n\n" + "**5.** " + activated_emoji + "`" + prefix + "activate` でセキュリティを有効にします。") await ctx.send(embed=embed)
async def help(self, ctx, page: str = None): footer = "Sharbull Securityは647によって開発されました" icon_url = "https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678094-shield-512.png" prefix = get_prefix(self, ctx.message) if page == "commands": title = "コマンド一覧" description = \ "".join(("`", prefix, "setup` : 簡易設定メニューを開く\n - 必要な権限 : 管理者\n\n", "`", prefix, "mute <Member>` : メンバーをミュートし、そのアカウントをSharbullデータベースに報告します。\n - 必要な権限 : メンバーをミュート\n\n", "`", prefix, "kick <Member>` : メンバーをキックし、そのアカウントをSharbullデータベースに報告します。\n - 必要な権限 : メンバーをキック\n\n", "`", prefix, "ban <Member>` : メンバーをBANし、Sharbullデータベースにアカウントを報告します。\n - 必要な権限 : メンバーをBAN\n\n", "`", prefix, "alert` : 警戒モードを切り替えます。(スパムを行ったユーザーは警告なしにBANされます)\n - 必要な権限 : メンバーをBAN\n\n", "`", prefix, "report <Member> <reason>` : サーバーとSharbullデータベースにアカウントを報告します。\n - 必要な権限 : なし\n\n", "`", prefix, "flags <Member (optional)>` : ユーザーのフラグを取得します。\n - 必要な権限 : なし\n\n", "`", prefix, "status`` : このサーバーで有効化されている保護機能を確認します。\n - 必要な権限 : なし\n\n", "`", prefix, "set_prefix <prefix>` : このボットに新しいPrefixを設定します\n - 必要な権限 : 管理者\n\n", "Prefixを使用する代わりに、私にタグを付けることもできます")) elif page == "security": title = "セキュリティについて" description = "".join(( "**自動フラグ付け**\nSharbullは、アバター、作成日、バッジ、レポートを確認してセルフボットや偽物である可能性が高いかを自動的に検出します。", "このデータを使用して、信頼スコアが計算され、さらにアクションを実行できます。\n\n", "**画像認証**\n画像認証は広く使用されており、セルフボットに対して効果的であることが認められています。", "そしてSharbullは、保護を3段階で行います。\n", "- Level 1 : ユーザーは、画像認証を完了することなくサーバーに参加できます。\n", "- Level 2 : Sharbullは、ユーザーのフラグを確認することで、疑わしいユーザーの画像認証を有効にするかどうかを判定します。\n", "- Level 3 : 低リスクなユーザーを含むすべての人が画像認証を完了する必要があります。\n\n", "**スパム対策**\n", "ユーザーに自動的にフラグを立てるスパム対策も含まれています。", "ユーザーの信頼に応じてスコアが計算され、それに応じてミュート、キック、またはBANが行われる可能性があります。\n\n", "**警戒モード**\n", "警戒モードを有効にすると、スパムを行ったユーザーは警告なしにBANされます。", "(*Sharbull保護サービスを最初に有効にする必要があります*)", "メンバーがスパムによるBANのしきい値に達すると、警戒モードが自動的に有効になります。", "ボットに無視させたい場合は該当チャンネルで、Sharbullのメッセージを読む権限をブロックします。")) else: title = "Sharbull Security Botへようこそ!" description = "".join(( "**このボットは何ですか?**\nSharbullは、フィルターで除外することを目的とした、数分でデプロイ可能なすぐに使用できるボットです。 ", "偽のアカウントを検出し、画像認証システムを使用してセルフボットアカウントを識別します。", "備え付けのアンチスパムフィルターを備えたこのボットは、チャットに占領すrユーザーのレートリミットも行います。", "Sharbullは、スパマーと乗っ取りに対して厳格なルールに基づいて設計されています。厳しい認証はオプションではなく必須です。\n", "このBotは、あなたのサーバーに参加する前から有害な人を検知するため、共有されたデータベースを使用します。", "サーバーに参加します。\n\n", "**主な特徴** \n", "- 参加したメンバーへの有効・無効を切替可能なCaptcha認証\n", "- すべてのサーバー間で共有される評価システム\n", "- ユーザーの設定にあった動作をするアンチスパム\n", "- セルフボット検出およびフラグシステム\n\n", "**使用法**\n", "サーバー管理者でこのボットを使用したい場合は、 ``", prefix, "setup``コマンドを実行し、初期セットアップを開始して下さい。\n", "`", prefix, "help commands` or `", prefix, "help security` コマンドで他の機能を確認できます。\n", "質問や提案があるならこちらで! `", prefix, "support`コマンドを実行するとサポートサーバーに参加できます。\n\n", "Prefixを使用する代わりに、メンションでも使用できます。")) embed = discord.Embed(title=title, description=description) embed.set_footer(text=footer, icon_url=icon_url) await ctx.send(embed=embed)
async def deactivate(self, ctx): log_channel_id, verified_role_id, captcha_level, security_activated = check_guild_setup(ctx.guild.id) prefix = get_prefix(self, ctx.message) if log_channel_id is None or verified_role_id is None or captcha_level is None: message = "⚠️Please perform the initial steps to setup your protection" embed = discord.Embed(description=message) await ctx.send(embed=embed) else: set_guild_setting(ctx.guild.id, new_security_activated=None) message = "✅ Protection is now disabled, run ``"+prefix+"activate`` to enable" embed = discord.Embed(description=message) await ctx.send(embed=embed)
async def deactivate(self, ctx): log_channel_id, verified_role_id, captcha_level, security_activated = check_guild_setup( ctx.guild.id) prefix = get_prefix(self, ctx.message) if log_channel_id is None or verified_role_id is None or captcha_level is None: message = "⚠️保護を有効にするための初期セットアップを行って下さい。" embed = discord.Embed(description=message) await ctx.send(embed=embed) else: set_guild_setting(ctx.guild.id, new_security_activated=None) message = "✅ 保護が無効になりました。有効にするには`" + prefix + "activate`コマンドを実行してください。" embed = discord.Embed(description=message) await ctx.send(embed=embed)
async def setup(self, ctx): add_guild(ctx.guild.id) prefix = get_prefix(self, ctx.message) log_channel_id, verified_role_id, captcha_level, security_activated = check_guild_setup(ctx.guild.id) log_emoji = "✅ " if log_channel_id is not None else "❌ " verified_emoji = "✅ " if verified_role_id is not None else "❌ " captcha_emoji = "✅ " if captcha_level is not None else "❌ " activated_emoji = "✅ " if security_activated is not None else "❌ " embed = discord.Embed(title="Welcome to Sharbull Security Bot!", description="In order to initially setup Sharbull, you will have to execute a few steps:\n\n" + "**1.** " + log_emoji + "``"+prefix+"set_log_channel`` in a text channel you want the logs to be posted in.\n\n" + "**2.** " + verified_emoji + "``"+prefix+"set_verified_role @a_role`` replace @a_role by the role you want users to get when they get approved by the bot\n\n" + "**3.** Edit channels permissions to restrict access to Verified users only.\n\n" + "**4.** " + captcha_emoji + "``"+prefix+"set_captcha_level <level (1, 2, or 3)>`` to setup captcha policy (learn more with ``"+prefix+"help security``\n" + " > Level ``1`` : No captcha verification\n" + " > Level ``2`` : Verification for suspicious users only (recommended)\n" + " > Level ``3`` : Verification for everyone\n" + "⚠️ Caution : Users must authorize direct messages from servers, otherwise verification will be impossible.\n\n"+ "**5.** " + activated_emoji + "``"+prefix+"activate`` to start security services" ) await ctx.send(embed=embed)
async def help(self, ctx, page: str = None): footer = "Sharbull Security - Developed by 647" icon_url = "https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678094-shield-512.png" prefix = get_prefix(self, ctx.message) if page == "commands": title = "About the commands" description = "".join(( "``", prefix, "setup`` : Open minimum configuration menu\n - Permission required : administrator\n\n", "``", prefix, "mute <Member>`` : Mute a member and report their account to the Sharbull database\n - Permission required : mute members\n\n", "``", prefix, "kick <Member>`` : Kick a member and report their account to the Sharbull database\n - Permission required : kick members\n\n", "``", prefix, "ban <Member>`` : Ban a member and report their account to the Sharbull database\n - Permission required : ban members\n\n", "``", prefix, "alert`` : Toggles ALERT mode (any spamming member will be banned without a warning)\n - Permission required : ban members\n\n", "``", prefix, "report <Member> <reason>`` : Report an account to the server and to the Sharbull database\n - Permission required : None\n\n", "``", prefix, "flags <Member (optional)>`` : Get the public flags of the user\n - Permission required : None\n\n", "``", prefix, "status`` : See the enabled protection features on this server\n - Permission required : None\n\n", "``", prefix, "set_prefix <prefix>`` : Sets a new prefix for this bot\n - Permission required : administrator\n\n", "You can also tag me instead of using the prefix")) elif page == "security": title = "About the security" description = "".join(( "**Automatic flagging**\nSharbull automatically detects if an account is fake or likely to be a ", "selfbot by checking their avatar, creation date, user flags and reports. ", "With this data, a trust score is calculated and further actions may be taken :\n\n", "**Captcha**\nCaptchas are widely used everywhere and have proven to be effective against selfbots, ", "and Sharbull uses 3 levels of protection : \n", "- Level One : Users can join your server without having to complete a challenge.\n", "- Level Two : By looking at the user's flags, Sharbull enables or not the challenge for a suspicious user.\n", "- Level Three : Everyone including clean users will have to complete a challenge.\n\n", "**AntiSpam**\n", "An antispam is also included, which automatically flags the user. Depending on their trust ", "score, they may get muted, kicked or even banned.\n\n", "**ALERT mode**\n", "When you enable alert mode, any spamming member will be banned without a warning. ", "(*Sharbull protection services must be enabled first*) ", "Alert mode is automatically enabled when a member reaches the spamming ban treshold. If you want the bot to ignore ", "a channel, block the Read Messages permission of this channel to Sharbull." )) else: title = "Welcome to Sharbull Security Bot!" description = "".join(( "**What is this bot?**\nSharbull is a ready to use bot deployable in minutes, aimed to filter out ", "selfbot accounts by detecting fake accounts and using a captcha system. ", "With its built-in anti-spam filter this bot will also rate limit humans who flood the chat, as ", "Sharbull has a strict policy on spammers and raiders, zero tolerance is not an option, it's mandatory.\n", "Our bot is using a shared database across all servers in order to detect toxic people before they even ", "join your server.\n\n", "**Main features** \n", "- Togglable Captcha for joining members\n", "- Shared reputation system between all servers\n", "- AntiSpam operating according to the user's rep\n", "- Selfbots detection and flagging system\n\n", "**Usage**\n", "If you are a server administrator and would like to use this bot, start now by using the command ``", prefix, "setup``\n", "Take a look at other commands by sending ``", prefix, "help commands`` or ``", prefix, "help security``\n", "Question? Concerns? Contest a bad reputation? Get the support server link by sending ``", prefix, "support``\n\n", "You can also tag me instead of using the prefix")) embed = discord.Embed(title=title, description=description) embed.set_footer(text=footer, icon_url=icon_url) await ctx.send(embed=embed)