Skip to content

Commit

Permalink
Merge pull request #1 from Araon/wiki
Browse files Browse the repository at this point in the history
Wiki
  • Loading branch information
Araon authored Oct 8, 2020
2 parents 908c624 + d52a119 commit bc5f8c1
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 41 deletions.
11 changes: 11 additions & 0 deletions botlog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Bot Online from Thu Oct 8 23:29:38 2020
Bot Online from Thu Oct 8 23:36:04 2020
Bot Online from Thu Oct 8 23:40:11 2020
Bot Online from Thu Oct 8 23:41:01 2020
Connected to General Thu Oct 8 23:46:18 2020
Connected to General Fri Oct 9 00:37:21 2020
Left the General channel
Fri Oct 9 00:37:27 2020
Bot Online from Fri Oct 9 01:57:28 2020
Bot Online from Fri Oct 9 02:11:31 2020
8 changes: 8 additions & 0 deletions discordsystem.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
2020-10-09 02:11:27,977:INFO:discord.client: logging in using static token
2020-10-09 02:11:29,017:INFO:discord.gateway: Shard ID None has sent the IDENTIFY payload.
2020-10-09 02:11:29,422:INFO:discord.gateway: Shard ID None has connected to Gateway: ["gateway-prd-main-n391",{"micros":82901,"calls":["discord-sessions-prd-2-10",{"micros":74233,"calls":["start_session",{"micros":46083,"calls":["api-prd-main-wfmr",{"micros":43826,"calls":["get_user",{"micros":2579},"add_authorized_ip",{"micros":1574},"get_guilds",{"micros":13237},"coros_wait",{"micros":1}]}]},"guilds_connect",{"micros":29,"calls":[]},"presence_connect",{"micros":2,"calls":[]}]}]}] (Session ID: 18a05bdf03a156e117dd0bff39d8605e).
2020-10-09 02:21:11,270:INFO:discord.client: Received signal to terminate bot and event loop.
2020-10-09 02:21:11,270:INFO:discord.client: Cleaning up tasks.
2020-10-09 02:21:11,270:INFO:discord.client: Cleaning up after 1 tasks.
2020-10-09 02:21:11,305:INFO:discord.client: All tasks finished cancelling.
2020-10-09 02:21:11,305:INFO:discord.client: Closing the event loop.
3 changes: 2 additions & 1 deletion helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def spank(url):
poffset = (1200,340)
background.paste(profile, poffset)
background.save('spank.jpg')




#spank('https://cdn.discordapp.com/avatars/651715103313362944/d8b5f4ee9746238ef82dd5a7a10a575b.webp')
64 changes: 36 additions & 28 deletions pybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from dotenv import load_dotenv
from helper import worthless, slap, spank
from sentimentAnalyzer import sentiment
from wiki import sendWiki
load_dotenv()

