If they can clearly track a flow of items/gold going from a detected bot account to another account, they can ban the second account for 'exploiting the economy'. That's their catchall reason for whenever they know you broke the ToS but don't have direct evidence to support it.
Generally though, if the items are being distributed to a lot of players in your guild, they should be pretty safe. It's not like a GM can narrow down one or two to punish, and he can't ban them all either.
Blizzard can't do anything to the guild itself though, just its members. That's why a lot of people store botted gold in guild banks; if the accounts are banned the guild is still there.