get with the times

This commit is contained in:
Adam 2022-11-06 02:55:37 -05:00
parent a75eb093c2
commit 9a496e1c8f

View file

@ -22,11 +22,12 @@ import discord, datetime
import numpy as np import numpy as np
from fortune import fortune from fortune import fortune
from src.twitter import get_tweet from src.twitter import get_tweet
from src.cartman import cartman_speak #from src.cartman import cartman_speak
chuck_quotes = open('data/chuck_quotes').read().split('\n%\n') chuck_quotes = open('data/chuck_quotes').read().split('\n%\n')
ligma_list = open('data/ligma_list').read().split('\n') ligma_list = open('data/ligma_list').read().split('\n')
limericks = open('data/limericks').read().split('\n%\n') limericks = open('data/limericks').read().split('\n%\n')
aclist = open('data/aclist').read().split('\n')
def show_menu(): def show_menu():
return menu return menu
@ -46,6 +47,9 @@ def prost():
def chuck(): def chuck():
return np.random.choice(chuck_quotes) return np.random.choice(chuck_quotes)
def ac():
return np.random.choice(aclist)
message_handler = {'lulzbot': show_menu, # these need to be functions message_handler = {'lulzbot': show_menu, # these need to be functions
'musk': musk, 'musk': musk,
'deez': ligma, 'deez': ligma,
@ -57,10 +61,13 @@ message_handler = {'lulzbot': show_menu, # these need to be functions
'prost!': prost, 'prost!': prost,
'fortune': fortune, 'fortune': fortune,
'chuck': chuck, 'chuck': chuck,
'ac':ac,
} }
TOKEN = open('.sekrit/discord_token').read() TOKEN = open('.sekrit/discord_token').read()
client = discord.Client(activity=discord.Game(name='with myself')) intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(activity=discord.Game(name='with myself'), intents=intents)
@client.event @client.event
async def on_ready(): async def on_ready():
@ -79,7 +86,8 @@ async def on_message(message):
elif message.channel.name == 'cartman': elif message.channel.name == 'cartman':
async with message.channel.typing(): async with message.channel.typing():
await message.channel.send(cartman_speak(user_message)) #await message.channel.send(cartman_speak(user_message))
await message.channel.send("I'm broken, come back later.")
elif message.channel.name == 'shitposting': elif message.channel.name == 'shitposting':
if user_message in message_handler: if user_message in message_handler: