remove the class and print tracked message
This commit is contained in:
parent
62704394d7
commit
3e8abef694
1 changed files with 7 additions and 6 deletions
13
main.py
13
main.py
|
@ -3,25 +3,26 @@ import discord
|
||||||
from discord.ext.commands import Bot
|
from discord.ext.commands import Bot
|
||||||
|
|
||||||
bot_version = os.environ['version']
|
bot_version = os.environ['version']
|
||||||
print('] radiobot ' + bot_version + ' starting')
|
print('radiobot ' + bot_version + ' starting')
|
||||||
|
|
||||||
bot_token = os.environ['token']
|
bot_token = os.environ['token']
|
||||||
|
|
||||||
client = Bot(command_prefix="!")
|
client = Bot(command_prefix="!")
|
||||||
|
|
||||||
isPlaying = False
|
isPlaying = False
|
||||||
class MyClient(discord.Client):
|
class Radio(discord.Client):
|
||||||
|
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
print('Logged on as', self.user)
|
print('Logged on as', self.user)
|
||||||
|
|
||||||
async def on_message(self, message):
|
async def on_message(self, message):
|
||||||
print (']' + message.author.nick + '<' + message.content + '>')
|
|
||||||
# don't respond to ourselves
|
# don't respond to ourselves
|
||||||
if message.author == self.user:
|
if message.author == self.user:
|
||||||
return
|
return
|
||||||
|
|
||||||
if message.content == 'version':
|
print ('<' + message.author.nick + '> ' + message.content)
|
||||||
|
|
||||||
|
if message.content == '!version':
|
||||||
await message.channel.send('] radiobot ' + bot_version)
|
await message.channel.send('] radiobot ' + bot_version)
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
|
@ -37,5 +38,5 @@ class MyClient(discord.Client):
|
||||||
print("gg")
|
print("gg")
|
||||||
await self.voiceChannel.disconnect()
|
await self.voiceChannel.disconnect()
|
||||||
|
|
||||||
client = MyClient()
|
client = Radio()
|
||||||
client.run(bot_token) # Get token for this shit
|
client.run(bot_token) # Get tokeun for this shit
|
||||||
|
|
Loading…
Reference in a new issue