From 2f38cae85b13dba6367169a52d1c3f9aeccf49ef Mon Sep 17 00:00:00 2001 From: Rebeca Angulo Rojas Date: Mon, 22 Mar 2021 11:33:00 -0600 Subject: [PATCH 1/6] =?UTF-8?q?a=C3=B1adi=20hel=20para=20leave?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- help_command.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/help_command.py b/help_command.py index 7b672f5..ca13d43 100644 --- a/help_command.py +++ b/help_command.py @@ -59,5 +59,14 @@ async def inspire(self,context): embed.set_author(name="ITAM4Code") await context.channel.send(embed=embed) + @help.command() + async def leave(self,context): + embed= discord.Embed(title="leave", description= "Comando para que un usuario deje un proyecto al que esté asignado",color=0x00ff00) + embed.add_field(name="**Syntax**", value="--leave") + embed.add_field(name="Permissions", value="All Users") + embed.set_author(name="ITAM4Code") + await context.channel.send(embed=embed) + + def setup(bot): bot.add_cog(Help(bot)) \ No newline at end of file From a733b4c05b17b37c6efe7efe88ebbd2d6808e4f5 Mon Sep 17 00:00:00 2001 From: Rebeca Angulo Rojas Date: Mon, 22 Mar 2021 11:59:27 -0600 Subject: [PATCH 2/6] modif a .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4c49bd7..8661818 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .env +.vscode From b591e74a9dead6bcfaf390f80d4676e052f6ca04 Mon Sep 17 00:00:00 2001 From: Rebeca Angulo Rojas Date: Mon, 22 Mar 2021 12:41:10 -0600 Subject: [PATCH 3/6] agregue funciones para abandonar proyetco --- __pycache__/error_handler.cpython-38.pyc | Bin 1429 -> 2019 bytes __pycache__/help_command.cpython-38.pyc | Bin 3562 -> 3944 bytes bot.py | 16 ++++++++++++++++ help_command.py | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/__pycache__/error_handler.cpython-38.pyc b/__pycache__/error_handler.cpython-38.pyc index 72db757ea9e43d18d16625b567b18eee32791a46..4b5a990455b3321d847db2535da868382285b7c1 100644 GIT binary patch delta 752 zcmZvZ&ubGw6vuZqX=3wZ+iInvf+MAnC}xd%@*pH_#eyjkE!vAZ*&Wk~yZgeMU1&lf zLjM6_@gNB5Um#ip@g(%WSiyt-4PHF?HiY!hF6_?C`+na0zIpqm_-D@ADwhieJ&Qk| zJpYpaY%Q_T-vOQNEiF;oC_B;-BIrgQAoPT`*AV(0*tJ`Vw}ith?J@ED)mxpOn*c9) zLt)ik11Iuj5NdnlQKMD6aechrS_N0yuF?*md#wYZEfE2q?TEnjB-Z+aB<`~NW|PHV z*}GAg+cU#_&)PTf`yT7f_6i@0Ztf%7FkIuF!HkJMM|v{V^T+gg(*I5MQ^)j$ee*TL zi&J8DLR>wvI6X%0Op(G-5!ZNVREzOr^V^l-_PWOfcE>jd9sm!O3?!Exe*x%=5V+KR ziNcM4ne|b0n4RRBAS=r4g}l-&584sPB#JtM=3lt6v#cnh2yBhgJ5{!#9T5% z@P^CVg3Dc{L&>9niuyES@}S~UOS1Dj%P6Ds)WIfjipYSp5DyQy@OY#nfeNZ;;)Tqo zr%ACX+{WZu$=N1^Ev2;zx(~)JY6XE#tfO!nJeizZ1wZv{%Puv6A|z@({n?4tl72_x zCWLn(3f%Zdrdh91A4aCcvSyBD**vW!v&0rpd@YJw@ulnzyBv#|rTBezP_`*un`se- Um3U>QUR;>esXDUYFW^rnHzWbz+p7Y|AD)Igc%!QD*XbcJaw?*(!OJfVLJhf$U~1Ql4DQZpf_wWEU}m2xXuu HV@4SOmT)gw diff --git a/__pycache__/help_command.cpython-38.pyc b/__pycache__/help_command.cpython-38.pyc index 33feff2ce04cbd5dacb6d24b8c7e9be2419feb88..44ffa4d4bcb444506a03856b92215e3e309046ae 100644 GIT binary patch delta 412 zcmaDQ{X&i}l$V!_0SH8HMy)OX2GF3nBND=F6Z3~}_;Gco|vCeHaOsro6I z#mV_aDY{AdCHfhuIR){_`MJ4?c`14YmA5!Hi!n8@r?TdxCYGg^Isu*HoDY)AS13p< zN>nH;O;sq(Qz$JiO)SdHS4c_C0`m)s@+(u5OY#*GbHGYci%Sl#R7fn&OwUV9$uANB z8dD?)BGiFI6}zr3*!al}Z03^}a!GP?c>rCZ2N8S7R6xd~pB( delta 182 zcmaDM_ez>Cl$V!_0SI=Si%8Joo5**Kao)tIy<(}H3%C|Cq==-5wlFj^MhT>d1v6-h zPoBW&WBAK1*(xTqIJKxarl>S2H7~{`Ke;qFHLs*N#xumx*TgwLB{e1`vp6}wC`C6Z zza(a}7t=)c&Ai+^jFT(4BsLrJC^E9@1FdwM9L}r3C^)%+w|+7UpDd%&WFfZ fynaC0VkVHY7>g_?@8-*6w4B5zKG~69jnN4JA-6N7 diff --git a/bot.py b/bot.py index 813ef59..26ec863 100644 --- a/bot.py +++ b/bot.py @@ -103,6 +103,22 @@ async def show_available_roles(context): embed.add_field(name="Proyecto: "+role.name, value=role.id) await context.message.channel.send(embed=embed) + + +#Abandonar proyecto +@client.command(name='leave') +async def leave(context, args): + user=context.message.author + for role in user.roles : + role=get(context.message.guild.roles, name=args) ##es True si tiene ese rol + if role: + await role.delete() + await context.message.channel.send('El rol asignado al proyecto fue eliminado') + else: + await context.message.channel.send('El rol/proyecto no existe') + + + #Test command @client.command(name='test') async def test(ctx, arg): diff --git a/help_command.py b/help_command.py index 32c7b24..a8426f2 100644 --- a/help_command.py +++ b/help_command.py @@ -62,7 +62,7 @@ async def inspire(self,context): @help.command() async def leave(self,context): embed= discord.Embed(title="leave", description= "Comando para que un usuario deje un proyecto al que esté asignado",color=0x00ff00) - embed.add_field(name="**Syntax**", value="--leave") + embed.add_field(name="**Syntax**", value="--leave [nombre del proyecto]") embed.add_field(name="Permissions", value="All Users") embed.set_author(name="ITAM4Code") await context.channel.send(embed=embed) From 0bf80e3561cf919693dac7d7f208c0d2527a8afe Mon Sep 17 00:00:00 2001 From: Rebeca Angulo Rojas Date: Tue, 23 Mar 2021 09:53:06 -0600 Subject: [PATCH 4/6] =?UTF-8?q?a=C3=B1adi=20el=20help?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/help_command.cpython-38.pyc | Bin 3944 -> 3966 bytes bot.py | 37 ++++++++++++++---------- help_command.py | 12 ++++++-- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/__pycache__/help_command.cpython-38.pyc b/__pycache__/help_command.cpython-38.pyc index 44ffa4d4bcb444506a03856b92215e3e309046ae..3a19618f566cbe7ff2a1fb7a52c1b9e6585311f3 100644 GIT binary patch delta 58 zcmaDM_fL*Dl$V!_0SKy|L?qN~yRY*zAQ79 Date: Wed, 7 Apr 2021 21:58:55 -0500 Subject: [PATCH 5/6] =?UTF-8?q?a=C3=B1adi=20funcion=20de=20bienvenida?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/help_command.cpython-38.pyc | Bin 3966 -> 4277 bytes bot.py | 40 +++++++++++++++++++++++- help_command.py | 2 ++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/__pycache__/help_command.cpython-38.pyc b/__pycache__/help_command.cpython-38.pyc index 3a19618f566cbe7ff2a1fb7a52c1b9e6585311f3..68f83845b210649d41ee08b2c6de57aefc883140 100644 GIT binary patch delta 381 zcmew-w^flZl$V!_0SGGD@)CFjC-Plm+&1xPuU;zW0yEJ{=;EKOA?%~L2XE=?@T%vVTB%>wfa zit;N{lS}dy5_7;xQj1FtuT)4Z&P>lsOvx`202)&y2qM%$4w0Q~$0a-YJ-fx^C0tWC z2lDVRvg!lH-8U!knlQ2&0GWQ1XY*+=3Qa!3*TTp(*^yJ2ixnu!1H{EDle77iCQszg b;tdCJnScZXW0BQl4uL#ItI6d8wv65YP2xhb diff --git a/bot.py b/bot.py index c118713..23e394d 100644 --- a/bot.py +++ b/bot.py @@ -8,6 +8,12 @@ from dotenv import load_dotenv from discord.utils import get + +intents = discord.Intents.default() +intents.members = True +client2 = discord.Client(intents = intents) +#client2=discord.Client(intents=intents) + #Load TOKEN load_dotenv() token=os.getenv('BOT_TOKEN') @@ -15,6 +21,7 @@ #Prefix client = commands.Bot(command_prefix='--') + #Approved roles to make few changes approved_roles=['admin','mesa'] other_roles=['@everyone','Colmillo'] @@ -25,10 +32,22 @@ client.load_extension('error_handler') #Event when connected -@client.event +@client2.event async def on_ready(): await client.change_presence(status=discord.Status.online, activity=discord.Game('ITAM4Code')) + print('loggeado como') + print(client.user.name) + print(client.user.id) +# enviar un mensaje de bienvenida: +newUserMessage = """ Bienvenido colega!""" + +@client2.event +async def on_member_join(member): + guild = client2.get_guild(821699949493485578) + channel = guild.get_channel(821699949493485581) + await channel.send(newUserMessage + f' {member.mention} ! :partying_face:') + await member.send(f'Welcome to the {guild.name} server, {member.name}! :partying_face:') #Version command @client.command(name='version') @@ -143,6 +162,25 @@ async def inspire(ctx): quote = get_quote() await ctx.send(quote) +@client.command(name='emoji') +async def emoji(ctx): + await ctx.send("🔥") + await ctx.send(":noice:") + await ctx.send("<:67069a13e006345ce28ecc581f2ed162>") + + + + + +#@client.event +#async def on_member_leave(member): + # print("Recognised that a member called " + member.name + " left") + # embed=discord.Embed(title=" Goodbye "+member.name+"!", description="Until we meet again old friend.", color=0x00ff00) #Run client +#embed=discord.Embed(title= "Informacion usuario", description="Bienvenido", color=0x00ff00) +client2.run(token) client.run(token) +# puedo tener dos clients? + + \ No newline at end of file diff --git a/help_command.py b/help_command.py index 9be2dca..6901128 100644 --- a/help_command.py +++ b/help_command.py @@ -92,5 +92,7 @@ async def show_projects(self,context): await context.channel.send(embed=embed) + + def setup(bot): bot.add_cog(Help(bot)) \ No newline at end of file From 35beb0083bb9e609df8ad400486d17b5ed03364c Mon Sep 17 00:00:00 2001 From: Rebeca Angulo Rojas Date: Sun, 11 Apr 2021 12:32:01 -0500 Subject: [PATCH 6/6] =?UTF-8?q?a=C3=B1adi=20funcion=20de=20bienvenida=20co?= =?UTF-8?q?n=20modificaciones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 6148 bytes bot.py | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e2cb111ca08e7fc9e38cc68517e77c1f4f8087a6 GIT binary patch literal 6148 zcmeHK%Wl&^6upy%)~14bfkZb*-mr_Jq*MhKNNJiZA^}1e!2*zL#}={VdP3|FN(joH zFMyxmJNN*^x3GdU51?_9Wf7pc)}1qtduBW*nHdievGzD>5;;U_rsKjh!ESuA-w)w z8ggq{;Uphw*5`1TCVA0ld}Wo5>V?fM%eF21lKtEp@QGIh#W-&Vqo<M| zxzpP>Z`IuW8wazQZC$_L7{j7ivw#gA54)?KX29!}msjOYWXV*&n9l6n_7|F*E$LR!*>SGoA zeTltAcd185)TR66QFrlO*|$=(O%D-yNFBNdtYf5Tkx>x}oSofe%qpgrG^T`dc!4*} z!7S)C6(#PM5*I~d=dXbNyIb4mKa?54C}0%$#}p9zg9{hf(l}Qrw+MFlD<(^m|p=%{yfTub9zp`sJhmk*{#X8MN0PNi<_aYRi9U{H gMjXYvaA|0BMF!Z?I9G@onE4QpGML0D@JAK+0Xapt(*OVf literal 0 HcmV?d00001 diff --git a/bot.py b/bot.py index 23e394d..8741e22 100644 --- a/bot.py +++ b/bot.py @@ -178,8 +178,9 @@ async def emoji(ctx): # embed=discord.Embed(title=" Goodbye "+member.name+"!", description="Until we meet again old friend.", color=0x00ff00) #Run client #embed=discord.Embed(title= "Informacion usuario", description="Bienvenido", color=0x00ff00) -client2.run(token) client.run(token) +client2.run(token) + # puedo tener dos clients?