add funny things
This commit is contained in:
commit
d2d5a32d46
8 files changed
+540
No files matched your search
@@ -0,0 +1,73 @@
|
||||
import random
|
||||
import os
|
||||
import secrets
|
||||
|
||||
import emoji
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from googledoccy import jackblack
|
||||
|
||||
load_dotenv()
|
||||
TOKEN = os.getenv("TOKEN")
|
||||
|
||||
intents = discord.Intents.default()
|
||||
|
||||
bot = commands.Bot(command_prefix=commands.when_mentioned_or("g-"), intents=intents)
|
||||
|
||||
footer = "Chat now with your own personalized AI assistant! <https://bit.ly/4dz9g8S>"
|
||||
|
||||
def emojer():
|
||||
e = []
|
||||
all_emojis = emoji.EMOJI_DATA
|
||||
for em in all_emojis:
|
||||
e.append(em)
|
||||
moji = random.choices(e, k=3)
|
||||
return " ".join(moji)
|
||||
|
||||
emoji_response = emojer()
|
||||
|
||||
|
||||
async def doccy_response():
|
||||
doccy = jackblack()
|
||||
#print(doccy)
|
||||
resp = secrets.choice(doccy)
|
||||
return resp
|
||||
|
||||
|
||||
|
||||
async def build_response():
|
||||
|
||||
resps = [
|
||||
doccy_response,
|
||||
emoji_response,
|
||||
|
||||
]
|
||||
|
||||
return secrets.choice(resps)
|
||||
|
||||
async def video_response():
|
||||
pass
|
||||
|
||||
@bot.event
|
||||
async def on_message(message):
|
||||
if bot.user.mentioned_in(message):
|
||||
response = await build_response()
|
||||
if response.startswith("<https://"):
|
||||
pass
|
||||
elif response.isupper():
|
||||
pass
|
||||
else:
|
||||
response = response.capitalize()
|
||||
if response.startswith("<"):
|
||||
await message.channel.send(f"{response}")
|
||||
elif response.startswith(":"):
|
||||
await message.channel.send(f"{response}")
|
||||
elif random.randint(1, 5) == 1:
|
||||
await message.channel.send(f"{response}\n\n\n{footer}")
|
||||
else:
|
||||
await message.channel.send(f"{response}")
|
||||
|
||||
bot.run(TOKEN)
|
||||
|
||||
Reference in new issue
Block a user