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?
Python-Chatbot/Calculator.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (20 sloc)
578 Bytes
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 | |
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) |