'''
Expand Down Expand Up @@ -96,11 +97,13 @@ async def yo(ctx):
embed.add_field(name='`gali`', value='Get bestowed with a random gali',inline=True)
embed.add_field(name='`inv`', value='Generate an Invite to this Server',inline=True)
embed.add_field(name='`poke`', value='Use this command as ;poke@mention to poke someone',inline=True)
embed.add_field(name='`worth`', value='Use as ;worth @mention',inline=True)
embed.add_field(name='`worth`', value='Use as ;worth name(not mention)',inline=True)
embed.add_field(name='`kami`', value='kami',inline=True)
embed.add_field(name='`gibslap`', value='use as ;slap @mention',inline=True)
embed.add_field(name='`gibslap`', value='use as ;gibslap @mention',inline=True)
embed.add_field(name='`toss`', value='do a coin flip',inline=True)
embed.add_field(name='`gibspank`', value='use as ;gibspank @mention',inline=True)
embed.add_field(name='`poll`', value='Seperate two options with **or**',inline=True)
embed.add_field(name='`wiki`', value='Get 3 sentence or less summary of a topic',inline=True)
embed.add_field(name='`owner`', value='Notify the owner of this Bot',inline=True)
embed.set_footer(text='Have a nice day!😄')
await ctx.send(embed = embed)
Expand Down Expand Up @@ -169,26 +172,32 @@ async def gibslap(ctx, *, avamember : discord.Member=None):
#userAvatarUrl = avamember.avatar_url
slap(avamember.avatar_url)
await ctx.send(file=discord.File('slap.jpg'))
'''
This command does not work for some reasons, gets stuck at "getting user dp"
update it dosent "get stuck", it makes the meme but fails to send it for some reason
UPDATE: nevermind, the problem was not with the code it was me, extension should have been .jpg
and i've been using .png
'''

@client.command()
async def gibspank(ctx, *, avamember : discord.Member=None):
#userAvatarUrl = avamember.avatar_url
spank(avamember.avatar_url)
await ctx.send(file=discord.File('spank.jpg'))

@client.command(aliases=['sentiment'])
async def senti(ctx):
lastmessageID = ctx.channel.last_message_id
msg = await ctx.fetch_message(lastmessageID)
print(msg.content)
lastmsg = sentiment(msg.content)
print(lastmsg)
if lastmsg == 1:
await ctx.send_reaction("👍")
if lastmsg == 0:
await ctx.send_reaction("👌")
else:
await ctx.send_reaction("👎")
# @client.command(aliases=['sentiment'])
# async def senti(ctx):
# lastmessageID = ctx.channel.last_message_id
# msg = await ctx.fetch_message(lastmessageID)
# print(msg.content)
# lastmsg = sentiment(msg.content)
# print(lastmsg)
# if lastmsg == 1:
# await ctx.send_reaction("👍")
# if lastmsg == 0:
# await ctx.send_reaction("👌")
# else:
# await ctx.send_reaction("👎")


@client.command(aliases=['pl'])
Expand All @@ -207,25 +216,24 @@ async def poll(ctx,*,msg,avamember : discord.Member=None):
await message_.add_reaction("❎")
await ctx.message.delete()

@client.command(aliases=['Wi'])
async def wiki(ctx, usr: str):
queryTerm = usr
result = sendWiki(queryTerm)
embed = discord.Embed(
title = queryTerm,
description = result,
colour = 0xce65dc
)
await ctx.send(embed = embed)
await ctx.message.delete()


'''
This command does not work for some reasons, gets stuck at "getting user dp"
update it dosent "get stuck", it makes the meme but fails to send it for some reason
UPDATE: nevermind, the problem was not with the code it was me, extension should have been .jpg
and i've been using .png
'''

#New stuff


'''
@client.command()
async def uptime(ctx):
today = datetime.now().strftime("%x")
uptime = (today - starttime)
print(uptime)
print("beep boop this part ran")
await ctx.send(f'AraonJR is up for {uptime}')
Expand Down
96 changes: 84 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,107 @@
aiohttp==3.6.2
altgraph==0.17
appdirs==1.4.4
args==0.1.0
async-timeout==3.0.1
asyncio==3.4.3
attrs==20.2.0
attrs==19.3.0
beautifulsoup4==4.9.1
certifi==2020.6.20
cffi==1.14.3
cffi==1.14.0
chardet==3.0.4
click==7.1.2
discord.py==1.4.1
clint==0.5.1
colorama==0.4.3
configparser==5.0.0
crayons==0.3.1
cryptography==2.9.2
cycler==0.10.0
dearpygui==0.1.0b10
decorator==4.4.2
dhooks==1.1.4
discord.py==1.5.0
distlib==0.3.0
facebook-sdk==3.1.0
Faker==4.1.2
filelock==3.0.12
Flask==1.1.2
future==0.18.2
get-stick-bugged-lol==0.0.1
googletrans==3.0.0
h11==0.9.0
h2==3.2.0
hpack==3.0.0
hstspreload==2020.9.23
hstspreload==2020.10.6
httpcore==0.9.1
httpx==0.13.3
hyperframe==5.2.0
idna==2.10
joblib==0.16.0
multidict==4.7.6
imageio==2.9.0
imageio-ffmpeg==0.4.2
itsdangerous==1.1.0
Jinja2==2.11.2
joblib==0.17.0
kiwisolver==1.2.0
MarkupSafe==1.1.1
matplotlib==3.2.1
MouseInfo==0.1.3
moviepy==1.0.3
multidict==4.7.5
mysql-connector-python==8.0.20
networkx==2.4
nltk==3.5
numpy==1.19.1
opencv-python==4.2.0.34
pandas==1.0.3
pefile==2019.4.18
Pillow==7.2.0
pipenv==2018.11.26
praw==7.1.0
prawcore==1.4.0
proglog==0.1.9
py-stackexchange==2.2.7
PyAutoGUI==0.9.50
pycparser==2.20
pygame==1.9.6
PyGetWindow==0.0.8
PyInstaller==3.6
pylsd-nova==1.0.0
PyMsgBox==1.0.8
PyNaCl==1.3.0
python-dotenv==0.14.0
regex==2020.7.14
pyparsing==2.4.7
pyperclip==1.8.0
PyRect==0.1.4
PyScreeze==0.1.26
python-dateutil==2.8.1
python-dotenv==0.13.0
PyTweening==1.0.3
pytz==2020.1
PyWavelets==1.1.1
pywin32-ctypes==0.2.0
regex==2020.9.27
requests==2.24.0
rfc3986==1.4.0
six==1.15.0
scikit-image==0.17.2
scipy==1.4.1
selenium==3.141.0
six==1.14.0
sniffio==1.1.0
socli==5.7
soupsieve==2.0.1
text-unidecode==1.3
textblob==0.15.3
tqdm==4.49.0
tifffile==2020.6.3
tkintertable==1.3.2
tqdm==4.48.2
update-checker==0.17
urllib3==1.25.10
yarl==1.5.1
youtube-dl==2020.9.20
urwid==2.1.0
virtualenv==20.0.20
virtualenv-clone==0.5.4
webdriver-manager==3.2.2
websocket-client==0.57.0
websockets==8.1
Werkzeug==1.0.1
wikipedia==1.4.0
yarl==1.4.2
youtube-dl==2020.5.8
12 changes: 12 additions & 0 deletions wiki.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import time
import wikipedia

def sendWiki(text):
try:
sh = wikipedia.summary(text, sentences = 3)
pgContent = sh
except:
pgContent = 'Search term is too broad, be more specific '

return pgContent

0 comments on commit bc5f8c1

Please sign in to comment.