-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot_markII.py
37 lines (31 loc) · 1.04 KB
/
bot_markII.py
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
from time import sleep
import os
import discord
import keyboard
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
intents = discord.Intents.all()
client = discord.Client(command_prefix='!', intents=intents)
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user: #or message.author == "Darthmuffin#5299":
return
print(message.author)
print(message.content)
#print(len(message.content))
if message.content.isdigit():
#await message.channel.send("is int")
count = int(message.content)
next_count = count + 1
next_count_str = str(next_count)
#keyboard.write(next_count_str)
sleep(1)
#keyboard.press_and_release("enter")
await message.channel.send(next_count_str)
else:
await message.channel.send("Please refrain from using this channel for things other than counting or you will be terminated")
client.run(TOKEN)