File tree Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,13 @@ async def on_ready():
96
96
teapot .cogs .osu .setup (bot )
97
97
teapot .cogs .github .setup (bot )
98
98
teapot .cogs .cat .setup (bot )
99
+ teapot .cogs .eightball .setup (bot )
99
100
teapot .cogs .neko .setup (bot )
100
101
if teapot .config .storage_type () == "mysql" :
101
102
for guild in bot .guilds :
102
103
teapot .managers .database .create_guild_table (guild )
103
104
elif teapot .config .storage_type () == "sqlite" :
104
- print ("[!] Warning: SQLite storage has not been implemented yet. MySQL database is recommended" ) # WIP
105
+ print ("[!] Warning: SQLite storage has not been implemented yet. MySQL is recommended" ) # WIP
105
106
print (f"Registered commands and events in { round (time .perf_counter () - time_start , 2 )} s" )
106
107
await bot .change_presence (status = discord .Status .online ,
107
108
activity = discord .Game (teapot .config .bot_status ())) # Update Bot status
Original file line number Diff line number Diff line change 8
8
9
9
10
10
def version ():
11
- return "v0.0.1.6 "
11
+ return "v0.0.1.7 "
12
12
13
13
14
14
def config_version ():
Original file line number Diff line number Diff line change 1
1
from .cat import *
2
2
from .cmds import *
3
+ from .eightball import *
3
4
from .github import *
4
5
from .music import *
5
6
from .neko import *
Original file line number Diff line number Diff line change
1
+ """ Module for generating random neko pictures"""
2
+ import io
3
+ import json
4
+
5
+ import aiohttp
6
+ import discord
7
+ import requests
8
+ from discord .ext import commands
9
+
10
+ import teapot
11
+ import teapot .tools .embed as dmbd
12
+
13
+
14
+ class EightBall (commands .Cog ):
15
+ """8 Ball"""
16
+
17
+ def __init__ (self , bot ):
18
+ """ Initialize 8ball class"""
19
+ self .bot = bot
20
+
21
+ def eightball_api (self , ctx ):
22
+ try :
23
+ req = requests .get (f'https://nekos.life/api/v2/8ball/{ x } ' )
24
+ if req .status_code != 200 :
25
+ print ("Could not get a response" )
26
+ apijson = json .loads (req .text )
27
+ em = dmbd .newembed ().set_image (url = apijson ["url" ])
28
+ return em
29
+ except :
30
+ return teapot .messages .error (f"obtaining 8ball image ({ req .status_code } )" )
31
+
32
+ @commands .command (pass_context = True )
33
+ async def eightball (self , ctx ):
34
+ await ctx .send (embed = self .eightball_api (ctx ))
35
+
36
+ def setup (bot ):
37
+ """ Setup Eight Ball Module"""
38
+ bot .add_cog (EightBall (bot ))
You can’t perform that action at this time.
0 commit comments