Removed old files
This commit is contained in:
parent
3b92a9b2ea
commit
7691d28050
3
.idea/dataSources.xml
generated
3
.idea/dataSources.xml
generated
@ -6,6 +6,9 @@
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mysql://192.168.1.52:5618/</jdbc-url>
|
||||
<driver-properties>
|
||||
<property name="serverTimezone" value="UTC" />
|
||||
</driver-properties>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
@ -1,19 +0,0 @@
|
||||
1: No swearing
|
||||
|
||||
2: No spamming (This includes out of place images, images with no context, and more than 5 messages in a row)
|
||||
|
||||
3: No impersonating any other person wether it be inside or outside of this group.
|
||||
|
||||
4: No organization of any raids on any other discord servers no matter the relationship
|
||||
|
||||
5: No NSFW content (This includes talking about anything relating to NSFW content)
|
||||
|
||||
6: Do not ask for ranks
|
||||
|
||||
7: English only
|
||||
|
||||
8: Ban evading is not allowed
|
||||
|
||||
9: You can only have one account on this server. NO ALTS
|
||||
|
||||
10: Disputes between users must be settled in #arguments
|
@ -1,2 +0,0 @@
|
||||
(message.author.id == '305589587215122432') or
|
||||
(message.author.id == '376159852856344576')
|
176
OLD/bot.py
176
OLD/bot.py
@ -1,176 +0,0 @@
|
||||
from discord.ext.commands import Bot
|
||||
import discord
|
||||
import random
|
||||
import math
|
||||
# version 1.0
|
||||
|
||||
prefix = 'o!'
|
||||
token = "NTAxNDg1OTA2ODAxNDU5MjAw.DqaHWQ.MZ_B52xFTKyffRJ9pmMiYLVHYhM"
|
||||
client = Bot(command_prefix=prefix)
|
||||
client.remove_command("help")
|
||||
ouat_bypass = open("Data/ouat_bypass.txt", 'r')
|
||||
|
||||
|
||||
@client.command(name='8ball',
|
||||
description='Answers a yes or no question',
|
||||
brief="Its an 8ball",
|
||||
aliases=['eight_ball', 'eightball', '8bal'],
|
||||
pass_context=True)
|
||||
async def eight_ball(context):
|
||||
possible_responses = [
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'That is a resounding no',
|
||||
'It is not looking likely',
|
||||
'Too hard to tell',
|
||||
'It is quite possible',
|
||||
'Definitely',
|
||||
'Na man your gay'
|
||||
]
|
||||
await client.say(random.choice(possible_responses) + ", " + context.message.author.mention)
|
||||
|
||||
|
||||
@client.command(name='Add',
|
||||
description='Adds two real numbers',
|
||||
brief="MATHS",
|
||||
aliases=['add', '+'],
|
||||
pass_context=True)
|
||||
async def add(context, number, second_number):
|
||||
added = float(number) + float(second_number)
|
||||
await client.say(
|
||||
context.message.author.mention +
|
||||
' ' +
|
||||
str(number) +
|
||||
" + " +
|
||||
str(second_number) +
|
||||
" is " +
|
||||
str(added))
|
||||
|
||||
|
||||
@client.command(name='Square root',
|
||||
description='Squares a real number',
|
||||
brief='Hard MATHS',
|
||||
aliases=['squareroot', 'square_root', 'sqrt'],
|
||||
pass_context=True)
|
||||
async def sqrt(context, number):
|
||||
squared = math.sqrt(float(number))
|
||||
await client.say(context.message.author.mention +
|
||||
', ' +
|
||||
str(number) +
|
||||
" Squared is " +
|
||||
str(squared))
|
||||
|
||||
|
||||
@client.command(pass_context=True)
|
||||
async def rules_update(ctx):
|
||||
if ctx.message.author.id == '305589587215122432':
|
||||
rules = open("Data/Rules", 'r')
|
||||
await client.purge_from(client.get_channel("501176716962824212"))
|
||||
await client.send_message(client.get_channel("501176716962824212"), rules.read())
|
||||
else:
|
||||
await client.say("Incorrect permission, If you believe this is a mistake please contact bot developer")
|
||||
|
||||
|
||||
@client.command(pass_context=True)
|
||||
async def rules_add(ctx, new_rule):
|
||||
if ctx.message.author.id == '305589587215122432':
|
||||
rules = open("Data/Rules", 'a')
|
||||
rules.write('\n')
|
||||
rules.write('\n')
|
||||
rules.write(new_rule)
|
||||
else:
|
||||
await client.say("Incorrect permission, If you believe this is a mistake please contact bot developer")
|
||||
|
||||
|
||||
@client.command(pass_context=True)
|
||||
async def help(ctx):
|
||||
author = ctx.message.author
|
||||
embed = discord.Embed(
|
||||
colour=discord.Colour.green()
|
||||
)
|
||||
embed.set_author(name="help")
|
||||
embed.add_field(name="eight_ball", value="Answers a question ~ Usage - !8ball", inline=False)
|
||||
embed.add_field(name="Add", value="Adds two real numbers ~ Usage - !add NUMBER NUMBER", inline=False)
|
||||
embed.add_field(name="Square root", value="Squares a real number ~ Usage - !sqrt NUMBER", inline=False)
|
||||
await client.send_message(author, embed=embed)
|
||||
|
||||
|
||||
@client.event
|
||||
async def on_message(message):
|
||||
if message.channel.id == "507386320604102696":
|
||||
temp = 0
|
||||
temp2 = 0
|
||||
contents = message.content.split()
|
||||
string_contents = ''.join(contents)
|
||||
temp_contents = message.content.split('.')
|
||||
n = len(string_contents)
|
||||
y = 0
|
||||
try:
|
||||
for k in range(n):
|
||||
x = (string_contents[k])
|
||||
y = y + 1
|
||||
if x == '.':
|
||||
temp = temp + 1
|
||||
if ((len(contents) >= 3) or (len(temp_contents) >= 3)) and (temp > 1) and (temp2 == 0):
|
||||
await client.delete_message(message)
|
||||
|
||||
temp2 = 1
|
||||
else:
|
||||
if (not(x == '.') and(y == n)) or (temp >= 2) and (temp2 == 0):
|
||||
await client.delete_message(message)
|
||||
temp2 = 1
|
||||
except:
|
||||
# this is here to do nothing
|
||||
return True
|
||||
await client.process_commands(message)
|
||||
|
||||
|
||||
client.run(token)
|
@ -1,126 +0,0 @@
|
||||
from discord.ext import commands
|
||||
import discord
|
||||
import pymysql
|
||||
import asyncio
|
||||
|
||||
con = pymysql.connect(host='192.168.1.52',
|
||||
user='Bot',
|
||||
password='',
|
||||
db='serverIDs',
|
||||
charset='utf8mb4',
|
||||
cursorclass=pymysql.cursors.DictCursor)
|
||||
|
||||
|
||||
class AddServer(commands.Cog):
|
||||
def __init__(self, client):
|
||||
self.client = client
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_message(self, ctx):
|
||||
if isinstance(ctx.channel, discord.DMChannel):
|
||||
if ctx.content.lower() == "add server":
|
||||
await ctx.channel.send("Send me an invite to the server. Say ``cancel`` anytime to cancel.")
|
||||
try:
|
||||
invite = await self.client.wait_for("message", check=lambda message: message.author == ctx.author
|
||||
and message.channel == ctx.channel, timeout=20)
|
||||
if invite.content == "cancel":
|
||||
await ctx.channel.send("Process canceled")
|
||||
else:
|
||||
is_invite = invite.content.find("discord.gg")
|
||||
try:
|
||||
if is_invite > 0:
|
||||
invite = await self.client.fetch_invite(invite.content, with_counts=True)
|
||||
with con:
|
||||
cur = con.cursor()
|
||||
server_exists = cur.execute(f"SELECT ID FROM servers WHERE ID = {invite.guild.id}")
|
||||
|
||||
if server_exists == 0:
|
||||
try:
|
||||
if invite.guild.owner == ctx.author:
|
||||
if invite.max_uses is None:
|
||||
await ctx.channel.send("Please send a description of the server")
|
||||
description = await self.client.wait_for("message", check=lambda message:
|
||||
message.author == ctx.author and
|
||||
message.channel == ctx.channel,
|
||||
timeout=60)
|
||||
if description.content == "cancel":
|
||||
await ctx.channel.send("Process canceled. If need be have "
|
||||
"this pre typed")
|
||||
else:
|
||||
await ctx.channel.send("Please send a list of tags separated by a "
|
||||
"comma(,) no spaces")
|
||||
tags = await self.client.wait_for("message", check=lambda message:
|
||||
message.author == ctx.author
|
||||
and message.channel == ctx.channel)
|
||||
if tags == "cancel":
|
||||
await ctx.channel.send("Process canceled")
|
||||
else:
|
||||
try:
|
||||
with con:
|
||||
cur = con.cursor()
|
||||
cur.execute(f"INSERT INTO servers "
|
||||
f"(ID, name, category, tags, description, raiting, nsfw, invite, sent) "
|
||||
f"VALUES ({invite.guild.id},'"
|
||||
f"{invite.guild.name}','"
|
||||
f"{}"
|
||||
f"{tags.content}','"
|
||||
f"{invite.code}','"
|
||||
f"{description.content}')")
|
||||
await ctx.channel.send("Server added successfully")
|
||||
|
||||
embed = discord.Embed(
|
||||
colour=discord.Colour.green()
|
||||
)
|
||||
embed.set_author(name="Server Added")
|
||||
embed.add_field(name="ID", value=f"{invite.guild.id}", inline=False)
|
||||
embed.add_field(name="Name", value=f"{invite.guild.name}", inline=False)
|
||||
embed.add_field(name="Tags", value=f"{tags.content}", inline=False)
|
||||
embed.add_field(name="Code", value=f"{invite.code}", inline=False)
|
||||
embed.add_field(name="Description", value=f"{description.content}", inline=False)
|
||||
await self.client.get_channel(658442038475358238).send(embed=embed)
|
||||
|
||||
except Exception as e:
|
||||
await ctx.channel.send("An error has occurred and will be fixed"
|
||||
"shortly.")
|
||||
print(e)
|
||||
await self.client.get_channel(656997125627969546).send(e)
|
||||
await self.client.\
|
||||
get_channel(656997125627969546).\
|
||||
send("<@305589587215122432>")
|
||||
else:
|
||||
await ctx.channel.send("Cannot verify server ownership. "
|
||||
"Either you are not the guild owner or "
|
||||
"the bot has not been added to verify ownership.\n"
|
||||
"Add the bot here : https://discordapp.com/api/oauth2"
|
||||
"/authorize?client_"
|
||||
"id=501485906801459200&permissions=1024"
|
||||
"&scope=bot\n"
|
||||
"Once the bot is added restart the verification process "
|
||||
"using ``add server`` in this DM\n"
|
||||
"After ownership is verified the bot can be removed.")
|
||||
|
||||
except AttributeError:
|
||||
await ctx.channel.send("Cannot verify server ownership. "
|
||||
"Either you are not the guild owner or "
|
||||
"the bot has not been added to verify ownership.\n"
|
||||
"Add the bot here : https://discordapp.com/api/oauth2"
|
||||
"/authorize?client_id=501485906801459200&permissions=1024"
|
||||
"&scope=bot\n"
|
||||
"Once the bot is added restart the verification process "
|
||||
"using ``add server`` in this DM\n"
|
||||
"After ownership is verified the bot can be removed.")
|
||||
|
||||
else:
|
||||
await ctx.channel.send("It seems this server is already in our databases. "
|
||||
"It can be removed with ``remove server``")
|
||||
|
||||
else:
|
||||
await ctx.channel.send("Invalid invite.")
|
||||
except discord.errors.NotFound:
|
||||
await ctx.channel.send("Invalid invite.")
|
||||
except asyncio.TimeoutError:
|
||||
await ctx.channel.send("Process timeout.")
|
||||
|
||||
|
||||
def setup(client):
|
||||
client.add_cog(AddServer(client))
|
@ -1,50 +0,0 @@
|
||||
from discord.ext import commands
|
||||
import discord
|
||||
import pymysql
|
||||
import asyncio
|
||||
|
||||
password = open("../../../../sqlPass.txt", 'r')
|
||||
|
||||
con = pymysql.connect(host='localhost',
|
||||
user='Bot',
|
||||
password=f'{password}',
|
||||
db='serverIDs',
|
||||
charset='utf8mb4',
|
||||
cursorclass=pymysql.cursors.DictCursor)
|
||||
|
||||
|
||||
class NewServer(commands.Cog):
|
||||
def __init__(self, client):
|
||||
self.client = client
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_message(self, ctx):
|
||||
if isinstance(ctx.channel, discord.DMChannel):
|
||||
if ctx.content.lower() == "add server":
|
||||
await ctx.channel.send("Send an invite to the server")
|
||||
invite = await self.client.wait_for("message", check=lambda message: message.author == ctx.author and message.channel == ctx.channel)
|
||||
is_invite = invite.content.find("discord.gg")
|
||||
if is_invite > 0:
|
||||
invite = await self.client.fetch_invite(invite.content, with_counts=True)
|
||||
print(invite.max_uses)
|
||||
if not (invite.max_uses is None):
|
||||
await ctx.channel.send("Please send a invite with no max uses")
|
||||
elif invite.inviter != ctx.author:
|
||||
await ctx.channel.send("Please be the creator of the invite")
|
||||
elif invite.inviter != invite.guild.owner:
|
||||
await ctx.channel.send("Please be the owner of this server")
|
||||
else:
|
||||
await ctx.channel.send("Please send a description of the server")
|
||||
description = await self.client.wait_for("message", check=lambda message: message.author == ctx.author and message.channel == ctx.channel)
|
||||
await ctx.channel.send("Please send a list of tags separated by a comma(,) no spaces")
|
||||
tags = await self.client.wait_for("message", check=lambda message: message.author == ctx.author and message.channel == ctx.channel)
|
||||
with con:
|
||||
cur = con.cursor()
|
||||
cur.execute(f"INSERT INTO servers (ID, name, tags, invite, description) VALUES ({invite.guild.id},'{invite.guild.name}','{tags.content}','{invite.code}','{description.content}')")
|
||||
else:
|
||||
await ctx.channel.send("Invalid invite")
|
||||
await self.client.process_commands(ctx)
|
||||
|
||||
|
||||
def setup(client):
|
||||
client.add_cog(NewServer(client))
|
Loading…
x
Reference in New Issue
Block a user