This commit is contained in:
ionburger 2022-10-19 10:58:37 -06:00
parent d61ede74c4
commit 1865506172
4 changed files with 37 additions and 15 deletions

0
TOKEN Normal file
View File

40
bot.py
View File

@ -1,16 +1,15 @@
#imports
import discord import discord
import random
import configparser
import backports.zoneinfo as zoneinfo import backports.zoneinfo as zoneinfo
import datetime import datetime
import time from datetime import time
import configparser
import random
from discord.ext import tasks, commands from discord.ext import tasks, commands
#glob vars
quotetime = datetime.time(hour=12,tzinfo=zoneinfo.ZoneInfo("MST")) quotetime = datetime.time(hour=12,tzinfo=zoneinfo.ZoneInfo("MST"))
intents = discord.Intents.all()
client = discord.Client(intents=intents)
avgtimelst = []
print("discord.py version")
print(discord.__version__)
#loading config files #loading config files
@ -23,15 +22,23 @@ quotebotconf.read("config/quotebot.conf")
#bot info #bot info
@client.event @bot.event
async def on_ready(): async def on_ready():
print('We have logged in as {0.user}'.format(client)) print('We have logged in as {0.user}'.format(bot))
if not dailyquote.is_running(): if not dailyquote.is_running():
dailyquote.start() dailyquote.start()
print("discord.py version")
print(discord.__version__)
@bot.command()
async def foo(ctx):
for guild in bot.guilds:
await ctx.send(guild.id)
#main event #main event
@client.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)
@ -74,8 +81,13 @@ async def on_message(message):
file.write(":") file.write(":")
file.close() file.close()
#bot commands
await bot.process_commands(message)
#end function timer #end function timer
global avgtimelst
avgtimelst = []
end = time.time() end = time.time()
reventime = str(round((end - start),3)) reventime = str(round((end - start),3))
avgtimelst.append(float(reventime)) avgtimelst.append(float(reventime))
@ -90,10 +102,12 @@ async def dailyquote():
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)
channel = client.get_channel(int(quotebotconf["config"]["dailyquote"])) channel = bot.get_channel(int(quotebotconf["config"]["dailyquote"]))
await channel.send(list.pop(rand)) await channel.send(list.pop(rand))
file.write(":".join(list)) file.write(":".join(list))
file.close() file.close()
client.run(botconf["config"]["token"]) intents = discord.Intents.all()
bot = commands.Bot(intents=intents,command_prefix=".")
bot.run(botconf["config"]["token"])

View File

@ -1,5 +1,5 @@
[config] [config]
token = token = OTg2NDA4MjM3Njg5NjMwNzYx.GfV6cT.3AywcQ7RIApTk4EAQP5nUayAoGPQxAEt79NKB8
replytobot = false replytobot = false
[modules] [modules]

View File

@ -1 +1,9 @@
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: 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: