-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinosuke_bot.py
More file actions
83 lines (65 loc) · 2.64 KB
/
inosuke_bot.py
File metadata and controls
83 lines (65 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#Discord
import discord
from discord.ext import commands
import pandas as pd
import random
#Token
from tokens import token
# Client
client = commands.Bot(command_prefix='%')
#Functions
#Commands
@client.command(name='version')
async def version(context):
emb=discord.Embed(title="Current Version", description="Version of the bot is 1.0", color=0x00ff00)
emb.add_field(name="Version Code:", value="v1.0.1", inline=False)
emb.add_field(name="Date Released:", value="20/02/21", inline=False)
emb.set_footer(text="Version")
emb.set_author(name="Ruben Romero")
await context.message.channel.send(embed=emb)
@client.command(name='kick', pass_context=True)
@commands.has_permissions(kick_members=True)
async def kick(context, member: discord.Member):
await member.kick()
await context.send('User '+member.display_name+ 'has been kicked')
@client.command(name='ban', pass_context=True)
@commands.has_permissions(kick_members=True)
async def ban(context, member: discord.Member, *, reason=None):
await member.ban()
await context.send('User '+member.display_name+ 'has been banned')
@client.command(name='dm')
async def dm(context):
await context.message.author.send("Hi! Did you ask for a DM?")
#myID=686620827717730384
#await context.message.channel.send(context.message.author.id)
#if(context.message.author.id==myID):
#else:
# await context.message.author.send("U are not an Admin")
@client.command(name='img')
async def img(context):
await context.channel.send(file=discord.File("InosukeBot/santiago.jpeg"))
#Events
@client.event
async def on_ready():
configChanID=812579716161994802
configChan=client.get_channel(configChanID)
await configChan.send('Hola zorras!')
await client.change_presence(status=discord.Status.do_not_disturb, activity=discord.Game('Fcking around'))
#df = pd.DataFrame({"A":['Hello','Test']})
#df.to_csv('C:/Users/ruben/Documents/Inosuke Bot/InosukeBot/data.csv')
@client.event
async def on_message(message):
if message.author.id==725560073266659351:
await message.channel.send(file=discord.File("InosukeBot/santiago.jpeg"))
if message.content == 'Append':
df = pd.read_csv('C:/Users/ruben/Documents/Inosuke Bot/InosukeBot/data.csv',index_col=0)
df=df.append({"A": 'New message to append'}, ignore_index=True)
df.to_csv('C:/Users/ruben/Documents/Inosuke Bot/InosukeBot/data.csv')
await client.process_commands(message)
@client.event
async def on_disconnect():
configChanID=812579716161994802
configChan=client.get_channel(configChanID)
await configChan.send('Aios perras')
#Run client
client.run(token)