import json from channels import Group as ChannelGroup class BuyerLoseMoney(Exception): def __init__(self, owner): channel = ChannelGroup(owner.get_personal_channel_name()) channel.send({'text': json.dumps({'warning': 'You may lose money with this offer, ' 'please enter a different price.'})}) super().__init__('Not enough money to create a new bid of this amount') class SellerLoseMoney(Exception): def __init__(self, owner): channel = ChannelGroup(owner.get_personal_channel_name()) channel.send({'text': json.dumps({'warning': 'You may lose money with this offer, ' 'please enter a different price.'})}) super().__init__('Not enough money to create a new bid of this amount') class HigherThanStanding(Exception): def __init__(self, owner): channel = ChannelGroup(owner.get_personal_channel_name()) channel.send({'text': json.dumps({'warning': 'Your price has to be lower than the lowest selling offer.' '' })}) super().__init__('Not enough items to sell') class LowerThanStanding(Exception): def __init__(self, owner): channel = ChannelGroup(owner.get_personal_channel_name()) channel.send({'text': json.dumps({'warning': 'Your price has to be higher than the highest buying offer.' '' })}) super().__init__('Not enough items to sell')