eee
This commit is contained in:
parent
f1ad230ada
commit
50ff47a034
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,7 @@
|
|||||||
*.conf
|
*.conf
|
||||||
|
*.shlf
|
||||||
|
*test*
|
||||||
|
*TOKEN*
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|||||||
1
TOKEN
1
TOKEN
@ -1 +0,0 @@
|
|||||||
OTg2NDA4MjM3Njg5NjMwNzYx.GfV6cT.3AywcQ7RIApTk4EAQP5nUayAoGPQxAEt79NKB8
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
[config]
|
|
||||||
token = OTg2NDA4MjM3Njg5NjMwNzYx.GfV6cT.3AywcQ7RIApTk4EAQP5nUayAoGPQxAEt79NKB8
|
|
||||||
replytobot = false
|
|
||||||
|
|
||||||
[modules]
|
|
||||||
triggerbot = "true"
|
|
||||||
quotebot = "true"
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[config]
|
|
||||||
enabled = true
|
|
||||||
quotequeue = 1010042640508669982
|
|
||||||
dailyquote = 1004178748205187086
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
[config]
|
|
||||||
enabled = true
|
|
||||||
blacklist = 1234567890,0987654321 #blacklisted channels
|
|
||||||
triggers = hello,howdy
|
|
||||||
[replys]
|
|
||||||
hello = hello,hi
|
|
||||||
howdy = howdy
|
|
||||||
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
joe mama -ian:joe mama -eric:avergae man -peter:hello:a:a:a:a:a:a:a:a:a:hello:hello:joe mama -ian:joe mama -eric:avergae man -peter:hello:a:a:a:a:a:a:a:a:hello:hello:we are declaring this house Vatican city and a portal to hell -trevor 2022 (edited):5 stars for the dinosaur portion. 3 stars for the porn exhibit (pretty sparse). -Museum of the Rockies Reviews 2021
|
|
||||||
August 5, 2022:what is twitter? twitter is website where people go and talk shit about other people -radal 2022:McDonald's: exercise your pancreas -peter 2022
|
|
||||||
August 9, 2022:christmas festive ass bowl w/ real wood knife -order invoice 2022
|
|
||||||
August 10, 2022:bruh settings dosent have an option for nipple sensitivity -peter 2022
|
|
||||||
August 24, 2022:A 1 billion port network switch would be longer than the continent of Africa - reddit 2022:if theres an option not to be talking to you id rather be playing tf2 -tf2 chat 2022
|
|
||||||
August 31, 2022:asprin tree -person 2022:i just ran over all the rally car witnesses -peter 2022
|
|
||||||
September 13, 2022:i know my fridge isnt racist because the mold includes every color -reddit 2022
|
|
||||||
September 16, 2022:no shirt no shoes no service never said anything about pants -reddit 2022:free and open horse -trail sign 2022:give em a bludgeoning with the thinkpad -person 2022
|
|
||||||
October 4, 2022:ich bin i just kicked your ass -tf2 solder 2007:create a problem and sell a solution -apple 2022:goddamnit we have the potato salad -ian 2022:i could pull it out to show you but then i wouldnt be having a fun time -ian 2022:e:e:e:e:e:e:e:e:e:e:e:e:e:e:e:ee:e:e:e:e:e:e:e:e:e:e:e:e:e:e:ee:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee:
|
|
||||||
35
html/about.html
Normal file
35
html/about.html
Normal file
File diff suppressed because one or more lines are too long
@ -1,3 +1,9 @@
|
|||||||
|
<!--
|
||||||
|
# Copyright (c) 2022, Ian Burgess
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the GPLv3 license. A copy of this license can be found in the LICENSE file in the root directory of this source tree.
|
||||||
|
-->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
BIN
images/a.jpg
Normal file
BIN
images/a.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
BIN
images/coffee.jpg
Normal file
BIN
images/coffee.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 404 KiB |
@ -1,47 +1,28 @@
|
|||||||
#imports
|
# Copyright (c) 2022, Ian Burgess
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the GPLv3 license. A copy of this license can be found in the LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
import shelve
|
|
||||||
import random
|
import random
|
||||||
import configparser
|
|
||||||
import backports.zoneinfo as zoneinfo
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import shelve
|
||||||
|
import datetime
|
||||||
|
import shelve
|
||||||
|
import backports.zoneinfo as zoneinfo
|
||||||
|
from py.storage import config
|
||||||
from discord.ext import tasks, commands
|
from discord.ext import tasks, commands
|
||||||
|
|
||||||
|
|
||||||
quotetime = datetime.time(hour=12,tzinfo=zoneinfo.ZoneInfo("MST"))
|
quotetime = datetime.time(hour=12, tzinfo=zoneinfo.ZoneInfo("MST"))
|
||||||
server = "global"
|
|
||||||
avgtimelst = []
|
avgtimelst = []
|
||||||
|
|
||||||
token = open("TOKEN","r").read()
|
token = open("py/TOKEN", "r").read()
|
||||||
intents = discord.Intents.all()
|
intents = discord.Intents.all()
|
||||||
bot = commands.Bot(intents=intents,command_prefix=".")
|
bot = commands.Bot(intents=intents, command_prefix=".")
|
||||||
|
|
||||||
|
|
||||||
#loading config files
|
# bot info
|
||||||
def config(value,db="config",serverid=server,mode="r"):
|
|
||||||
global = {
|
|
||||||
"replytobot":"false",
|
|
||||||
"triggerbotenabled":"true",
|
|
||||||
"quotebotenabled":"true",
|
|
||||||
"triggerbottriggers":["hello","hi","howdy"],
|
|
||||||
"quotequeue":"1010042640508669982",
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
data = shelve.open("bot.shlf",writeback=True)
|
|
||||||
if mode == "r":
|
|
||||||
try:
|
|
||||||
return data[db][serverid][value]
|
|
||||||
except:
|
|
||||||
return global[value]
|
|
||||||
elif mode == "w":
|
|
||||||
data[db][serverid] = value
|
|
||||||
return("success")
|
|
||||||
else:
|
|
||||||
print("error")
|
|
||||||
data.close()
|
|
||||||
|
|
||||||
#bot info
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
print('We have logged in as {0.user}'.format(bot))
|
print('We have logged in as {0.user}'.format(bot))
|
||||||
@ -57,67 +38,63 @@ async def foo(ctx):
|
|||||||
await ctx.send(guild.id)
|
await ctx.send(guild.id)
|
||||||
|
|
||||||
|
|
||||||
#main event
|
# main event
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
#defining variables
|
# defining variables
|
||||||
msg = str(message.content)
|
msg = str(message.content)
|
||||||
channel = str(message.channel.id)
|
channel = str(message.channel.id)
|
||||||
server = message.guild.id
|
server = message.guild.id
|
||||||
author = str(message.author)
|
author = str(message.author)
|
||||||
|
|
||||||
|
|
||||||
#reply to bots
|
# reply to bots
|
||||||
if message.author.bot and config("replytobot") == "false":
|
if message.author.bot and config("replytobot") == "false":
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# start event timer
|
||||||
#start event timer
|
|
||||||
print("\n start client.event")
|
print("\n start client.event")
|
||||||
start = datetime.datetime.now()
|
start = datetime.datetime.now()
|
||||||
|
|
||||||
|
# triggerbot
|
||||||
#triggerbot
|
|
||||||
if config("triggerbotenabled") == "true":
|
if config("triggerbotenabled") == "true":
|
||||||
x = 0
|
x = 0
|
||||||
found = "false"
|
found = "false"
|
||||||
triggers = config("triggerbottriggers",db="data")
|
triggers = config("triggerbottriggers", db="data")
|
||||||
while x < len(triggers) and found == "false":
|
while x < len(triggers) and found == "false":
|
||||||
if triggers[x] not in msg:
|
if triggers[x] not in msg:
|
||||||
x = x+1
|
x = x+1
|
||||||
elif triggers[x] in msg:
|
elif triggers[x] in msg:
|
||||||
found = "true"
|
found = "true"
|
||||||
replys = config(triggerbotreplys,db=data)
|
replys = config(triggerbotreplys, db=data)
|
||||||
rand = random.randint(0,len(replys))-1
|
rand = random.randint(0, len(replys))-1
|
||||||
await message.channel.send(replys[rand])
|
await message.channel.send(replys[rand])
|
||||||
else:
|
else:
|
||||||
print("something happened")
|
print("something happened")
|
||||||
|
|
||||||
|
|
||||||
#daily quote
|
# daily quote
|
||||||
if channel == config("quotequeue") and config("quotebotenabled") == "true":
|
if channel == config("quotequeue") and config("quotebotenabled") == "true":
|
||||||
file = open("data/quotes.var","a")
|
file = open("data/quotes.var", "a")
|
||||||
file.write(msg)
|
file.write(msg)
|
||||||
file.write(":")
|
file.write(":")
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
#bot commands
|
# bot commands
|
||||||
await bot.process_commands(message)
|
await bot.process_commands(message)
|
||||||
|
|
||||||
|
# end function timer
|
||||||
#end function timer
|
|
||||||
end = datetime.datetime.now()
|
end = datetime.datetime.now()
|
||||||
eventime = (end - start)
|
eventime = (end - start)
|
||||||
microseconds = eventime.microseconds
|
microseconds = eventime.microseconds
|
||||||
avgtimelst.append(microseconds)
|
avgtimelst.append(microseconds)
|
||||||
avgtime = sum(avgtimelst) / len(avgtimelst)
|
avgtime = sum(avgtimelst) / len(avgtimelst)
|
||||||
print("\n end client.event \n microseconds: " + str(microseconds) + "\n average time: " + str(avgtime))
|
print("\n end client.event \n microseconds: " +
|
||||||
|
str(microseconds) + "\n average time: " + str(avgtime))
|
||||||
|
|
||||||
|
|
||||||
@tasks.loop(time=quotetime,reconnect=True)
|
@tasks.loop(time=quotetime, reconnect=True)
|
||||||
async def dailyquote():
|
async def dailyquote():
|
||||||
if config("quotebotenabled") == "true":
|
if config("quotebotenabled") == "true":
|
||||||
file = open("data/quotes.var","r+")
|
file = open("data/quotes.var", "r+")
|
||||||
list = file.read().split(":")
|
list = file.read().split(":")
|
||||||
rand = random.randint(0, (len(list)-1))
|
rand = random.randint(0, (len(list)-1))
|
||||||
print(rand)
|
print(rand)
|
||||||
29
py/storage.py
Normal file
29
py/storage.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Copyright (c) 2022, Ian Burgess
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the GPLv3 license. A copy of this license can be found in the LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
server = "default"
|
||||||
|
def config(value,db="config",serverid=server,mode="r"):
|
||||||
|
default = {
|
||||||
|
"replytobot":"false",
|
||||||
|
"triggerbotenabled":"true",
|
||||||
|
"quotebotenabled":"true",
|
||||||
|
"triggerbottriggers":["hello","hi","howdy"],
|
||||||
|
"quotequeue":"1010042640508669982",
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
data = shelve.open("bot.shlf",writeback=True)
|
||||||
|
if mode == "r":
|
||||||
|
try:
|
||||||
|
return data[db][serverid][value]
|
||||||
|
except:
|
||||||
|
return default[value]
|
||||||
|
elif mode == "w":
|
||||||
|
data[db][serverid] = value
|
||||||
|
return("success")
|
||||||
|
else:
|
||||||
|
print("error")
|
||||||
|
data.close()
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user