From 4ffa7788efe05ea1a6634315829d8f54cbc1d62f Mon Sep 17 00:00:00 2001 From: Yashvardhan Baid Date: Fri, 11 Mar 2022 15:11:54 +0530 Subject: [PATCH 1/8] [not working] saving progress... --- Procfile | 2 +- data/prefixes.json | 3 +- data/tag_messages.json | 3 +- main.py | 4 + src/__init__.py | 1 + src/__pycache__/__init__.cpython-39.pyc | Bin 0 -> 158 bytes src/__pycache__/bot.cpython-39.pyc | Bin 0 -> 5382 bytes src/bot.py | 148 ++++++++++++ src/cogs/__pycache__/__init__.cpython-39.pyc | Bin 0 -> 132 bytes .../__pycache__/codeforces.cpython-39.pyc | Bin 0 -> 792 bytes src/cogs/__pycache__/fun.cpython-38.pyc | Bin 6793 -> 0 bytes src/cogs/__pycache__/fun.cpython-39.pyc | Bin 6893 -> 6898 bytes src/cogs/__pycache__/info.cpython-38.pyc | Bin 6735 -> 0 bytes src/cogs/__pycache__/info.cpython-39.pyc | Bin 6915 -> 3963 bytes src/cogs/__pycache__/modset.cpython-38.pyc | Bin 2913 -> 0 bytes src/cogs/__pycache__/modset.cpython-39.pyc | Bin 5346 -> 5312 bytes src/cogs/__pycache__/music.cpython-38.pyc | Bin 4429 -> 0 bytes src/cogs/__pycache__/music.cpython-39.pyc | Bin 15200 -> 15167 bytes src/cogs/__pycache__/report.cpython-38.pyc | Bin 4328 -> 0 bytes src/cogs/__pycache__/report.cpython-39.pyc | Bin 4396 -> 4684 bytes src/cogs/codeforces.py | 216 ++++++++++++++++++ src/cogs/fun.py | 21 +- src/cogs/info.py | 92 -------- src/cogs/music.py | 28 +-- src/cogs/report.py | 158 +++++++------ src/main.py | 56 ----- 26 files changed, 489 insertions(+), 243 deletions(-) create mode 100644 main.py create mode 100644 src/__init__.py create mode 100644 src/__pycache__/__init__.cpython-39.pyc create mode 100644 src/__pycache__/bot.cpython-39.pyc create mode 100644 src/bot.py create mode 100644 src/cogs/__pycache__/__init__.cpython-39.pyc create mode 100644 src/cogs/__pycache__/codeforces.cpython-39.pyc delete mode 100644 src/cogs/__pycache__/fun.cpython-38.pyc delete mode 100644 src/cogs/__pycache__/info.cpython-38.pyc delete mode 100644 src/cogs/__pycache__/modset.cpython-38.pyc delete mode 100644 src/cogs/__pycache__/music.cpython-38.pyc delete mode 100644 src/cogs/__pycache__/report.cpython-38.pyc create mode 100644 src/cogs/codeforces.py delete mode 100644 src/main.py diff --git a/Procfile b/Procfile index a010ff86..26b6d8a4 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -worker: python ./src/main.py \ No newline at end of file +worker: python ./main.py \ No newline at end of file diff --git a/data/prefixes.json b/data/prefixes.json index 187fd63f..812efb61 100644 --- a/data/prefixes.json +++ b/data/prefixes.json @@ -4,5 +4,6 @@ "785867687536230420": "$dex", "947421517317304361": "$dex", "802197877039956008": "$dex", - "761902999207280690": "$dex" + "761902999207280690": "$dex", + "948280503952347166": "$dex" } \ No newline at end of file diff --git a/data/tag_messages.json b/data/tag_messages.json index 5bfd0c72..d729d785 100644 --- a/data/tag_messages.json +++ b/data/tag_messages.json @@ -4,5 +4,6 @@ "785867687536230420": "off", "947421517317304361": "on", "802197877039956008": "off", - "761902999207280690": "off" + "761902999207280690": "off", + "948280503952347166": "off" } \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 00000000..88db0b57 --- /dev/null +++ b/main.py @@ -0,0 +1,4 @@ +from src import Bot + +if __name__ == '__main__': + Bot().run() \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 00000000..b3cd2807 --- /dev/null +++ b/src/__init__.py @@ -0,0 +1 @@ +from .bot import Bot \ No newline at end of file diff --git a/src/__pycache__/__init__.cpython-39.pyc b/src/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07139230b8d957fadf8acb07d52b8a53180e7eb3 GIT binary patch literal 158 zcmYe~<>g`kg5SF|lSF{@V-N=!FabFZKwK;UBvKes7;_kM8KW2(8B&;n88n$+G6ID) z8E-K=<(K$rGDR^b<(CwJ^sHnkVg^!R;+Kk(Rg8OPiAQM?j7mwZh$${gj){-Y%*!l^ ZkJl@xyv1RYo1apelWGSt^D_`L003whA}{~| literal 0 HcmV?d00001 diff --git a/src/__pycache__/bot.cpython-39.pyc b/src/__pycache__/bot.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..793b10a74d463ea0dfc71f9afb73a357da2d183c GIT binary patch literal 5382 zcmbVQOLN=S6~-GN#fL1vlQw}TPr1>4O#6~0;V!l0wqhw__M2*{ zOlHax!O|`ZOl8^=foZPd>yKqiXW|WETz`i7gvD_&G3sHv?F1~UOQgy_w61~c0#7k$;&9*c(s zCLa_Yi=wbYs~i+yk-GSN-{cf?VrQzu-G=wjjVApl3=)y|q+;>8XpZZN5_a4mQBu9q z3LTcH9qt8jB1bV#)MnRfu|)FNxRS`VFi!Ng8%0jjO%$3lF@`fg75E;!)blsbpZVgl z7hmbthBxLu{37D@FEDzt^C&4c-Pq1X>9iHJCxTcK-xm*wd@tH{Qf&Rmc_;cU8m>U6 zgcA}inMszyWSop*X-u{BuY`ukG^Rf>EF*0jtblfb71_w2L{?(uCyG_fdlgniZzS)H zvOVaP^4=KRi(WbJ?PL4VtFQy?AkM$~6;8(*#r_^jA4ffPoMnR>W8yEcQ}fkoABD$(wB`Kj+;7mVs3VB zZf5$_M59rgW3^MW6OHNm^u+9`x#nVy@SIDMji z@_2p5nW)XxYZJ56GwwufX0|rLPM&VKCu@xpGt&+&^X#9eekb(a8opAt0qI-UL*`D@ zR~)?L6o4>Q7q^@&xkMRP6<5@Oh=s?3FUC?V`^rGw0Ni~Im+l)(>-dpp-vE%$$Y-A&f*4m5C4STa(gUaMTGf`ro35Rnl-=bms~WYP zR_l93qDDCWcwDwBIRWG_w{-XuU=SsSQ;)q>FMiZ3PENrmrs`oc>dA16UIAU~STmY@ z_U(%oFUG5wuG?{WV%WA9c(HA#&XMTMi|Qd~mcEcrD#MDzIG4|yl!mQkvc1sqBCPEN z&7?Aa`^veSHC^ee zafQE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qq;M1bK$vU01dHe5k)Bz+8M)?NO1;b# zx7E2zKfu+^w9a$ck)Bcf95{&2n7zu;qnEGG&o3`5UcPbU=uu8Z4{DGF+>#OIMs@CW zh-oa9D3)`g1O6EV{>5+~BB4)n`JdC{h6j2g>gkQO9p;*~M3SYEn*$G&;}>TaO53dC}00h^Q;7MHIt*$dY$)6-T;ml?on&b z5;tk$kqZ~>t4o)c(phhlI$c}Y62lp3ci}(&F@E?GS2PPjSVPJ8LXnEN7jY-*qp$H_ zO{+jhM5v`ih}L(S0vb#s`OX}34;95!l-qVvwC#4tx-Dv#Z2NxKX=T6g6)ee{B#3sc z;>G#f_MQ2wSC?+_25C(a$4JbPxJcqMiC>VYk@y%QDd&Z4-9@#Z7q=X literal 0 HcmV?d00001 diff --git a/src/bot.py b/src/bot.py new file mode 100644 index 00000000..bebaa66e --- /dev/null +++ b/src/bot.py @@ -0,0 +1,148 @@ +import discord +import json +import os +from discord.ext import commands +import datetime + + +class Bot(commands.Bot): + + CC_LOGO_URL = 'https://avatars.githubusercontent.com/u/63065397?v=4' + INTRO_IMG_URL = 'https://user-images.githubusercontent.com/63065397/156466208-ffb6db84-f0c0-4860-ab6d-48ad0f2cd5f7.png' + EXHAUSTED_FACE = 'https://user-images.githubusercontent.com/63065397/156922064-95c73c2a-b6cb-402e-b24b-d79fe7bf520a.png' + DEX_YELLOW = 0x8e38ce + REPOSITORY_URL = 'https://github.com/code-chaser/dex/' + + def __init__(self, *args, **kwargs): + super().__init__( + command_prefix=get_prefix, + intents=discord.Intents.all(), + activity=discord.Activity( + type=discord.ActivityType.listening, + name="Stop WW3!", + large_image_url=self.EXHAUSTED_FACE, + small_image_url=self.EXHAUSTED_FACE, + start=datetime.datetime(2022, 2, 24), + ), + ) + for file in os.listdir('./src/cogs'): + if file.endswith('.py'): + self.load_extension(f'src.cogs.{file[:-3]}') + + async def get_prefix(self, bot, message): + with open('./data/prefixes.json', 'r') as pref: + prefixes = json.load(pref) + print(prefixes[str(message.guild.id)]+"\n\n") + return prefixes[str(message.guild.id)] + ' ' + + def run(self): + super().run(os.getenv('BOT_TOKEN')) + + async def on_ready(self) -> None: + print('Logged in as {0.user}'.format(self)) + await self.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name='Stop WW3!', start=datetime.datetime(2022, 2, 24))) + + async def on_guild_join(self, guild) -> None: + with open('./data/prefixes.json', 'r') as pref: + prefixes = json.load(pref) + prefixes[str(guild.id)] = '$dex' + with open('./data/prefixes.json', 'w') as pref: + json.dump(prefixes, pref, indent=4) + with open('./data/tag_messages.json', 'r') as tag_: + tag_messages = json.load(tag_) + tag_messages[str(guild.id)] = 'on' + with open('./data/tag_messages.json', 'w') as tag_: + json.dump(tag_messages, tag_, indent=4) + for channel in guild.text_channels: + if channel.permissions_for(guild.me).send_messages: + general = channel + if general is not None: + await general.send(embed=self.intro_msg_embed(guild)) + + async def on_guild_remove(self, guild) -> None: + with open('./data/prefixes.json', 'r') as pref: + prefixes = json.load(pref) + if str(guild.id) in prefixes.keys(): + prefixes.pop(str(guild.id)) + with open('./data/prefixes.json', 'w') as pref: + json.dump(prefixes, pref, indent=4) + with open('./data/tag_messages.json', 'r') as tag_: + tag_messages = json.load(tag_) + if str(guild.id) in tag_messages.keys(): + tag_messages.pop(str(guild.id)) + with open('./data/tag_messages.json', 'w') as tag_: + json.dump(tag_messages, tag_, indent=4) + + async def on_message(self, message) -> None: + with open('./data/tag_messages.json', 'r') as tag_: + tag_messages = json.load(tag_) + if tag_messages[str(message.guild.id)] == 'off': + return + target = message.author + if target == self.user or target.bot: + return + embed = discord.Embed( + title='Message Tagged', + colour=target.colour, + timestamp=datetime.datetime.utcnow(), + ) + embed.set_footer( + text=''.join('` tags off` -to turn this off'), + ) + embed.add_field(name='Message', value=message.content, inline=False) + embed.add_field(name='Author', value=target.mention, inline=True) + embed.set_thumbnail(url=target.avatar_url) + await message.channel.send(embed=embed) + + async def on_command_error(self, ctx, error) -> None: + embed = discord.Embed( + title='Status', + colour=0xff0000, + timestamp=datetime.datetime.utcnow(), + ) + if isinstance(error, commands.MissingPermissions): + n = 'Error' + v = 'Missing Permissions' + elif isinstance(error, commands.MissingRequiredArgument): + n = 'Error' + v = 'Missing required arguements' + elif isinstance(error, commands.MemberNotFound): + n = 'Error' + v = "Requested member not found or Dex doesn't have access to them" + elif isinstance(error, commands.BotMissingPermissions): + n = 'Error' + v = 'Missing Permissions' + elif isinstance(error, commands.CommandNotFound): + n = 'Error' + v = 'Invalid Command' + else: + raise error + return + embed.add_field(name=n, value=v, inline=False) + await ctx.send(embed=embed) + + def intro_msg_embed(self, guild): + description = '' + description = description.join( + '\nThanks for adding me to ' + guild.name + '!') + description = description.join('\nUse `$dex help` to get started!') + description = description.join( + '\nVisit: '.join(self.REPOSITORY_URL)) + embed = discord.Embed( + title='**GREETINGS!**', + description=description, + color=0x8e38ce, + timestamp=datetime.datetime.utcnow(), + ) + embed.set_image(url=self.INTRO_IMG_URL) + embed.set_author( + name='dex', + url=self.REPOSITORY_URL, + icon_url=self.user.avatar_url, + ) + embed.set_footer( + text='made by codechaser', + icon_url=self.CC_LOGO_URL, + ) + embed.set_thumbnail(url=guild.icon_url) + return embed diff --git a/src/cogs/__pycache__/__init__.cpython-39.pyc b/src/cogs/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..668fd1faa52037c45d82b3684900c530ba2d668a GIT binary patch literal 132 zcmYe~<>g`k0^L`dNg(<$h(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o2DL$tuP@v&5q` u2}Y%)R>Tw+CC4P^rx(Y>$7kkcmc+;F6;$5hu*uC&Da}c>0~zrdh#3HzZXA;U literal 0 HcmV?d00001 diff --git a/src/cogs/__pycache__/codeforces.cpython-39.pyc b/src/cogs/__pycache__/codeforces.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8eb80edef2c6938a7dcf260e8521fcdf5ad59fc9 GIT binary patch literal 792 zcmZ8f&5GMF5SIKCD^5~McVD50P{;$6QkI6Yy)=8sO$3BvX@iSxc_kTkOQ46{2WgLa zmOem1*Pcq>pr_6#F%2CvGv8=Nn)xIbvsq3+et(~DZ(b7e6N7U}Ah-gx9T-U@tqDJR z%4vur9)XYQxJh_IF&Ecqlkzm+q#iXH&jLFC?R|_CmdqNu=rm;pIYVm?gwN}w9Ex=oq1-|U9YUO zKKW#I>mzOb$USsbyEAwJCI;g(S=mw>X>cHZd5RY5-YrhgZB2^RBQ!`ZoPRb2-l#$9 Yp1nC<)>|YPeg@zV-*oum=U>Rjzg*F%A^-pY literal 0 HcmV?d00001 diff --git a/src/cogs/__pycache__/fun.cpython-38.pyc b/src/cogs/__pycache__/fun.cpython-38.pyc deleted file mode 100644 index c7f949445c980fc6ef8b0967cc55618a57678488..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6793 zcmbtZ%a0t#dGG4i^gOu_zC}wd>cx>XJNw=xVcH^=T#2x?W+ci^CXvRyQ$4f2JJUT| z-NV&(X6zu80bLjnruWpy$@b!1rBI=kDkAR?rFS?Sa40 zKTfP>)APNk*(}n;@{24k;p+?Ijuu1D_>aUz!y}h*14N`eW}H1?BNnNTwISQrL91LH zs$9d~^h?SGg&P-?tZq_$qzzTmLq+$PE{~pzid&dR^d>gWlKd zs-W*D>@e1@+O>o^PmRP9?%}`Ib zAg6DpoRXHOlNM#-EnupqC%ev|9$F|AR$wJ&v$#Sh@|>ZO^Zc;y2{$p*5%JZ~^?7JJ zcDimm?RQd{w&kop7u|weGpy{)ua*^Ce0C7d#e+qz;wG#uIst`zF_hkZzo{fyd;zM;gOvqut8d^Hc3?KZlzrJYshtIv*&cs-%WH z@%&x6q49$Mgf8Q$mKc#2b+OA<&P_5vYh(FZX#T&d5Npq(bBlXkv}iXgd4%t6%hgClX7DtU+VX4`YSoaEZ) z<7?Gg(dXhCjd_U*67#8xED~#WljqPC(()8lXC^cM$J8u#5x@8h-RKnO2{EUo zMxZgimdQJf@Ppp54F)@C+tHqDbLZG@i=b!I*1jR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ouHr#QeZ@ zIKVS{R6G-=so2G!69tq`kK%_x2yfv^25Q-WhJf;K#*FDCKN9ss}moiUsfjdXsOo{Zz zxY2zRF`GWr;hn6V=Pu>w=x6~(mU}5;7xma!prk=u_=Mm+0J9&(ms5BzCBFriP;2eM zyU64UrKtAgHHPtAmZtFhP8tv0uoG6O=2DwQracYxjK1(-oKA*!RU=JdbF#_W12^FE|SADCpa?1q$C! z;m^rHY}51+5g@)HJskg$51Yhy{{e3gjEH0eoix%II^o3wLW`GyGZ{2WJy1nAk~f#7 zHw@^lF*NoO{~<1vX*xuH2GSY%A#R&e7pRlo8N4`!r+_jrkBL}M&t@tELmKHffzK`y zZsqJi6JO$8N#CQ~;g|ATXCezLs$7D6OnuYfGqN2koodf<Q?5eC{%Z^vX_>Lux35g2efWr%y}*aD!0XhG0lbC_Vs{TE2KT4QeJr1vo@b zQyQXp1}PDM9+~H}w-HfE?1%i31Qi8|EmAyIPU#P`uWNNt_mrRg;X6m>E32zAAcytb zSZ=S>cGq3l&2<-c^ZGJy&RToPS=?M+;*P{Q(nbriP0z?k$q?H~tk#~_1SD4O6;bYzLbQz3b3k8je% zWQtRJViQH?xmtJ*e*`JE_&F6W6*3ezFlEzAa=v>+IVkZ7dMFp^@Y6P>BF*>Yg8mMS zGApU51wfcm1~?F&18|U;NyGICP(hn1vuzd(5JGqLGREkDJvwRxSk6nZVxfh88HB-X z1-HWqUfvzrN0x6Z1DkApBq?7QI=RxR*ReOWcb?8d^?sh|--bq9HM(<34dY^d+y4uwabmRq diff --git a/src/cogs/__pycache__/fun.cpython-39.pyc b/src/cogs/__pycache__/fun.cpython-39.pyc index a5009df71839edd1fb4be67bc73049ea4e1a6c88..d25578f2f526801ffd5c41bbc61bf409d21f82a5 100644 GIT binary patch delta 1732 zcmZuxU1%It6rQ`YGkbS-XLqw^H`&x=6HODhv1w^qwKlbiF-_tRf!3ccNZ9P1O=q(+ zySXzPYu(sF<4fsJ;srq|rT8EOMJPeV7qJgT5%ocRkO9F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iMovC#cJD>6Lz6BlF)@pd+)LBU0^TZ!7T)1 z2oonVOlBUoJ`SuTLlHz@UTN3J$maNI4d&JOj-e}Ptywnx$x-G~>hW-DSQ^5xL4+Om zIavFK^Hp(Q@-q2Ne3Q&3vrUzfj6~&enN>K9DOI`nBl(0lmdeE!nmUb*D-70|$i#y1 zQV&8yucwYDe&8}UXj@b6lI93)=i+v%mpm)FI?tre6Bv?-PvL*QX*88_vPjr1aj7#$ zei83<9xou#>=ZzY*y*-0Z_2IZH?ljNXAh%GzgX{FA$hUVHKd1Ap@^<@&dHL!8@R4gtwn&UbfolBpe|0TE5~Q6V`FC{UyYxN85Pzks zb_@=L&k57Tc;-lI^O8_<&>Rt8XL_6=LyHm1G0YeN&1&ZUSp$p(If&ppRIZP)2s)bx zn^7=8p!qJJZ2SzOF9S$~F~EYu!YK%!n|nbK==@T{tBo;qYCU)n>iOk5qpb%qd1rUP ny~q!g#kH)_tD&oo5Z;b)x7^;UL42Rx6^jBT;in{Kr8EBl$-8ql diff --git a/src/cogs/__pycache__/info.cpython-38.pyc b/src/cogs/__pycache__/info.cpython-38.pyc deleted file mode 100644 index a7f915d8190b0cbc8b64124df4633de35a79b56a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6735 zcmbVR&5s<%b?@r0>G_@=&MrSh*-c7oc?fWqkw}VO(3C_{q-caIn_S6u!^XIGs%N%` zGu^}Lo+a6swS$nih=}7LC&$6^NFRL8$rt|%IRuRy0vj-(oB|kz0Xd2Cd(}O=J1bg> zvxBa#_v%&ktE%_$tJ)8$)slk08wGpwmoF>IZ-_Yfr-OJKPxKKAu5dO~ob1gUCTZ1C z4_I1SG3D(%Y0&`4Qtv($Qj9Q$G54yn%F*o*y<*VaoSTZRK>4mn2>EFdtswRbK0Byv`d>HLvVdjw^iO z9~p1*BTsaUT7^`LFY+aR6jH}>sah^|oS%?Vb^a38R#QFlhCNY*z;i{^@%rTD)va*kt%^wycw&`%4_CWkKU($i zg_ZH6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Dy7pZA$4`_RcJKC5sRQ6uSuXdw*1?%a^-&B06)$ z3d|Ko!`VF*xI$e|%}}Dv=W2F@@F0W(F&iCrN$c{^9c^;=%8w!OJ3LBqTKZb1fppfD z%fqni4x=lmWWs;0HoDIdrXq|kVk+j3DPkMEza#zw6o2m68V~sA5B-z>@6ZJReZuUY zKm6a%hIfn&y8aN~1H&=ie}ImTdB^JmdMBl8SG<%{mnTeAhtBw4W6Lg5B|Z;$`6%#e*B)&7@c~%^ zo=J5B_aOGQ{2nB!eHi*(Z;y6L*O1owq42%PF({EoP63D(<3w%k_cX$<|LSkV5Aoi} zKa&Y5$YizOuq_#CQ>oou$V~A7Hg?BbqO~t`2Ck|QKGKl zL5gN4@mpfoQOkZyO#M&2S;JjT(l{JS*4qubM5cSTPA4sOI-`(JhE%U~I`=2;Fl!MD zq%a)@9gEhME{nuv;=M)1Z7M#bf_y`e$p|_%iZK;r*Wx28_Gc_>bdw}XD9C@J6DTZZ zX_)2`9t+PRp3_a%T5K{Y_ZgogySPT32{ufXT_wiF`eQ~nKy;v!-q}{20v*C}aV`hR zymem{(gJwQiznk>&`_kk!UV@tV<#8=jjXwIKRZ6YP*~VNUAB~Qoz*5N{Sw>6RM@4P? INO|Rd0U$kKT>t<8 diff --git a/src/cogs/__pycache__/info.cpython-39.pyc b/src/cogs/__pycache__/info.cpython-39.pyc index 0d316e5b50546bad532fa7433ee73d64e5f8675f..2ba860b5a38d55bd8ed51435524e9d658400c07c 100644 GIT binary patch delta 1107 zcmaKr&rcIU6vsQ=AKeyOid3KlK_pQM{)nOmjN(rY{y>cMR7{#_XDEx?UGioYhzC7r zylGAyai)C=x+9#nKz&J=FPmf4^RIbDbRdAmom?@ zFB8pM#dn2a(!67)JXI$wRZla*(vMPgi`&dwb4KGPvrVe zc3=BH*J@^1gDIocp`B{E?br{PfD^{1on(@9fOaCx=uacSQ4Euu^cb?9--<#kzxqC~ zZwl{KyO3lLvq+vni`}H5(0R$XWTUl8!;l9;4GkWd!&|6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F3eRg8DDb;6LJ+s`UEN)N%*+KB%|4|#}iqZnU zMLW7!fw{tHID213y`iq9W+Br#sPuxm!T6$Zi zfpp=e)qdD<`_UydGUh*38{Ov!UJ;~=n85UwMr?!j6QbV(_)}$TJm8-#`lp{)bO9Rx zs^vdh{6`b&{N$E-!ijfsWhx)O7prR;p%i+v?OWl3tcL%-wg<4)-cl3h0xz85(LrT54wpwfk$sHOckN%*(F{44Q& zJlC^g_qi;+nlgDra!;OZz9~DWMo23tjwETB9c8AriAn3z!BF3i;uLwYPscCVV#$@2 zo|l?J8h}9IuZSMKqHkci#TjbWwrKZo5`L5x{A>hSMlK)C$YdcY%c@}q zIi6O)i$p+Q+fUFUBy`&8(()k>{{i|V0YC*ZT@_q(dZXj~#zex#DGoEAmXNsTnY@0l zTa?0UxDQfyjXjTx`pu`b7gSj(OX`!STEiQ3%`^2s^k$7US<*NfZq`~2I`pQKzIHn; zwcCS`kNVWEwA*(_Za?c0bnGN(Bbiz>|8!g>R*Cioftv(w6CnQ)WLAQ9oMK3TY+rmx z;9yo{i;lNM34l)Oqmuv@vouV_3EUR$Iozikthvx&lJ8S~OSW@`UZ&Dwtn4W<{t(z@ zbjn1VLFvIQ)hW;h9tZtWNaoQ8s>nk&1IKuy;Xjcm(q3WWZva~}*-_FG+EfXm3hLsd zI>I*o!4U0iq-5+_jVZ@W!*!bZf#VXKh>mXQkC{kLpqwJ7e5hY;^)l7yqtBY9)LP9J a<`VgFv;csqk{4M|Q`%5PYy5@sl|KNX3x6;G diff --git a/src/cogs/__pycache__/modset.cpython-38.pyc b/src/cogs/__pycache__/modset.cpython-38.pyc deleted file mode 100644 index 5235b435bffc0da1719464d57a52d29887a718eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2913 zcmaJ@OLH4V5T2QRXeCRsY%5N}E1QBUq5yWno2u}rgaDzy32_3{9$40zvAptXSImrT zN3}UQ#Vth+oG1>?(N+8l{>5D3lE1(K=-!oLg_PN<>Ft^6>F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9g9yv{*IqRXr~(*v|p zmm-#1k4F*Bb^6>C#js}Fo*?*%4c0nycFy=$UPW?LcnYq#tv#5)n^R%Wqn_2IZPudg=bBXFTo<1L(+_zph*zK~ zyp(ftKs3B?_UXgoK{g%XKRmYMBwFXO-iWi-5ws>;WV{2X|w&91&P zgxXU&Q_TPAy%0vAC UeJjdu9b(ghR)^~AvDPR50^QQI00000 diff --git a/src/cogs/__pycache__/modset.cpython-39.pyc b/src/cogs/__pycache__/modset.cpython-39.pyc index d9c7a7bf6d5012e42cdff8028c0a38a437575f43..c7410405347557a2f24a88a8175cf2b1bccdffe9 100644 GIT binary patch delta 1336 zcmZ{kNpBM|6vxN2I?J?4Q+6mtP|+znZP^P5QLzfKh;0CcX~rZ2lT2h!3oVC$;0qvg zKzsr?R=pzN#GMNVOI)~d;R7I~;^!%}svwbm^Y?pi{Oo`1eDgkfZs59kO@12h1}C1p za5r>PIS927#hMRKJw{F4*AZwVHkyWSC~d}C)AY@zIL{2f5az=CbImV?=!)hQzQa0Z-;W_&km9XIU2f?6P>~HQF{R7ApeO^ z4y^$>1lT1p({+J7?7v9Kz35SY#QNzr$ZQAf;EkNu838#eA&jV%3O!-MA+4#1CM}w6 z01Ea44gd~9sU1wFjf4s-dDtS9?uNu3z+S*G;E;spDEHLHg&EK~6LwoIMeSCYZMu!z z6F7@W50-7;tu=yHom8{@@Z9128e_%s{mVWxTlqX*$vbZ4j}foj&ucfyj3|VJ)o9dC zqogIQS`sIeZst$B-pJo*sQbRZ8rG^TTVf2vj!Agy=}FMaqj6CGcO;!|N3FVW!id!p z8qzZV(Y+28c)m2&`IkS+a`OS1X2NJE?aVK{=vQ_gROiFc`3T@N;0$1yQ{|WhQ>2MS4tOaK1bAAKChXZo} delta 1329 zcmZ{jyKmG$5Qn{ftbKR(-Q@uZFA*YwaKf8_0wfUwa<_-*JkH`1QZu zKJ)aEv!(SwECMA!krE>hA<$~1da8J8krwNoE^T^b#D-@`ZA5B}Jsg{!Dc3l%;(}L@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H!AaP$h1E1hNQ0coJ#ag7t_;rDpJDhC0O9$#<|0i(cU+B~UJ}RE zZ%;qkJWdLFj54zwWgMZd)u=x~-q`RcAmke`?w4S@m|U_NPGeRtX(qo-z1x~yXUe&_ zB4jC}Fi&ZQJ!eVnuztgl%txf*&>w!znFqUvVUW1y?Kgfw?p41$liQaits5G%DiS{O Tx9^EYy>li{tvPe{u;}?Oa%|>M diff --git a/src/cogs/__pycache__/report.cpython-38.pyc b/src/cogs/__pycache__/report.cpython-38.pyc deleted file mode 100644 index 2ad1be95105b19b4c694c49538fb1bf981290271..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4328 zcmbUk*=`)iaeA(uJxMMpUZTX2ZN^$3KR^^WWD)ht)c32q(JX2T|J}(zncH_`nVS_00*b4Q&Sn0&wWQEB!mirHd~gA775M7j<-Kv7b*OWLo4o?n=D;*h$;jXq)v3XYhb1tX`B)pl8S*m7 zlxrN2146AGjTU)1J;Fhx72xDMdZK=&jLM)>EiLyZdiB$KNjc@-WF~{Fe2Sl= zV|4tH0%NrU(C7ecA-NN;<Z1ysf*qFgou32g)6xdh$n8z!{29P!B!3pL z*~2+H_cXKBJXjAk%Bb_XP77z(kuxvkeHUNTw}?^>=btK>jdE!=y#!iRD8ciaQRrJU zilo(?emke%$?2t>{!UKgS-vavJD*FuEUAT@YDnrrPQ53oi#hc^QiqFQ)98clcfY~P?|rX&!rpVdY>f|_46niq1nv6Too4IK#~aSt=JjTC<74O6x-eVZ<%7ik z)7x+dA$)M32c9rHaS#ufC}LDexEuD{g_g(mJ(g?@t6MR513QZ_$*`1>H)5WE06lU; zPZ;}dFaR-r6!?*c_kF+u_!t`HA4GtNY-LQ6OkCMXHpfF(#M14#yOuCT5IZn#a|tCxZLJ2Yi@DUTO%+t2ao8R z#lL?fUKm@_KUDA>GtYUOB8Z< z5$5I~bfe@I8{nDC^R@s%FRuW}Fvv4ZAaAtl_plSKDs*(gH_J6)49fkVq<;TM>acdh zg;Ye3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forces.py b/src/cogs/codeforces.py new file mode 100644 index 00000000..4ce70dca --- /dev/null +++ b/src/cogs/codeforces.py @@ -0,0 +1,216 @@ +import requests +import json +import os +from typing import Optional +from datetime import datetime +from discord import Embed +from discord.ext.commands import Cog +from discord.ext.commands import command + + +class Codeforces(Cog): + def __init__(self, bot): + self.bot = bot + """ + def get_iquote(self): + response = requests.get("https://zenquotes.io/api//random") + quote_json = json.loads(response.text) + quote = "\"" + quote_json[0]['q'] + "\" -" + quote_json[0]['a'] + return (quote_json) + + @command(name="inspire", aliases=["iquote"], help="sends a random inspirational quote") + async def send_iquote(self, ctx): + embed = Embed(title="Inspirational Quote", + colour=ctx.author.colour, + timestamp=datetime.utcnow()) + iquote = self.get_iquote() + embed.add_field(name="Quote", value=iquote[0]['q'], inline=False) + embed.add_field(name="Author", value=iquote[0]['a'], inline=False) + await ctx.send(embed=embed) + + def get_nasa(self): + response = requests.get( + "https://api.nasa.gov/planetary/apod?api_key="+str(os.getenv('NASA_API_KEY'))) + response_json = json.loads(response.text) + return response_json + + @command(name="astropic", aliases=["astropicotd", "nasapic", "nasapicotd"], help="sends astronomy pic of the day from NASA") + async def send_nasa_pic_otd(self, ctx): + embed = Embed(title="NASA", + description="Picture of the day", + colour=0x0B3D91, + timestamp=datetime.utcnow()) + embed.set_thumbnail( + url="https://user-images.githubusercontent.com/63065397/156291255-4af80382-836c-4801-8b4f-47da33ea36c5.png") + embed.set_footer(text="updated daily at 05:00:00 UTC [00:00:00 ET]") + nasa_api = self.get_nasa() + embed.set_image(url=nasa_api["url"]) + embed.add_field(name="Date", value=nasa_api["date"], inline=False) + embed.add_field(name="Image Title", + value=nasa_api["title"], inline=False) + await ctx.send(embed=embed) + + def get_covid19_details(self): + response = requests.get("https://api.covid19api.com/summary") + response_json = json.loads(response.text) + return response_json + + @command(name="covid19", help="sends COVID-19 stats of the given country (global stats if country == null)") + async def covid19_data(self, ctx, *args): + countr = "" + for arg in args: + countr += arg + " " + size = len(countr) + country = countr[:size - 1] + original = country + found = False + stats = self.get_covid19_details() + if country: + for k in stats["Countries"]: + if ((k["CountryCode"]).lower() == country.lower()) or ((k["Country"]).lower() == country.lower()): + embed = Embed( + title=(k["Country"]).title(), + description="COVID-19 Statistics", + colour=0xff0000, + timestamp=datetime.utcnow() + ) + flag_url = "https://flagcdn.com/w640/" + \ + str(k["CountryCode"]).lower() + ".jpg" + embed.set_thumbnail(url=flag_url) + fields = [ + ("New Confirmed Cases", k["NewConfirmed"], True), + ("Total Confirmed Cases", k["TotalConfirmed"], True), + ("Country Code", k["CountryCode"], True), + ("New Deaths", k["NewDeaths"], True), + ("Total Deaths", k["TotalDeaths"], True), + ("Report Time (UTC)", "Date: " + + k["Date"][0:10] + " & Time: " + k["Date"][11:19], True), + ("New Recovered", k["NewRecovered"], True), + ("Total Recovered", k["TotalRecovered"], True) + ] + for n, v, i in fields: + embed.add_field(name=n, value=v, inline=i) + await ctx.send(embed=embed) + found = True + else: + k = stats["Global"] + embed = Embed( + title="Global", + description="COVID-19 Statistics", + colour=0xff0000, + timestamp=datetime.utcnow() + ) + embed.set_thumbnail( + url="https://user-images.githubusercontent.com/63065397/156144079-6f90504d-ad48-4f2e-bec5-bae31cebd858.png") + fields = [ + ("New Confirmed Cases", k["NewConfirmed"], True), + ("Total Confirmed Cases", k["TotalConfirmed"], True), + ("New Deaths", k["NewDeaths"], True), + ("Total Deaths", k["TotalDeaths"], True), + ("New Recovered", k["NewRecovered"], True), + ("Total Recovered", k["TotalRecovered"], True) + ] + for n, v, i in fields: + embed.add_field(name=n, value=v, inline=i) + await ctx.send(embed=embed) + found = True + if not found: + embed = Embed( + title="Error", + description="Country Not Found", + colour=0xff0000 + ) + embed.add_field(name="Given Country Name", + value=original, inline=True) + await ctx.send(embed=embed) + + def get_meme(self): + response = requests.get("https://meme-api.herokuapp.com/gimme") + response_json = json.loads(response.text) + return response_json + + @command(name="meme", aliases=["hehe"], help="sends a random meme") + async def send_meme(self, ctx): + embed = Embed(title="MEME", + colour=0xffee00, + timestamp=datetime.utcnow()) + meme = self.get_meme() + embed.add_field(name="Post Link", value=meme["postLink"], inline=True) + embed.add_field(name="Author", value=meme["author"], inline=True) + embed.add_field(name="Header", value=meme["title"], inline=False) + embed.set_image(url=meme["url"]) + embed.set_thumbnail( + url="https://user-images.githubusercontent.com/63065397/156142184-0675cfee-2863-41d7-bef8-87f600a713b0.png") + await ctx.send(embed=embed) + + def get_subreddit(self, subreddit): + url = str("https://www.reddit.com/r/" + subreddit + ".json") + response = requests.get( + url, headers={'User-agent': 'github.com/code-chaser/dex'}) + print("requesting from : " + + str("https://www.reddit.com/r/" + subreddit + ".json") + "\n") + response_json = json.loads(response.text) + return response_json + + @command(name="reddit", aliases=["subreddit"], help="shows top headlines of the given subreddit") + async def send_subreddit(self, ctx, subreddit, number: Optional[int]): + data = self.get_subreddit(subreddit) + if ('message' in data.keys()): + if data['message'] == "Not Found": + embed = Embed( + title="Status", + colour=0xff0000, + timestamp=datetime.utcnow() + ) + embed.add_field(name="Error", value="Not Found", inline=True) + embed.set_footer(text="given subreddit: "+subreddit) + await ctx.send(embed=embed) + return + embed = Embed( + title="Error", + description="API Request Fail", + colour=0xff0000, + timestamp=datetime.utcnow() + ) + for key_i in data.keys(): + if key_i != 'message' and key_i != 'error': + new_key = key_i + embed.add_field(name='Error Code', value=str( + data['error']), inline=True) + embed.add_field(name='Error Message', value=str( + data['message']), inline=True) + if new_key is not None: + embed.add_field(name=new_key.title(), value=str( + data[new_key]), inline=True) + embed.set_footer(text="given subreddit: "+subreddit) + await ctx.send(embed=embed) + else: + embed = Embed(title=str("/r/"+subreddit), + colour=0xff5700, timestamp=datetime.utcnow()) + embed.set_thumbnail( + url="https://user-images.githubusercontent.com/63065397/156344382-821872f3-b6e3-46e7-b925-b5f1a0821da8.png") + i = 1 + if number is None: + number = 5 + for head in (data['data']['children']): + embed.add_field( + name=str(i), + value=head['data']['title'][0:127] + "...", + inline=False + ) + i += 1 + if i > number: + break + if i <= number: + embed.add_field( + name=str(i), + value="No more data could be received...", + inline=False + ) + if number > 0: + await ctx.send(embed=embed) + return + """ + +def setup(bot): + bot.add_cog(Codeforces(bot)) diff --git a/src/cogs/fun.py b/src/cogs/fun.py index 270696c8..6dc1d5ab 100644 --- a/src/cogs/fun.py +++ b/src/cogs/fun.py @@ -1,8 +1,8 @@ import requests import json import os +import datetime from typing import Optional -from datetime import datetime from discord import Embed from discord.ext.commands import Cog from discord.ext.commands import command @@ -22,7 +22,7 @@ def get_iquote(self): async def send_iquote(self, ctx): embed = Embed(title="Inspirational Quote", colour=ctx.author.colour, - timestamp=datetime.utcnow()) + timestamp=datetime.datetime.utcnow()) iquote = self.get_iquote() embed.add_field(name="Quote", value=iquote[0]['q'], inline=False) embed.add_field(name="Author", value=iquote[0]['a'], inline=False) @@ -39,7 +39,7 @@ async def send_nasa_pic_otd(self, ctx): embed = Embed(title="NASA", description="Picture of the day", colour=0x0B3D91, - timestamp=datetime.utcnow()) + timestamp=datetime.datetime.utcnow()) embed.set_thumbnail( url="https://user-images.githubusercontent.com/63065397/156291255-4af80382-836c-4801-8b4f-47da33ea36c5.png") embed.set_footer(text="updated daily at 05:00:00 UTC [00:00:00 ET]") @@ -72,7 +72,7 @@ async def covid19_data(self, ctx, *args): title=(k["Country"]).title(), description="COVID-19 Statistics", colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) flag_url = "https://flagcdn.com/w640/" + \ str(k["CountryCode"]).lower() + ".jpg" @@ -98,10 +98,11 @@ async def covid19_data(self, ctx, *args): title="Global", description="COVID-19 Statistics", colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_thumbnail( - url="https://user-images.githubusercontent.com/63065397/156144079-6f90504d-ad48-4f2e-bec5-bae31cebd858.png") + url="https://user-images.githubusercontent.com/63065397/156144079-6f90504d-ad48-4f2e-bec5-bae31cebd858.png" + ) fields = [ ("New Confirmed Cases", k["NewConfirmed"], True), ("Total Confirmed Cases", k["TotalConfirmed"], True), @@ -133,7 +134,7 @@ def get_meme(self): async def send_meme(self, ctx): embed = Embed(title="MEME", colour=0xffee00, - timestamp=datetime.utcnow()) + timestamp=datetime.datetime.utcnow()) meme = self.get_meme() embed.add_field(name="Post Link", value=meme["postLink"], inline=True) embed.add_field(name="Author", value=meme["author"], inline=True) @@ -160,7 +161,7 @@ async def send_subreddit(self, ctx, subreddit, number: Optional[int]): embed = Embed( title="Status", colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.add_field(name="Error", value="Not Found", inline=True) embed.set_footer(text="given subreddit: "+subreddit) @@ -170,7 +171,7 @@ async def send_subreddit(self, ctx, subreddit, number: Optional[int]): title="Error", description="API Request Fail", colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) for key_i in data.keys(): if key_i != 'message' and key_i != 'error': @@ -186,7 +187,7 @@ async def send_subreddit(self, ctx, subreddit, number: Optional[int]): await ctx.send(embed=embed) else: embed = Embed(title=str("/r/"+subreddit), - colour=0xff5700, timestamp=datetime.utcnow()) + colour=0xff5700, timestamp=datetime.datetime.utcnow()) embed.set_thumbnail( url="https://user-images.githubusercontent.com/63065397/156344382-821872f3-b6e3-46e7-b925-b5f1a0821da8.png") i = 1 diff --git a/src/cogs/info.py b/src/cogs/info.py index 528c4ee2..86d176b9 100644 --- a/src/cogs/info.py +++ b/src/cogs/info.py @@ -14,98 +14,6 @@ class Info(Cog): def __init__(self, bot): self.bot = bot - @Cog.listener() - async def on_guild_join(self, guild): - with open('./data/tag_messages.json', 'r') as tag_: - tag_messages = json.load(tag_) - tag_messages[str(guild.id)] = "on" - with open('./data/tag_messages.json', 'w') as tag_: - json.dump(tag_messages, tag_, indent=4) - for channel in guild.text_channels: - if channel.permissions_for(guild.me).send_messages: - general = channel - if general is not None: - embed = discord.Embed(title="**GREETINGS!**", description=f""" - Thanks for adding me to {guild.name}! - Use `$dex help` to get started! - Visit: https://github.com/code-chaser/dex/ - - """, color=0x8e38ce, timestamp=datetime.utcnow()) - embed.set_image( - url="https://user-images.githubusercontent.com/63065397/156466208-ffb6db84-f0c0-4860-ab6d-48ad0f2cd5f7.png") - embed.set_author( - name="dex", url="https://github.com/code-chaser/dex", icon_url=self.bot.user.avatar_url) - embed.set_footer(text="made by codechaser", - icon_url="https://avatars.githubusercontent.com/u/63065397?v=4") - embed.set_thumbnail(url=guild.icon_url) - await general.send(embed=embed) - - @Cog.listener() - async def on_guild_remove(self, guild): - with open('./data/tag_messages.json', 'r') as tag_: - tag_messages = json.load(tag_) - if str(guild.id) in tag_messages.keys(): - tag_messages.pop(str(guild.id)) - with open('./data/tag_messages.json', 'w') as tag_: - json.dump(tag_messages, tag_, indent=4) - - @Cog.listener() - async def on_message(self, message): - with open('./data/tag_messages.json', 'r') as tag_: - tag_messages = json.load(tag_) - if tag_messages[str(message.guild.id)] == "off": - return - target = message.author - if target == self.bot.user: - return - embed = Embed( - title="Message Tagged", - colour=target.colour, - timestamp=datetime.utcnow() - ) - embed.set_footer( - text=" tags off -to turn this off" - ) - embed.add_field(name="Message", value=message.content, inline=False) - embed.add_field(name="Author", value=target.mention, inline=True) - embed.set_thumbnail(url=target.avatar_url) - await message.channel.send(embed=embed) - - @Cog.listener() - async def on_command_error(self, ctx, error): - flag = False - embed = Embed( - title="Status", - colour=0xff0000, - timestamp=datetime.utcnow() - ) - if isinstance(error, commands.MissingPermissions): - flag = True - await ctx.send("Missing Permissions!") - return - elif isinstance(error, commands.MissingRequiredArgument): - flag = True - n = "Error" - v = "Missing required arguements" - elif isinstance(error, commands.MemberNotFound): - flag = True - n = "Error" - v = "Requested member not found or Dex doesn't have access to them" - elif isinstance(error, commands.BotMissingPermissions): - flag = True - await ctx.send("Missing Permissions!") - return - elif isinstance(error, commands.CommandNotFound): - flag = True - n = "Error" - v = "Invalid Command" - if flag: - embed.add_field(name=n, value=v, inline=False) - await ctx.send(embed=embed) - return - else: - raise error - @command(name="userinfo", aliases=["ui", "memberinfo", "mi"], help="shows user info") async def user_info(self, ctx, target: Optional[Member]): target = target or ctx.author diff --git a/src/cogs/music.py b/src/cogs/music.py index 4b1a64c8..22e9a40f 100644 --- a/src/cogs/music.py +++ b/src/cogs/music.py @@ -3,7 +3,7 @@ import asyncio from typing import Optional from datetime import datetime -from discord import Embed, Member, Guild +from discord import Embed from discord.ext import commands # Suppress noise about console usage from errors @@ -565,25 +565,25 @@ async def skip_song(self, ctx): @commands.command(name="ping", aliases=["latency"], help="shows the latency of the bot") async def ping(self, ctx): with ctx.typing(): - ping=round(self.bot.latency * 1000, 1) - high=400 - low=30 - red=min((ping)/high,1) - green=1-red - if ping>=high: - red=1 - green=0 - if ping<=low: - red=0 - green=1 + ping = round(self.bot.latency * 1000, 1) + high = 400 + low = 30 + red = min((ping)/high, 1) + green = 1-red + if ping >= high: + red = 1 + green = 0 + if ping <= low: + red = 0 + green = 1 embed = Embed( title="Ping", description="**"+str(ping)+"ms**", - colour=discord.Color.from_rgb(int(red*255),int(green*255),0), + colour=discord.Color.from_rgb(int(red*255), int(green*255), 0), timestamp=datetime.utcnow() ) await ctx.send(embed=embed) + def setup(bot): bot.add_cog(Music(bot)) - \ No newline at end of file diff --git a/src/cogs/report.py b/src/cogs/report.py index 6639fc1f..f018d4c9 100644 --- a/src/cogs/report.py +++ b/src/cogs/report.py @@ -1,16 +1,16 @@ +import discord +import os from typing import Optional from datetime import datetime -from discord import Embed, Member, Guild -from discord.ext.commands import Cog +from discord.ext import commands -import os +class Report(commands.Cog): -class Report(Cog): def __init__(self, bot): self.bot = bot - @Cog.listener() + @commands.Cog.listener() async def on_ready(self): member_count = 0 bot_count = 0 @@ -20,13 +20,13 @@ async def on_ready(self): if m.bot: bot_count += 1 - channel = self.bot.get_channel(int(os.environ['CONSOLE_CHANNEL_ID'])) - embed = Embed(title="Status", colour=0x0023dd, - timestamp=datetime.utcnow()) + channel = self.bot.get_channel(int(os.getenv('CONSOLE_CHANNEL_ID'))) + embed = discord.Embed(title='Status', colour=0x0023dd, + timestamp=datetime.utcnow()) fields = [ - ("Servers", str(len(self.bot.guilds)), True), - ("Total Members", str(member_count), True), - ("Total Bots", str(bot_count), True) + ('Servers', str(len(self.bot.guilds)), True), + ('Total Members', str(member_count), True), + ('Total Bots', str(bot_count), True) ] for n, v, i in fields: embed.add_field(name=n, value=v, inline=i) @@ -34,82 +34,104 @@ async def on_ready(self): await channel.send(embed=embed) for target in self.bot.guilds: - embed = Embed(title="Server Information", - colour=target.owner.colour, - timestamp=datetime.utcnow()) + embed = discord.Embed(title='Server Information', + colour=target.owner.colour, + timestamp=datetime.utcnow()) embed.set_thumbnail(url=target.icon_url) statuses = [ - len(list(filter(lambda m: str(m.status) == "online", target.members))), - len(list(filter(lambda m: str(m.status) == "idle", target.members))), - len(list(filter(lambda m: str(m.status) == "dnd", target.members))), - len(list(filter(lambda m: str(m.status) == "offline", target.members))) + len(list(filter(lambda m: str(m.status) == 'online', target.members))), + len(list(filter(lambda m: str(m.status) == 'idle', target.members))), + len(list(filter(lambda m: str(m.status) == 'dnd', target.members))), + len(list(filter(lambda m: str(m.status) == 'offline', target.members))) ] fields = [ - ("Title", str(target), True), - ("ID", target.id, True), - ("Owner", str(target.owner), True), - ("Region", target.region, True), - ("Created at", target.created_at.strftime( - "%d/%m/%Y %H:%M:%S"), True), - ("Members", len(target.members), True), - ("Humans", len(list(filter(lambda m: not m.bot, target.members))), True), - ("Bots", len(list(filter(lambda m: m.bot, target.members))), True), - ("Banned Members", len(await target.bans()), True), - ("Members' status", ":green_circle: " + str(statuses[0]) + " :orange_circle: " + str( - statuses[1]) + " :red_circle: " + str(statuses[2]) + " :white_circle: " + str(statuses[3]), True), - ("Text Channels", len(target.text_channels), True), - ("Voice Channels", len(target.voice_channels), True), - ("Categories", len(target.categories), True), - ("Roles", len(target.roles), True), - ("Invites", len(await target.invites()), True), - ("\u200b", "\u200b", True) + ('Title', str(target), True), + ('ID', target.id, True), + ('Owner', str(target.owner), True), + ('Region', target.region, True), + ('Created at', target.created_at.strftime( + '%d/%m/%Y %H:%M:%S'), True), + ('Members', len(target.members), True), + ('Humans', len(list(filter(lambda m: not m.bot, target.members))), True), + ('Bots', len(list(filter(lambda m: m.bot, target.members))), True), + ('Banned Members', len(await target.bans()), True), + ("Members' status", ':green_circle: ' + str(statuses[0]) + ' :orange_circle: ' + str( + statuses[1]) + ' :red_circle: ' + str(statuses[2]) + ' :white_circle: ' + str(statuses[3]), True), + ('Text Channels', len(target.text_channels), True), + ('Voice Channels', len(target.voice_channels), True), + ('Categories', len(target.categories), True), + ('Roles', len(target.roles), True), + ('Invites', len(await target.invites()), True), + ('\u200b', '\u200b', True) ] for n, v, i in fields: embed.add_field(name=n, value=v, inline=i) channel = self.bot.get_channel( - int(os.environ['CONSOLE_CHANNEL_ID'])) + int(os.getenv('CONSOLE_CHANNEL_ID')) + ) await channel.send(embed=embed) - @Cog.listener() + @commands.Cog.listener() async def on_message(self, message): target = message.author - if target == self.bot.user: + if target == self.bot.user or target.bot: return - embed = Embed(title="Message Information", - colour=target.colour, - timestamp=message.created_at) + embed = discord.Embed(title='Message Information', + colour=target.colour, + timestamp=message.created_at) embed.set_thumbnail(url=target.avatar_url) embed.set_author(name=str(target), icon_url=target.avatar_url) - embed.add_field(name="Message", value=message.content, inline=False) + embed.add_field(name='Message', value=message.content, inline=False) channel = self.bot.get_channel( - int(os.environ['USAGE_HISTORY_CHANNEL_ID'])) + int(os.getenv('USAGE_HISTORY_CHANNEL_ID')) + ) await channel.send(embed=embed) - embed = Embed(title="Message Information", - colour=target.colour, - timestamp=message.created_at) - embed.set_thumbnail(url=message.guild.icon_url) - fields = [ - ("Sent Time", message.created_at, True), - ("Message ID", message.id, True), - ("Channel", message.channel.name, True), - ("Channel ID", message.channel.id, True), - ("Server", message.guild.name, True), - ("Server ID", message.guild.id, True), - ("Author", str(target), True), - ("Author ID", target.id, True), - ("Author is Bot", target.bot, True), - ("Author Top Role", str(target.top_role), True), - ("Author Status", str(target.status).title(), True), - ("Author Activity", - f"{str(target.activity.type).split('.')[-1].title() if target.activity else 'None'} {target.activity.name if target.activity else ''}", True), - ("Author Joined Discord at", target.created_at.strftime( - "%d/%m/%Y %H:%M:%S"), True), - ("Author Joined that Server at", - target.joined_at.strftime("%d/%m/%Y %H:%M:%S"), True), - ("Author Boosted", bool(target.premium_since), True) - ] + embed = discord.Embed( + title='Message Information', + colour=target.colour if target.colour is not None else 0x530cff, + timestamp=message.created_at + ) + try: + embed.set_thumbnail(url=message.guild.icon_url) + except AttributeError: + pass + if message.guild is not None: + fields = [ + ('Sent Time', message.created_at, True), + ('Message ID', message.id, True), + ('Channel', message.channel.name, True), + ('Channel ID', message.channel.id, True), + ('Server', message.guild.name, True), + ('Server ID', message.guild.id, True), + ('Author', str(target), True), + ('Author ID', target.id, True), + ('Author is Bot', target.bot, True), + ('Author Top Role', str(target.top_role), True), + ('Author Status', str(target.status).title(), True), + ('Author Activity', + f"{str(target.activity.type).split('.')[-1].title() if target.activity else 'None'} {target.activity.name if target.activity else ''}", True), + ('Author Joined Discord at', target.created_at.strftime( + '%d/%m/%Y %H:%M:%S'), True), + ('Author Joined that Server at', + target.joined_at.strftime('%d/%m/%Y %H:%M:%S'), True), + ('Author Boosted', bool(target.premium_since), True) + ] + else: + fields = [ + ('Direct Message', 'True', True), + ('Sent Time', message.created_at, True), + ('Message ID', message.id, True), + ('Author', str(target), True), + ('Author ID', target.id, True), + ('Author is Bot', target.bot, True), + ('Author Status', str(target.status).title(), True), + ('Author Activity', + f"{str(target.activity.type).split('.')[-1].title() if target.activity else 'None'} {target.activity.name if target.activity else ''}", True), + ('Author Joined Discord at', target.created_at.strftime( + '%d/%m/%Y %H:%M:%S'), True), + ] for n, v, i in fields: embed.add_field(name=n, value=v, inline=i) await channel.send(embed=embed) diff --git a/src/main.py b/src/main.py deleted file mode 100644 index 6f5d6b29..00000000 --- a/src/main.py +++ /dev/null @@ -1,56 +0,0 @@ -import discord -import json -import os -import cogs.info as info -import cogs.modset as modset -import cogs.report as report -import cogs.fun as fun -import cogs.music as music -from datetime import datetime -from typing import Optional - -cogs_list = [info, modset, report, fun, music] - - -def get_prefix(client, message): - with open('./data/prefixes.json', 'r') as pref: - prefixes = json.load(pref) - return prefixes[str(message.guild.id)] + ' ' - - -intents = discord.Intents.all() - -client = discord.ext.commands.Bot(command_prefix=get_prefix, intents=intents) - -for cog in cogs_list: - cog.setup(client) - -exhausted_face='https://user-images.githubusercontent.com/63065397/156922064-95c73c2a-b6cb-402e-b24b-d79fe7bf520a.png' - - -@client.event -async def on_ready(): - print('Logged in as {0.user}'.format(client)) - await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name='Stop WW3!', large_image_url=exhausted_face, small_image_url=exhausted_face, start=datetime(2022,2,24))) - - -@client.event -async def on_guild_join(guild): - with open('./data/prefixes.json', 'r') as pref: - prefixes = json.load(pref) - prefixes[str(guild.id)] = '$dex' - with open('./data/prefixes.json', 'w') as pref: - json.dump(prefixes, pref, indent=4) - - -@client.event -async def on_guild_remove(guild): - with open('./data/prefixes.json', 'r') as pref: - prefixes = json.load(pref) - if str(guild.id) in prefixes.keys(): - prefixes.pop(str(guild.id)) - with open('./data/prefixes.json', 'w') as pref: - json.dump(prefixes, pref, indent=4) - - -client.run(os.getenv('BOT_TOKEN')) From 12c489e54b9008dab75878fea4639246274fbc60 Mon Sep 17 00:00:00 2001 From: Yashvardhan Baid Date: Fri, 11 Mar 2022 21:18:14 +0530 Subject: [PATCH 2/8] update bot.py --- src/__pycache__/__init__.cpython-39.pyc | Bin 158 -> 158 bytes src/__pycache__/bot.cpython-39.pyc | Bin 5382 -> 5269 bytes src/bot.py | 11 +++++------ .../__pycache__/codeforces.cpython-39.pyc | Bin 792 -> 792 bytes src/cogs/__pycache__/fun.cpython-39.pyc | Bin 6898 -> 6898 bytes src/cogs/__pycache__/info.cpython-39.pyc | Bin 3963 -> 3963 bytes src/cogs/__pycache__/music.cpython-39.pyc | Bin 15167 -> 15167 bytes src/cogs/__pycache__/report.cpython-39.pyc | Bin 4684 -> 4684 bytes 8 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/__pycache__/__init__.cpython-39.pyc b/src/__pycache__/__init__.cpython-39.pyc index 07139230b8d957fadf8acb07d52b8a53180e7eb3..e2b4ffba59d666e17428e389e8eb52e025580a61 100644 GIT binary patch delta 19 ZcmbQoIFFG#k(ZZ?0SF9#Xiemv3;-t;1W^D0 delta 19 ZcmbQoIFFG#k(ZZ?0SJEY(wxXW82~Dm1l#}s diff --git a/src/__pycache__/bot.cpython-39.pyc b/src/__pycache__/bot.cpython-39.pyc index 793b10a74d463ea0dfc71f9afb73a357da2d183c..fd2e72a7bf3bb85f7b1b84949297ab14c36175db 100644 GIT binary patch delta 1592 zcmZuy-A^1<6rZy*JIpRK%kBaNgtpr+?125GG}h9_LKiG<;4!F3xL+%U& z)+#X&`&L75Of=C%AN%CPKKarY{R@2XVG?6Z^ufQOG4Y&Pi7R#{_qXSsdp>^m%)Mtn z9s1lf9K%RT_&hHUFU$MJQ5fGJJ~jpw*^-&WVilztx8fj8Nla$Sp2QS4zNYTVmdapW zGUI=e?~DndR`RM#u9sym0(HM{uMlyR)Fcu*waNWcKvvy zV@Fueo?>;dUeBo{HSs9G}N~03H3kJtvfwU{F!6Ru+{3uVur07ukx+a-~M(s28 z#C+hb=N1=7PL#!%vILg+TDhTz$yGP7*SWh=-V(nmJ$;sTs}z(s%fYs#A4m(^>#ij_ z;sHDpAH&H7u4A$^u^&K?Km`Rf94f>R70_QOf2n#3l2F&jz2LlUmuuy~wo5TG|L0Ng zSHtlG4u44!7n0ZZf7_1pZk!7n`bK#_N==|N+(0;i!zV8ZbT|vWP)|{UmOT{J0r7ME z%1%4lgfic#@hnLynz*&iXAs5beW+^*J&e;=arhBIsJBs2^eq7@4<3?mB zu-xCmE`Su(IW|-8E_kb}?i9b2vG)!%*{T zHg_GiJ%o!*E)Bb_3hGfZJ|=$B^4&QSsSNxi!D)g)@mk`3nhM9y5S%42#nZ&lvH#XE zG%&;JM!C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QYMcX@3gg?5q<(&W>`gazUzx@+j|_$nwlM(^%vYmv9DIGJ8Fi~Q#MOnhk?(%uBLg~;JHl~_cn0iI^r#W z85zyowpKDzQ?tur4W*rke#8~TC}Irp31Ss-9U$YDl`Cc)C&!CL%c|Ql|LySKr!z1Q zbHKrys|WB+Qole1V#%0ds78Zf7|lkjz=@FK{#Es_72ZBGdi*+G=G(5om#21=P1wQ} hbvFG3L7P$^EZJJc>H}0`!2c{R{6UTU-DD diff --git a/src/bot.py b/src/bot.py index bebaa66e..960bda16 100644 --- a/src/bot.py +++ b/src/bot.py @@ -1,8 +1,8 @@ import discord import json import os -from discord.ext import commands import datetime +from discord.ext import commands class Bot(commands.Bot): @@ -15,7 +15,7 @@ class Bot(commands.Bot): def __init__(self, *args, **kwargs): super().__init__( - command_prefix=get_prefix, + command_prefix=self.get_prefix, intents=discord.Intents.all(), activity=discord.Activity( type=discord.ActivityType.listening, @@ -25,22 +25,22 @@ def __init__(self, *args, **kwargs): start=datetime.datetime(2022, 2, 24), ), ) + for file in os.listdir('./src/cogs'): if file.endswith('.py'): self.load_extension(f'src.cogs.{file[:-3]}') - async def get_prefix(self, bot, message): + async def get_prefix(self, message): with open('./data/prefixes.json', 'r') as pref: prefixes = json.load(pref) print(prefixes[str(message.guild.id)]+"\n\n") return prefixes[str(message.guild.id)] + ' ' - def run(self): + def run(self) -> None: super().run(os.getenv('BOT_TOKEN')) async def on_ready(self) -> None: print('Logged in as {0.user}'.format(self)) - await self.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name='Stop WW3!', start=datetime.datetime(2022, 2, 24))) async def on_guild_join(self, guild) -> None: with open('./data/prefixes.json', 'r') as pref: @@ -117,7 +117,6 @@ async def on_command_error(self, ctx, error) -> None: v = 'Invalid Command' else: raise error - return embed.add_field(name=n, value=v, inline=False) await ctx.send(embed=embed) diff --git a/src/cogs/__pycache__/codeforces.cpython-39.pyc b/src/cogs/__pycache__/codeforces.cpython-39.pyc index 8eb80edef2c6938a7dcf260e8521fcdf5ad59fc9..9a37469177f091505f00081e9bf809e5e41cefe1 100644 GIT binary patch delta 20 acmbQiHiL~jk(ZZ?0SF9#Xl>-?Wd;B$tpn@; delta 20 acmbQiHiL~jk(ZZ?0SI27*4)U=%M1W6umpGj diff --git a/src/cogs/__pycache__/fun.cpython-39.pyc b/src/cogs/__pycache__/fun.cpython-39.pyc index d25578f2f526801ffd5c41bbc61bf409d21f82a5..5f5a4b40fd772a0b0c2263abcc3bd0da6b178c00 100644 GIT binary patch delta 20 acmexl`pJ|#k(ZZ?0SF9#Xl>+vE(HKUa0TxG delta 20 acmexl`pJ|#k(ZZ?0SF#^(cH-WTnYe190r*H diff --git a/src/cogs/__pycache__/info.cpython-39.pyc b/src/cogs/__pycache__/info.cpython-39.pyc index 2ba860b5a38d55bd8ed51435524e9d658400c07c..b2c392a057ff76d5e163e6d7d2915d15927038a5 100644 GIT binary patch delta 42 vcmew@_gjuTk(ZZ?0SF9#Xl>+f;A6Zsxrfh$F?;eszDgjez$ZRAh+h)`3*!t# delta 42 vcmew@_gjuTk(ZZ?0SG3Z*4W71z{eOhxrfh$F>CTczDgjez$ZRAh+h)`2MG)F diff --git a/src/cogs/__pycache__/music.cpython-39.pyc b/src/cogs/__pycache__/music.cpython-39.pyc index 4b97d7ffe22ff9a5a053c2b4ddc57e02b0160ea8..25f069d34317f5651b5bae2b6e51f83c5ceecaed 100644 GIT binary patch delta 20 acmdmAw!e%!k(ZZ?0SF9#Xl>*+u?7G@y#;vy delta 20 acmdmAw!e%!k(ZZ?0SLbLYHZ{-u?7G`n+4JU diff --git a/src/cogs/__pycache__/report.cpython-39.pyc b/src/cogs/__pycache__/report.cpython-39.pyc index 71888b3bd1ec0f290a01032b3dcfa4ddf9c01e8b..f4046fa277fb4c5ccd2c01b24909d56630bed982 100644 GIT binary patch delta 20 acmX@3az=$ak(ZZ?0SF9#Xl>+n6aoM@6a>=% delta 20 acmX@3az=$ak(ZZ?0SNe>Xl~?o6aoM>q6C`& From ff8d393eb738c2f17bef25507fd18fa3fd75e15b Mon Sep 17 00:00:00 2001 From: Yashvardhan Baid Date: Fri, 11 Mar 2022 21:24:28 +0530 Subject: [PATCH 3/8] Create delme.py --- src/delme.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/delme.py diff --git a/src/delme.py b/src/delme.py new file mode 100644 index 00000000..a9ff46db --- /dev/null +++ b/src/delme.py @@ -0,0 +1,69 @@ +import json +import os +import datetime + +import discord +from discord.ext import commands + +exhausted_face = "https://user-images.githubusercontent.com/63065397/156922064-95c73c2a-b6cb-402e-b24b-d79fe7bf520a.png" + + +class Bot(commands.Bot): + """ + a simple bot subclass + """ + + def __init__(self, *args, **kwargs): + super().__init__( + command_prefix=self.get_prefix, + intents=discord.Intents.all(), + activity=discord.Activity( + type=discord.ActivityType.listening, + name="Stop WW3!", + large_image_url=exhausted_face, + small_image_url=exhausted_face, + start=datetime.datetime(2022, 2, 24), + ), + ) # just calling the init of the parent class (commands.Bot) + + self.setup() + + async def get_prefix(self, message): + with open("./data/prefixes.json", "r") as pref: + prefixes = json.load(pref) + print(prefixes[str(message.guild.id)]+"\n\n") + return prefixes[str(message.guild.id)] + " " + + def setup(self) -> None: + """ + setting up the bot which entails + loading all cogs and printing info. + """ + + for _file in os.listdir("src/cogs"): # _file is the name of each file in the cogs dir + if not _file.startswith("_"): # make sure it doesnt load __pycache__ + self.load_extension(f"src.cogs.{_file[:-3]}") # load the cog + + def run(self) -> None: + TOKEN = os.environ["BOT_TOKEN"] + super().run(TOKEN) # just to keep main.py even more tidy + + async def on_ready(self) -> None: + print("Logged in as {0.user}".format(self)) + + async def on_guild_join(self, guild: discord.Guild) -> None: + with open("./data/prefixes.json", "r") as pref: + prefixes = json.load(pref) + + prefixes[str(guild.id)] = "$dex" + with open("./data/prefixes.json", "w") as pref: + json.dump(prefixes, pref, indent=4) + + async def on_guild_remove(self, guild: discord.Guild) -> None: + with open("./data/prefixes.json", "r") as pref: + prefixes = json.load(pref) + + if str(guild.id) in prefixes.keys(): + prefixes.pop(str(guild.id)) + with open("./data/prefixes.json", "w") as pref: + json.dump(prefixes, pref, indent=4) \ No newline at end of file From a38d9a4128722a68afe3d35b051f2598e228b7bf Mon Sep 17 00:00:00 2001 From: Yashvardhan Baid Date: Sat, 12 Mar 2022 19:44:01 +0530 Subject: [PATCH 4/8] cf features yet to be implemented --- src/__pycache__/bot.cpython-39.pyc | Bin 5269 -> 5299 bytes src/bot.py | 3 +- src/cogs/codeforces.py | 7 +++ src/cogs/fun.py | 2 +- src/cogs/music.py | 2 +- src/delme.py | 69 ----------------------------- 6 files changed, 11 insertions(+), 72 deletions(-) delete mode 100644 src/delme.py diff --git a/src/__pycache__/bot.cpython-39.pyc b/src/__pycache__/bot.cpython-39.pyc index fd2e72a7bf3bb85f7b1b84949297ab14c36175db..2c161e7ef0ea071e4c80df5750da8dd0e0e73f47 100644 GIT binary patch delta 379 zcmX|+Jxc>Y5Qca6ZgU^WUQY9+0UNO}2r&va))KX{uu%y}lCjy4MDC6>?jai6XtCH| zz*>|bg1^FFVWEG*Nes>~#XK+XJIrHcQV~rdT!OW8wb5F66>sUaZ`>3~h@xY9NPrv= zN+Jpr*pNMxV-~T*(4S7}dbftkv`=xA5t)igE>lCgOu*={paJ9MGfQrmSLW;y26W}8w=8DTKq!J&jF$H@>F`LT;a4=~RTu6_MKe7rLH0MD4 zqde{f@Mab&i?XEeGw->jGygK^w=cr*yxs41n>`41U3^*V)3>Rwx4a|ztZ%$3ZRi)T zuwTbVSj440WWfoTu?bepd$l=rkoIPjBQ4LVi}Y?rZKUYGr4v8%_<^jCj?Pbh!0?4A%cPkmL?uVCt$JJau&hZZsTAp3Frgp zB6fL@Jb=&P*=48v{yB50`fq(TR4O3277x24{-u6Gwj_4pA3YhKb3?Vza!NM{@G;BI zfLszZrw~RMqTMl@jEvA;c2}3&*8yPBVIJvdrsf1>$qQ+uj=`BF;La&{C8Y$V13sSA zg#f~mw-Vv(3aCcXdebUG58`Ho>Qt}U_vn|d+k5pVcj{N$tN5IL+s}A^?8S+J$y~l?X5Nim|mLXVe$-nruA>CLGnSJAzm^W*k$LSa=Ry- Lr}3t}=-vJU;CoFv diff --git a/src/bot.py b/src/bot.py index 960bda16..0098111e 100644 --- a/src/bot.py +++ b/src/bot.py @@ -74,6 +74,7 @@ async def on_guild_remove(self, guild) -> None: json.dump(tag_messages, tag_, indent=4) async def on_message(self, message) -> None: + await self.process_commands(message) with open('./data/tag_messages.json', 'r') as tag_: tag_messages = json.load(tag_) if tag_messages[str(message.guild.id)] == 'off': @@ -130,7 +131,7 @@ def intro_msg_embed(self, guild): embed = discord.Embed( title='**GREETINGS!**', description=description, - color=0x8e38ce, + color=self.DEX_YELLOW, timestamp=datetime.datetime.utcnow(), ) embed.set_image(url=self.INTRO_IMG_URL) diff --git a/src/cogs/codeforces.py b/src/cogs/codeforces.py index 4ce70dca..eb7aebaa 100644 --- a/src/cogs/codeforces.py +++ b/src/cogs/codeforces.py @@ -11,6 +11,13 @@ class Codeforces(Cog): def __init__(self, bot): self.bot = bot + def get_user_details(self, *username): + for i in username: + usernames += (i+';') + url = str("https://codeforces.com/api/user.info?handles=" + username) + response = requests.get(url) + response_json = json.loads(response.text) + return response_json """ def get_iquote(self): response = requests.get("https://zenquotes.io/api//random") diff --git a/src/cogs/fun.py b/src/cogs/fun.py index 6dc1d5ab..04f37d35 100644 --- a/src/cogs/fun.py +++ b/src/cogs/fun.py @@ -34,7 +34,7 @@ def get_nasa(self): response_json = json.loads(response.text) return response_json - @command(name="astropic", aliases=["astropicotd", "nasapic", "nasapicotd"], help="sends astronomy pic of the day from NASA") + @command(name="apod", aliases=["napod", "astropic", "astropicotd"], help="sends astronomy pic of the day from NASA") async def send_nasa_pic_otd(self, ctx): embed = Embed(title="NASA", description="Picture of the day", diff --git a/src/cogs/music.py b/src/cogs/music.py index 22e9a40f..a16b3254 100644 --- a/src/cogs/music.py +++ b/src/cogs/music.py @@ -518,7 +518,7 @@ async def resume(self, ctx): if not ctx.voice_client.is_playing(): await self.keep_playing(ctx) - @commands.command(name="leave", aliases=["disconnect"], help="leaves if connected to any voice channel") + @commands.command(name="leave", aliases=["disconnect, dc"], help="leaves if connected to any voice channel") async def leave_vc(self, ctx): self.music_queue.clear() if ctx.voice_client is None: diff --git a/src/delme.py b/src/delme.py deleted file mode 100644 index a9ff46db..00000000 --- a/src/delme.py +++ /dev/null @@ -1,69 +0,0 @@ -import json -import os -import datetime - -import discord -from discord.ext import commands - -exhausted_face = "https://user-images.githubusercontent.com/63065397/156922064-95c73c2a-b6cb-402e-b24b-d79fe7bf520a.png" - - -class Bot(commands.Bot): - """ - a simple bot subclass - """ - - def __init__(self, *args, **kwargs): - super().__init__( - command_prefix=self.get_prefix, - intents=discord.Intents.all(), - activity=discord.Activity( - type=discord.ActivityType.listening, - name="Stop WW3!", - large_image_url=exhausted_face, - small_image_url=exhausted_face, - start=datetime.datetime(2022, 2, 24), - ), - ) # just calling the init of the parent class (commands.Bot) - - self.setup() - - async def get_prefix(self, message): - with open("./data/prefixes.json", "r") as pref: - prefixes = json.load(pref) - print(prefixes[str(message.guild.id)]+"\n\n") - return prefixes[str(message.guild.id)] + " " - - def setup(self) -> None: - """ - setting up the bot which entails - loading all cogs and printing info. - """ - - for _file in os.listdir("src/cogs"): # _file is the name of each file in the cogs dir - if not _file.startswith("_"): # make sure it doesnt load __pycache__ - self.load_extension(f"src.cogs.{_file[:-3]}") # load the cog - - def run(self) -> None: - TOKEN = os.environ["BOT_TOKEN"] - super().run(TOKEN) # just to keep main.py even more tidy - - async def on_ready(self) -> None: - print("Logged in as {0.user}".format(self)) - - async def on_guild_join(self, guild: discord.Guild) -> None: - with open("./data/prefixes.json", "r") as pref: - prefixes = json.load(pref) - - prefixes[str(guild.id)] = "$dex" - with open("./data/prefixes.json", "w") as pref: - json.dump(prefixes, pref, indent=4) - - async def on_guild_remove(self, guild: discord.Guild) -> None: - with open("./data/prefixes.json", "r") as pref: - prefixes = json.load(pref) - - if str(guild.id) in prefixes.keys(): - prefixes.pop(str(guild.id)) - with open("./data/prefixes.json", "w") as pref: - json.dump(prefixes, pref, indent=4) \ No newline at end of file From 359e629e0d8f20fd4b6f66fa8481233109b37dca Mon Sep 17 00:00:00 2001 From: Yashvardhan Baid Date: Sat, 12 Mar 2022 23:41:39 +0530 Subject: [PATCH 5/8] saving progress --- src/cogs/fun.py | 40 ++++++------ src/cogs/music.py | 151 ++++++++++++++++++++++++++-------------------- 2 files changed, 104 insertions(+), 87 deletions(-) diff --git a/src/cogs/fun.py b/src/cogs/fun.py index 04f37d35..3da74e2c 100644 --- a/src/cogs/fun.py +++ b/src/cogs/fun.py @@ -1,14 +1,12 @@ +import discord import requests import json import os import datetime -from typing import Optional -from discord import Embed -from discord.ext.commands import Cog -from discord.ext.commands import command +import typing +from discord.ext import commands - -class Fun(Cog): +class Fun(commands.Cog): def __init__(self, bot): self.bot = bot @@ -18,9 +16,9 @@ def get_iquote(self): quote = "\"" + quote_json[0]['q'] + "\" -" + quote_json[0]['a'] return (quote_json) - @command(name="inspire", aliases=["iquote"], help="sends a random inspirational quote") + @commands.command(name="inspire", aliases=["iquote"], help="sends a random inspirational quote") async def send_iquote(self, ctx): - embed = Embed(title="Inspirational Quote", + embed = discord.Embed(title="Inspirational Quote", colour=ctx.author.colour, timestamp=datetime.datetime.utcnow()) iquote = self.get_iquote() @@ -34,9 +32,9 @@ def get_nasa(self): response_json = json.loads(response.text) return response_json - @command(name="apod", aliases=["napod", "astropic", "astropicotd"], help="sends astronomy pic of the day from NASA") + @commands.command(name="apod", aliases=["napod", "astropic", "astropicotd"], help="sends astronomy pic of the day from NASA") async def send_nasa_pic_otd(self, ctx): - embed = Embed(title="NASA", + embed = discord.Embed(title="NASA", description="Picture of the day", colour=0x0B3D91, timestamp=datetime.datetime.utcnow()) @@ -55,7 +53,7 @@ def get_covid19_details(self): response_json = json.loads(response.text) return response_json - @command(name="covid19", help="sends COVID-19 stats of the given country (global stats if country == null)") + @commands.command(name="covid19", help="sends COVID-19 stats of the given country (global stats if country == null)") async def covid19_data(self, ctx, *args): countr = "" for arg in args: @@ -68,7 +66,7 @@ async def covid19_data(self, ctx, *args): if country: for k in stats["Countries"]: if ((k["CountryCode"]).lower() == country.lower()) or ((k["Country"]).lower() == country.lower()): - embed = Embed( + embed = discord.Embed( title=(k["Country"]).title(), description="COVID-19 Statistics", colour=0xff0000, @@ -94,7 +92,7 @@ async def covid19_data(self, ctx, *args): found = True else: k = stats["Global"] - embed = Embed( + embed = discord.Embed( title="Global", description="COVID-19 Statistics", colour=0xff0000, @@ -116,7 +114,7 @@ async def covid19_data(self, ctx, *args): await ctx.send(embed=embed) found = True if not found: - embed = Embed( + embed = discord.Embed( title="Error", description="Country Not Found", colour=0xff0000 @@ -130,9 +128,9 @@ def get_meme(self): response_json = json.loads(response.text) return response_json - @command(name="meme", aliases=["hehe"], help="sends a random meme") + @commands.command(name="meme", aliases=["hehe"], help="sends a random meme") async def send_meme(self, ctx): - embed = Embed(title="MEME", + embed = discord.Embed(title="MEME", colour=0xffee00, timestamp=datetime.datetime.utcnow()) meme = self.get_meme() @@ -153,12 +151,12 @@ def get_subreddit(self, subreddit): response_json = json.loads(response.text) return response_json - @command(name="reddit", aliases=["subreddit"], help="shows top headlines of the given subreddit") - async def send_subreddit(self, ctx, subreddit, number: Optional[int]): + @commands.command(name="reddit", aliases=["subreddit"], help="shows top headlines of the given subreddit") + async def send_subreddit(self, ctx, subreddit, number: typing.Optional[int]): data = self.get_subreddit(subreddit) if ('message' in data.keys()): if data['message'] == "Not Found": - embed = Embed( + embed = discord.Embed( title="Status", colour=0xff0000, timestamp=datetime.datetime.utcnow() @@ -167,7 +165,7 @@ async def send_subreddit(self, ctx, subreddit, number: Optional[int]): embed.set_footer(text="given subreddit: "+subreddit) await ctx.send(embed=embed) return - embed = Embed( + embed = discord.Embed( title="Error", description="API Request Fail", colour=0xff0000, @@ -186,7 +184,7 @@ async def send_subreddit(self, ctx, subreddit, number: Optional[int]): embed.set_footer(text="given subreddit: "+subreddit) await ctx.send(embed=embed) else: - embed = Embed(title=str("/r/"+subreddit), + embed = discord.Embed(title=str("/r/"+subreddit), colour=0xff5700, timestamp=datetime.datetime.utcnow()) embed.set_thumbnail( url="https://user-images.githubusercontent.com/63065397/156344382-821872f3-b6e3-46e7-b925-b5f1a0821da8.png") diff --git a/src/cogs/music.py b/src/cogs/music.py index a16b3254..fa47f88b 100644 --- a/src/cogs/music.py +++ b/src/cogs/music.py @@ -1,9 +1,10 @@ import discord +import requests +import json import youtube_dl import asyncio -from typing import Optional -from datetime import datetime -from discord import Embed +import typing +import datetime from discord.ext import commands # Suppress noise about console usage from errors @@ -97,11 +98,11 @@ async def join_vc(self, ctx): await ctx.author.voice.channel.connect() return else: - embed = Embed( + embed = discord.Embed( title="Error", description=ctx.author.mention + ", you are not connected to a voice channel", colour=0xFF0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_footer(text="join request from " + ctx.author.name) await ctx.send(embed=embed) @@ -114,22 +115,22 @@ async def join_vc(self, ctx): await ctx.voice_client.move_to(ctx.author.voice.channel) return else: - embed = Embed( + embed = discord.Embed( title="Error", description=ctx.author.mention + ", you are not connected to a voice channel", colour=0xFF0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_footer( text="join request from " + ctx.author.name) await ctx.send(embed=embed) return - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Can't move b/w channels while playing music!\n**NOTE: **You can still add music to the queue!"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_footer(text="join request from " + ctx.author.name) await ctx.send(embed=embed) @@ -139,11 +140,11 @@ async def make_join(self, ctx): if ctx.author.voice: await ctx.author.voice.channel.connect() else: - embed = Embed( + embed = discord.Embed( title="Error", description=ctx.author.mention + ", you are not connected to a voice channel", colour=0xFF0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return @@ -157,12 +158,12 @@ async def play_music_from_player(self, ctx, *, player): if player is None: return self.currently_playing_player = player - embed = Embed( + embed = discord.Embed( title="Now Playing", description="- requested by " + self.music_queue[0][1].author.mention, colour=0x00ff00, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_thumbnail(url=self.MUSIC_ICON) embed.set_author(name=player.title, url=player.url, @@ -185,7 +186,7 @@ async def keep_playing(self, ctx): await asyncio.sleep(0.5) @commands.command(name="play", aliases=["stream", "p", "add"], help="streams a song directly from youtube") - async def add_to_queue_0(self, ctx, *, url: Optional[str]): + async def add_to_queue_0(self, ctx, *, url: typing.Optional[str]): if (url is None) and (ctx.message.content[(len(ctx.message.content)-3):(len(ctx.message.content))] != "add"): if ctx.voice_client is None: await self.make_join(ctx) @@ -199,20 +200,20 @@ async def add_to_queue_0(self, ctx, *, url: Optional[str]): if not ctx.voice_client.is_playing(): await self.keep_playing(ctx) else: - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Queue is empty, nothing to play\nUse ` play ` to add to queue"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return elif url is None: - embed = Embed( + embed = discord.Embed( title="Status", colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) n = "Error" v = "Missing required arguements" @@ -226,20 +227,20 @@ async def add_to_queue_0(self, ctx, *, url: Optional[str]): player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True) if player is None: with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join(self.bad_request_error_message), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return self.music_queue.append([player, ctx]) - embed = Embed( + embed = discord.Embed( title="Added to queue", description="\"" + url + "\" requested by " + ctx.author.mention, colour=0x00ff00, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_thumbnail(url=self.MUSIC_ICON) embed.set_author(name=player.title, url=player.url, @@ -259,20 +260,20 @@ async def add_to_queue_1(self, ctx, *, url): player = await YTDLSource.from_url(url, loop=self.bot.loop) if player is None: with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join(self.bad_request_error_message), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return self.music_queue.append([player, ctx]) - embed = Embed( + embed = discord.Embed( title="Downloaded & Added to queue", description="\"" + url + "\" requested by " + ctx.author.mention, colour=0x00ff00, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_thumbnail(url=self.MUSIC_ICON) embed.set_author(name=player.title, url=player.url, @@ -287,21 +288,21 @@ async def add_to_queue_1(self, ctx, *, url): # async def loop(self, ctx): # if ctx.voice_client is None: # with ctx.typing(): - # embed=Embed( + # embed=discord.Embed( # title="Error", # description=''.join("Dex is not in any voice channel\n**Use ` join` to make it connect to one and then use music commands**"), # colour=0xff0000, - # timestamp=datetime.utcnow() + # timestamp=datetime.datetime.utcnow() # ) # await ctx.send(embed=embed) # return # if (not ctx.voice_client.is_playing()) and (not ctx.voice_client.is_paused()): # with ctx.typing(): - # embed=Embed( + # embed=discord.Embed( # title="Error", # description=''.join("Queue is empty, nothing to loop through\nUse ` play ` to add to queue"), # colour=0xff0000, - # timestamp=datetime.utcnow() + # timestamp=datetime.datetime.utcnow() # ) # await ctx.send(embed=embed) # return @@ -316,31 +317,31 @@ async def view_queue(self, ctx, *args): return if ctx.voice_client is None: with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one and then use music commands**"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return if len(self.music_queue) == 0: with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Queue", description=''.join( "Queue is empty, nothing to play\nUse ` play ` to add to queue"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Queue", colour=0x0000ff, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_thumbnail(url=self.MUSIC_ICON) embed.set_author(name="Dex", icon_url=self.bot.user.avatar_url) @@ -363,33 +364,33 @@ async def remove_from_queue(self, ctx, pos): pos = int(pos) if ctx.voice_client is None: with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one and then use music commands**"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return if len(self.music_queue) < int(pos): with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join("There are only " + str(len(self.music_queue)) + " songs in the queue\nNo song at position "+str(pos)+"\n**Use ` queue` to view the queue**"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Removed from queue", description="track requested by " + self.music_queue[int(pos)-1][1].author.mention, colour=0x00ff00, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) player = self.music_queue[int(pos)-1][0] embed.set_thumbnail(url=self.MUSIC_ICON) @@ -406,32 +407,32 @@ async def jump_to(self, ctx, pos): pos = int(pos) if ctx.voice_client is None: with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one and then use music commands**"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return if len(self.music_queue) < int(pos): with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join("There are only " + str(len(self.music_queue)) + " songs in the queue\nNo song at position "+str(pos)+"\n**Use ` queue` to view the queue**"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Jumping to " + str(pos), description="- requested by " + ctx.author.mention, colour=0x00ff00, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) player = self.music_queue[int(pos)-1][0] embed.set_thumbnail(url=self.MUSIC_ICON) @@ -451,21 +452,21 @@ async def jump_to(self, ctx, pos): async def volume(self, ctx, volume: int): if ctx.voice_client is None: with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one and then use music commands**"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return ctx.voice_client.source.volume = volume / 100 with ctx.typing(): - embed = Embed( + embed = discord.Embed( title=str(volume) + "%", colour=0x00ff00, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) embed.set_author(name="Volume set to", icon_url=ctx.author.avatar_url) @@ -475,12 +476,12 @@ async def volume(self, ctx, volume: int): async def stop_music(self, ctx): if ctx.voice_client is None: with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one and then use music commands**"), colour=0xff0000, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) return @@ -492,12 +493,12 @@ async def stop_music(self, ctx): @commands.command(name="pause", help="pauses the music player") async def pause(self, ctx): if ctx.voice_client is None: - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one**"), colour=0xff0000, - timestamp=datetime.utcnow()) + timestamp=datetime.datetime.utcnow()) await ctx.send(embed=embed) elif ctx.voice_client.is_playing(): ctx.voice_client.pause() @@ -505,12 +506,12 @@ async def pause(self, ctx): @commands.command(name="resume", help="resumes the music player") async def resume(self, ctx): if ctx.voice_client is None: - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one**"), colour=0xff0000, - timestamp=datetime.utcnow()) + timestamp=datetime.datetime.utcnow()) await ctx.send(embed=embed) elif ctx.voice_client.is_paused(): ctx.voice_client.resume() @@ -522,12 +523,12 @@ async def resume(self, ctx): async def leave_vc(self, ctx): self.music_queue.clear() if ctx.voice_client is None: - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one**"), colour=0xff0000, - timestamp=datetime.utcnow()) + timestamp=datetime.datetime.utcnow()) await ctx.send(embed=embed) else: await ctx.voice_client.disconnect() @@ -535,20 +536,20 @@ async def leave_vc(self, ctx): @commands.command(name="skip", aliases=["next"], help="skips the currently playing song") async def skip_song(self, ctx): if ctx.voice_client is None: - embed = Embed( + embed = discord.Embed( title="Error", description=''.join( "Dex is not in any voice channel\n**Use ` join` to make it connect to one**"), colour=0xff0000, - timestamp=datetime.utcnow()) + timestamp=datetime.datetime.utcnow()) await ctx.send(embed=embed) else: if ctx.voice_client.is_playing() or ctx.voice_client.is_paused(): async with ctx.typing(): - embed = Embed( + embed = discord.Embed( title="Skipping", colour=0x00ff00, - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) player = self.currently_playing_player embed.set_thumbnail(url=self.MUSIC_ICON) @@ -576,13 +577,31 @@ async def ping(self, ctx): if ping <= low: red = 0 green = 1 - embed = Embed( + embed = discord.Embed( title="Ping", description="**"+str(ping)+"ms**", colour=discord.Color.from_rgb(int(red*255), int(green*255), 0), - timestamp=datetime.utcnow() + timestamp=datetime.datetime.utcnow() ) await ctx.send(embed=embed) + + def get_lyrics(self, song_title): + LYRICS_API_URL = "https://some-random-api.ml/lyrics?title=" + response = requests.get(LYRICS_API_URL + song_title) + response_json = json.loads(response.text) + return response_json + + @commands.command(name="lyrics", help="sends the lyrics of the song") + async def lyrics_command(self, ctx, *args) -> None: + song_title='' + for arg in args: + song_title+=arg+'%20' + if len(song_title)>0: + song_title=song_title[:-3] + else: + song_title=self.currently_playing_player.title + data = self.get_lyrics(song_title) + if len() def setup(bot): From f074a04df544842a599cb5c2f44e168a808390c5 Mon Sep 17 00:00:00 2001 From: Yashvardhan Baid Date: Sun, 13 Mar 2022 00:27:47 +0530 Subject: [PATCH 6/8] [working] lyrics implemented lyrics error handling still not done --- src/__pycache__/bot.cpython-39.pyc | Bin 5299 -> 5301 bytes .../__pycache__/codeforces.cpython-39.pyc | Bin 792 -> 1129 bytes src/cogs/__pycache__/fun.cpython-39.pyc | Bin 6898 -> 6900 bytes src/cogs/__pycache__/music.cpython-39.pyc | Bin 15167 -> 16877 bytes src/cogs/music.py | 45 ++++++++++++++++-- 5 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/__pycache__/bot.cpython-39.pyc b/src/__pycache__/bot.cpython-39.pyc index 2c161e7ef0ea071e4c80df5750da8dd0e0e73f47..cfe6b28a2b1935da18c0769741acb294cffd02fd 100644 GIT binary patch delta 1081 zcmZvbT~E_c7{_ti-=6 zDK{y%XWSERBDZ%$48;|P^HBRL8p%MD-x za8%~56*6k-YNOmP%MXc!T6~@#K}x)AL>VGuY)N>TA z6~m+oGJCQcE4oJSAZM8ED}~e~%N znkT&5Svt-BM3%&aNN=-rwC7|7jo#x}5Hx)|Ay6-b`)oZLk7i-M;z&ej9=4b5MPq%~ zS9@S9Fr9s&zRc!w`R512|Bfbe4-ha9%yL+ACZp!^ck}AA`5c{tZ08gmzsM5Q|2G_3 zicNOMiO80_i;E!$%YX{VKoCd*qd*#%0-gekK#IdsRJBws*6Ss`T2)oYw%doUmkq_n z7wx$Qumq>m9%w<<%Jq^#wNZWBq;ALpaP(W)7LK^(OK%ujqpIH|+^gfL`$*>w3jY9l Cq|sCW delta 1063 zcmZXTTTc@~6vsQ=3)^nDYzrhBT2thrh2V`#3SzvJLXb+KNR@h7x7`(5OP5Ty1hvMP znD|s59DUbE6JN~gi$3@beAUc1@LM=%8*qc0^w%^0Ik(+8^EK%t6PC2pCvS>OAJa3A;_ z2mA{eBL&fj54w&IExe=Kc>K_#ItGtnZ5*=1Avo&A;1XvE)`U_!Z55) z1CnGQFe-bRbP9pD=y@jVJY z^38^cDOa*=9A-KdGCL*Hz-b7MkWWe>H3w#j;h@P=ARM+vMO(-0VDJ>ko<5z~@Hj$O z$#(ba*dpvrLJq|(gKvNk0j!Xy`eb4aOivNYmF;~hm>65w%}i09qCIbZ@`=RT-MPXe?VGT$?V{G`&OmsBPcgY%i&+GZx3&E3Kez#{}u0Aql&fJ=ZY zfDOQ1zzhRbG_73I8;!DAt7)3&Slmk)Bg4H@D$G-70O9tsX{z@2d+xbADlzh|H}Mx_ C`P7{N diff --git a/src/cogs/__pycache__/codeforces.cpython-39.pyc b/src/cogs/__pycache__/codeforces.cpython-39.pyc index 9a37469177f091505f00081e9bf809e5e41cefe1..3429d95df382cb0ae4251d58007ebb9ef285193f 100644 GIT binary patch delta 465 zcmZ9HJxc>Y5Qca5_AY14g@{E!13`LI!?M zB+&L2<^y6w*-c$kKMa)coOxGIon#Ktw44#?q%H+qQcvMJ7us)kRUS`OdW(P!dB{N) zbF_N&_lf^R%{Aj^*npMz71pvAk~Y}X&crqqrI*x>{@BSfitETF6uFEgzNe>9MyeQp I&Fs3lIFhnt@Fb6YevP>3b zT*>SQq&bvnnumQZ?$Q*teVA? zR~67e-%>#Lt%kj+)f_Ou+)`>TutlY6-6LCj`LYQjbVm&CzU;x7A9Jy>1qM1Dp*sl8Xbj@(FTFkmrjs0}UB z8~Uzs2Sd26t*f!JYu-`TwODOfpv4$U^lsq43D&m86v?;yd}n~q8n#I3i(g8k`Gvb0 zA0_9;4X?T8CuY!Y25tO)c`dr$;XH$~yDTyM)-@lhPGUh2E_FC0#(Cl-rq|P(6uWw9 zu|$>}51{__z;8mLhkhHXI=6_gEk*D0qqyQ_A_p#?BGvxwhfp5oktnJu9OK7N=V${l z5-p5)qISZ>#9;aD8@xcGA`#k!w;^AASp3}>8av>^rueqK(3=z)bLz0}bvs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uD|=Y6>HN=3 zEEKs&c_@?ifZ&xeJZ)XUgw+hhT&$7@gZX8uIYr5NB&j%WBO!DOH$|x3;J-n6V3zV_ zwSC0Q^I0kjoyOr%{1%DB7jk}9`C8~$Yah?+46@3_kZ zl{Y)X#O)80W=F*jf(7^hl_f0C=lKh~3E6x7BVoe)a*XAoBw_&pC|$dWA^hNvk< z{zb~&q2z0nyidtDDB$+swBOZk_SBNgGd?a&>DeUei7JdzW*Jn|qT7QHzB zp&SOCWi#T9PxTEax>#i>r61u$B8WRb7a56cp?pFgeI=$xkD=^&d`{xpH>3}ZBcwEp zd<@qh>IQH None: song_title='' for arg in args: @@ -599,9 +601,44 @@ async def lyrics_command(self, ctx, *args) -> None: if len(song_title)>0: song_title=song_title[:-3] else: - song_title=self.currently_playing_player.title + args=self.currently_playing_player.title.split() + for arg in args: + song_title+=arg+'%20' + song_title=song_title[:-3] + data = self.get_lyrics(song_title) - if len() + if not 'lyrics' in data.keys(): + print('title: '+song_title) + with ctx.typing(): + embed = discord.Embed( + title="Error", + description=data['error'].join('\n'+'[try on Google](https://www.google.com/search?q='+song_title+'+lyrics)'), + colour=0xff0000, + timestamp=datetime.datetime.utcnow(), + ) + await ctx.send(embed=embed) + else: + with ctx.typing(): + lyrics=data['lyrics'] + extend_text='\n[see on Google](https://www.google.com/search?q='+song_title+'+lyrics)' + if len(lyrics)>3500: + lyrics=lyrics[:3500]+'... ' + extend_text='[read more](https://www.google.com/search?q='+song_title+'+lyrics)' + + embed=discord.Embed( + title=data['title'], + description=lyrics+extend_text, + color=ctx.author.color, + timestamp=datetime.datetime.utcnow(), + ) + embed.set_author( + name=data['author'], + ) + embed.set_thumbnail(url=data['thumbnail']['genius']) + embed.set_footer( + icon_url=ctx.author.avatar_url, + ) + await ctx.send(embed=embed) def setup(bot): From 57095a9f9b1efca3490bdcf30cb4a1033f2e969d Mon Sep 17 00:00:00 2001 From: Yashvardhan Baid Date: Sun, 13 Mar 2022 18:03:06 +0530 Subject: [PATCH 7/8] bugfixes in music.py --- src/cogs/__pycache__/music.cpython-39.pyc | Bin 16877 -> 17662 bytes src/cogs/music.py | 244 ++++++++++++---------- 2 files changed, 130 insertions(+), 114 deletions(-) diff --git a/src/cogs/__pycache__/music.cpython-39.pyc b/src/cogs/__pycache__/music.cpython-39.pyc index d1ea7bec271a402741a364015e9989ece5ffd524..a95dd27cb169df5f93f1a1463908a19ce1c147e9 100644 GIT binary patch delta 6248 zcmd5=eQaCR6@T~n*?zWTCvlwG`F7g0jhm!RQ#T)7la{Ttq0lxYrO=cTl01{t|l_xIN^bFIRi)#9gGu z#-l@{v8k!ysKT0xZ!7a2nAOHdH|MoK6s}C2AcBx2s-P13A^aB=VOF4<^cK~UmX?GY z1V!i-h@g-G94V%)OM=$JpKMD4{WU(R7DHpgf-PzLk`P|eJiixo#W^u9s}9AI6cs7% zRGn$plAu`UQ_`FzX;F(58=t`K7Zm$EA;PV&s05!g7GwFDi(6MF)PC3s=HTZjd|@$9 zQd}a&I7MDDv)C}n)CaE+J!v*C)hnFuB*Kbq=!X);0Y;c@1QV||XMxNdGz?lG+Maxq zR8P{PIOp?>QiK5^5fFpcDNP$2qWjo0C2M!ILyJIU;v_yIi5rNQNbnK)N4{dS^^g*14-lJ( zJtB+~iF_q&^OBb@m%KyBMfMZ#@k(w-2d=>10GC`bi)}C4AHbK%Naz7>Sk@Z$t+EdC zefCz_M=i%-NQlrVY8KjD~MfAv+9BTOz2l1nU99wJk0pu8)1927=H z5cmhU7i9Q4;QJbUHQB;0l>fO~0eF<;qZjb%Qk;rC?pEDt58&1{Z<(_w(ww9e%~=7y zrAaAiRose)k(vs3zX=z;Ea9*1PYP)%Nemp$*^)NJJs~a-dLM!!?p4c@Vp33jYPnLZ zl+3SSe$Jk>V>&K~w7S5kPPWJ23~tjib3vT3nby35Yc}A_FsGdMC+$fx1{uP0#r$e# z*+qYMhh42n+SOXfmVjEPteLmKICv!m^wb)BsccIij#kQN2v~`)>Ms^&-pwv7YQM#W zSv*if;_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ttS=l=hj|TgY2$n+c-rq{ LFT?5f0oL_DXKseg diff --git a/src/cogs/music.py b/src/cogs/music.py index 9b9e6f96..5bf6b25e 100644 --- a/src/cogs/music.py +++ b/src/cogs/music.py @@ -93,7 +93,7 @@ def __init__(self, bot): self.music_queue = [] @commands.command(name="join", aliases=["connect"], help="joins the voice channel of the author") - async def join_vc(self, ctx): + async def join_command(self, ctx): if ctx.voice_client is None: if ctx.author.voice is not None: await ctx.author.voice.channel.connect() @@ -137,23 +137,36 @@ async def join_vc(self, ctx): await ctx.send(embed=embed) async def make_join(self, ctx): - if ctx.voice_client is None: - if ctx.author.voice: + if ctx.author.voice: + if ctx.voice_client is None: await ctx.author.voice.channel.connect() + return True else: + if (ctx.voice_client.is_playing() or ctx.voice_client.is_paused()) and (ctx.voice_client.channel != ctx.author.voice.channel): + async with ctx.typing(): + mssg_="Can't move b/w channels while playing music!\n**NOTE: **You can still add music to the queue!" + embed=discord.Embed( + title="Error", + description=mssg_, + colour=0xff0000, + timestamp=datetime.datetime.utcnow() + ) + embed.set_footer(text="play request from " + ctx.author.name) + await ctx.send(mssg_) + return True + else: + await ctx.voice_client.move_to(ctx.author.voice.channel) + return True + else: + async with ctx.typing(): embed = discord.Embed( title="Error", description=ctx.author.mention + ", you are not connected to a voice channel", colour=0xFF0000, timestamp=datetime.datetime.utcnow() ) - await ctx.send(embed=embed) - return - else: - if ctx.voice_client.is_playing() or ctx.voice_client.is_paused(): - pass - else: - await ctx.voice_client.move_to(ctx.author.voice.channel) + await ctx.send(embed=embed) + return False async def play_music_from_player(self, ctx, *, player): if player is None: @@ -187,7 +200,7 @@ async def keep_playing(self, ctx): await asyncio.sleep(0.5) @commands.command(name="play", aliases=["stream", "p", "add"], help="streams a song directly from youtube") - async def add_to_queue_0(self, ctx, *, url: typing.Optional[str]): + async def play_command(self, ctx, *, url: typing.Optional[str]): if (url is None) and (ctx.message.content[(len(ctx.message.content)-3):(len(ctx.message.content))] != "add"): if ctx.voice_client is None: await self.make_join(ctx) @@ -211,41 +224,42 @@ async def add_to_queue_0(self, ctx, *, url: typing.Optional[str]): await ctx.send(embed=embed) return elif url is None: - embed = discord.Embed( - title="Status", - colour=0xff0000, - timestamp=datetime.datetime.utcnow() - ) - n = "Error" - v = "Missing required arguements" - embed.add_field(name=n, value=v, inline=False) + async with ctx.typing(): + embed = discord.Embed( + title="Status", + colour=0xff0000, + timestamp=datetime.datetime.utcnow() + ) + n = "Error" + v = "Missing required arguements" + embed.add_field(name=n, value=v, inline=False) await ctx.send(embed=embed) - + + joined = await self.make_join(ctx) + if joined == False: + return + player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True) + if player is None: + async with ctx.typing(): + embed = discord.Embed( + title="Error", + description=''.join(self.bad_request_error_message), + colour=0xff0000, + timestamp=datetime.datetime.utcnow(), + ) + await ctx.send(embed=embed) + return + self.music_queue.append([player, ctx]) async with ctx.typing(): - await self.make_join(ctx) - if ctx.voice_client is None: - return - player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True) - if player is None: - with ctx.typing(): - embed = discord.Embed( - title="Error", - description=''.join(self.bad_request_error_message), - colour=0xff0000, - timestamp=datetime.datetime.utcnow() - ) - await ctx.send(embed=embed) - return - self.music_queue.append([player, ctx]) embed = discord.Embed( title="Added to queue", description="\"" + url + "\" requested by " + ctx.author.mention, colour=0x00ff00, - timestamp=datetime.datetime.utcnow() + timestamp=datetime.datetime.utcnow(), ) embed.set_thumbnail(url=self.MUSIC_ICON) embed.set_author(name=player.title, url=player.url, - icon_url=ctx.author.avatar_url) + icon_url=ctx.author.avatar_url) embed.add_field(name="Title", value=player.title, inline=False) embed.add_field(name="Queue Position", value=len( self.music_queue), inline=True) @@ -253,28 +267,28 @@ async def add_to_queue_0(self, ctx, *, url: typing.Optional[str]): await self.keep_playing(ctx) @commands.command(name='dplay', help="downloads a song and then plays it to reduce any possible lags") - async def add_to_queue_1(self, ctx, *, url): + async def dplay_command(self, ctx, *, url): + await self.make_join(ctx) + if ctx.voice_client is None: + return + player = await YTDLSource.from_url(url, loop=self.bot.loop) + if player is None: + async with ctx.typing(): + embed = discord.Embed( + title="Error", + description=''.join(self.bad_request_error_message), + colour=0xff0000, + timestamp=datetime.datetime.utcnow() + ) + await ctx.send(embed=embed) + return + self.music_queue.append([player, ctx]) async with ctx.typing(): - await self.make_join(ctx) - if ctx.voice_client is None: - return - player = await YTDLSource.from_url(url, loop=self.bot.loop) - if player is None: - with ctx.typing(): - embed = discord.Embed( - title="Error", - description=''.join(self.bad_request_error_message), - colour=0xff0000, - timestamp=datetime.datetime.utcnow() - ) - await ctx.send(embed=embed) - return - self.music_queue.append([player, ctx]) embed = discord.Embed( title="Downloaded & Added to queue", description="\"" + url + "\" requested by " + ctx.author.mention, colour=0x00ff00, - timestamp=datetime.datetime.utcnow() + timestamp=datetime.datetime.utcnow(), ) embed.set_thumbnail(url=self.MUSIC_ICON) embed.set_author(name=player.title, url=player.url, @@ -288,7 +302,7 @@ async def add_to_queue_1(self, ctx, *, url): # @commands.command(name="loop", help="loops the currently playing song") # async def loop(self, ctx): # if ctx.voice_client is None: - # with ctx.typing(): + # async with ctx.typing(): # embed=discord.Embed( # title="Error", # description=''.join("Dex is not in any voice channel\n**Use ` join` to make it connect to one and then use music commands**"), @@ -298,7 +312,7 @@ async def add_to_queue_1(self, ctx, *, url): # await ctx.send(embed=embed) # return # if (not ctx.voice_client.is_playing()) and (not ctx.voice_client.is_paused()): - # with ctx.typing(): + # async with ctx.typing(): # embed=discord.Embed( # title="Error", # description=''.join("Queue is empty, nothing to loop through\nUse ` play ` to add to queue"), @@ -310,14 +324,14 @@ async def add_to_queue_1(self, ctx, *, url): # while True: @commands.command(name="queue", aliases=["view"], help="displays the current queue") - async def view_queue(self, ctx, *args): + async def queue_command(self, ctx, *args): if (ctx.message.content[(len(ctx.message.content)-5):(len(ctx.message.content))] == "queue"): url = "".join(args) if url != "": - await self.add_to_queue_0(ctx, url) + await self.play_command(ctx, url) return if ctx.voice_client is None: - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Error", description=''.join( @@ -328,7 +342,7 @@ async def view_queue(self, ctx, *args): await ctx.send(embed=embed) return if len(self.music_queue) == 0: - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Queue", description=''.join( @@ -338,33 +352,33 @@ async def view_queue(self, ctx, *args): ) await ctx.send(embed=embed) return - with ctx.typing(): - embed = discord.Embed( - title="Queue", - colour=0x0000ff, - timestamp=datetime.datetime.utcnow() - ) - embed.set_thumbnail(url=self.MUSIC_ICON) - embed.set_author(name="Dex", icon_url=self.bot.user.avatar_url) - size = len(self.music_queue) - for i in range(0, size, 25): - if i + 25 > size: - for j in range(i, size): - embed.add_field( - name=str(j + 1), value=self.music_queue[j][0].title, inline=False) - else: - for j in range(i, i + 25): - embed.add_field( - name=str(j + 1), value=self.music_queue[j][0].title, inline=False) + embed = discord.Embed( + title="Queue", + colour=0x0000ff, + timestamp=datetime.datetime.utcnow() + ) + embed.set_thumbnail(url=self.MUSIC_ICON) + embed.set_author(name="Dex", icon_url=self.bot.user.avatar_url) + size = len(self.music_queue) + for i in range(0, size, 25): + if i + 25 > size: + for j in range(i, size): + embed.add_field( + name=str(j + 1), value=self.music_queue[j][0].title, inline=False) + else: + for j in range(i, i + 25): + embed.add_field( + name=str(j + 1), value=self.music_queue[j][0].title, inline=False) + async with ctx.typing(): embed.set_footer( text="Page " + str(int(i / 25) + 1) + " of " + str(int(size / 25) + 1)) - await ctx.send(embed=embed) + await ctx.send(embed=embed) @commands.command(name="remove", help="removes a song from the queue, takes song position as argument") - async def remove_from_queue(self, ctx, pos): + async def remove_command(self, ctx, pos): pos = int(pos) if ctx.voice_client is None: - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Error", description=''.join( @@ -375,7 +389,7 @@ async def remove_from_queue(self, ctx, pos): await ctx.send(embed=embed) return if len(self.music_queue) < int(pos): - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Error", description=''.join("There are only " + str(len(self.music_queue)) + @@ -385,7 +399,7 @@ async def remove_from_queue(self, ctx, pos): ) await ctx.send(embed=embed) return - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Removed from queue", description="track requested by " + @@ -404,10 +418,10 @@ async def remove_from_queue(self, ctx, pos): await ctx.send(embed=embed) @commands.command(name="jump", help="jumps to a song in the queue, takes song position as argument") - async def jump_to(self, ctx, pos): + async def jump_command(self, ctx, pos): pos = int(pos) if ctx.voice_client is None: - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Error", description=''.join( @@ -418,7 +432,7 @@ async def jump_to(self, ctx, pos): await ctx.send(embed=embed) return if len(self.music_queue) < int(pos): - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Error", description=''.join("There are only " + str(len(self.music_queue)) + @@ -428,7 +442,7 @@ async def jump_to(self, ctx, pos): ) await ctx.send(embed=embed) return - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Jumping to " + str(pos), description="- requested by " + ctx.author.mention, @@ -450,9 +464,9 @@ async def jump_to(self, ctx, pos): await self.skip_song(ctx) @commands.command(name="volume", aliases=["vol"], help="changes the volume of the music player") - async def volume(self, ctx, volume: int): + async def volume_command(self, ctx, volume: int): if ctx.voice_client is None: - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Error", description=''.join( @@ -463,7 +477,7 @@ async def volume(self, ctx, volume: int): await ctx.send(embed=embed) return ctx.voice_client.source.volume = volume / 100 - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title=str(volume) + "%", colour=0x00ff00, @@ -474,9 +488,9 @@ async def volume(self, ctx, volume: int): await ctx.send(embed=embed) @commands.command(name="stop", aliases=["stfu", "shut"], help="stops the music player and clears the queue") - async def stop_music(self, ctx): + async def stop_command(self, ctx): if ctx.voice_client is None: - with ctx.typing(): + async with ctx.typing(): embed = discord.Embed( title="Error", description=''.join( @@ -492,7 +506,7 @@ async def stop_music(self, ctx): return @commands.command(name="pause", help="pauses the music player") - async def pause(self, ctx): + async def pause_command(self, ctx): if ctx.voice_client is None: embed = discord.Embed( title="Error", @@ -505,7 +519,7 @@ async def pause(self, ctx): ctx.voice_client.pause() @commands.command(name="resume", help="resumes the music player") - async def resume(self, ctx): + async def resume_command(self, ctx): if ctx.voice_client is None: embed = discord.Embed( title="Error", @@ -521,7 +535,7 @@ async def resume(self, ctx): await self.keep_playing(ctx) @commands.command(name="leave", aliases=["disconnect, dc"], help="leaves if connected to any voice channel") - async def leave_vc(self, ctx): + async def leave_command(self, ctx): self.music_queue.clear() if ctx.voice_client is None: embed = discord.Embed( @@ -535,14 +549,16 @@ async def leave_vc(self, ctx): await ctx.voice_client.disconnect() @commands.command(name="skip", aliases=["next"], help="skips the currently playing song") - async def skip_song(self, ctx): + async def skip_command(self, ctx): if ctx.voice_client is None: - embed = discord.Embed( - title="Error", - description=''.join( - "Dex is not in any voice channel\n**Use ` join` to make it connect to one**"), - colour=0xff0000, - timestamp=datetime.datetime.utcnow()) + async with ctx.typing(): + embed = discord.Embed( + title="Error", + description=''.join( + "Dex is not in any voice channel\n**Use ` join` to make it connect to one**"), + colour=0xff0000, + timestamp=datetime.datetime.utcnow(), + ) await ctx.send(embed=embed) else: if ctx.voice_client.is_playing() or ctx.voice_client.is_paused(): @@ -565,8 +581,8 @@ async def skip_song(self, ctx): ctx.voice_client.stop() @commands.command(name="ping", aliases=["latency"], help="shows the latency of the bot") - async def ping(self, ctx): - with ctx.typing(): + async def ping_command(self, ctx): + async with ctx.typing(): ping = round(self.bot.latency * 1000, 1) high = 400 low = 30 @@ -609,18 +625,18 @@ async def lyrics_command(self, ctx, *args) -> None: data = self.get_lyrics(song_title) if not 'lyrics' in data.keys(): print('title: '+song_title) - with ctx.typing(): - embed = discord.Embed( - title="Error", - description=data['error'].join('\n'+'[try on Google](https://www.google.com/search?q='+song_title+'+lyrics)'), - colour=0xff0000, - timestamp=datetime.datetime.utcnow(), - ) + err_mssg=data['error'] + embed = discord.Embed( + title="Error", + description=err_mssg+('\n'+'[see results from GoogleSearch](https://www.google.com/search?q='+song_title+'+lyrics)'), + colour=0xff0000, + timestamp=datetime.datetime.utcnow(), + ) await ctx.send(embed=embed) else: - with ctx.typing(): + async with ctx.typing(): lyrics=data['lyrics'] - extend_text='\n[see on Google](https://www.google.com/search?q='+song_title+'+lyrics)' + extend_text='\n[see results from GoogleSearch](https://www.google.com/search?q='+song_title+'+lyrics)' if len(lyrics)>3500: lyrics=lyrics[:3500]+'... ' extend_text='[read more](https://www.google.com/search?q='+song_title+'+lyrics)' @@ -628,7 +644,7 @@ async def lyrics_command(self, ctx, *args) -> None: embed=discord.Embed( title=data['title'], description=lyrics+extend_text, - color=ctx.author.color, + color=0x00ff00, timestamp=datetime.datetime.utcnow(), ) embed.set_author( From 39b8c9ed576434f3d8bfaa7cde7c522d9e9ef528 Mon Sep 17 00:00:00 2001 From: Yashvardhan Baid Date: Sun, 13 Mar 2022 18:04:49 +0530 Subject: [PATCH 8/8] nothing --- src/cogs/codeforces.py | 223 ----------------------------------------- 1 file changed, 223 deletions(-) delete mode 100644 src/cogs/codeforces.py diff --git a/src/cogs/codeforces.py b/src/cogs/codeforces.py deleted file mode 100644 index eb7aebaa..00000000 --- a/src/cogs/codeforces.py +++ /dev/null @@ -1,223 +0,0 @@ -import requests -import json -import os -from typing import Optional -from datetime import datetime -from discord import Embed -from discord.ext.commands import Cog -from discord.ext.commands import command - - -class Codeforces(Cog): - def __init__(self, bot): - self.bot = bot - def get_user_details(self, *username): - for i in username: - usernames += (i+';') - url = str("https://codeforces.com/api/user.info?handles=" + username) - response = requests.get(url) - response_json = json.loads(response.text) - return response_json - """ - def get_iquote(self): - response = requests.get("https://zenquotes.io/api//random") - quote_json = json.loads(response.text) - quote = "\"" + quote_json[0]['q'] + "\" -" + quote_json[0]['a'] - return (quote_json) - - @command(name="inspire", aliases=["iquote"], help="sends a random inspirational quote") - async def send_iquote(self, ctx): - embed = Embed(title="Inspirational Quote", - colour=ctx.author.colour, - timestamp=datetime.utcnow()) - iquote = self.get_iquote() - embed.add_field(name="Quote", value=iquote[0]['q'], inline=False) - embed.add_field(name="Author", value=iquote[0]['a'], inline=False) - await ctx.send(embed=embed) - - def get_nasa(self): - response = requests.get( - "https://api.nasa.gov/planetary/apod?api_key="+str(os.getenv('NASA_API_KEY'))) - response_json = json.loads(response.text) - return response_json - - @command(name="astropic", aliases=["astropicotd", "nasapic", "nasapicotd"], help="sends astronomy pic of the day from NASA") - async def send_nasa_pic_otd(self, ctx): - embed = Embed(title="NASA", - description="Picture of the day", - colour=0x0B3D91, - timestamp=datetime.utcnow()) - embed.set_thumbnail( - url="https://user-images.githubusercontent.com/63065397/156291255-4af80382-836c-4801-8b4f-47da33ea36c5.png") - embed.set_footer(text="updated daily at 05:00:00 UTC [00:00:00 ET]") - nasa_api = self.get_nasa() - embed.set_image(url=nasa_api["url"]) - embed.add_field(name="Date", value=nasa_api["date"], inline=False) - embed.add_field(name="Image Title", - value=nasa_api["title"], inline=False) - await ctx.send(embed=embed) - - def get_covid19_details(self): - response = requests.get("https://api.covid19api.com/summary") - response_json = json.loads(response.text) - return response_json - - @command(name="covid19", help="sends COVID-19 stats of the given country (global stats if country == null)") - async def covid19_data(self, ctx, *args): - countr = "" - for arg in args: - countr += arg + " " - size = len(countr) - country = countr[:size - 1] - original = country - found = False - stats = self.get_covid19_details() - if country: - for k in stats["Countries"]: - if ((k["CountryCode"]).lower() == country.lower()) or ((k["Country"]).lower() == country.lower()): - embed = Embed( - title=(k["Country"]).title(), - description="COVID-19 Statistics", - colour=0xff0000, - timestamp=datetime.utcnow() - ) - flag_url = "https://flagcdn.com/w640/" + \ - str(k["CountryCode"]).lower() + ".jpg" - embed.set_thumbnail(url=flag_url) - fields = [ - ("New Confirmed Cases", k["NewConfirmed"], True), - ("Total Confirmed Cases", k["TotalConfirmed"], True), - ("Country Code", k["CountryCode"], True), - ("New Deaths", k["NewDeaths"], True), - ("Total Deaths", k["TotalDeaths"], True), - ("Report Time (UTC)", "Date: " + - k["Date"][0:10] + " & Time: " + k["Date"][11:19], True), - ("New Recovered", k["NewRecovered"], True), - ("Total Recovered", k["TotalRecovered"], True) - ] - for n, v, i in fields: - embed.add_field(name=n, value=v, inline=i) - await ctx.send(embed=embed) - found = True - else: - k = stats["Global"] - embed = Embed( - title="Global", - description="COVID-19 Statistics", - colour=0xff0000, - timestamp=datetime.utcnow() - ) - embed.set_thumbnail( - url="https://user-images.githubusercontent.com/63065397/156144079-6f90504d-ad48-4f2e-bec5-bae31cebd858.png") - fields = [ - ("New Confirmed Cases", k["NewConfirmed"], True), - ("Total Confirmed Cases", k["TotalConfirmed"], True), - ("New Deaths", k["NewDeaths"], True), - ("Total Deaths", k["TotalDeaths"], True), - ("New Recovered", k["NewRecovered"], True), - ("Total Recovered", k["TotalRecovered"], True) - ] - for n, v, i in fields: - embed.add_field(name=n, value=v, inline=i) - await ctx.send(embed=embed) - found = True - if not found: - embed = Embed( - title="Error", - description="Country Not Found", - colour=0xff0000 - ) - embed.add_field(name="Given Country Name", - value=original, inline=True) - await ctx.send(embed=embed) - - def get_meme(self): - response = requests.get("https://meme-api.herokuapp.com/gimme") - response_json = json.loads(response.text) - return response_json - - @command(name="meme", aliases=["hehe"], help="sends a random meme") - async def send_meme(self, ctx): - embed = Embed(title="MEME", - colour=0xffee00, - timestamp=datetime.utcnow()) - meme = self.get_meme() - embed.add_field(name="Post Link", value=meme["postLink"], inline=True) - embed.add_field(name="Author", value=meme["author"], inline=True) - embed.add_field(name="Header", value=meme["title"], inline=False) - embed.set_image(url=meme["url"]) - embed.set_thumbnail( - url="https://user-images.githubusercontent.com/63065397/156142184-0675cfee-2863-41d7-bef8-87f600a713b0.png") - await ctx.send(embed=embed) - - def get_subreddit(self, subreddit): - url = str("https://www.reddit.com/r/" + subreddit + ".json") - response = requests.get( - url, headers={'User-agent': 'github.com/code-chaser/dex'}) - print("requesting from : " + - str("https://www.reddit.com/r/" + subreddit + ".json") + "\n") - response_json = json.loads(response.text) - return response_json - - @command(name="reddit", aliases=["subreddit"], help="shows top headlines of the given subreddit") - async def send_subreddit(self, ctx, subreddit, number: Optional[int]): - data = self.get_subreddit(subreddit) - if ('message' in data.keys()): - if data['message'] == "Not Found": - embed = Embed( - title="Status", - colour=0xff0000, - timestamp=datetime.utcnow() - ) - embed.add_field(name="Error", value="Not Found", inline=True) - embed.set_footer(text="given subreddit: "+subreddit) - await ctx.send(embed=embed) - return - embed = Embed( - title="Error", - description="API Request Fail", - colour=0xff0000, - timestamp=datetime.utcnow() - ) - for key_i in data.keys(): - if key_i != 'message' and key_i != 'error': - new_key = key_i - embed.add_field(name='Error Code', value=str( - data['error']), inline=True) - embed.add_field(name='Error Message', value=str( - data['message']), inline=True) - if new_key is not None: - embed.add_field(name=new_key.title(), value=str( - data[new_key]), inline=True) - embed.set_footer(text="given subreddit: "+subreddit) - await ctx.send(embed=embed) - else: - embed = Embed(title=str("/r/"+subreddit), - colour=0xff5700, timestamp=datetime.utcnow()) - embed.set_thumbnail( - url="https://user-images.githubusercontent.com/63065397/156344382-821872f3-b6e3-46e7-b925-b5f1a0821da8.png") - i = 1 - if number is None: - number = 5 - for head in (data['data']['children']): - embed.add_field( - name=str(i), - value=head['data']['title'][0:127] + "...", - inline=False - ) - i += 1 - if i > number: - break - if i <= number: - embed.add_field( - name=str(i), - value="No more data could be received...", - inline=False - ) - if number > 0: - await ctx.send(embed=embed) - return - """ - -def setup(bot): - bot.add_cog(Codeforces(bot))