commit 2e4707ce1658e4ba7340ffdac2ff5cf43276dc58 Author: xenofem Date: Fri May 15 21:58:03 2020 -0400 Club Penguin bot diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd19ba4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +env/ +token \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3c42862 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +MIT License Copyright (c) 2020 xenofem + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b7e48da --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# club-penguin + +Discord bot that tells you off for saying rude words + +## Setup + + git clone https://git.xeno.science/xenofem/club-penguin + cd club-penguin + python3 -m venv env + source env/bin/activate + pip install discord.py + echo > token + python club-penguin.py diff --git a/club-penguin.py b/club-penguin.py new file mode 100644 index 0000000..e18b2ec --- /dev/null +++ b/club-penguin.py @@ -0,0 +1,45 @@ +import discord +import sys + +client = discord.Client() + +RUDE_WORDS = [ + 'asshole', + 'bastard', + 'bitch', + 'boob', + 'cock', + 'cunt', + 'damn', + 'dick', + 'dildo', + 'fuck', + 'hell', + 'penis', + 'porn', + 'sex', + 'shit', + 'slut', + 'tiddy', + 'tiddies', + 'tits', + 'titty', + 'titties', + 'vagina' +] + +@client.event +async def on_ready(): + print('logged in as {0.user}'.format(client), file=sys.stderr) + +@client.event +async def on_message(message): + if message.author == client.user: + return + + if any(w in message.content for w in RUDE_WORDS): + await message.channel.send('Your Club Penguin account has been deactivated for inappropriate language.') + +with open('token') as f: + token = f.read().strip() +client.run(token)