-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
86 lines (65 loc) · 2.78 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#Bot can be invited to a server https://discord.com/developers/applications/837969138919931924/oauth2 at this link. Check "Bot" in the "Scopes" selections, choose the bot permissions and then copy the link from the "Scopes" box that appears
#Help: https://dev.to/mikeywastaken/events-in-discord-py-mk0
import discord
from discord.ext import commands
#------------------ For 24/7 Uptime ------------------
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Your Bot Is Ready"
def run():
app.run(host="0.0.0.0", port=8000)
def keep_alive():
server = Thread(target=run)
server.start()
#------------------ For 24/7 Uptime ------------------
intents = discord.Intents(messages = True, guilds = True, reactions = True, members= True, presences = True)
vinny = commands.Bot(command_prefix = '.', intents = intents, case_insensitive= True)
@vinny.event
async def on_ready():
print("I'm up and running!")
@vinny.event
async def on_member_join(member):
print(f"{member} has joined Sonder!")
@vinny.event
async def on_member_remove(member):
print(f"{member} has left Sonder :(")
#Custom Commands
@vinny.command(name="hello", description="Greet the user!")
async def hello(ctx):
await ctx.send(f"Hiya {ctx.author.name}, I'm Vinny, now get moving bub.") #f-string to make Vinny say hello
#Auto Responder
@vinny.event
async def on_message(message):
if "Vinny" in message.content:
await message.channel.send("What")
#------------------Beginning of Auto Moderation Section(Kinda currently only deletes the sent message and pings the user in the sent channel)------------------
#Blocks the user from sending links(https)
@vinny.event
async def on_message_1(message):
if "https://" in message.content:
await message.delete()
await message.channel.send(f"{message.author.mention} Try that shit again and I'll break your windpipe.")
else:
await vinny.process_commands(message)
#Blocks the user from sending links(http)
@vinny.event
async def on_message_2(message):
if "http://" in message.content:
await message.delete()
await message.channel.send(f"{message.author.mention} Try that shit again and I'll break your windpipe.")
else:
await vinny.process_commands(message)
#Shit Broke
#wordBanList= ['poop', 'peepee', 'stupid']
#@vinny.event
#async def on_message(message):
# for i in wordBanList: #loops through the word ban list
# if i in message:
# await message.delete()
# await message.channel.send(f"{message.author.mention} say that again and I'll feed your balls to my greyhounds")
# return #stops bot from going sickomode and trying to delete the message again
# await vinny.process_commands(message)
vinny.run('ODM3OTY5MTM4OTE5OTMxOTI0.YI0Rkw.3UoV-KuzrCqurcEFPUtzzCaYpHU')