This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Chat-Bot/finaru.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
48 lines (45 sloc)
1.49 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
""" THIS CODE IS NOT OURS CODE IT'S FROM THE INTERNET """ | |
"""Source of the code: https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be """ | |
class FinaruCog: | |
def __init__(self, client): | |
self.client = client | |
async def on_message(ctx, message): | |
mylist=message.content.split() | |
case=0 | |
no=0 | |
pers=0 | |
for words in mylist: | |
def valid(words): | |
word = "" | |
for character in words: | |
if character.isalpha(): | |
word+=character | |
return word | |
word=valid(words) | |
# Not in use atm | |
#m = ["movie","movies"] | |
#ms = ["music", "song", "songs"] | |
#d = ["don't","dont","no"] | |
if word.lower() == "movie": | |
case=1 | |
elif word.lower() == "music": | |
case=2 | |
elif word.lower() == "dont": | |
no=1 | |
else: | |
continue | |
for i in range(2): | |
if no == 1 and case != 0: | |
await message.channel.send("What else can I do for you?") | |
break | |
else: | |
if case == 1: | |
await message.channel.send("Searching for movies") | |
break | |
elif case == 2: | |
await message.channel.send("Searching for songs") | |
break | |
def setup(client): | |
client.add_cog(FinaruCog(client)) |