├── LICENSE ├── README.md ├── keepalive.py └── main.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 bsd_witch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LOL-banner 2 | 3 | A discord bot that bans anybody playing league of legends 4 | This bot has reached the server limit. I cannot verify the bot 5 | 6 | Note: Theres a meme with "30 min of league leads to a ban", want to clarify, I am not the creator of the 30 min bot and this is a seperate bot 7 | 8 | https://discord.com/api/oauth2/authorize?client_id=937810355206357062&permissions=8&scope=bot 9 | -------------------------------------------------------------------------------- /keepalive.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | from threading import Thread 3 | 4 | app = Flask(__name__) 5 | 6 | @app.route('/') 7 | def index(): 8 | return 'Fuck LOL players' 9 | 10 | def run(): 11 | app.run(host="0.0.0.0", port=8080) 12 | 13 | def keepAlive(): 14 | server = Thread(target=run) 15 | server.start() 16 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | #https://discord.com/api/oauth2/authorize?client_id=937810355206357062&permissions=8&scope=bot 2 | 3 | import os 4 | import random 5 | import discord 6 | from discord.ext import commands 7 | from keepalive import keepAlive 8 | 9 | 10 | intents = discord.Intents.all() 11 | intents.members = True 12 | 13 | 14 | 15 | client = commands.Bot(command_prefix='!', intents=intents) 16 | 17 | messages = [ 18 | "Stop playing league of legends", 19 | "Take a shower", 20 | "Among us??? Sussy??? Imposter league of legends?" 21 | ] 22 | 23 | 24 | 25 | @client.event 26 | async def on_ready(): 27 | print("Ready!") 28 | print(client.guilds) 29 | await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{len(client.guilds)} sussy bakers")) 30 | members = 0 31 | 32 | for guild in client.guilds: 33 | for member in guild.members: 34 | members += 1 35 | 36 | with open("members.txt", "w") as f: 37 | f.write(str(members)) 38 | 39 | 40 | 41 | 42 | @client.event 43 | async def on_member_update(before, after): 44 | #await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=random.choice(status))) 45 | 46 | 47 | if after.activity != None: 48 | print(after.name) 49 | if len(after.activities) > 1: 50 | print(after.activities[1].name) 51 | if str(after.activities[1].name).lower() == "league of legends": 52 | print("banning") 53 | try: 54 | with open("hall-of-shame.txt", "a+") as f: 55 | f.write(after.name) 56 | 57 | 58 | await after.send(random.choice(messages)) 59 | await after.ban(reason='Playing League of legends') 60 | except discord.errors.Forbidden: 61 | print("Not valid permissions") 62 | after.send("") 63 | 64 | print(after.activities[1]) 65 | 66 | 67 | 68 | 69 | 70 | keepAlive() 71 | client.run(os.environ['TOKEN']) 72 | --------------------------------------------------------------------------------