-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSahootihootBot.py
More file actions
55 lines (47 loc) · 1.61 KB
/
Copy pathSahootihootBot.py
File metadata and controls
55 lines (47 loc) · 1.61 KB
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
import os
from pathlib import Path
import discord
from discord.ext import commands
#from discord.ext import has_permissions
from dotenv import load_dotenv
import random
#getting bot token from env file
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
bot = commands.Bot(command_prefix='~', description='This is an inside joke bot')
@bot.command(brief='finishes the word')
async def test(ctx):
await ctx.send('osterone')
@bot.command(brief='gives a famous quote')
async def quote(ctx):
quote_file = open('quotes.txt', 'r')
quotes = quote_file.read().split('\n')
quote_file.close()
if len(quotes) < 1:
await ctx.send('nothing here :(')
else:
await ctx.send(f'***{quotes[random.randint(0, len(quotes)-1)]}***')
@bot.command(brief='adds to the list of famous quotes')
@commands.has_permissions(administrator=True)
async def addquote(ctx, quote):
if not quote:
return
quote = ctx.message.content.strip(bot.command_prefix + ctx.invoked_with + ' ')
with open("quotes.txt", "a") as quote_file:
quote_file.write("\n")
quote_file.write(quote)
await ctx.send(f'***{quote}*** added to list of quotes')
@bot.event
async def on_message(message):
await bot.process_commands(message)
if message.author == bot.user:
return
bruh_file = open('bruh.txt', 'r')
bruh_list = bruh_file.read().split(',')
bruh_file.close()
if any(ext in message.content for ext in bruh_list):
await message.channel.send('***bruh***', tts=True)
@bot.event
async def on_ready():
print('ready bot go')
bot.run(TOKEN)