So, I'm trying to write a bot for a discord server, using discord.py as an API wrapper. I'm trying to use my Raspberry Pi 2 B as a server to run it. I have jessie and python 3.4 installed on the device, as well as some modules for python. The imported modules in my code are discord, asyncio, and datetime. However, when I try to run my bot, which works perfectly on my mac, I get this error message:
File "BotTest.py", line 8 async def on_ready(): ^ SyntaxError: invalid syntax
For reference: this is a sample of the code I'm using:
import discord import asyncio import datetime bot = discord.Client() @bot.event async def on_ready(): print('Logged in as') print(bot.user.name, bot.user) print(bot.user.id) print([c.name for c in bot.get_all_channels()]) print('------') bot.run('Bot-User-Token')
The 'Bot-User-Token' is, of course, replaced by the actual user token in the full code. The only other part of the code is a function defined with 'async def on_message(message):', so it would be affected by the same issue.