s=['65126-0000582','65126-0000583','65126-0008582','651C75-0000582','650175-0000500','650175-0008582']
from collections import defaultdict
b = defaultdict(list)
for x in s:
b[x.split('-')[0]].append(x)
print(b)
# получаем значения, сгруппированные по ключам
# {'65126': ['65126-0000582', '65126-0000583', '65126-0008582'], '651C75': ['651C75-0000582'], '650175': ['650175-0000500', '650175-0008582']}
# или так, в списки попадут значения после дефиса
b = defaultdict(list)
for x in s:
key, val = x.split('-')
b[key].append(val)
print(b)
# {'65126': ['0000582', '0000583', '0008582'], '651C75': ['0000582'], '650175': ['0000500', '0008582']}
length = 3
cap = 700
random.randint(10**(length-1), cap-1)
root=Tk()
root.title("TelePY")
teleid = StringVar()
...
client.send_message(teleid, text)
client.send_message(teleid.get(), text.get())
idtxt.grid(row=0, column=0, sticky="w")
mtxt.grid(row=1, column=0, sticky="w")
idbox.grid(row=0,column=1, padx=5, pady=5)
textbox.grid(row=1,column=1, padx=5, pady=5)
send.grid(row=2, column=1, padx=5, pady=5)
teleid = StringVar()
teleid.set('@none')
idbox = Entry(textvariable=teleid)
teleid = '@none'
idbox = Entry(text=teleid)
cur.execute("INSERT INTO users(guild, user) VALUES(?, ?)", (guildid, user))