Auto Donate GP

I tried to donate GP using PHbot’s condition function. But I don’t know what is wrong with this plugin. It does not work. May you help me, please? @Ryan

import phBot
import struct
EVENT_LEVEL_UP = 10 # data = new level
def handle_event(t,data):
	if t = EVENT_LEVEL_UP:
		return True

def CheckGP():
	if phBot.get_character_data()['sp'] != 0:
		log('GP successfully Checked!')
		return True

def DonateGP(quantity=None):
	if quantity == None:
		quantity = phBot.get_character_data()['sp']
		if quantity == 0:
			return
	phBot.inject_joymax(0x7258,struct.pack('I', quantity),False)
	log('GP successfully donated!')

def DonateGP_All():
	DonateGP()
	return

if(Python==CheckGP){Python(DonateGP_All);}
if(Python==handle_event){Python(DonateGP_All);}