Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
1,266 additions
and
1,068 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import discord | ||
import webbrowser | ||
import nltk | ||
import random | ||
from discord.ext import commands | ||
import asyncio | ||
|
||
TOKEN = 'NTA3NjMyNDUwMzkwODUxNTg1.Drzsew.lVbUm7WKIPrV56q_9LegdqZuXZo' | ||
|
||
client = commands.Bot(command_prefix = '?') | ||
|
||
@client.event | ||
async def on_ready(): | ||
print('"BOT ON DUTY"') | ||
|
||
@client.command | ||
async def test(ctx): | ||
await ctx.send('I heard you! {0}'.format(ctx.author)) | ||
|
||
@client.event | ||
async def message(message): | ||
|
||
if message.author.id == client.user.id: | ||
return | ||
|
||
if message.content.lower().startswith ('!math'): | ||
|
||
|
||
|
||
|
||
client.run(TOKEN) | ||
import discord | ||
import webbrowser | ||
import nltk | ||
import random | ||
from discord.ext import commands | ||
import asyncio | ||
|
||
TOKEN = 'NTA3NjMyNDUwMzkwODUxNTg1.Drzsew.lVbUm7WKIPrV56q_9LegdqZuXZo' | ||
|
||
client = commands.Bot(command_prefix = '?') | ||
|
||
@client.event | ||
async def on_ready(): | ||
print('"BOT ON DUTY"') | ||
|
||
@client.command | ||
async def test(ctx): | ||
await ctx.send('I heard you! {0}'.format(ctx.author)) | ||
|
||
@client.event | ||
async def message(message): | ||
|
||
if message.author.id == client.user.id: | ||
return | ||
|
||
if message.content.lower().startswith ('!math'): | ||
|
||
|
||
|
||
|
||
client.run(TOKEN) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
# Discord Chatbot | ||
|
||
Multi-purpose discord chatbot for module 4006CEM - Oct/Nov 2018 | ||
Semi-intelligent discord chatbot for module 4006CEM - Oct/Nov 2018 | ||
|
||
Usage: python3 connector.py | ||
|
||
# Python 3.5 or larger must be installed due to asynchronous functions | ||
You will | ||
|
||
# Please state which modules/components needed to be installed before executing your program, thanks! | ||
Libraries being used: | ||
- requests (http://docs.python-requests.org/en/master/) by Kenneth Reitz for web requests | ||
- bs4 (https://www.crummy.com/software/BeautifulSoup/) by Leonard Richardson for parsing HTML pages | ||
- discord.py (https://github.com/Rapptz/discord.py/) by Rapptz used to connect to Discord. | ||
- selenium (https://docs.seleniumhq.org/) by (originally) Jason Huggins used to scrap pages that use javascript calls for data (translate module) | ||
- googletrans(https://pypi.org/project/googletrans/) by SuHun Han used as Google Translate API | ||
|
||
|
||
If you get an error (error 'NoneType' object has no attribute 'group') when using googletrans follow these instructions: | ||
Step 1. pip uninstall googletrans | ||
Step 2. clone https://github.com/BoseCorp/py-googletrans.git | ||
Step 3. ./py-googletrans | ||
Step 4. setup.py install |
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
Oops, something went wrong.